/* Ibrahim Games — shared look for the 3D games (loading, title, HUD, toasts,
   countdown, touch controls, pause, results). Each game sets --accent,
   --accent-2 and --accent-deep on :root to colour it. */

@font-face { font-family: "Nunito"; src: url("/assets/fonts/nunito-latin-var.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Lilita One"; src: url("/assets/fonts/lilita-one-latin.woff2") format("woff2"); font-display: swap; }

:root {
  --accent: #ffcc1f;
  --accent-2: #ff8a1f;
  --accent-deep: #c97a00;
  --ink: #ffffff;
  --ink-2: rgba(255, 255, 255, 0.82);
  --glass: rgba(10, 14, 30, 0.62);
  --font: "Nunito", "Segoe UI", system-ui, sans-serif;
  --display: "Lilita One", "Nunito", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0c18; color: var(--ink); font: 700 16px/1.35 var(--font); }
body { -webkit-user-select: none; user-select: none; touch-action: none; -webkit-tap-highlight-color: transparent; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #38e1ff; outline-offset: 3px; border-radius: 12px; }
.hidden { display: none !important; }

/* ---------- Loading ---------- */
#loading {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; gap: 12px;
  background: radial-gradient(circle at 50% 40%, #1b2140, #0a0c18);
  transition: opacity 0.5s ease, visibility 0.5s;
}
#loading.done { opacity: 0; visibility: hidden; }
#loading .spin { width: 64px; height: 64px; border-radius: 50%; border: 7px solid rgba(255, 255, 255, 0.12); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
#loading p { font-family: var(--display); font-size: 22px; letter-spacing: 0.03em; color: var(--ink-2); text-align: center; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Screens (title, pause, results...) ---------- */
.screen {
  position: fixed; inset: 0; z-index: 40; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 70px 18px 28px; text-align: center;
}
.screen.on { display: flex; }
.screen.dim { background: radial-gradient(circle at 50% 45%, rgba(8, 10, 22, 0.45), rgba(8, 10, 22, 0.82)); backdrop-filter: blur(3px); }
.screen.title-screen { background: linear-gradient(180deg, rgba(8, 10, 22, 0.55) 0%, rgba(8, 10, 22, 0) 38%, rgba(8, 10, 22, 0) 55%, rgba(8, 10, 22, 0.75) 100%); justify-content: space-between; }

.game-logo {
  font-family: var(--display); font-weight: 400; line-height: 0.9; letter-spacing: 0.02em;
  font-size: clamp(52px, 11vw, 118px);
  color: #fff;
  text-shadow: 0 5px 0 var(--accent-deep), 0 9px 0 rgba(0, 0, 0, 0.35), 0 0 40px rgba(0, 0, 0, 0.35);
  transform: rotate(-3deg);
  animation: logo-in 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.game-logo span { display: block; color: var(--accent); }
.tagline { margin-top: 10px; font-size: clamp(16px, 2.3vw, 21px); font-weight: 900; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
@keyframes logo-in { from { transform: rotate(-3deg) scale(0.4); opacity: 0; } }

.title-bottom { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.big-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-width: min(360px, 86vw); height: 76px; padding: 0 40px; border-radius: 24px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #1b1200; font-family: var(--display); font-size: 38px; letter-spacing: 0.04em;
  box-shadow: 0 8px 0 var(--accent-deep), 0 18px 40px rgba(0, 0, 0, 0.45);
  animation: breathe 2.4s ease-in-out infinite;
  transition: transform 0.12s;
}
.big-btn:hover { animation: none; transform: translateY(-3px) scale(1.03); }
.big-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 var(--accent-deep); }
@keyframes breathe { 50% { transform: scale(1.05); } }
.row-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 16px;
  background: var(--glass); border: 2px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px);
  font-weight: 900; font-size: 16px; transition: transform 0.12s, background 0.15s, border-color 0.15s;
}
.chip-btn:hover { transform: translateY(-2px); background: rgba(20, 26, 52, 0.8); border-color: var(--accent); }
.chip-btn.on { border-color: var(--accent); background: rgba(20, 26, 52, 0.85); }
.best-line { font-size: 15px; font-weight: 900; color: var(--ink-2); text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7); }
.best-line b { color: var(--accent); }
.keys-hint { font-size: 13px; color: rgba(255, 255, 255, 0.65); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.keys-hint kbd { display: inline-block; min-width: 26px; padding: 2px 7px; margin: 0 2px; border-radius: 7px; background: rgba(255, 255, 255, 0.14); border-bottom: 2px solid rgba(255, 255, 255, 0.25); font: 800 12px var(--font); }
body.touch .keys-hint { display: none; }

/* Corner buttons */
.corner { position: fixed; top: 14px; z-index: 60; display: flex; gap: 8px; }
.corner.left { left: 14px; }
.corner.right { right: 14px; }
.round-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; min-width: 46px; padding: 0 14px;
  border-radius: 999px; background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.16); backdrop-filter: blur(8px);
  font-weight: 900; font-size: 15px; transition: transform 0.12s, background 0.15s;
}
.round-btn:hover { background: rgba(20, 26, 52, 0.85); transform: translateY(-1px); }
.round-btn.exit { background: rgba(232, 48, 58, 0.85); border-color: rgba(255, 255, 255, 0.3); }
.round-btn.exit:hover { background: #e8303a; }
body[data-screen="play"] .corner .only-menu { display: none; }
body:not([data-screen="play"]) .corner .only-play { display: none; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; display: none; }
body[data-screen="play"] #hud { display: block; }
.hud-top { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: stretch; }
.hud-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 96px; padding: 6px 16px 7px;
  border-radius: 16px; background: var(--glass); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.12);
}
.hud-pill small { font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }
.hud-pill b { font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.hud-pill.big b { font-size: 36px; color: var(--accent); }
.hud-pill.bump { animation: bump 0.3s ease-out; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* Combo / meter bar under the pills */
.meter { position: absolute; top: 88px; left: 50%; width: min(300px, 60vw); transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity 0.2s; }
.meter.on { opacity: 1; }
.meter .m-label { font-family: var(--display); font-size: 26px; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); color: #fff; }
.meter .m-label em { font-style: normal; color: var(--accent); }
.meter .m-bar { height: 8px; margin-top: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.meter .m-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

/* ---------- Toasts + countdown ---------- */
#toasts { position: fixed; top: 34%; left: 50%; transform: translateX(-50%); z-index: 30; pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.toast { text-align: center; animation: toast 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.toast b {
  display: block; font-family: var(--display); font-weight: 400; font-size: clamp(34px, 6vw, 60px); line-height: 1; letter-spacing: 0.02em;
  color: #fff; text-shadow: 0 4px 0 var(--accent-deep), 0 8px 18px rgba(0, 0, 0, 0.45);
}
.toast small { display: block; margin-top: 2px; font-family: var(--display); font-size: clamp(22px, 3.4vw, 32px); color: var(--accent); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }
.toast.gold b { color: var(--accent); text-shadow: 0 4px 0 #8a5a00, 0 0 30px rgba(255, 204, 31, 0.6); }
.toast.bad b { color: #ff8a8a; text-shadow: 0 4px 0 #7a1a1a; }
.toast.small b { font-size: clamp(24px, 4vw, 38px); }
@keyframes toast {
  0% { transform: scale(0.3) rotate(-6deg); opacity: 0; }
  18% { transform: scale(1.12) rotate(2deg); opacity: 1; }
  30% { transform: scale(1) rotate(0); }
  78% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}
#countdown {
  position: fixed; inset: 0; z-index: 35; display: none; place-items: center; pointer-events: none;
  font-family: var(--display); font-size: clamp(110px, 24vw, 240px); color: #fff;
  text-shadow: 0 8px 0 var(--accent-deep), 0 16px 40px rgba(0, 0, 0, 0.5);
}
#countdown.on { display: grid; }
#countdown.pop { animation: cd 0.6s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes cd { 0% { transform: scale(2.4); opacity: 0; } 40% { transform: scale(0.9); opacity: 1; } 100% { transform: scale(1); } }

/* Speed lines overlay (set --speed 0..1 on #speedlines) */
#speedlines {
  position: fixed; inset: 0; z-index: 10; pointer-events: none; opacity: calc(var(--speed, 0) * 0.55);
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(255, 255, 255, 0.0) 0deg 5deg, rgba(255, 255, 255, 0.22) 5deg 5.6deg);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 32%, #000 78%);
  mask: radial-gradient(circle at 50% 50%, transparent 32%, #000 78%);
  animation: lines 0.25s steps(2) infinite;
}
@keyframes lines { 50% { transform: rotate(3deg) scale(1.02); } }

/* ---------- Touch controls ---------- */
#touch { position: fixed; inset: auto 0 0 0; z-index: 25; display: none; justify-content: space-between; align-items: flex-end; padding: 0 18px calc(18px + env(safe-area-inset-bottom)); pointer-events: none; }
body.touch[data-screen="play"] #touch { display: flex; }
#touch .pad { display: flex; gap: 12px; pointer-events: auto; }
.tbtn {
  width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 14, 30, 0.45); border: 3px solid rgba(255, 255, 255, 0.35); backdrop-filter: blur(4px);
  font-family: var(--display); font-size: 30px; color: #fff; touch-action: none;
  transition: transform 0.06s, background 0.1s;
}
.tbtn.on { transform: scale(0.92); background: rgba(255, 255, 255, 0.3); border-color: var(--accent); }
.tbtn.action { width: 100px; height: 100px; background: color-mix(in srgb, var(--accent) 55%, transparent); border-color: var(--accent); color: #1b1200; }
.tbtn small { display: block; font: 900 11px var(--font); letter-spacing: 0.06em; margin-top: -8px; }

/* ---------- Results ---------- */
.card {
  width: min(460px, 94vw); padding: 24px 24px 22px; border-radius: 26px;
  background: linear-gradient(180deg, rgba(24, 30, 60, 0.96), rgba(12, 16, 34, 0.96));
  border: 2px solid rgba(255, 255, 255, 0.1); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: card-in 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes card-in { from { transform: scale(0.8) translateY(30px); opacity: 0; } }
.card h2 { font-family: var(--display); font-weight: 400; font-size: clamp(34px, 7vw, 48px); line-height: 1; letter-spacing: 0.02em; text-shadow: 0 4px 0 var(--accent-deep); }
.card .big-num { margin: 12px 0 4px; font-family: var(--display); font-size: clamp(56px, 12vw, 84px); line-height: 1; color: var(--accent); text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35); }
.card .unit { font-size: 15px; font-weight: 900; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.1em; }
.card .new-best { display: inline-block; margin-top: 8px; padding: 4px 14px; border-radius: 999px; background: linear-gradient(135deg, #d13dd1, #7a4fff); font-weight: 900; font-size: 14px; letter-spacing: 0.08em; animation: wiggle 0.9s ease-in-out infinite; }
@keyframes wiggle { 25% { transform: rotate(-4deg) scale(1.06); } 75% { transform: rotate(4deg) scale(1.06); } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 18px; }
.stat { padding: 10px 6px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.stat b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; }
.stat small { font-size: 11px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.6); }
.stars { display: flex; justify-content: center; gap: 8px; margin: 10px 0 2px; font-size: 44px; }
.stars i { font-style: normal; filter: grayscale(1) brightness(0.45); transform: scale(0.8); transition: all 0.3s; }
.stars i.on { filter: none; transform: scale(1); animation: star-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes star-in { from { transform: scale(0) rotate(-90deg); } }
.card .btns { display: flex; flex-direction: column; gap: 10px; }
.card .big-btn { min-width: 0; width: 100%; height: 64px; font-size: 30px; animation: none; }
.card .chip-btn { justify-content: center; width: 100%; }
.card .row { display: flex; gap: 10px; }
.card .row .chip-btn { flex: 1; }
.card p.lead { color: var(--ink-2); font-size: 16px; margin-top: 6px; }

/* Picker grids (riders, cars, boards...) */
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0; max-height: 46vh; overflow-y: auto; padding: 4px; }
.pick { position: relative; padding: 10px 6px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 3px solid transparent; font-weight: 900; font-size: 13px; }
.pick .sw { display: block; width: 46px; height: 46px; margin: 0 auto 6px; border-radius: 14px; font-size: 30px; line-height: 46px; }
.pick.on { border-color: var(--accent); background: rgba(255, 255, 255, 0.12); }
.pick.locked { opacity: 0.55; }
.pick.locked::after { content: "🔒"; position: absolute; top: 4px; right: 6px; font-size: 14px; }
.pick small { display: block; font-size: 11px; color: rgba(255, 255, 255, 0.6); margin-top: 2px; }

/* Party (pass the device) */
.party-names { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.party-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); border: 2px solid transparent; }
.party-row:focus-within { border-color: var(--pc); }
.party-row i { width: 14px; height: 14px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 10px var(--pc); flex: none; }
.party-row input { flex: 1; min-width: 0; padding: 9px 2px; border: 0; background: none; color: #fff; font: 800 17px var(--font); outline: none; -webkit-user-select: text; user-select: text; }
.party-row button { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); font-size: 20px; }
.party-add { width: 100%; padding: 10px; border: 2px dashed rgba(255, 255, 255, 0.2); border-radius: 14px; color: rgba(255, 255, 255, 0.7); font-weight: 800; }
.party-res { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); border-left: 5px solid var(--pc); font-size: 17px; font-weight: 900; text-align: left; }
.party-res span { flex: 1; }
.party-res b { color: var(--pc); }
.party-res .medal { font-size: 26px; flex: none; }
.party-list { display: flex; flex-direction: column; gap: 6px; margin: 12px 0 16px; }
.turn-name { font-family: var(--display); font-size: clamp(40px, 9vw, 64px); line-height: 1; color: var(--pc); text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35); animation: logo-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

@media (max-width: 600px) {
  .hud-pill { min-width: 76px; padding: 5px 10px; }
  .hud-pill b { font-size: 22px; }
  .hud-pill.big b { font-size: 28px; }
  .meter { top: 74px; }
  .big-btn { height: 68px; font-size: 32px; }
  .round-btn .lbl { display: none; }
  .tbtn { width: 74px; height: 74px; }
  .tbtn.action { width: 88px; height: 88px; }
}
/* Narrow phones (portrait): buttons shrink with the screen so both pads always
   fit side by side — but never below a comfortable 52px thumb target. */
@media (max-width: 480px) {
  #touch { padding: 0 10px calc(12px + env(safe-area-inset-bottom)); }
  #touch .pad { gap: 8px; }
  .tbtn { width: clamp(52px, 15vw, 74px); height: clamp(52px, 15vw, 74px); font-size: 24px; }
  .tbtn.action { width: clamp(64px, 19vw, 88px); height: clamp(64px, 19vw, 88px); }
  .tbtn small { font-size: 9px; margin-top: -6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  #speedlines { display: none; }
}

/* ======================= Online-with-friends UI ======================= */

.room-code {
  display: inline-block; margin: 6px 0 4px; padding: 10px 18px; border-radius: 18px;
  background: rgba(6, 8, 18, 0.6); border: 3px dashed rgba(255, 204, 31, 0.6);
  font-family: var(--display); font-size: clamp(28px, 5vw, 40px); color: #ffcc1f; letter-spacing: 0.03em;
  -webkit-user-select: all; user-select: all;
}
.lobby-players { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 14px 0; }
.lp { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); font-weight: 900; font-size: 14px; text-align: left; animation: card-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.lp i { width: 26px; height: 26px; flex: none; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); display: grid; place-items: center; font-style: normal; font-size: 13px; }
.lp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp.me { outline: 2px solid var(--accent); }
.lp.empty { opacity: 0.35; border: 2px dashed rgba(255, 255, 255, 0.25); background: none; }
.host-tag { margin-left: auto; font-size: 11px; color: var(--accent); }

/* Round banner (top centre) */
#round-bar { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
#round-bar .rb-name { font-weight: 900; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.8); text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7); }
#round-bar .rb-main { display: flex; gap: 8px; }
#round-bar .rb-pill { padding: 6px 16px 7px; border-radius: 16px; background: rgba(10, 14, 30, 0.62); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.12); font-family: var(--display); font-size: 26px; line-height: 1; white-space: nowrap; }
#round-bar .rb-pill.hot { background: rgba(232, 48, 58, 0.85); animation: bump 0.6s ease-in-out infinite; }
#round-bar .rb-pill small { font-family: var(--font); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.7); margin-right: 6px; }
#show-clock { position: absolute; top: 16px; right: 70px; padding: 4px 12px; border-radius: 12px; background: rgba(10, 14, 30, 0.55); font-weight: 900; font-size: 12px; color: rgba(255, 255, 255, 0.8); pointer-events: none; }

/* Live scoreboard (top right, under the corner buttons) */
#scoreboard { position: absolute; top: 70px; right: 14px; width: 190px; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.sb-row { display: flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 10px; background: rgba(10, 14, 30, 0.55); font-weight: 900; font-size: 13px; transition: transform 0.3s; }
.sb-row i { width: 12px; height: 12px; border-radius: 50%; background: var(--pc); flex: none; }
.sb-row span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-row b { color: var(--accent); font-variant-numeric: tabular-nums; }
.sb-row .role { font-size: 13px; }
.sb-row.me { outline: 2px solid var(--accent); }
.sb-row.out { opacity: 0.55; }

/* Event feed (bottom left) */
#feed { position: absolute; left: 14px; bottom: 120px; width: min(330px, 60vw); display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.feed-item { padding: 5px 12px; border-radius: 12px; background: rgba(10, 14, 30, 0.6); font-weight: 800; font-size: 14px; animation: feed 5s ease forwards; }
.feed-item b { color: var(--accent); }
@keyframes feed { 0% { opacity: 0; transform: translateX(-20px); } 6% { opacity: 1; transform: none; } 85% { opacity: 1; } 100% { opacity: 0; } }

/* Emote bar */
#emotes { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 6px; pointer-events: auto; }
#emotes button { height: 40px; padding: 0 12px; border-radius: 999px; background: rgba(10, 14, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.16); font-weight: 900; font-size: 13px; white-space: nowrap; }
#emotes button:hover { background: rgba(20, 26, 52, 0.9); }
#emotes button kbd { font: 900 10px var(--font); opacity: 0.6; margin-right: 4px; }
body.touch #emotes { bottom: auto; top: 118px; transform: translateX(-50%) scale(0.85); }

/* Big centre announcements (HIDE! / SEEK! / FOUND!) */
#announce { position: fixed; inset: 0; z-index: 33; display: grid; place-items: center; pointer-events: none; text-align: center; }
#announce .an { font-family: var(--display); font-size: clamp(48px, 10vw, 110px); line-height: 0.95; color: #fff; text-shadow: 0 7px 0 var(--accent-deep), 0 14px 34px rgba(0, 0, 0, 0.5); animation: an 2.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
#announce .an small { display: block; margin-top: 8px; font-family: var(--font); font-weight: 900; font-size: clamp(16px, 2.6vw, 24px); color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8); }
@keyframes an { 0% { transform: scale(0.3); opacity: 0; } 15% { transform: scale(1.08); opacity: 1; } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05); } }

