/* YallaPlay's own identity, as on yallaplay.ae: black top bar with the round
   logo, warm light ground with a dot grid, Changa headings in capitals,
   Readex Pro text, one orange accent, black buttons, 4-6px corners.
   The school appears as the host, with its crest. */
:root {
  --bg: #f9f8f6;
  --bg-2: #f2efe9;
  --paper: #ffffff;
  --ink: #19180f;
  --muted: #5a574e;
  --rule: #e5e2db;
  --orange: #ff7a1a;
  --orange-ink: #c4570a;   /* orange for small text on light, 4.6:1 */
  --black: #0b0b0a;
  --gold: #f59e0b;
  --shadow: 0 1px 2px rgba(25, 24, 15, .06), 0 8px 24px rgba(25, 24, 15, .07);
  --head: "Changa", "Arial Narrow", Arial, sans-serif;
  --text: "Readex Pro", "Segoe UI", Roboto, sans-serif;
  --pad-l: max(16px, env(safe-area-inset-left, 0px));
  --pad-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--text); }
::selection { background: var(--orange); color: #fff; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--pad-l); padding-right: var(--pad-r); }
.dots { background-color: var(--bg-2); background-image: radial-gradient(rgba(25, 24, 15, .09) 1px, transparent 1.2px); background-size: 22px 22px; }
h1, h2, h3 { font-family: var(--head); margin: 0; text-transform: uppercase; text-wrap: balance; line-height: 1.05; }
h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 700; margin-bottom: 18px; }
main > section { padding-block: 48px 0; }
.card { background: var(--paper); border-radius: 6px; box-shadow: var(--shadow); }

