@font-face {
  font-family: "Anton";
  src: url("fonts/anton-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url("fonts/barlow-condensed-latin-800-normal.woff2") format("woff2");
  font-weight: 800;
  font-display: swap;
}

:root {
  --navy: #10294b;
  --navy-hi: #17365f;
  --navy-lo: #0b1d37;
  --blue: #10a1dc;
  --blue-d: #1170b8;
  --green: #79be60;
  --green-d: #0e7e3f;
  --white: #ffffff;
  --muted: #9fb2cf;
  --blue-l: #3cc0f0;
  --blue-rgb: 16, 161, 220;
  --green-rgb: 121, 190, 96;
  --green-d-rgb: 14, 126, 63;
  --navy-lo-rgb: 11, 29, 55;
  --line: rgba(255, 255, 255, .12);
  --grad: linear-gradient(90deg, var(--blue) 0%, var(--green-d) 62%, var(--green) 100%);
  --grad-diag: linear-gradient(135deg, var(--blue) 0%, var(--green-d) 62%, var(--green) 100%);
  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --ui: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --radius: 22px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }

body {
  background-color: var(--navy);
  background-image:
    radial-gradient(900px 520px at 15% -10%, rgba(var(--blue-rgb), .22), transparent 60%),
    radial-gradient(900px 520px at 95% 110%, rgba(var(--green-rgb), .16), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 16px);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--ui);
  font-weight: 600;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }
svg { display: block; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding:
    max(14px, env(safe-area-inset-top))
    max(18px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(18px, env(safe-area-inset-left));
}

/* ---------- Header / brand ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.emblem-wrap { height: 84px; flex: none; display: flex; align-items: center; }
.emblem { height: 100%; width: auto; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.emblem-img { height: 100%; width: auto; max-width: 140px; object-fit: contain; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .35)); }
.wordmark { line-height: 1; }
.wm-bar { height: 5px; width: 100%; background: var(--grad); border-radius: 3px; margin-bottom: 6px; }
.wm-name { font-family: var(--display); font-size: 34px; letter-spacing: .01em; }
.wm-sub { font-weight: 800; font-size: 14px; letter-spacing: .38em; margin-top: 4px; }
.wm-sub .wm-tag { color: var(--green); letter-spacing: .25em; }

.icon-btn {
  width: 60px; height: 60px; flex: none;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .06);
  display: grid; place-items: center;
  cursor: pointer;
}
.icon-btn svg { width: 30px; height: 30px; }

/* ---------- Board ---------- */
.board {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-content: center;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}
.clocks { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.controls { display: flex; flex-direction: column; gap: 14px; }

.card {
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .03));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}

.label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: 15px;
  color: var(--muted);
}
.label b { color: var(--white); }

.match { padding: 14px 22px 16px; text-align: center; }
.match-time {
  font-family: var(--ui);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: clamp(72px, 13vw, 132px);
  line-height: .95;
  letter-spacing: .01em;
}
.progress { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; margin: 10px 0 8px; }
.progress div { height: 100%; width: 0; background: var(--grad); border-radius: 4px; transition: width .2s linear; }
.match-meta { display: flex; justify-content: space-between; font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
#matchState { color: var(--green); }
.paused #matchState { color: #ffd166; }

.match-time.jump { animation: jump .45s ease-out; }
@keyframes jump { 0% { color: var(--green); transform: scale(1.06); } 100% { color: inherit; transform: none; } }

/* Interval ring */
.ring-wrap {
  --ring: min(78vw, 31vh, 420px);
  position: relative;
  width: var(--ring);
  height: var(--ring);
}
.ring { width: 100%; height: 100%; transform: rotate(-90deg); filter: drop-shadow(0 0 10px rgba(var(--blue-rgb), .45)); }
.ring circle { fill: none; stroke-width: 14; }
.ring-track { stroke: rgba(255, 255, 255, .09); }
.ring-fill { transition: stroke-dashoffset .12s linear; }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.int-time {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: calc(var(--ring) * .3);
  line-height: 1;
}
.int-len { color: var(--muted); font-size: 17px; letter-spacing: .14em; text-transform: uppercase; }
.ring-wrap.warn .ring-fill { stroke: var(--white); }
.ring-wrap.warn .ring { filter: drop-shadow(0 0 16px rgba(255, 255, 255, .8)); }
.ring-wrap.warn .int-time { animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); color: var(--green); } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 76px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: .14em;
  cursor: pointer;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn svg { width: 28px; height: 28px; flex: none; }