/* Seeker blindfold during the hide phase */
#blindfold { position: fixed; inset: 0; z-index: 15; display: none; place-items: center; background: radial-gradient(circle at 50% 50%, rgba(20, 10, 40, 0.86), rgba(6, 4, 14, 0.97)); text-align: center; pointer-events: none; }
#blindfold.on { display: grid; }
#blindfold b { display: block; font-family: var(--display); font-size: clamp(90px, 18vw, 180px); color: #fff; text-shadow: 0 8px 0 var(--accent-deep); line-height: 1; }
#blindfold p { font-weight: 900; font-size: 20px; color: rgba(255, 255, 255, 0.85); margin-top: 10px; }

/* Awards + podium */
.awards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.award { padding: 12px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.07); animation: card-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.award .ic { font-size: 34px; display: block; }
.award b { display: block; font-family: var(--display); font-weight: 400; font-size: 18px; margin-top: 4px; }
.award small { display: block; color: rgba(255, 255, 255, 0.7); font-size: 12px; font-weight: 800; }
.award .who { color: var(--accent); font-weight: 900; font-size: 15px; margin-top: 4px; }
.podium3 { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin: 18px 0 10px; }
.podium3 > div { width: 30%; border-radius: 16px 16px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 10px 6px; font-weight: 900; }
.podium3 .medal { font-size: 40px; }
.podium3 .nm { font-family: var(--display); font-weight: 400; font-size: 20px; }
.podium3 .pts { color: var(--accent); }
.podium3 .p1 { height: 170px; background: linear-gradient(180deg, rgba(255, 204, 31, 0.55), rgba(255, 204, 31, 0.08)); animation: rise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.6s both; }
.podium3 .p2 { height: 130px; background: linear-gradient(180deg, rgba(200, 210, 225, 0.45), rgba(200, 210, 225, 0.06)); animation: rise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both; }
.podium3 .p3 { height: 100px; background: linear-gradient(180deg, rgba(205, 127, 50, 0.5), rgba(205, 127, 50, 0.06)); animation: rise 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes rise { from { transform: translateY(60px); opacity: 0; } }

@media (max-width: 700px) {
  #scoreboard { width: 140px; top: 64px; }
  .sb-row { font-size: 11px; padding: 3px 8px; }
  #feed { bottom: 190px; }
  #show-clock { display: none; }
  #emotes button { padding: 0 9px; font-size: 12px; }
  #emotes button kbd { display: none; }
}

/* Tall cards (podium, awards) scroll on short screens instead of overflowing. */
.card { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; scrollbar-width: thin; }
.screen.dim { padding-top: 20px; padding-bottom: 20px; }

/* Online games on narrow portrait phones: the round bar sits under the corner
   buttons, and the scoreboard under it. */
@media (max-width: 520px) and (orientation: portrait) {
  #round-bar { top: 66px; }
  #round-bar .rb-pill { font-size: 22px; padding: 5px 12px 6px; }
  #scoreboard { top: 150px; width: 130px; }
}
