/* The page wears the Data App's own palette (app.css in data-app-fifa), so the bar, the frame and the app read as one
   surface. Dark is the default; html[data-mode="light"] follows the app's light theme (SLDS greys, navy ink). */
@font-face { font-family: 'Inter'; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-display: swap; src: url(/fonts/barlow-condensed-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-display: swap; src: url(/fonts/barlow-condensed-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #070d1a; --bg2: #0b1120; --panel: #0f1729; --panel2: #141e34;
  --ink: #eef2fa; --ink2: #c2cbdc; --muted: #8b97b0; --line: #1f2a42; --line2: #2b3954;
  --gold: #FFD23F; --green: #19B36B; --brand3: #2b5fd9; --live: #4fe39b; --live-rgb: 79,227,155; --focus: #5DC8FF;
  --act: #eef2fa; --onact: #0b1120; --bad: #FF5D6C; --tabon: #FFD23F;
  --head-a: rgba(12,20,38,.98); --head-b: rgba(7,13,26,.98);
  --cover-a: #0f1d3a; --card: rgba(11,17,32,.9);
  --display: 'Barlow Condensed', 'Arial Narrow', system-ui, sans-serif;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 8px; --ease: 200ms ease-out; --bar: 64px; --foot: 28px;
}
:root[data-mode="light"] {
  --bg: #f3f3f3; --bg2: #ffffff; --panel: #ffffff; --panel2: #f3f3f3;
  --ink: #03234d; --ink2: #2e2e2e; --muted: #5c5c5c; --line: #e5e5e5; --line2: #c9c9c9;
  --gold: #ca8501; --green: #2e844a; --brand3: #066afe; --live: #056764; --live-rgb: 5,103,100; --focus: #0250d9;
  --act: #03234d; --onact: #ffffff; --bad: #b60554; --tabon: #03234d;
  --head-a: #ffffff; --head-b: #ffffff;
  --cover-a: #ffffff; --card: #ffffff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 400 14px/1.45 var(--font); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, select { font: inherit; }
a { color: var(--ink2); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---- bar: brand, the app's tabs, then team, source, theme, narration, Ask, page tools ---- */
.bar { height: var(--bar); display: flex; align-items: center; gap: 16px; padding: 0 14px 0 16px; position: relative; z-index: 2;
  background: linear-gradient(180deg, var(--head-a), var(--head-b)); border-bottom: 1px solid var(--line); }
/* the app's tri-colour rule (green, gold, blue) under the bar */
.bar::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; opacity: .85;
  background: linear-gradient(90deg, var(--green) 0 33%, var(--gold) 33% 66%, var(--brand3) 66%); }
.brand { display: flex; align-items: center; gap: 14px; flex: none; }
.lockup { display: block; height: 56px; width: auto; flex: none; }
.title { font: 700 22px/1 var(--display); letter-spacing: .6px; text-transform: uppercase; white-space: nowrap; }
.spacer { flex: 1; }
.ctrls { display: flex; align-items: center; gap: 8px; flex: none; }

.tabs { display: flex; gap: 2px; align-self: stretch; min-width: 0; flex: 0 1 auto; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; padding: 0 10px; font: 600 15px var(--display); letter-spacing: .6px; text-transform: uppercase; color: var(--muted);
  cursor: pointer; border-top: 3px solid transparent; border-bottom: 3px solid transparent; white-space: nowrap; display: flex; align-items: center;
  transition: color var(--ease), border-color var(--ease); }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); border-bottom-color: var(--tabon); }
.tab:focus-visible { outline-offset: -3px; }

.chip { height: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; cursor: pointer; flex: none;
  border: 1px solid var(--line2); background: var(--panel); color: var(--ink2); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: border-color var(--ease), background var(--ease), color var(--ease); }
.chip:hover { border-color: var(--ink2); color: var(--ink); }
.chip.on { border-color: var(--ink2); color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; transition: background var(--ease), box-shadow var(--ease); }
.chip.on .dot, .chip .dot.live { background: var(--live); box-shadow: 0 0 8px rgba(var(--live-rgb), .7); }
.chip.speaking .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(var(--live-rgb), 0); transform: scale(1.25); } }

.chip .spk { width: 16px; height: 16px; flex: none; }
.team { padding: 0 10px 0 6px; }
.team .flag { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; box-shadow: 0 0 0 1px var(--line2); }
.team .tname { font-size: 14px; font-weight: 700; max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.team .caret { color: var(--muted); font-size: 11px; }

.ask { background: var(--act); color: var(--onact); border-color: var(--act); }
.ask:hover { color: var(--onact); border-color: var(--act); filter: brightness(1.08); }
.ask .dot { background: var(--muted); }
.ask .dot.live { background: var(--live); }
.ask.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--act); color: var(--onact); }

