/* PADEL WORLD - browser prototype UI, "Blue Night Arena" art pack (art/). Sprites are 9-sliced with border-image
   (slice values from art pack UI/design_tokens.json, drawn at ~0.36 x the 1080 px reference = CSS px on a 390 px phone). */

/* ---------------------------------------------------------------- fonts (art/fonts, SIL OFL 1.1 / Bitstream Vera) */
@font-face { font-family: 'Barlow Condensed'; src: url(art/fonts/BarlowCondensed-Bold.ttf) format('truetype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(art/fonts/BarlowCondensed-BoldItalic.ttf) format('truetype'); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url(art/fonts/BarlowCondensed-SemiBold.ttf) format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(art/fonts/Barlow-Regular.ttf) format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(art/fonts/Barlow-SemiBold.ttf) format('truetype'); font-weight: 600; font-style: normal; font-display: swap; }
/* DejaVu Sans only for the arrows missing from Barlow (the progression arrow); downloaded only if such a glyph is shown. */
@font-face { font-family: 'PW Symbols'; src: url(art/fonts/DejaVuSans.ttf) format('truetype'); unicode-range: U+2190-21FF; font-display: swap; }

:root {
  /* art pack design tokens */
  --navy: #07162F; --surface: #10294D; --surface2: #173E6C; --cyan: #18D9FF; --blue: #0878F9; --white: #F4F8FF; --muted: #AFC5E0;
  --gold: #FFD566; --coral: #FF6858; --lime: #DFFF42; --green: #56ECA2;
  --a: var(--cyan); --b: var(--coral);
  --display: 'Barlow Condensed', 'PW Symbols', system-ui, sans-serif;
  --body: 'Barlow', 'PW Symbols', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px);
  --press: 90ms; --panelIn: 180ms;
}
html, body { margin: 0; height: 100%; background: var(--navy); overflow: hidden; touch-action: none; font-family: var(--body); color: var(--white);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 75% at 50% 52%, transparent 58%, rgba(2, 6, 22, .5) 100%); }
button { font-family: inherit; color: inherit; -webkit-touch-callout: none; }
img { -webkit-user-drag: none; }
@media (prefers-reduced-motion: reduce) { :root { --press: 0ms; --panelIn: 0ms; } }

/* ---------------------------------------------------------------- sprite primitives */
/* Icon: white PNG from the pack used as a mask, so it takes the text colour (currentColor). */
.ico { display: inline-block; flex: none; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--i) center / contain no-repeat; mask: var(--i) center / contain no-repeat; }
.slice { border-style: solid; border-color: transparent; box-sizing: border-box; }
.slice.panel { border-width: 10px; border-image: url(art/ui/panel_base.png) 28 fill / 10px stretch; }
.slice.panelHi { border-width: 10px; border-image: url(art/ui/panel_elevated.png) 28 fill / 10px stretch; }
.slice.pill { border-width: 0 8px; border-image: url(art/ui/pill.png) 32 fill / 11px 11px stretch; }
.logoImg { display: block; height: auto; pointer-events: none; }

/* Sprite buttons: default / pressed / disabled (+ selected for secondary). Text is real HTML (localized). */
.sbtn { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; min-height: 48px; padding: 0 6px;
  border: 10px solid transparent; border-image: url(art/ui/button_secondary_default.png) 28 fill / 10px stretch; background: none; cursor: pointer;
  font-family: var(--display); font-weight: 700; font-style: italic; text-transform: uppercase; letter-spacing: .01em; color: var(--white);
  transition: transform var(--press); }
