/* Toeggeli Cup - stili comuni. Colori del brand PROLIGHTS, solo tramite token. Tema scuro e chiaro. */
:root {
  --bg: #141414;
  --surface: #1d1d1d;
  --raised: #272727;
  --line: #343434;
  --fg: #f8f8f8;
  --muted: #a4a4a4;
  --accent: #f3cb12;
  --accent-fg: #f3cb12;
  --on-accent: #141414;
  --blue: #5a96f0;
  --blue-fg: #86b4f7;
  --orange: #fa640a;
  --orange-fg: #ff8d4a;
  --band: #141414;
  --band-line: #2c2c2c;
  --band-fg: #f8f8f8;
  --band-muted: #a4a4a4;
  --font: 'Inter Variable', Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not(.force-dark) {
    --bg: #f8f8f8;
    --surface: #ffffff;
    --raised: #f0f0ee;
    --line: #e0e0dd;
    --fg: #141414;
    --muted: #5b5b5b;
    --accent-fg: #7a6200;
    --blue-fg: #2b66c2;
    --orange-fg: #bf4700;
    color-scheme: light;
  }
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
}
p {
  margin: 0;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.wrap {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.wrap.wide {
  max-width: 1400px;
}

/* Barra in alto: sempre scura, come il brand */
.bar {
  background: var(--band);
  color: var(--band-fg);
  border-bottom: 1px solid var(--band-line);
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.bar .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  flex-wrap: wrap;
  padding-block: 8px;
}
.bar .logo {
  height: 18px;
  width: auto;
  display: block;
}
.bar .cup {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-left: 12px;
  border-left: 1px solid var(--band-line);
  white-space: nowrap;
}
.bar .spacer {
  flex: 1;
}
.langs {
  display: flex;
  gap: 4px;
}
.langs button {
  border: 1px solid var(--band-line);
  background: transparent;
  color: var(--band-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.langs button[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: #141414;
}

/* Elementi comuni */
.status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin: 14px 0 10px;
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  flex: none;
}
.dot.live {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.dot.offline {
  background: var(--orange);
}
.h {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 22px 0 8px;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.card.live {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent) inset;
}
.meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tag.live {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.tag.next {
  border-color: var(--blue);
  color: var(--blue-fg);
}
.tag.ko {
  border-color: var(--orange);
  color: var(--orange-fg);
}
.side {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.names {
  font-weight: 800;
  font-size: 18px;
  line-height: 1.25;
  min-width: 0;
}
.names small {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.score-n {
  font-size: 46px;
  font-weight: 800;
  min-width: 1.2ch;
  text-align: center;
  color: var(--accent-fg);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
  flex-wrap: wrap;
}
.row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  align-items: center;
}
.row:last-child {
  border-bottom: 0;
}
.row .t {
  color: var(--blue-fg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.row b {
  font-weight: 700;
}
.row small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.row .pt {
  font-weight: 800;
  font-size: 18px;
  color: var(--accent-fg);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.row.q .t {
  color: var(--accent-fg);
}
.row .res {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.champ {
  border-radius: var(--r);
  background: var(--accent);
  color: #141414;
  padding: 18px;
  margin-bottom: 14px;
}
.champ small {
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
.champ b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  margin: 4px 0;
}
.podium {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 700;
}
.pagefoot {
  font-size: 12px;
  color: var(--muted);
  padding-block: 18px 32px;
}

/* Bottoni e campi */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  touch-action: manipulation;
}
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #141414;
}
.btn.warn {
  border-color: var(--orange);
  color: var(--orange-fg);
}
.btn.small {
  padding: 6px 12px;
  font-size: 13px;
}
.btn.big {
  width: 100%;
  padding: 16px;
  font-size: 16px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.field select,
.field input,
.input {
  width: 100%;
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 9px 10px;
  font-size: 15px;
  min-width: 0;
}
textarea.input {
  min-height: 140px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
}
.hint {
  font-size: 13px;
  color: var(--muted);
}
.hint.warn {
  color: var(--orange-fg);
  font-weight: 700;
}
.chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}
.chip.ok {
  background: var(--accent);
  border-color: var(--accent);
  color: #141414;
}
.chip.over {
  border-color: var(--orange);
  color: var(--orange-fg);
}

/* Regia: pulsanti dei gol */
.ctl {
  display: flex;
  align-items: center;
  gap: 8px;
}
.gbtn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--raised);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  line-height: 1;
}
.gbtn.plus {
  width: 64px;
  height: 64px;
  background: var(--accent);
  border-color: var(--accent);
  color: #141414;
  font-size: 34px;
}
.gbtn:disabled {
  opacity: 0.3;
}
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--raised);
  padding: 4px;
  border-radius: 999px;
  margin: 14px 0 6px;
}
.tabs button {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 8px;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.tabs button[aria-selected='true'] {
  background: var(--surface);
  color: var(--fg);
  box-shadow: 0 1px 0 var(--line);
}
.settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.prow {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 6px 0;
}
.prow .int {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.prow .int input {
  accent-color: var(--accent);
}
.xbtn {
  border: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 6px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 14px;
}
.ticker {
  font-weight: 800;
  color: var(--accent-fg);
  min-height: 1.4em;
  font-size: 14px;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  background: var(--orange);
  color: #141414;
  font-weight: 700;
  padding: 12px 16px;
  border-radius: 12px;
  max-width: calc(100% - 32px);
  z-index: 50;
  font-size: 14px;
}
.login {
  max-width: 360px;
  margin: 12vh auto 0;
  display: grid;
  gap: 12px;
}
.login .input {
  font-size: 28px;
  text-align: center;
  letter-spacing: 0.3em;
}
.reveal {
  animation: pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3) both;
  animation-delay: calc(var(--i) * 160ms);
}
@keyframes pop {
  from {
    opacity: 0.15;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Schermo TV */
.tv {
  padding-block: 24px 32px;
}
.tv-top {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tv-top h1 {
  font-size: clamp(26px, 3.4vw, 46px);
}
.tv-top h1 span {
  color: var(--accent);
}
.tv-top .ph {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.clock {
  margin-left: auto;
  font-size: clamp(22px, 2.6vw, 38px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.tv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.tv-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 20px 22px;
  min-width: 0;
}
.tv-card + .tv-card {
  margin-top: 24px;
}
.tv-label {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.tv-label.on {
  color: var(--accent);
}
.bigmatch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  text-align: center;
}
.bigmatch + .bigmatch {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.bigmatch > div {
  min-width: 0;
}
.bigmatch b {
  display: block;
  font-size: clamp(18px, 1.9vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.bigmatch span {
  display: block;
  font-size: clamp(13px, 1.2vw, 18px);
  color: var(--muted);
  margin-top: 6px;
}
.led {
  font-size: clamp(56px, 8.5vw, 150px);
  font-weight: 800;
  line-height: 0.9;
  color: var(--accent);
  text-shadow: 0 0 28px rgba(243, 203, 18, 0.4);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.led i {
  font-style: normal;
  color: var(--muted);
  text-shadow: none;
  margin: 0 0.08em;
}
.bm-meta {
  grid-column: 1 / -1;
  font-size: 15px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.tv .row {
  font-size: clamp(15px, 1.4vw, 21px);
  grid-template-columns: 70px minmax(0, 1fr) auto;
}
.tv .row small {
  font-size: 0.7em;
}
.tv .row .pt {
  font-size: 1.2em;
  color: var(--accent);
}
.tv-pairs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.tv-pair {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--raised);
}
.tv-pair b {
  display: block;
  font-size: clamp(18px, 1.8vw, 26px);
  color: var(--accent);
  font-weight: 800;
  line-height: 1.2;
}
.tv-pair span {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
}
.bigchamp {
  text-align: center;
  padding: 30px 10px;
}
.bigchamp small {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.bigchamp b {
  display: block;
  font-size: clamp(36px, 5.5vw, 88px);
  line-height: 1.05;
  color: var(--accent);
  font-weight: 800;
  text-shadow: 0 0 40px rgba(243, 203, 18, 0.35);
  margin: 8px 0;
}
.bigchamp span {
  font-size: clamp(16px, 1.8vw, 26px);
  font-weight: 700;
}
.qr {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.qr img {
  width: 120px;
  height: 120px;
  border-radius: 10px;
  background: #ffffff;
  padding: 6px;
}
.qr b {
  display: block;
  font-size: clamp(16px, 1.5vw, 22px);
}
.qr span {
  color: var(--muted);
  font-size: 14px;
  word-break: break-all;
}
.tv-tools {
  display: flex;
  gap: 8px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .tv-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .bigmatch {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 420px) {
  .bar .cup {
    display: none;
  }
  .prow {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  }
  .prow .int {
    grid-column: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .reveal {
    animation: none;
  }
}