/* the app's data source as a dot: colour is the state; the words are in the label and the hover */
.srcdot { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink2); flex: none; }
.srcdot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; }
.srcdot.live { color: var(--live); }
.srcdot.live::before { background: currentColor; box-shadow: 0 0 6px rgba(var(--live-rgb), .6); }
.srcdot.partial::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

.seg { display: inline-flex; height: 34px; border: 1px solid var(--line2); border-radius: 999px; padding: 2px; background: var(--panel); flex: none; }
.seg button { border: 0; background: none; color: var(--ink2); padding: 0 10px; border-radius: 999px; cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .3px;
  transition: background var(--ease), color var(--ease); }
.seg button[aria-pressed='true'] { background: var(--act); color: var(--onact); }

.icon { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; cursor: pointer; flex: none;
  border: 1px solid var(--line2); background: var(--panel); color: var(--ink2); font-size: 15px; line-height: 1; transition: border-color var(--ease), color var(--ease); }
.icon:hover { border-color: var(--ink2); color: var(--ink); }
.icon svg { width: 16px; height: 16px; }

/* narrower screens: the words go first, the controls stay */
@media (max-width: 1599px) { .askfull { display: none; } }
@media (max-width: 1439px) { #narrate .lbl { display: none; } .team .tname { max-width: 110px; } }
@media (max-width: 1299px) { .title { display: none; } .tab { padding: 0 7px; font-size: 14px; } }
@media (max-width: 1099px) { #reload { display: none; } .lockup { height: 48px; } }

/* ---- stage ---- */
.stage { position: relative; height: calc(100vh - var(--bar) - var(--foot)); min-height: 560px; background: var(--bg); overflow: hidden; }
/* Tableau draws a 4px white sheet margin around the data app; host.js sizes the viz 8px larger
   (width/height attributes, which its iframe follows) and this offset crops the margin away. */
.stage tableau-viz { display: block; margin: -4px; }
.cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 35%, var(--cover-a) 0%, var(--bg) 60%); transition: opacity 400ms ease-out; }
.cover.gone { opacity: 0; pointer-events: none; }
.coverlock { height: 120px; width: auto; margin-bottom: 8px; }
.cover strong { font-size: 20px; }
.cover p { margin: 0; max-width: 520px; color: var(--ink2); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--gold); animation: spin 1s linear infinite; }
.cover.err .spinner { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn { height: 38px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--act); color: var(--onact); font-weight: 700; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }

/* ---- foot ---- */
.foot { height: var(--foot); display: flex; align-items: center; gap: 16px; padding: 0 20px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--bg2); white-space: nowrap; overflow: hidden; }
.foot b { color: var(--ink2); font-weight: 600; }
.foot .ok { color: var(--live); }
.foot .warn { color: var(--bad); }
.foot a { color: var(--muted); }

/* ---- full screen: the bar stays once it carries the app's tabs; otherwise just the app ---- */
body.full .foot { display: none; }
body.full .stage { height: calc(100vh - var(--bar)); min-height: 0; }
body.full:not(.hosted) .bar { display: none; }
body.full:not(.hosted) .stage { height: 100vh; }

/* ---- login ---- */
.login { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 20%, #13234a 0%, #070d1a 60%); }
.card { width: min(440px, 100%); background: rgba(11,17,32,.92); border: 1px solid var(--line2); border-radius: 16px; padding: 28px 32px 32px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
  position: relative; overflow: hidden; }
.card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--green) 0 33%, var(--gold) 33% 66%, var(--brand3) 66%); }
.card .lock { display: block; height: 112px; width: auto; margin: 4px auto 8px; }
.card .kicker { font: 700 13px var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin: 12px 0 0; text-align: center; }
.card h1 { font: 700 34px/1.05 var(--display); letter-spacing: .4px; text-transform: uppercase; margin: 4px 0 10px; text-align: center; }
.card p { margin: 0 0 24px; color: var(--ink2); text-align: center; }
.card label { display: block; font-size: 12px; font-weight: 600; color: var(--ink2); margin-bottom: 8px; }
.card input { width: 100%; height: 44px; border-radius: var(--r); border: 1px solid var(--line2); background: var(--bg); color: var(--ink); padding: 0 12px; font: inherit; font-size: 15px; }
.card input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(93,200,255,.25); }
.card .btn { width: 100%; height: 44px; margin-top: 16px; font-size: 15px; border-radius: var(--r); }
.card .msg { color: var(--bad); font-size: 13px; margin: 12px 0 0; min-height: 18px; }
.card small { display: block; margin-top: 20px; color: var(--muted); font-size: 12px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .spinner, .chip.speaking .dot { animation: none; }
  .cover, .chip, .seg button, .tab { transition: none; }
}