.sbtn:active:not(:disabled) { transform: scale(.97); border-image-source: url(art/ui/button_secondary_pressed.png); }
.sbtn.sel { border-image-source: url(art/ui/button_secondary_selected.png); }
.sbtn:disabled { cursor: default; border-image-source: url(art/ui/button_secondary_disabled.png); color: rgba(244, 248, 255, .55); }
.sbtn.primary { border-image-source: url(art/ui/button_primary_default.png); }
.sbtn.primary:active:not(:disabled) { border-image-source: url(art/ui/button_primary_pressed.png); }
.sbtn.primary:disabled { border-image-source: url(art/ui/button_primary_disabled.png); }
.sbtn.gold { border-image-source: url(art/ui/button_gold_default.png); color: #1a1405; }
.sbtn.gold:active:not(:disabled) { border-image-source: url(art/ui/button_gold_pressed.png); }
.sbtn.gold:disabled { border-image-source: url(art/ui/button_gold_disabled.png); color: rgba(244, 248, 255, .55); }
.sbtn:focus-visible, .tab:focus-visible, .iconBtn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
/* "Bientôt" tag on features that do not exist yet. */
.soon em, .modeCard.soon .sbtn b { font-family: var(--display); font-style: normal; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.soon em { position: absolute; top: -13px; right: 2px; font-size: 10px; line-height: 1; padding: 3px 7px; border-radius: 9px; color: var(--navy); background: var(--muted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4); white-space: nowrap; }

/* ---------------------------------------------------------------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; display: none; font-family: var(--display); }
#hud.show { display: block; }
#score { position: fixed; left: calc(12px + var(--sl)); top: calc(10px + var(--st)); padding: 2px 4px 2px 6px; min-width: 200px; font-variant-numeric: tabular-nums; }
#score .row { display: flex; align-items: center; gap: 7px; height: 34px; font-weight: 700; font-size: 18px; text-transform: uppercase; }
#score .dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
#score .a .dot { background: var(--a); } #score .b .dot { background: var(--b); }
#score .nm { flex: 1; white-space: nowrap; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; }
#score .srv { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); visibility: hidden; flex: none; }
#score .srv.on { visibility: visible; }
#score .sets { font-size: 14px; color: var(--muted); font-weight: 600; }
#score .pt { min-width: 32px; height: 30px; padding: 0 3px; display: grid; place-items: center; font-size: 20px; font-weight: 600; box-sizing: border-box;
  border: 7px solid transparent; border-image: url(art/ui/score_cell_blue.png) 20 fill / 7px stretch; }
#score .b .pt { border-image-source: url(art/ui/score_cell_red.png); }
#score .pt span { margin: -7px; }
#score .gm { min-width: 22px; text-align: center; font-size: 20px; font-weight: 600; }
#titleBadge { position: fixed; left: 50%; top: calc(10px + var(--st)); transform: translateX(-50%); text-align: center; }
#titleBadge .logoImg { width: 200px; margin: 0 auto; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .5)); }
#titleBadge .badgeSub { white-space: nowrap; margin-top: 5px; font-family: var(--body); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; text-shadow: 0 1px 3px #000; }
#pauseBtn { position: fixed; right: calc(12px + var(--sr)); top: calc(10px + var(--st)); width: 48px; height: 48px; border: 0; padding: 0; display: none; z-index: 6;
  background: url(art/hud/pause.png) center / contain no-repeat; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45)); transition: transform var(--press); }
#pauseBtn:active { transform: scale(.92); }
#pauseBtn.show { display: block; }
/* Combo / timing bar: art-pack timing track + 8 segments, bound to the perfect-hit streak. */
#combo { position: fixed; left: calc(12px + var(--sl)); top: calc(102px + var(--st)); display: flex; align-items: center; gap: 6px; }
#combo .bolt { width: 26px; height: 26px; color: var(--gold); filter: drop-shadow(0 0 4px rgba(255, 213, 102, .6)); }
#combo .track { width: 168px; height: 24px; background: url(art/hud/timing_track.png) center / 100% 100% no-repeat; display: flex; align-items: center; padding: 0 7px; box-sizing: border-box; }
#combo .segs { display: flex; gap: 2px; width: 100%; }
#combo .segs i { flex: 1; height: 14px; background: url(art/hud/timing_segment.png) center / 100% 100% no-repeat; opacity: .14; filter: grayscale(1) brightness(1.6); transition: opacity .2s, filter .2s; }
#combo .segs i.on { opacity: 1; filter: hue-rotate(78deg) saturate(.85); }      /* green (#56ECA2) segments */
#combo .segs i.on.hi { filter: none; }                                           /* lime (#DFFF42) top of the streak */
#combo .cx { font-weight: 700; font-style: italic; font-size: 22px; color: var(--gold); text-transform: uppercase; opacity: 0; transition: opacity .2s; text-shadow: 0 2px 4px rgba(0, 0, 0, .6); white-space: nowrap; }
#combo .cx.show { opacity: 1; }
/* Hit grade text (PARFAIT ! / BIEN / TROP TARD...) with the pack's perfect_streak sprite under it. */
#popup { position: fixed; left: 0; top: 0; opacity: 0; transition: opacity .25s; will-change: transform, opacity; }
#popupTxt { display: inline-block; position: relative; font-family: var(--display); font-weight: 700; font-style: italic; font-size: clamp(30px, 8vmin, 54px); white-space: nowrap;
  text-transform: uppercase; color: var(--white); --glow: var(--green); text-shadow: 0 2px 0 rgba(0, 0, 0, .45), 0 0 14px var(--glow); }
#popupTxt::after { content: ''; position: absolute; left: -22%; right: -26%; top: 34%; height: 62%; z-index: -1; opacity: .9;
  background: url(art/vfx/perfect_streak.png) center / 100% 100% no-repeat; }