.btn:active, .pad:active, .icon-btn:active { transform: scale(.97); filter: brightness(1.15); }
.btn.start {
  border: 0;
  background: var(--grad-diag);
  box-shadow: 0 10px 30px rgba(var(--green-d-rgb), .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  min-height: 104px;
  font-size: 38px;
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: .1em;
}
.btn.start svg { width: 40px; height: 40px; }
.btn.start.running {
  background: var(--white);
  color: var(--navy);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}
.btn.small { min-height: 54px; font-size: 18px; padding: 0 18px; }
.btn.small.start { font-size: 22px; min-height: 54px; }
.btn.ghost { background: transparent; }
.btn.next { flex: 2; }
.btn.ghost#resetBtn { flex: 1; }
.btn:disabled { opacity: .4; pointer-events: none; }
.row { display: flex; gap: 14px; }

.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pad {
  position: relative;
  overflow: hidden;
  min-height: 150px;
  border-radius: var(--radius);
  border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--display);
  font-size: 30px;
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .3);
  transition: transform .08s ease, filter .15s ease;
}
.pad svg { width: 54px; height: 54px; }
.pad::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 3px, transparent 3px 12px);
  pointer-events: none;
}
.pad-buzzer { background: linear-gradient(160deg, var(--buzz-top, var(--blue-l)), var(--buzz-bottom, var(--blue-d))); }
.pad-horn { background: linear-gradient(160deg, var(--horn-top, var(--green)), var(--horn-bottom, var(--green-d))); }
.pad.playing { animation: padglow .45s ease-in-out infinite alternate; }
@keyframes padglow { to { filter: brightness(1.35); box-shadow: 0 0 0 4px #fff, 0 0 40px rgba(255, 255, 255, .5); } }

/* ---------- Flash on buzz ---------- */
.flash {
  position: fixed; inset: 0;
  background: var(--grad-diag);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}
.flash.on { animation: flash .55s ease-out 3; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }

/* ---------- Full time ---------- */
.fulltime {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: rgba(var(--navy-lo-rgb), .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 24px;
  text-align: center;
}
.fulltime[hidden] { display: none; }
.emblem.big, .ft-logo { height: min(280px, 34vh); width: auto; max-width: 70vw; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0, 0, 0, .4)); }
.ft-title {
  font-family: var(--display);
  font-size: clamp(64px, 12vw, 120px);
  line-height: 1;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ft-sub { color: var(--muted); font-size: 20px; letter-spacing: .14em; text-transform: uppercase; }
.ft-actions { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.ft-actions .btn { min-width: 220px; }

/* ---------- Settings sheet ---------- */
.sheet {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--navy-hi);
  color: var(--white);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.sheet::backdrop { background: rgba(var(--navy-lo-rgb), .75); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-inner { padding: 22px 24px 24px; display: flex; flex-direction: column; gap: 20px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; letter-spacing: .04em; }

.field { display: flex; flex-direction: column; gap: 10px; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-label {
  display: flex; justify-content: space-between;
  font-weight: 800; font-size: 15px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 4px;
}
.field-label b { color: var(--white); letter-spacing: .05em; }

.stepper { display: grid; grid-template-columns: 76px 1fr 76px; gap: 10px; }
.stepper button {
  height: 70px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .08);
  font-size: 40px;
  font-weight: 800;
  cursor: pointer;
}
.stepper output {
  display: grid; place-items: center;
  border-radius: 18px;
  background: var(--navy-lo);
  font-size: 40px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button, .seg button {
  flex: 1 1 0;
  min-height: 52px;
  min-width: 72px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .04em;
  cursor: pointer;
}
.chips button.on, .seg button.on {
  background: var(--grad-diag);
  border-color: transparent;
}
.seg-row { display: flex; gap: 10px; }
.seg { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.seg button:disabled { opacity: .35; }
.test-btn {
  width: 60px; flex: none;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .1);
  display: grid; place-items: center;
  cursor: pointer;
}
.test-btn svg { width: 26px; height: 26px; }

input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 44px; background: transparent;
}
input[type=range]::-webkit-slider-runnable-track { height: 10px; border-radius: 5px; background: var(--grad); }
input[type=range]::-moz-range-track { height: 10px; border-radius: 5px; background: var(--grad); }
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 34px; height: 34px; margin-top: -12px;
  border-radius: 50%; background: var(--white); border: 4px solid var(--navy); box-shadow: 0 2px 8px rgba(0, 0, 0, .4);
}
input[type=range]::-moz-range-thumb { width: 28px; height: 28px; border-radius: 50%; background: var(--white); border: 4px solid var(--navy); }

.sound-row {
  display: grid; grid-template-columns: 120px 1fr 60px auto auto; align-items: center; gap: 10px;
  min-height: 60px;
}
.sound-row .test-btn { height: 54px; }
.sound-row .use-builtin.off { visibility: hidden; }
.sound-name { font-weight: 800; font-size: 20px; letter-spacing: .04em; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.custom-name { color: var(--muted); font-size: 18px; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hint { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.4; }
.hint b { color: var(--white); }

/* ---------- Layouts ---------- */
/* iPad landscape and wide screens: clocks left, controls right. */
@media (min-width: 820px) and (orientation: landscape) {
  .board { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 28px; }
  .ring-wrap { --ring: min(44vh, 36vw, 440px); }
  .match-time { font-size: clamp(72px, 9vw, 132px); }
}
@media (min-width: 820px) and (orientation: landscape) and (max-height: 760px) {
  .clocks { gap: 12px; }
  .ring-wrap { --ring: min(40vh, 34vw); }
  .match-time { font-size: clamp(64px, 8vw, 110px); }
  .pad { min-height: 120px; }
  .btn.start { min-height: 92px; }
}
/* Phones */
@media (max-width: 560px) {
  .wm-name { font-size: 26px; }
  .wm-sub { font-size: 12px; letter-spacing: .3em; }
  .emblem-wrap { height: 58px; }
  .btn { font-size: 19px; min-height: 66px; padding: 0 14px; letter-spacing: .08em; }
  .btn.start { font-size: 32px; min-height: 88px; }
  .pad { min-height: 118px; font-size: 24px; }
  .pad svg { width: 42px; height: 42px; }
  .stepper { grid-template-columns: 64px 1fr 64px; }
  .field.two { grid-template-columns: 1fr; }
  .sheet-inner { padding: 18px 16px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .flash.on { animation: flash 1.2s ease-out 1; }
  .ring-wrap.warn .int-time, .pad.playing { animation: none; }
}

/* ---------- Team profiles (settings) ---------- */
.profile-chips button { flex: 0 1 auto; padding: 0 18px; }
.profile-chips .add { border-style: dashed; color: var(--muted); }
.profile-edit {
  display: grid; gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(var(--navy-lo-rgb), .55);
  border: 1px solid var(--line);
}
.profile-edit, .text-row > *, .color-row > * { min-width: 0; }
.text-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.text-row label, .color-row label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.text-row input {
  width: 100%; min-width: 0;
  min-height: 52px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--navy-lo); color: var(--white);
  font: inherit; font-size: 20px; letter-spacing: .02em; text-transform: none;
  -webkit-user-select: text; user-select: text;
}
.color-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.color-row input[type=color] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 56px; padding: 0;
  border: 2px solid var(--line); border-radius: 14px;
  background: none; cursor: pointer;
}
.color-row input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color-row input[type=color]::-webkit-color-swatch { border: 0; border-radius: 12px; }
.color-row input[type=color]::-moz-color-swatch { border: 0; border-radius: 12px; }
.logo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo-thumb {
  height: 64px; width: 96px; object-fit: contain;
  border-radius: 12px; background: var(--navy); border: 1px solid var(--line); padding: 4px;
}
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-actions .btn { flex: 1 1 auto; }
.btn.danger { color: #ff8a8a; border-color: rgba(255, 138, 138, .35); }
@media (max-width: 560px) {
  .text-row { grid-template-columns: 1fr; }
  .color-row { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- GOAL! light show ---------- */
.goal {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(var(--navy-lo-rgb), .6), rgba(var(--navy-lo-rgb), .96) 70%);
  cursor: pointer;
}
.goal[hidden] { display: none; }
.goal::after {
  content: ""; position: absolute; inset: 0;
  background: #ff2a2a;
  mix-blend-mode: screen;
  opacity: 0;
}
.goal-beams {
  position: absolute; inset: -60%;
  background: repeating-conic-gradient(from 0deg,
    rgba(255, 42, 42, 0) 0deg 10deg, rgba(255, 42, 42, .55) 16deg 22deg, rgba(255, 42, 42, 0) 28deg 45deg);
}
.goal-inner { position: relative; text-align: center; }
.goal-text {
  font-family: var(--display);
  font-size: clamp(120px, 26vw, 320px);
  line-height: .9;
  color: #fff;
  text-shadow: 0 0 30px rgba(255, 42, 42, .9), 0 0 90px rgba(255, 42, 42, .7), 0 8px 0 rgba(var(--navy-lo-rgb), .8);
}
.goal-team {
  margin-top: 10px;
  font-weight: 800; font-size: clamp(22px, 4vw, 40px); letter-spacing: .3em;
  color: var(--white);
}
.goal.on .goal-beams { animation: spin 2.2s linear infinite; }
.goal.on::after { animation: strobe .5s steps(1) infinite; }
.goal.on .goal-text { animation: goalpop .6s cubic-bezier(.2, 1.6, .4, 1), goalshake .18s .6s ease-in-out infinite alternate; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes strobe { 0% { opacity: .28; } 50% { opacity: 0; } }
@keyframes goalpop { 0% { transform: scale(.2) rotate(-8deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes goalshake { from { transform: rotate(-2deg) scale(1.02); } to { transform: rotate(2deg) scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
  .goal.on .goal-beams, .goal.on::after, .goal.on .goal-text { animation: none; }
}
@media (max-width: 560px) {
  .sound-row { grid-template-columns: 1fr 1fr 60px; row-gap: 6px; margin-bottom: 8px; }
  .sound-row .sound-name { grid-area: 1 / 1 / 2 / 3; }
  .sound-row .play-sound { grid-area: 1 / 3; }
  .sound-row .custom-name { grid-area: 2 / 1 / 3 / -1; }
  .sound-row .file-btn { grid-area: 3 / 1; }
  .sound-row .use-builtin { grid-area: 3 / 2 / 4 / 4; }
}

/* ---------- Settings tabs ---------- */
.tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: var(--navy-lo);
}
.tab {
  min-height: 52px;
  border: 0; border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 800; font-size: 19px; letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer;
}
.tab.on { background: var(--grad-diag); color: var(--white); }
.tab-panel { display: flex; flex-direction: column; gap: 20px; }
.pf-locked { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.4; }
.pf-locked b { color: var(--white); }
.profile-edit.locked .text-row, .profile-edit.locked .color-row, .profile-edit.locked .logo-row .file-btn { opacity: .45; pointer-events: none; }

/* ---------- Header actions ---------- */
.top-actions { display: flex; gap: 10px; flex: none; }
@media (max-width: 560px) {
  .top-actions { gap: 6px; }
  .top-actions .icon-btn { width: 48px; height: 48px; border-radius: 14px; }
  .top-actions .icon-btn svg { width: 24px; height: 24px; }
}

/* ---------- Team picker ---------- */
.profile-select { position: relative; flex: 1 1 260px; display: block; }
.profile-select select {
  -webkit-appearance: none; appearance: none;
  width: 100%;
  min-height: 52px;
  padding: 0 48px 0 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--white);
  font: inherit; font-weight: 800; font-size: 19px; letter-spacing: .04em;
  cursor: pointer;
}
.profile-select::after {
  content: ""; position: absolute; right: 18px; top: 50%;
  width: 10px; height: 10px; margin-top: -8px;
  border-right: 3px solid currentColor; border-bottom: 3px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}
.profile-select.on select { background: var(--grad-diag); border-color: transparent; }
.profile-select select option { color: #000; background: #fff; }

/* ---------- Help and About pages ---------- */
.sheet.page { width: min(820px, calc(100vw - 24px)); }
.sheet.page .sheet-inner { max-height: calc(100dvh - 26px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet.page h3 { margin: 0 0 10px; font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .04em; color: var(--green); }
.sheet.page p, .sheet.page li { font-size: 19px; line-height: 1.45; font-weight: 600; }
.sheet.page p { margin: 0; }
.sheet.page ul { margin: 10px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.sheet.page b { color: var(--white); }
.help-sec { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.help-sec:last-child { border-bottom: 0; padding-bottom: 0; }
.help-sec img { display: block; width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
#about .sheet-inner { gap: 18px; text-align: center; align-items: center; }
.about-logo { height: 160px; width: auto; filter: drop-shadow(0 8px 20px rgba(0, 0, 0, .4)); }
.about-lead { font-size: 22px !important; }
.coffee-btn { text-decoration: none; color: var(--white); padding: 0 34px; font-size: 30px !important; }
.sheet.page a { color: var(--green); }
.about-maker { color: var(--muted); }
#about .sheet-head { align-self: stretch; text-align: left; }
.sheet.page a.coffee-btn { color: var(--white); }

/* ---------- Sound blocked banner ---------- */
.sound-banner {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 35;
  display: flex; align-items: center; gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 16px 22px;
  border: 0; border-radius: 18px;
  background: #ffcd00; color: #111;
  font-weight: 800; font-size: 19px; text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  cursor: pointer;
  animation: bannerpulse 1s ease-in-out infinite alternate;
}
.sound-banner svg { width: 28px; height: 28px; flex: none; }
@keyframes bannerpulse { to { box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 6px rgba(255, 205, 0, .35); } }

/* Keep white text readable on light team colours. */
.btn.start:not(.running) span, .pad span, .pad svg, .tab.on, .chips button.on, .seg button.on, .profile-select.on select {
  text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.pad svg { filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); }

/* ---------- Sponsors: rink-board strip ---------- */
/* Last row of the page, so it never covers the controls. */
.boards {
  width: 100%; max-width: 1280px; margin: 4px auto 0;
  display: flex; align-items: center; gap: 16px;
  padding: 8px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  border-top: 2px solid rgba(255, 255, 255, .14);
  transition: opacity .6s ease;
}
body.running .boards { opacity: .1; }
.boards-label { flex: none; font-weight: 800; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); opacity: .85; }
.boards-slots { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.board-slot {
  height: 52px; padding: 0; border: 0; border-radius: 10px; background: none;
  display: grid; place-items: center; overflow: hidden; cursor: pointer;
  color: var(--muted); font-weight: 800; font-size: 13px; letter-spacing: .12em; text-transform: uppercase;
}
.board-slot img { max-height: 44px; max-width: 100%; width: auto; opacity: .6; filter: grayscale(1) brightness(1.2); transition: opacity .3s, filter .3s; }
.board-slot:hover img, .board-slot:focus-visible img { opacity: 1; filter: none; }
.board-slot.empty { border: 2px dashed rgba(255, 255, 255, .2); color: rgba(255, 255, 255, .42); }
@media (max-width: 560px) {
  .boards { gap: 8px; padding: 6px 8px; }
  .boards-label { display: none; }
  .boards-slots { gap: 6px; }
  .board-slot { height: 42px; font-size: 10px; letter-spacing: .06em; }
  .board-slot img { max-height: 34px; }
}

/* ---------- Sponsor popup ---------- */
.sponsor-sheet { width: min(540px, calc(100vw - 24px)); }
.sponsor-card { align-items: center; text-align: center; gap: 14px; }
.sponsor-tag { font-weight: 800; font-size: 13px; letter-spacing: .28em; text-transform: uppercase; color: var(--green); }
.sponsor-logo { max-height: 110px; max-width: 100%; width: auto; border-radius: 14px; }
.sponsor-card h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: .03em; }
.sponsor-card p { margin: 0; font-size: 19px; line-height: 1.45; }
.sponsor-card p a { color: var(--green); }
.sponsor-dash { width: 220px; height: 96px; border: 3px dashed rgba(255, 255, 255, .35); border-radius: 16px; display: grid; place-items: center; font-weight: 800; letter-spacing: .14em; color: rgba(255, 255, 255, .6); }
.sponsor-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }
a.btn { text-decoration: none; color: var(--white); }

/* ---------- About: app sponsors ---------- */
.about-sponsors { width: 100%; display: grid; gap: 10px; }
.about-sponsors h3 { margin: 0; }
.about-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.about-tile {
  height: 70px; padding: 6px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .05);
  display: grid; place-items: center; cursor: pointer;
}
.about-tile img { max-height: 56px; max-width: 100%; border-radius: 8px; }
.about-tile.empty { background: none; border: 2px dashed rgba(255, 255, 255, .25); color: rgba(255, 255, 255, .5); font-weight: 800; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; }
@media (max-width: 560px) { .about-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Team switch in the header ---------- */
.top { position: relative; }
button.brand {
  border: 0; background: none; color: inherit; font: inherit; text-align: left;
  padding: 4px 10px 4px 4px; margin: -4px; border-radius: 16px; cursor: pointer;
  transition: background .2s;
}
button.brand:active { background: rgba(255, 255, 255, .08); }
.wm-name { display: flex; align-items: center; gap: 8px; }
.team-chevron { width: 24px; height: 24px; flex: none; opacity: .75; transition: opacity .3s; }
body.running button.brand { cursor: default; }
body.running .team-chevron { opacity: .15; }
.team-hint {
  position: absolute; left: 70px; top: calc(100% + 6px); z-index: 8;
  padding: 12px 16px; border-radius: 14px;
  background: var(--white); color: var(--navy);
  font-weight: 800; font-size: 17px; letter-spacing: .02em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  cursor: pointer;
  animation: hintbob 1.2s ease-in-out infinite alternate;
}
.team-hint::before {
  content: ""; position: absolute; left: 28px; top: -8px;
  border: 8px solid transparent; border-top: 0; border-bottom-color: var(--white);
}
.team-hint[hidden], body.running .team-hint { display: none !important; }
@keyframes hintbob { to { transform: translateY(4px); } }

/* ---------- Team picker ---------- */
.team-sheet { width: min(760px, calc(100vw - 24px)); }
.team-sheet .sheet-inner { max-height: calc(100dvh - 26px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.team-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.team-item {
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 8px 12px 8px 8px;
  border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05);
  color: var(--white); font: inherit; font-weight: 800; font-size: 19px; text-align: left;
  cursor: pointer;
}
.team-item.on { border-color: transparent; background: var(--grad-diag); text-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.team-logo { width: 56px; height: 56px; flex: none; border-radius: 12px; display: grid; place-items: center; font-family: var(--display); font-size: 20px; }
.team-logo img { max-width: 48px; max-height: 48px; }

/* ---------- Report a problem ---------- */
.report-sheet { width: min(560px, calc(100vw - 24px)); }
.report-sheet p { margin: 0; font-size: 19px; line-height: 1.45; }
.report-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.report-actions .btn { min-height: 64px; font-size: 22px; }
.report-actions .btn[hidden] { display: none; }
#about .report-btn { margin-top: 4px; }
@media (max-width: 560px) {
  .report-actions { grid-template-columns: 1fr; }
  .team-hint { left: 8px; font-size: 15px; }
}

/* "Don't see your team?" in the team picker */
.team-missing {
  display: grid; gap: 10px;
  padding: 18px; border-radius: 18px;
  border: 2px dashed rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .03);
}
.team-missing h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: .04em; color: var(--green); }
.team-missing p { margin: 0; font-size: 18px; line-height: 1.45; }
.team-missing-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.team-missing-actions .btn { flex: 1 1 220px; }
.team-missing-actions .btn[hidden] { display: none; }