/* ——— Top bar, as on yallaplay.ae ——— */
.topbar { background: var(--black); color: #fff; }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand img { width: 52px; height: 52px; }
.host { display: flex; align-items: center; gap: 12px; }
.host span { font-family: var(--head); text-transform: uppercase; font-size: 13px; letter-spacing: .08em; color: #c9c5bb; }
.host img { height: 52px; width: auto; background: #fff; padding: 4px 8px; border-radius: 4px; }

/* ——— Hero ——— */
.hero { border-bottom: 1px solid var(--rule); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding-block: 48px; }
.kicker { margin: 0 0 14px; font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--orange-ink); }
.hero h1 { font-size: clamp(40px, 6vw, 72px); font-weight: 700; }
.hero h1 span { display: block; }
.hero h1 .o { color: var(--orange); }
.sub { margin: 16px 0 0; font-size: 18px; color: var(--muted); }
.status { margin: 22px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 500; }
.status .ph, .status .ph-fill { font-size: 20px; }
.status .ph-trophy { color: var(--gold); }
.live { background: var(--orange); color: var(--ink); font-family: var(--head); font-weight: 700; text-transform: uppercase; font-size: 13px; letter-spacing: .06em; padding: 4px 10px; border-radius: 4px; }
.hero-media { position: relative; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; background: var(--black); box-shadow: 0 18px 40px rgba(25, 24, 15, .18); max-width: 100%; }
.slides, .slide { position: absolute; inset: 0; }
.slide { opacity: 0; transition: opacity 1.2s ease; }
.slide.is-on { opacity: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide.is-on img { animation: drift 9s ease-out both; }
.slide.fallback { background: radial-gradient(70% 70% at 50% 60%, #2a2a26 0%, var(--black) 70%); display: grid; place-items: center; }
.slide.fallback img { width: auto; height: 78%; object-fit: contain; animation: none; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .6)); }
.slide-bars { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; gap: 6px; }
.slide-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .35); }
.slide-bars span.is-on { background: var(--orange); }
@keyframes drift { from { transform: scale(1.05); } to { transform: scale(1); } }
@media (max-width: 860px) { .hero-in { grid-template-columns: 1fr; gap: 28px; padding-block: 32px; } .host span { display: none; } }

/* ——— Ticker ——— */
.ticker { display: flex; align-items: stretch; background: var(--black); color: #fff; overflow: hidden; min-height: 48px; }
.tick-label { flex: none; background: var(--orange); color: var(--ink); font-family: var(--head); font-weight: 700; text-transform: uppercase; display: flex; align-items: center; padding: 0 18px 0 var(--pad-l); }
.tick-track { overflow: hidden; flex: 1; display: flex; align-items: center; }
.tick-run { display: flex; gap: 40px; padding-left: 24px; white-space: nowrap; animation: run 70s linear infinite; }
.tk b { font-weight: 600; } .tk em { font-style: normal; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #a5a198; margin-right: 8px; }
.tick-static { padding: 12px var(--pad-r) 12px var(--pad-l); } .tick-static b { color: var(--orange); margin-right: 8px; font-family: var(--head); }
@keyframes run { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ——— Find your name ——— */
.find { padding-top: 36px; display: grid; gap: 10px; }
.find-label { font-family: var(--head); font-weight: 700; text-transform: uppercase; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.find input { width: 100%; max-width: 560px; background: var(--paper); border: 1px solid #cfcac0; padding: 14px 16px; font-size: 18px; border-radius: 6px; box-shadow: var(--shadow); }
.find input::placeholder { color: #6f6b62; }
.find input:focus { border-color: var(--orange); outline: none; }
.find-hits { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.find-hits li { background: var(--paper); padding: 12px 16px; display: grid; gap: 2px; border-radius: 6px; box-shadow: var(--shadow); }
.find-hits span { color: var(--muted); } .find-hits span b { color: var(--orange-ink); }
.find-none { color: var(--muted); margin: 4px 0 0; }

/* ——— Score row ——— */
.bug { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; min-height: 46px; }
.bug .p { display: flex; align-items: center; padding: 8px 12px; font-weight: 500; overflow-wrap: anywhere; min-width: 0; }
.bug .p.b { justify-content: flex-end; text-align: right; }
.bug .p.won { font-weight: 700; }
.bug .p.lost { color: #6f6b62; }
.bug .sc { background: var(--black); color: #fff; font-family: var(--head); font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 6px; padding: 0 12px; min-width: 66px; justify-content: center; }
.bug .sc i { font-style: normal; color: var(--orange); }
.bug.big { min-height: 68px; border: 0; }
.bug.big .p { font-family: var(--head); font-weight: 600; font-size: clamp(18px, 2vw, 24px); text-transform: uppercase; }
.bug.big .sc { min-width: 84px; font-size: 24px; background: var(--orange); color: var(--ink); } .bug.big .sc i { color: var(--ink); }

/* ——— On the pitch ——— */
.stations { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.station { background: var(--paper); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.station header { display: flex; justify-content: space-between; align-items: center; font-family: var(--head); text-transform: uppercase; font-size: 15px; padding: 10px 14px; background: var(--black); color: #fff; }
.station header span:last-child { color: #c9c5bb; font-size: 13px; }
.station .bug { border-radius: 0; }
.station.free .free-note { margin: 0; padding: 22px 14px; color: var(--muted); }
.next { margin-top: 24px; }
.next h3 { font-size: 18px; margin-bottom: 10px; }
.next ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 28px; counter-reset: q; }
.next li { counter-increment: q; display: flex; gap: 8px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
.next li::before { content: counter(q); font-family: var(--head); font-weight: 700; color: var(--orange-ink); min-width: 1.6em; }
.next li em { font-style: normal; color: var(--muted); }
.next li span { overflow-wrap: anywhere; }

/* ——— Road to the final ——— */
.tree-sec .wrap > .panel { background: var(--paper); border-radius: 6px; box-shadow: var(--shadow); padding: 20px; }
.tree-scroll { overflow-x: auto; padding-bottom: 6px; }
.tree { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 36px; min-width: max-content; }
.tree .col { display: flex; flex-direction: column; }
.tree h3, .third h3 { font-size: 15px; color: var(--muted); padding-bottom: 8px; border-bottom: 2px solid var(--orange); margin-bottom: 14px; }
.col-in { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 18px; }
.pair { position: relative; display: flex; flex-direction: column; gap: 18px; }
.pair::after { content: ""; position: absolute; top: 25%; bottom: 25%; right: -20px; width: 18px; border: 2px solid #d6d1c6; border-left: 0; border-radius: 0 6px 6px 0; }
.col:not(:first-child) .node { position: relative; }
.col:not(:first-child) .node::before { content: ""; position: absolute; left: -18px; top: 23px; width: 16px; border-top: 2px solid #d6d1c6; }
.node small { display: block; color: var(--muted); font-size: 12px; padding: 4px 0 0; }
.node.ready .bug { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.final-node .bug { min-height: 64px; } .final-node .bug .p { font-size: 17px; }
.third { margin-top: 26px; max-width: 320px; }

/* ——— Every match ——— */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.tabs button { flex: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 9px 16px; font-family: var(--head); font-weight: 600; text-transform: uppercase; cursor: pointer; color: var(--muted); }
.tabs button[aria-selected=true] { background: var(--black); color: #fff; border-color: var(--black); }
.tabs button:hover { color: var(--ink); border-color: #cfcac0; }
.tabs button[aria-selected=true]:hover { color: #fff; }
.round-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }

/* ——— Results ——— */
.results { list-style: none; margin: 0; padding: 4px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 0 36px; background: var(--paper); border-radius: 6px; box-shadow: var(--shadow); }
.results li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; column-gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.results time { color: var(--muted); grid-row: span 2; }
.results li > span:nth-child(2) { overflow-wrap: anywhere; }
.results .score { font-family: var(--head); font-weight: 700; color: var(--orange-ink); }
.results li > .dim { grid-column: 2 / span 2; font-size: 14px; }
@media (max-width: 520px) { .results { grid-template-columns: 1fr; padding: 4px 14px; } }

/* ——— Podium ——— */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; max-width: 820px; }
.step { background: var(--paper); box-shadow: var(--shadow); border-radius: 6px 6px 0 0; padding: 18px 12px; text-align: center; display: grid; gap: 6px; min-width: 0; align-content: center; }
.step b { font-size: 18px; overflow-wrap: anywhere; }
.step .pl { font-family: var(--head); font-weight: 800; font-size: 48px; line-height: 1; color: var(--muted); }
.step.p1 { order: 2; min-height: 230px; background: var(--orange); color: var(--ink); } .step.p1 .pl { color: var(--ink); font-size: 72px; } .step.p1 .ph-trophy { font-size: 40px; }
.step.p2 { order: 1; min-height: 170px; } .step.p3 { order: 3; min-height: 140px; }

/* ——— Players and photos ——— */
.roster { columns: 4 200px; column-gap: 28px; margin: 0; padding: 18px 20px 18px 44px; background: var(--paper); border-radius: 6px; box-shadow: var(--shadow); }
.roster li { padding: 4px 0; break-inside: avoid; } .roster li::marker { color: var(--muted); font-variant-numeric: tabular-nums; }
.photos { columns: 3 280px; column-gap: 10px; }
.ph-tile { display: block; width: 100%; border: 0; padding: 0; margin: 0 0 10px; background: var(--bg-2); cursor: zoom-in; break-inside: avoid; border-radius: 6px; overflow: hidden; }
.ph-tile img { width: 100%; height: auto; transition: transform .4s cubic-bezier(.16, 1, .3, 1); }
.ph-tile:hover img { transform: scale(1.03); }
.viewer { border: 0; padding: 0; background: transparent; max-width: 96vw; max-height: 92vh; }
.viewer::backdrop { background: rgba(11, 11, 10, .92); }
.viewer img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 4px; }
.viewer-x { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: var(--pad-r); background: #fff; color: var(--ink); border: 0; width: 44px; height: 44px; border-radius: 6px; font-size: 22px; cursor: pointer; display: grid; place-items: center; }

/* ——— Footer ——— */
.foot { margin-top: 72px; background: var(--black); color: #fff; }
.foot-in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 28px; align-items: center; padding-block: 36px; }
.foot-in > img { width: 72px; height: 72px; }
.foot h2 { color: #fff; margin-bottom: 6px; font-size: 26px; }
.foot p { margin: 0; color: #c9c5bb; max-width: 60ch; }
.foot-cta { display: grid; gap: 10px; justify-items: start; }
.foot-cta b { color: #fff; user-select: all; }
.btn-dark { display: inline-block; background: var(--orange); color: var(--ink); font-family: var(--head); font-weight: 700; text-transform: uppercase; text-decoration: none; padding: 13px 22px; border-radius: 4px; transition: background .15s, transform .1s; }
.btn-dark:hover { background: #ff9447; }
.btn-dark:active { transform: translateY(1px); }
@media (max-width: 760px) { .foot-in { grid-template-columns: auto minmax(0, 1fr); } .foot-cta { grid-column: 1 / -1; } }

/* ——— Result announcement ——— */
.announce { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 50; width: min(560px, calc(100% - 32px)); cursor: pointer; animation: drop .5s cubic-bezier(.16, 1, .3, 1); }
.ann { background: var(--paper); border-radius: 6px; padding: 14px 20px; box-shadow: 0 20px 50px rgba(25, 24, 15, .28); border-top: 4px solid var(--orange); }
.ann-stage { margin: 0; font-family: var(--head); text-transform: uppercase; font-size: 13px; letter-spacing: .06em; color: var(--orange-ink); }
.ann-win { margin: 2px 0 0; font-family: var(--head); font-weight: 800; font-size: 32px; line-height: 1.05; text-transform: uppercase; overflow-wrap: anywhere; }
.ann-line { margin: 4px 0 0; color: var(--muted); } .ann-line b { color: var(--ink); margin-left: 6px; }
.announce.big { inset: 0; transform: none; width: auto; display: grid; place-items: center; background: rgba(11, 11, 10, .84); animation: fade .35s ease-out; }
.announce.big .ann { width: min(1100px, 90vw); padding: 6vh 5vw; border-top-width: 12px; animation: rise .7s cubic-bezier(.16, 1, .3, 1); }
.announce.big .ann-stage { font-size: clamp(18px, 2vw, 30px); }
.announce.big .ann-win { font-size: clamp(64px, 10vw, 170px); margin-top: 8px; }
.announce.big .ann-line { font-size: clamp(24px, 3vw, 46px); margin-top: 12px; }
.announce.final .ann { background: var(--orange); color: var(--ink); border-top-color: var(--black); } .announce.final .ann-stage, .announce.final .ann-line, .announce.final .ann-line b { color: var(--ink); }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }

/* ——— Screen mode (/tv) ——— */
body.tv { font-size: 20px; }
body.tv .hero-in { padding-block: 28px; }
body.tv .bug.big .p { font-size: clamp(22px, 2.2vw, 34px); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ——— Event energy: brand light behind the hero, entrances, live pulse ——— */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before, .hero::after { content: ""; position: absolute; z-index: -1; width: 46vw; height: 46vw; max-width: 620px; max-height: 620px; border-radius: 50%; filter: blur(80px); opacity: .32; pointer-events: none; }
.hero::before { background: #0e90cb; left: -12vw; top: -18vw; animation: roam-a 18s ease-in-out infinite alternate; }
.hero::after { background: var(--orange); right: -10vw; bottom: -22vw; animation: roam-b 22s ease-in-out infinite alternate; }
@keyframes roam-a { to { transform: translate(18vw, 10vw) scale(1.15); } }
@keyframes roam-b { to { transform: translate(-16vw, -8vw) scale(1.2); } }
.hero h1 span { animation: rise-in .9s cubic-bezier(.16, 1, .3, 1) both; }
.hero h1 .o { animation-delay: .12s; }
.kicker { animation: rise-in .7s cubic-bezier(.16, 1, .3, 1) both; }
.sub, .status { animation: rise-in .8s .22s cubic-bezier(.16, 1, .3, 1) both; }
.hero-media { animation: media-in 1.1s .1s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(22px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes media-in { from { opacity: 0; transform: translateY(30px) rotate(1.5deg) scale(.96); } to { opacity: 1; transform: none; } }
.live { position: relative; }
.live::before { content: ""; position: absolute; inset: 0; border-radius: 4px; box-shadow: 0 0 0 0 rgba(255, 122, 26, .55); animation: ping 1.8s cubic-bezier(.16, 1, .3, 1) infinite; }
@keyframes ping { to { box-shadow: 0 0 0 10px rgba(255, 122, 26, 0); } }
.station header .on-air { display: inline-flex; align-items: center; gap: 6px; }
.station header .on-air::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.station:not(.free) .bug.big .sc { background-image: linear-gradient(110deg, var(--orange) 40%, #ffa25a 50%, var(--orange) 60%); background-size: 250% 100%; animation: sheen 3.2s linear infinite; }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.reveal { animation: rise-in .8s cubic-bezier(.16, 1, .3, 1) both; }
.flash { animation: flash 2.4s ease-out; }
@keyframes flash { 0%, 30% { background: #ffe4cc; } 100% { background: transparent; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; width: 100%; height: 100%; }
@media (prefers-reduced-motion: reduce) { .hero::before, .hero::after { animation: none; } }

.final-standings { padding-block: 28px; }
.final-standings table { width: 100%; border-collapse: collapse; }
.final-standings th, .final-standings td { padding: 12px; text-align: left; border-bottom: 1px solid #b9bec9; }