#popup.late #popupTxt::after { filter: hue-rotate(-50deg) saturate(1.3); }
#popup.plain #popupTxt::after { display: none; }
#popup.pop #popupTxt { animation: pop .26s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes pop { 0% { transform: scale(1.5) translateX(-14px); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#banner { position: fixed; left: 4%; right: 4%; top: 25%; text-align: center; font-family: var(--display); font-size: clamp(26px, 7vmin, 52px); font-weight: 700; font-style: italic;
  text-transform: uppercase; white-space: pre-line; transition: opacity .3s; opacity: 0; text-shadow: 0 0 14px currentColor, 0 3px 0 rgba(0, 0, 0, .5); }
#banner small { display: block; font-family: var(--body); font-size: .42em; font-style: normal; font-weight: 600; text-transform: none; color: var(--white); text-shadow: 0 2px 6px #000; margin-top: 6px; }
#hint { position: fixed; left: 50%; bottom: 31%; transform: translateX(-50%); padding: 6px 16px; border-radius: 20px; font-family: var(--display); font-weight: 700; font-size: clamp(15px, 3.6vmin, 21px);
  text-transform: uppercase; background: rgba(7, 22, 47, .72); border: 1px solid rgba(24, 217, 255, .55); white-space: nowrap; display: none; }
#hint.show { display: block; }

/* Joystick + racket button (art-pack HUD sprites, bound to the existing touch handlers). */
#joy { position: fixed; width: 128px; height: 128px; margin: -64px 0 0 -64px; pointer-events: none; display: none; z-index: 4;
  background: url(art/hud/joystick_base.png) center / contain no-repeat; transition: opacity .2s; }
#knob { position: fixed; width: 56px; height: 56px; margin: -28px 0 0 -28px; pointer-events: none; display: none; z-index: 5;
  background: url(art/hud/joystick_knob.png) center / contain no-repeat; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .4)); transition: opacity .2s; }
#joy.idle, #knob.idle { opacity: .5; }
/* Shot pad: FRAPPE (pack hit_default / hit_pressed sprite), LOB and SMASH. Positions are set from game.js (thumb arc).
   Each button carries a ring gauge (conic gradients): dim zone track (green 0-60 %, yellow 60-85 %, red 85-100 %, i.e. the
   core's precision loss above 0.6 power) + the charge fill drawn with the same zones up to the current power. */
