/* ============================================================================
   BE Fit Club · css/welcome.css · the front door (round 7, "title screen") + Practice mode
   Spec: design-review/front-door.html, section 8 C and E. The screen element has data-theme="dark" (js/screens/
   welcome.js), so these rules see the dark tokens whatever the app theme is.
   ========================================================================== */

/* The front door uses the whole page: no padding, no 1040 px column, no room kept for a nav that isn't there. */
body.is-fd .screen-host, body.is-fd.no-nav .screen-host { padding: 0; max-width: none; margin: 0; width: 100%; }

.scr-welcome {
  --knock: var(--bg);                       /* the lockup's cut-outs show the page behind */
  position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; color: var(--ink);
  /* top floodlight + the first two active teams' glows at the bottom corners (set from Teams.list() in welcome.js) */
  background:
    radial-gradient(120% 55% at 50% -8%, rgba(242,243,245,.11), transparent 62%),
    radial-gradient(70% 45% at -10% 105%, color-mix(in srgb, var(--c1, var(--green)) 13%, transparent), transparent 70%),
    radial-gradient(70% 45% at 110% 105%, color-mix(in srgb, var(--c2, var(--red)) 12%, transparent), transparent 70%),
    var(--bg);
}

/* ---- title: lockup, name, slogan */
.scr-welcome .fd-title { display: flex; flex-direction: column; align-items: center; text-align: center; padding: calc(30px + env(safe-area-inset-top, 0px)) 20px 0; }
.scr-welcome .fd-lk { width: 184px; height: 92px; color: var(--ink); margin-bottom: -6px; display: block; }
.scr-welcome .fd-wm { font-weight: 800; font-size: 23px; letter-spacing: .17em; padding-left: .17em; margin-top: 8px; line-height: 1; }
.scr-welcome .fd-wm em { font-style: normal; color: var(--ink3); font-weight: 700; }
.scr-welcome .fd-slogan { font-size: 12px; font-weight: 600; letter-spacing: .26em; padding-left: .26em; text-transform: uppercase; color: var(--ink3); margin-top: 10px; }

/* ---- Tonight strip (and its live state) */
.scr-welcome .fd-tonight { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 16px 0; padding: 10px 12px 10px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--s1) 70%, transparent); box-shadow: inset 0 0 0 1px var(--line); }
.scr-welcome .fd-tonight .tl { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scr-welcome .fd-tonight .tl small { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); }
.scr-welcome .fd-tonight .tl b { font-size: 15px; font-weight: 700; }
.scr-welcome .fd-tonight .tr { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink3); }
.scr-welcome .fd-tonight .ms i { width: 26px; height: 26px; font-size: 13.5px; }
/* always dark: the app's light-theme darkening of team numerals ([data-theme="light"] .ms i / .tnum, matched through <html>) must not reach in */
.scr-welcome .ms i { color: var(--tc); }
.scr-welcome .ms i.lose { color: var(--ink2); }
.scr-welcome .sb .tnum { color: var(--tc); }
.scr-welcome .fd-live { margin: 22px 16px 0; }
.scr-welcome .fd-live .sb, .scr-welcome .fd-last .sb { width: 100%; text-align: left; }
.scr-welcome .fd-last .lbl, .scr-welcome .fd-live .lbl { margin-bottom: 10px; }
.scr-welcome .fd-live .lbl { margin-bottom: 8px; }