#shotPad { position: fixed; inset: 0; pointer-events: none; z-index: 5; display: none; }
#shotPad.show { display: block; }
.shot { position: absolute; width: 70px; height: 70px; margin: -35px 0 0 -35px; padding: 0; border: 0; border-radius: 50%; pointer-events: auto; touch-action: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--white);
  background: radial-gradient(circle at 50% 35%, #1d4d92, #0b1f45 70%); box-shadow: inset 0 0 0 2.5px var(--cyan), 0 3px 10px rgba(0, 0, 0, .45);
  transition: transform var(--press), filter .2s; --p: 0; }
.shot .ico { width: 24px; height: 24px; }
.shot .lbl { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 13px; line-height: 1; text-transform: uppercase; text-shadow: 0 1px 2px #000; }
.shot.big { width: 108px; height: 108px; margin: -54px 0 0 -54px; background: url(art/hud/hit_default.png) center / contain no-repeat; box-shadow: none; }
.shot.big .lbl { position: absolute; bottom: -17px; font-size: 14px; }
.shot.press { transform: scale(.94); box-shadow: inset 0 0 0 3px #fff, 0 0 14px rgba(24, 217, 255, .8); }
.shot.big.press { background-image: url(art/hud/hit_pressed.png); box-shadow: none; }
.shot.ready { filter: drop-shadow(0 0 10px rgba(24, 217, 255, .9)); }
.shot .gauge { position: absolute; inset: -9px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--green) 0 calc(min(var(--p), .6) * 1turn), var(--gold) 0 calc(min(var(--p), .85) * 1turn), var(--coral) 0 calc(var(--p) * 1turn), transparent 0), conic-gradient(rgba(86, 236, 162, .28) 0 .6turn, rgba(255, 213, 102, .3) 0 .85turn, rgba(255, 104, 88, .36) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px)); }
.shot.big .gauge { inset: -10px; }
.shot.risk .lbl { color: var(--gold); } .shot.over .lbl { color: var(--coral); }

/* ---------------------------------------------------------------- panels */
.panel:not(.slice) { position: fixed; inset: 0; display: none; z-index: 10; box-sizing: border-box; }
.panel.show { display: flex; }
.sheet { background: rgba(4, 12, 30, .66); align-items: center; justify-content: center; padding: 18px; }
.card { width: min(440px, 92vw); max-height: 92vh; overflow-y: auto; padding: 14px 10px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.cardTitle { font-family: var(--display); font-size: clamp(30px, 8vmin, 44px); font-weight: 700; font-style: italic; text-transform: uppercase; text-align: center; margin-bottom: 2px; }
.btn { width: 100%; font-size: 17px; }
.sbtn.sec.btn:not(:has(b)) { justify-content: flex-start; padding-left: 8px; font-style: normal; text-transform: none; font-family: var(--body); font-weight: 600; font-size: 15px; }
.sbtn.primary.btn, #eRematch { font-size: 22px; min-height: 54px; }
.help { color: var(--muted); font-size: 13px; line-height: 1.45; white-space: pre-line; padding: 0 4px; }
.note { opacity: .55; font-size: 12px; text-align: center; }
.pbar { height: 8px; border-radius: 4px; background: url(art/ui/progress_track.png) center / 100% 100% no-repeat; overflow: hidden; min-width: 60px; }
.pbar i { display: block; height: 100%; width: 0; background: url(art/ui/progress_fill.png) left center / auto 100% no-repeat; background-size: 100% 100%; border-radius: 4px; transition: width .6s; }
.lvBadge { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 14px; color: var(--cyan); padding: 2px 4px; white-space: nowrap; text-transform: uppercase; }

/* ---------------------------------------------------------------- full screens (mode select, result): pack navy gradient */
.screen { flex-direction: column; background: radial-gradient(ellipse 70% 40% at 50% 34%, rgba(18, 104, 150, .55), transparent 70%),
  linear-gradient(160deg, #10325f 0%, #0a1f42 45%, #07162F 75%, #0e2a55 100%);
  padding: calc(12px + var(--st)) calc(16px + var(--sr)) calc(88px + var(--sb)) calc(16px + var(--sl)); overflow-y: auto; }
.scrHead { display: flex; justify-content: center; padding: 4px 0 6px; }
.scrHead .logoImg { width: 190px; }
.scrBody { width: min(100%, 460px); margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.cap { font-family: var(--body); font-size: 13px; color: var(--cyan); text-transform: uppercase; letter-spacing: .04em; margin-top: 6px; }
.bigTitle { font-family: var(--display); font-weight: 700; font-style: italic; font-size: clamp(36px, 11vw, 60px); line-height: 1; text-transform: uppercase; margin-top: 0; }
.modeCard { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto auto; column-gap: 10px; padding: 6px 8px 8px; }
.modeCard .ico { width: 28px; height: 28px; color: var(--cyan); align-self: center; }
.modeCard > b { font-family: var(--display); font-weight: 700; font-style: italic; font-size: 24px; text-transform: uppercase; align-self: center; }
.modeCard p { grid-column: 1 / 3; margin: 2px 0 6px; font-size: 14px; color: var(--white); opacity: .9; }
.modeCard .sbtn { grid-column: 1 / 3; justify-self: end; width: 52%; font-size: 18px; }
.modeCard.soon { opacity: .72; }
.modeCard.soon .ico { color: var(--muted); }

/* result screen */
.endTop { text-align: left; }
.endHero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 4px; }
#endIcon { width: 92px; height: 92px; color: var(--gold); filter: drop-shadow(0 0 18px rgba(24, 217, 255, .35)); }
#end.lose #endIcon { color: var(--muted); }
#endScore { font-family: var(--display); font-weight: 600; font-size: clamp(44px, 13vw, 72px); line-height: 1.05; font-variant-numeric: tabular-nums; }
#endNames { font-family: var(--body); font-size: 15px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.endSide { display: flex; flex-direction: column; gap: 10px; }
.statsPanel { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.xpLine { display: flex; align-items: baseline; justify-content: center; gap: 8px; }
.xpLine b, #endStats b { font-family: var(--display); font-weight: 600; }
#endXp { font-size: 34px; color: var(--gold); }
.xpLine small, #endStats small { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#endStats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; text-align: center; }
#endStats div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
#endStats b { font-size: 24px; line-height: 1.1; }
#endStats small { font-size: 10.5px; line-height: 1.1; }
.lvlRow { display: flex; align-items: center; gap: 8px; }
.lvlRow .pbar { flex: 1; }
#endUp { font-family: var(--display); font-weight: 700; color: var(--green); font-size: 15px; white-space: nowrap; }

/* ---------------------------------------------------------------- bottom navigation */
#nav { position: fixed; left: 50%; bottom: calc(8px + var(--sb)); transform: translateX(-50%); width: min(calc(100% - 16px - var(--sl) - var(--sr)), 560px); z-index: 12;
  display: none; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 4px; box-sizing: border-box;
  background: linear-gradient(180deg, rgba(23, 62, 108, .92), rgba(10, 30, 62, .95)); border: 1.5px solid rgba(110, 150, 210, .45); border-radius: 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
#nav.show { display: grid; }
.tab { position: relative; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 2px 0; border: 0; background: none;
  font-family: var(--display); font-weight: 700; font-size: 13px; text-transform: uppercase; cursor: pointer; border-radius: 14px; }
.tab .ico { width: 22px; height: 22px; }
.tab.on { background: none; border: 8px solid transparent; border-image: url(art/ui/tab_selected.png) 28 fill / 8px stretch; padding: 0; }
.tab.soon { color: rgba(244, 248, 255, .45); cursor: default; }
.tab.soon em { top: -9px; right: 50%; transform: translateX(50%); font-size: 8.5px; padding: 2px 5px; }

/* ---------------------------------------------------------------- home: blue_night_home background (cover) + 2D hero cutout */
.home { flex-direction: column; padding: calc(10px + var(--st)) calc(12px + var(--sr)) calc(84px + var(--sb)) calc(12px + var(--sl)); gap: 4px;
  background: linear-gradient(180deg, rgba(7, 22, 47, .55) 0%, rgba(7, 22, 47, 0) 20%, rgba(7, 22, 47, 0) 60%, rgba(7, 22, 47, .6) 100%),
    url(art/artwork/blue_night_home.webp) center 30% / cover no-repeat var(--navy); }
.heroArt { position: absolute; left: -9%; bottom: calc(70px + var(--sb)); height: min(66%, 150vw); width: auto; pointer-events: none; z-index: 0;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .45)); }
.home > *:not(.heroArt) { position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; gap: 8px; }
.profile { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 0 1 270px; }
.avatar { width: 52px; height: 52px; flex: none; border-radius: 12px; border: 2px solid var(--cyan); box-sizing: border-box;
  background: url(art/artwork/player_blue_cutout.webp) -96px -10px / 260px auto no-repeat, linear-gradient(180deg, #1f5ec2, #0b2a63); }
.pinfo { flex: 1; min-width: 0; }
.pname { font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; text-transform: uppercase; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.lvl { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.xpTxt { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; text-shadow: 0 1px 3px #000; }
.pinfo .pbar { margin-top: 4px; height: 6px; max-width: 170px; }
.iconBtn { margin-left: auto; width: 48px; height: 48px; border-radius: 50%; border: 1.5px solid rgba(110, 150, 210, .6); background: rgba(16, 41, 77, .8); padding: 0;
  display: grid; place-items: center; cursor: pointer; }
.iconBtn .ico { width: 24px; height: 24px; }
.brand { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }
.brand .logoImg { width: min(86vw, 360px); filter: drop-shadow(0 3px 10px rgba(0, 0, 0, .5)); }
.tagline { margin-top: 6px; font-size: 14px; letter-spacing: .06em; text-transform: uppercase; text-shadow: 0 1px 4px #000; }
.venue { margin-top: 14px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; text-transform: uppercase; text-shadow: 0 1px 4px #000; letter-spacing: .03em; }
.venue b { font-weight: 400; } .venue small { font-size: 12px; color: var(--cyan); }
.homeCol { margin-top: auto; margin-left: auto; width: min(58%, 400px); display: flex; flex-direction: column; gap: 8px; }
.playBtn { min-height: 64px; gap: 14px; border-width: 12px; border-image-width: 12px; }
.playBtn .ico { width: 26px; height: 26px; }
.playBtn .pl { display: flex; flex-direction: column; align-items: center; line-height: .95; }
.playBtn b { font-size: 40px; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.playBtn small { font-family: var(--body); font-style: normal; font-weight: 600; text-transform: none; font-size: 11px; opacity: .92; margin-top: 2px; white-space: nowrap; }
.chips { display: flex; gap: 6px; }
.chip { flex: 1 1 0; min-width: 0; font-family: var(--body); font-style: normal; text-transform: none; font-weight: 600; font-size: 11.5px; line-height: 1.1; padding: 0 2px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 6px; margin-top: 4px; }
.tile { min-height: 50px; justify-content: flex-start; gap: 6px; padding: 0 2px 0 4px; font-size: 17px; }
.tile .ico { width: 20px; height: 20px; }
.tile b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.soon .ico { opacity: .6; }
.rankBar { min-height: 50px; justify-content: flex-start; font-size: 17px; margin-top: 6px; padding-left: 6px; }
.rankBar .ico { color: var(--cyan); }

/* landscape home: hero left, actions right */
@media (orientation: landscape) {
  .home { padding-bottom: calc(80px + var(--sb)); background-position: center 42%; }
  .heroArt { left: 2%; bottom: calc(2px + var(--sb)); height: 94%; }
  .brand { position: absolute; left: 50%; top: calc(14px + var(--st)); transform: translateX(-50%); margin: 0; }
  .brand .logoImg { width: min(30vw, 360px); }
  .venue { position: absolute; left: calc(20px + var(--sl)); top: 34%; display: none; }
  .homeCol { width: min(40%, 420px); margin-right: 3%; }
  #nav { width: min(52%, 560px); }
  #end .scrBody { margin: auto; }
  .endBody { width: min(100%, 980px); display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: center; }
  .endTop { grid-column: 1 / 3; }
  .screen { padding-bottom: calc(84px + var(--sb)); }
}
/* portrait match HUD: title on top, score below (like match_portrait preview) */
@media (orientation: portrait) {
  #titleBadge .logoImg { width: 190px; }
  #score { top: calc(66px + var(--st)); min-width: 178px; }
  #score .row { height: 31px; font-size: 17px; }
  #pauseBtn { top: calc(74px + var(--st)); }
  #combo { top: calc(146px + var(--st)); }
  #combo .track { width: 150px; }
}
/* short landscape phones (e.g. 844 x 390): compact everything */
@media (max-height: 540px) and (orientation: landscape) {
  .home { padding-bottom: calc(66px + var(--sb)); gap: 2px; }
  .brand .logoImg { width: min(26vw, 240px); } .tagline { display: none; }
  .playBtn { min-height: 52px; } .playBtn b { font-size: 30px; } .playBtn small { display: none; }
  .tiles { grid-template-columns: 1fr 1fr 1fr; gap: 9px 5px; margin-top: 2px; } .tile, .rankBar { min-height: 48px; font-size: 14px; } .rankBar { display: none; }
  .tile { gap: 4px; } .tile .ico { width: 17px; height: 17px; }
  .homeCol { gap: 6px; width: min(50%, 440px); margin-right: 1%; }
  .heroArt { height: 80%; left: 1%; }
  #nav { bottom: calc(4px + var(--sb)); } .tab { min-height: 50px; font-size: 11.5px; } .tab .ico { width: 18px; height: 18px; }
  .pname { font-size: 18px; } .avatar { width: 44px; height: 44px; background-size: 220px auto, auto; background-position: -81px -8px, 0 0; }
  #titleBadge .logoImg { width: 150px; } #titleBadge .badgeSub { font-size: 10px; }
  #score .row { height: 28px; font-size: 15px; } #combo { top: calc(76px + var(--st)); }
  #endScore { font-size: 40px; } #endIcon { width: 56px; height: 56px; }
  body[data-panel=end] #nav { display: none; }
  #end.screen { padding-bottom: calc(10px + var(--sb)); padding-top: calc(6px + var(--st)); }
  #end .scrHead { padding: 0; } #end .scrHead .logoImg { width: 140px; } #end .bigTitle { font-size: 38px; } #end .cap { margin-top: 0; }
  .endBody { row-gap: 6px; } .endSide { gap: 6px; } .statsPanel { gap: 4px; padding: 4px 10px 6px; }
}

/* ---------------------------------------------------------------- loading */
#loading { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 18px; z-index: 20;
  background: radial-gradient(ellipse at 50% 40%, #13325f, var(--navy) 70%); }
#loading .logoImg { width: min(80vw, 340px); }
#loading .bar { width: 220px; height: 6px; background: rgba(255, 255, 255, .15); border-radius: 3px; overflow: hidden; }
#loading .bar i { display: block; height: 100%; width: 30%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: ld 1.1s infinite ease-in-out; }
@keyframes ld { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
#loadMsg { opacity: .75; font-size: 14px; }
.err { color: #ff8080; max-width: 90vw; text-align: center; opacity: 1 !important; }