/* ---- doors */
.scr-welcome .fd-doors { padding: 16px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.scr-welcome .fd-door {
  display: flex; align-items: center; gap: 14px; min-height: 70px; padding: 12px 16px; border-radius: 16px; width: 100%; text-align: left; position: relative; overflow: hidden;
  background: var(--s1); box-shadow: var(--edge), inset 0 0 0 1px var(--line); color: var(--ink); cursor: pointer; border: 0; font: inherit;
  transition: transform .12s ease;
}
.scr-welcome .fd-door:active { transform: scale(.985); }
.scr-welcome .fd-door .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scr-welcome .fd-door .tx b { font-size: 19px; font-weight: 750; letter-spacing: -.015em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-welcome .fd-door .tx .sub { font-size: 13px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scr-welcome .fd-door .chev { font-size: 24px; color: var(--ink2); line-height: 1; }
.scr-welcome .fd-door > .tx, .scr-welcome .fd-door > .chev, .scr-welcome .fd-door > .av, .scr-welcome .fd-door > .fd-lock { position: relative; z-index: 1; }

/* Continue as <name>: team coloured */
.scr-welcome .fd-door.is-continue { min-height: 92px;
  background: radial-gradient(90% 140% at 0% 110%, color-mix(in srgb, var(--tc) 30%, transparent), transparent 65%), linear-gradient(180deg, #1A1E24, #15181D);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 0 0 1px color-mix(in srgb, var(--tc) 35%, transparent), 0 10px 30px -12px rgba(0,0,0,.6); }
.scr-welcome .fd-door.is-continue .av { --av: 48px; font-size: 19px; box-shadow: inset 0 0 0 2.5px var(--tc), 0 0 0 4px color-mix(in srgb, var(--tc) 20%, transparent); }
.scr-welcome .fd-door.is-continue .kk { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); }
.scr-welcome .fd-door.is-continue .tx b { font-size: 22px; }
.scr-welcome .fd-door.is-continue .sub em { font-style: normal; font-weight: 650; }
.scr-welcome .fd-door.is-continue .sub em.up { color: var(--green); }
.scr-welcome .fd-door.is-continue .sub em.dn { color: var(--ink3); }
.scr-welcome .fd-notyou { align-self: center; font-size: 15px; font-weight: 600; color: var(--ink2); min-height: 48px; display: flex; align-items: center; margin-top: -10px; }   /* 48: staff reach the menu too (Back to menu) · 15 px: round 8, "slightly bigger" */

/* Referee, Admin */
.scr-welcome .fd-door.is-staff { min-height: 58px; padding: 9px 16px; gap: 12px; }
.scr-welcome .fd-door.is-staff .tx b { font-size: 16px; font-weight: 700; }
.scr-welcome .fd-door.is-staff .tx .sub { font-size: 12.5px; color: var(--ink3); }
.scr-welcome .fd-door.is-staff .chev { font-size: 20px; color: var(--ink3); }
.scr-welcome .fd-lock { width: 30px; height: 30px; border-radius: 9px; background: var(--s2); display: grid; place-items: center; flex: none; }
.scr-welcome .fd-lock svg { width: 14px; height: 14px; stroke: var(--ink2); fill: none; stroke-width: 1.8; }
.scr-welcome .fd-lock.on { background: color-mix(in srgb, var(--green) 16%, var(--s2)); }
.scr-welcome .fd-lock.on svg { stroke: var(--green); }

/* door pictures: on the right, fading out under the words */
.scr-welcome .fd-art { position: absolute; top: 0; right: 0; bottom: 0; width: 64%; pointer-events: none; color: var(--ink);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent 22%, rgba(0,0,0,.45) 50%, #000 82%);
  mask-image: linear-gradient(90deg, transparent 0, transparent 22%, rgba(0,0,0,.45) 50%, #000 82%); }
.scr-welcome .fd-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scr-welcome .fd-door.is-continue .fd-art { color: var(--tc); }

/* footer: the one practice link */
.scr-welcome .fd-foot { margin-top: auto; padding: 0 0 calc(22px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: center; }
.scr-welcome .fd-practice { display: inline-flex; align-items: center; min-height: 48px; }
.scr-welcome .fd-pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 15px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--ink2); white-space: nowrap;
  background: color-mix(in srgb, var(--practice) 7%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--practice) 38%, transparent); }
.scr-welcome .fd-pill svg { width: 14px; height: 14px; fill: none; stroke: var(--practice); stroke-width: 1.8; flex: none; }
.scr-welcome .fd-pill em { font-style: normal; color: var(--ink3); font-weight: 500; }
.scr-welcome .fd-pill em + svg { width: 13px; height: 13px; stroke: var(--ink2); margin-left: 2px; }

/* the name box (round 8): the first door on the menu, the whole screen in state find */
.scr-welcome .fd-find { display: flex; flex-direction: column; gap: 10px; padding: 14px 14px 14px 16px; border-radius: 16px; position: relative;
  background: radial-gradient(90% 140% at 0% 0%, rgba(242,243,245,.10), transparent 60%), linear-gradient(180deg, #1A1E24, #15181D);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), inset 0 0 0 1px #343A44, 0 10px 30px -12px rgba(0,0,0,.6); }
.scr-welcome .fd-find::before { content: ''; position: absolute; left: 0; top: 14px; height: 26px; width: 3px; border-radius: 0 3px 3px 0; background: var(--ink); }
.scr-welcome .fd-find.is-quiet { display: none; }
.scr-welcome .fd-find-l { font-size: 18px; font-weight: 750; letter-spacing: -.015em; line-height: 1.2; }
.scr-welcome .fd-find .inp { height: 52px; border-radius: 13px; background: var(--s1); box-shadow: inset 0 0 0 1.5px var(--s3); font-size: 15px; }
.scr-welcome .fd-find .inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink2); }
.scr-welcome .fd-back { display: none; align-self: flex-start; align-items: center; gap: 2px; min-height: 44px; padding-right: 12px; margin: -6px 0 -4px -6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.scr-welcome .fd-back svg { width: 24px; height: 24px; }
.scr-welcome .fd-hint { display: none; font-size: 12px; color: var(--ink3); text-align: center; }
.scr-welcome [data-fd-res]:not(:empty) { margin-top: 2px; }
.scr-welcome .fd-hl { background: color-mix(in srgb, var(--ink) 16%, transparent); border-radius: 3px; padding: 0 1px; }
.scr-welcome .fd-skip { display: flex; justify-content: center; margin: 8px auto 0; }
/* typing: the rest fades out, then only the name box is left */
.scr-welcome.fd-fading :is(.fd-door, .fd-notyou, .fd-foot, .fd-section) { opacity: 0; transition: opacity .18s ease; }
.scr-welcome.is-find :is(.fd-door, .fd-notyou, .fd-foot, .fd-section) { display: none; }
@media (max-width: 959px) {   /* phones: the title and Tonight go too (the laptop keeps its left column) */
  .scr-welcome.fd-fading :is(.fd-title, .fd-tonight, .fd-live) { opacity: 0; transition: opacity .18s ease; }
  .scr-welcome.is-find :is(.fd-title, .fd-tonight, .fd-live) { display: none; }
}
.scr-welcome.is-find .fd-doors { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.scr-welcome.is-find .fd-find, .scr-welcome.is-find .fd-find.is-quiet { display: flex; background: none; box-shadow: none; padding: 0; }
.scr-welcome.is-find .fd-find::before { display: none; }
.scr-welcome.is-find .fd-find-l { font-size: 24px; letter-spacing: -.02em; }
.scr-welcome.is-find .fd-back { display: flex; }
.scr-welcome.is-find .fd-hint { display: block; }
@media (max-width: 959px) { .scr-welcome.is-find .fd-l { display: none; } }

/* entry motion: each block fades up 420 ms, 40 ms apart (js adds .fd-anim once, after the splash) */
.scr-welcome.fd-hold .st { opacity: 0; }
.scr-welcome.fd-anim .st { animation: fd-in .42s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(var(--i, 0) * 40ms); }
@keyframes fd-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .scr-welcome.fd-anim .st { animation: none; } .scr-welcome .fd-door { transition: none; } }

/* laptop: two columns */
@media (min-width: 960px) {
  .scr-welcome { flex-direction: row; }
  .scr-welcome .fd-l { flex: 1.15; display: flex; flex-direction: column; justify-content: center; padding: 0 80px; border-right: 1px solid var(--line); min-width: 0; }
  .scr-welcome .fd-r { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 90px; min-width: 0; }
  .scr-welcome .fd-title { align-items: flex-start; text-align: left; padding: 0; }
  .scr-welcome .fd-lk { width: 320px; height: 160px; margin-left: -6px; }
  .scr-welcome .fd-wm { font-size: 44px; padding-left: 0; margin-top: 18px; }
  .scr-welcome .fd-slogan { font-size: 14px; padding-left: 0; margin-top: 14px; }
  .scr-welcome .fd-last { margin-top: 44px; max-width: 470px; }
  .scr-welcome .fd-section { font-size: 12px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink3); margin: 0 2px 6px; max-width: 440px; }
  .scr-welcome .fd-doors { padding: 0; max-width: 440px; width: 100%; }
  .scr-welcome.is-find .fd-doors { padding-top: 0; }
  .scr-welcome .fd-foot { margin-top: 18px; padding: 0; justify-content: flex-start; }
}

/* ============================================================================
   Practice mode (spec E): the incognito look. html.practice comes from js/core/practice.js; the tokens are in
   css/tokens.css. Nothing here changes data, chips or numbers.
   ========================================================================== */
html.practice body { background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--practice) 5.5%, transparent) 0 2px, transparent 2px 16px); }
html.practice body::after { content: ''; position: fixed; inset: 0; box-shadow: inset 0 0 0 3px var(--practice); pointer-events: none; z-index: 60; }
html.practice .scr-welcome { min-height: calc(100dvh - 28px); }
/* on the front door the floodlight turns violet, and the texture sits under the glows */
html.practice .scr-welcome {
  background:
    radial-gradient(120% 55% at 50% -8%, color-mix(in srgb, var(--practice) 17%, transparent), transparent 62%),
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--practice) 5.5%, transparent) 0 2px, transparent 2px 16px),
    var(--bg);
}
html.practice .scr-welcome .fd-find:not(.is-quiet) {
  background: radial-gradient(90% 140% at 0% 0%, color-mix(in srgb, var(--practice) 16%, transparent), transparent 60%), linear-gradient(180deg, #221C30, #1A1625);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 0 0 1px #3A3150, 0 10px 30px -12px rgba(0,0,0,.6); }
html.practice .scr-welcome.is-find .fd-find { background: none; box-shadow: none; }
html.practice .scr-welcome .fd-pill { color: var(--ink); background: color-mix(in srgb, var(--practice) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--practice) 60%, transparent); }
/* the violet bar */
.practice-bar { gap: 7px; }
.practice-bar svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.9; flex: none; }
/* console cues: the clock's small label, the sync chip */
html.practice .cn-score .sb-mid.is-live { background: color-mix(in srgb, var(--practice) 24%, var(--s2)); }
html.practice .cn-score .sb-mid.is-live small { color: #C9B6FF; }
html.practice .hd-syncbtn .sync { color: var(--practice); }

/* the password gate (js/core/practice.js): a sheet in front of a practice that hasn't started yet */
.pg { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-end; justify-content: center; background: var(--bg) repeating-linear-gradient(135deg, color-mix(in srgb, var(--practice) 5.5%, transparent) 0 2px, transparent 2px 16px);
  box-shadow: inset 0 0 0 3px var(--practice); color: var(--ink); font: var(--fs-body)/1.4 var(--font); }
.pg-sheet { width: 100%; max-width: 440px; background: var(--s1); border-radius: 22px 22px 0 0; border-top: 1px solid var(--line); padding: 10px 16px calc(var(--sheet-safe) + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.pg-hdl { width: 36px; height: 5px; border-radius: 3px; background: var(--s3); align-self: center; }
.pg-sheet h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pg-sheet h2 svg { width: 16px; height: 16px; fill: none; stroke: var(--practice); stroke-width: 1.9; }
.pg-hint { font-size: 13px; color: var(--ink2); margin-top: -6px; }
.pg-inp { height: 52px; border-radius: 12px; background: var(--s2); display: flex; align-items: center; padding: 0 14px; }
.pg-inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--practice); }
.pg-inp input { flex: 1; height: 100%; font-size: 16px; color: var(--ink); outline: none; }
.pg-inp input:focus-visible { outline: none; }
.pg-inp input::placeholder { color: var(--ink3); }
.pg-err { font-size: 12px; color: var(--warn); min-height: 16px; margin-top: -6px; }
.pg-go { height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; background: var(--practice); color: var(--on-practice); width: 100%; }
.pg-go:active { filter: brightness(.92); }
.pg-cx { align-self: center; font-size: 14px; color: var(--ink2); min-height: 44px; display: flex; align-items: center; padding: 0 16px; }
@media (min-width: 600px) { .pg { align-items: center; } .pg-sheet { border-radius: 22px; border: 1px solid var(--line); } }
