/* =========================================================================
   Fucking Beans — client styles. One dark candy look for menu, lobby and the
   in-game HUD. The game itself is one canvas; everything here floats over it.
   ========================================================================= */
:root {
  --bg: #1b1030;
  --bg2: #2d1656;
  --card: rgba(38, 20, 68, 0.94);
  --card-edge: rgba(255, 255, 255, 0.09);
  --ink: #fff5fb;
  --muted: #b8a5d8;
  --pink: #ff4d6d;
  --pink-d: #b8223f;
  --yellow: #ffd23f;
  --yellow-d: #b88e0c;
  --blue: #3fa9ff;
  --blue-d: #1c63a8;
  --green: #5ce16b;
  --hud: rgba(22, 12, 40, 0.72);
  --font: 'Baloo 2', 'Nunito', 'Arial Rounded MT Bold', 'Segoe UI', system-ui, sans-serif;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden;
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-weight: 600;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
}
body { position: fixed; inset: 0; }
#app { position: fixed; inset: 0; height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
[hidden] { display: none !important; }

/* ---- screens ---------------------------------------------------------- */
.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: block; }
#menu, #lobby {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(255, 77, 109, 0.25), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(63, 169, 255, 0.22), transparent 60%),
    linear-gradient(180deg, var(--bg2), var(--bg));
}
#menu::before, #lobby::before {
  /* Faint confetti of beans in the background. */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0.08;
  background-image: radial-gradient(ellipse 7px 10px at 20px 20px, #fff 98%, transparent),
    radial-gradient(ellipse 7px 10px at 70px 60px, #fff 98%, transparent);
  background-size: 110px 90px;
  transform: rotate(-12deg) scale(1.4);
}
.menu-scroll {
  position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(18px + var(--sat)) calc(16px + var(--sar)) calc(24px + var(--sab)) calc(16px + var(--sal));
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

/* ---- logo --------------------------------------------------------------- */
.logo { text-align: center; margin-top: 4px; }
.logo-beans { width: min(220px, 56vw); height: auto; display: block; margin: 0 auto -6px; overflow: visible; }
.lb { transform-box: fill-box; transform-origin: 50% 100%; animation: hop 2.6s ease-in-out infinite; }
.lb-b { animation-delay: -0.85s; }
.lb-c { animation-delay: -1.7s; }
@keyframes hop { 0%, 70%, 100% { transform: translateY(0) scale(1, 1); } 78% { transform: translateY(0) scale(1.08, 0.92); } 86% { transform: translateY(-12px) scale(0.95, 1.06); } 94% { transform: translateY(0) scale(1.04, 0.96); } }
.logo h1 { margin: 0; line-height: 0.82; letter-spacing: -0.02em; }
.logo h1 span { display: block; paint-order: stroke fill; -webkit-text-stroke: 8px #2a0f1e; text-shadow: 0 6px 0 #2a0f1e; }
.logo .l1 { font-size: clamp(30px, 9vw, 46px); color: var(--yellow); transform: rotate(-4deg); font-weight: 900; }
.logo .l2 { font-size: clamp(60px, 19vw, 96px); color: var(--pink); font-weight: 900; }
.logo .tag { margin: 12px 0 0; color: var(--muted); font-size: 15px; }

/* ---- cards / form ----------------------------------------------------- */
.card {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--card-edge); border-radius: 22px;
  padding: 16px; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin: 16px 0 8px; font-weight: 800; }
.card .group:first-of-type h2 { margin-top: 14px; }
.field { display: block; }
.field span { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); margin-bottom: 6px; font-weight: 800; }
input {
  width: 100%; height: 48px; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28); color: var(--ink); padding: 0 14px; font-size: 18px; font-weight: 800; outline: none;
}
input:focus { border-color: var(--yellow); }
input::placeholder { color: rgba(255, 255, 255, 0.28); }

.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.lbl { min-width: 56px; color: var(--muted); font-size: 14px; font-weight: 800; }
.opts .row { flex-direction: column; align-items: flex-start; gap: 6px; margin: 12px 0; }
.opts .lbl { min-width: 0; }
.opts .mapsel { width: 100%; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; font-weight: 800; font-size: 15px;
  background: rgba(255, 255, 255, 0.07); border: 2px solid transparent; color: var(--ink);
  transition: transform 0.08s, background 0.15s;
}
.chips button:active { transform: scale(0.94); }
.chips button.on { background: rgba(255, 210, 63, 0.16); border-color: var(--yellow); color: var(--yellow); }
.chips.ro button { pointer-events: none; }
.chips.ro button:not(.on) { display: none; }

.btn {
  height: 46px; padding: 0 18px; border-radius: 14px; font-weight: 900; font-size: 16px;
  background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
  transition: transform 0.08s, filter 0.15s;
}
.btn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.25); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.big { width: 100%; height: 56px; font-size: 20px; border-radius: 16px; margin-top: 10px; letter-spacing: 0.01em; }
.btn.small { height: 40px; font-size: 14px; padding: 0 12px; }
.btn.primary { background: linear-gradient(180deg, #ff6f8a, var(--pink)); box-shadow: inset 0 -4px 0 var(--pink-d), 0 6px 18px rgba(255, 77, 109, 0.35); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); }
.btn.secondary { background: linear-gradient(180deg, #67bcff, var(--blue)); box-shadow: inset 0 -4px 0 var(--blue-d), 0 6px 18px rgba(63, 169, 255, 0.3); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.2); }
.btn.ghost { background: rgba(255, 255, 255, 0.07); }
.btn:hover { filter: brightness(1.08); }

.join { display: flex; gap: 8px; margin-top: 10px; }
.join input { text-transform: uppercase; letter-spacing: 0.3em; text-align: center; font-size: 20px; }
.join .btn { flex: 0 0 96px; height: 48px; }
.msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 77, 109, 0.15); color: #ffc2cf; font-size: 14px; }
.invite { margin-top: 14px; padding: 12px; border-radius: 16px; background: rgba(255, 210, 63, 0.12); border: 2px solid rgba(255, 210, 63, 0.5); }
.invite p { margin: 0; color: #ffe9a3; font-size: 15px; }
.invite b { color: var(--yellow); letter-spacing: 0.1em; }
.custom-map { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 12px; border-radius: 12px; background: rgba(92, 225, 107, 0.12); color: #c8f7cd; font-size: 14px; }
.custom-map .x { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); }

.howto summary { cursor: pointer; font-weight: 900; list-style: none; display: flex; justify-content: space-between; }
.howto summary::after { content: '＋'; color: var(--muted); }
.howto[open] summary::after { content: '－'; }
.howto ul { margin: 10px 0 0; padding-left: 18px; color: #ddd0f2; font-size: 14px; line-height: 1.45; }
.howto li { margin: 6px 0; }
.foot { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; padding-bottom: 6px; }
.link { color: var(--yellow); text-decoration: none; font-weight: 800; display: inline-block; padding: 12px 8px; margin: -12px -8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---- lobby -------------------------------------------------------------- */
.lobby-card { margin-top: 6px; }
.lobby-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.room-code { font-size: 46px; font-weight: 900; letter-spacing: 0.12em; color: var(--yellow); line-height: 1; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.players li { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.05); min-height: 52px; }
.players .dotc { width: 22px; height: 28px; border-radius: 50% 55% 50% 45% / 60% 60% 40% 40%; flex: 0 0 auto; box-shadow: inset -3px -4px 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 rgba(255, 255, 255, 0.35); }
.players .pname { flex: 1; font-weight: 900; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players .off { opacity: 0.5; }
.ptag { font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.1); color: var(--muted); }
.ptag.host { background: rgba(255, 210, 63, 0.18); color: var(--yellow); }
.ptag.you { background: rgba(92, 225, 107, 0.16); color: var(--green); }
.ptag.bot { background: rgba(63, 169, 255, 0.16); color: #9dd2ff; }
.players .kick { width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 77, 109, 0.14); color: #ff9fb2; font-size: 16px; }
.addbot { margin-top: 10px; }
.mapsel { display: flex; flex-direction: column; gap: 8px; flex: 1; min-width: 180px; }
.map-custom { display: flex; gap: 8px; }
.map-custom input { height: 40px; font-size: 14px; }
.lobby-actions { display: flex; gap: 10px; margin-top: 16px; align-items: flex-end; }
.lobby-actions .btn.ghost { flex: 0 0 auto; height: 56px; }
.lobby-actions .btn.big { margin-top: 0; }
#lobby-wait { margin-top: 10px; }
/* Short phones: the lobby scrolls, so Leave/Start ride along the bottom edge instead of
   hiding below the fold. Solid card colour behind them so the list scrolls underneath.
   The scroller's bottom padding (24px + safe area) counts for sticky, hence the negative
   offset; the extra bottom padding keeps the buttons clear of the screen edge. */
#lobby .lobby-actions {
  position: sticky; bottom: calc(-24px - var(--sab)); z-index: 2;
  margin: 16px -16px -16px; padding: 12px 16px calc(36px + var(--sab));
  background: rgb(38, 20, 68); border-radius: 0 0 22px 22px;
  box-shadow: 0 -10px 16px -8px rgba(0, 0, 0, 0.45);
}

/* ---- game + HUD ------------------------------------------------------- */
#game { background: #0d0818; touch-action: none; user-select: none; -webkit-user-select: none; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; }
#hud button, #hud .sheet { pointer-events: auto; }

.hud-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding: calc(8px + var(--sat)) calc(10px + var(--sar)) 0 calc(10px + var(--sal));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 8px;
}
.teams { display: flex; flex-direction: column; gap: 4px; max-width: 260px; }
.tbar { display: flex; align-items: center; gap: 6px; height: 16px; padding: 0 6px 0 0; }
.tbar .tn { font-size: 11px; font-weight: 900; width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 4px rgba(0, 0, 0, 0.6); }
.tbar .tb { flex: 1; min-width: 60px; height: 9px; border-radius: 6px; background: rgba(0, 0, 0, 0.45); overflow: hidden; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35); }
.tbar .tb i { display: block; height: 100%; border-radius: 6px; transition: width 0.5s ease; box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.tbar.turn .tn::before { content: '▸ '; }
.tbar.away { opacity: 0.55; }
.tbar.dead { opacity: 0.3; }

.turnbox { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.timer {
  min-width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-size: 26px; font-weight: 900; background: var(--hud); border: 3px solid var(--tc, #fff);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-variant-numeric: tabular-nums;
}
.timer.low { color: #ff6b81; animation: pulse 0.5s ease-in-out infinite alternate; }
.timer.retreat { color: var(--yellow); font-size: 22px; }
.timer.idle { opacity: 0.55; }
@keyframes pulse { to { transform: scale(1.08); } }
.turnname { font-size: 13px; font-weight: 900; padding: 2px 10px; border-radius: 10px; background: var(--hud); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hud-right { display: flex; justify-content: flex-end; align-items: flex-start; gap: 6px; }
.wind { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 8px 4px; border-radius: 12px; background: var(--hud); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.wind-bar { position: relative; width: 92px; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.wind-bar::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.6); }
.wind-bar i { position: absolute; top: 0; bottom: 0; width: 0; transition: width 0.4s ease;
  background: repeating-linear-gradient(90deg, #7fd6ff 0 6px, #3fa9ff 6px 9px); animation: windflow 0.6s linear infinite; }
.wind-bar i.pos { left: 50%; }
.wind-bar i.neg { right: 50%; animation-direction: reverse; }
@keyframes windflow { from { background-position: 0 0; } to { background-position: 9px 0; } }
.wind-lbl { font-size: 10px; letter-spacing: 0.2em; color: var(--muted); font-weight: 900; }
.iconbtn { width: 44px; height: 44px; border-radius: 12px; background: var(--hud); font-size: 18px; display: grid; place-items: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.iconbtn:active { transform: scale(0.92); }

.netstat { position: absolute; top: calc(78px + var(--sat)); left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: rgba(255, 77, 109, 0.9); font-weight: 900; font-size: 14px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); animation: blink 1s ease-in-out infinite alternate; }
@keyframes blink { from { opacity: 0.75; } to { opacity: 1; } }
.banner {
  position: absolute; top: 30%; left: 50%; transform: translate(-50%, -50%) scale(0.6); opacity: 0;
  padding: 10px 26px 12px; border-radius: 20px; text-align: center; white-space: nowrap;
  background: var(--hud); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 3px solid var(--bc, #fff); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  transition: transform 0.25s cubic-bezier(.2, 1.6, .4, 1), opacity 0.2s;
}
.banner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.banner .b1 { font-size: clamp(26px, 7vw, 40px); font-weight: 900; line-height: 1.05; color: var(--bc, #fff); text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.banner .b2 { font-size: 14px; color: var(--muted); font-weight: 800; margin-top: 2px; }
.sd { position: absolute; top: calc(84px + var(--sat)); left: 50%; transform: translateX(-50%); padding: 5px 12px; border-radius: 10px; background: rgba(140, 20, 40, 0.85); font-size: 12px; font-weight: 900; white-space: nowrap; letter-spacing: 0.03em; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 900; color: var(--muted); background: #140c24; }
.loading.done { display: none; }
.spectate { position: absolute; bottom: calc(18px + var(--sab)); left: 50%; transform: translateX(-50%); padding: 8px 14px; border-radius: 12px; background: var(--hud); font-weight: 900; }

.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 0 calc(10px + var(--sar)) calc(10px + var(--sab)) calc(10px + var(--sal));
  display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
}
.wpn-area { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 0; }
.wpn-row { display: flex; gap: 8px; align-items: center; }
.wpn {
  pointer-events: auto; display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 14px 0 10px;
  border-radius: 16px; background: var(--hud); border: 2px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.wpn .ico { font-size: 26px; line-height: 1; }
.wpn .nm { font-weight: 900; font-size: 15px; white-space: nowrap; }
.wpn .ammo { font-size: 12px; font-weight: 900; padding: 2px 7px; border-radius: 8px; background: rgba(255, 255, 255, 0.12); color: var(--yellow); }
.wpn.locked { opacity: 0.6; }
.action { height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 900; font-size: 18px; background: linear-gradient(180deg, #ff6f8a, var(--pink)); box-shadow: inset 0 -4px 0 var(--pink-d), 0 6px 18px rgba(255, 77, 109, 0.35); }
.action:active { transform: translateY(2px); }
.fuses { pointer-events: auto; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: var(--hud); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.fuses .fl { font-size: 11px; font-weight: 900; color: var(--muted); padding: 0 4px 0 6px; text-transform: uppercase; letter-spacing: 0.08em; }
.fuses button { width: 40px; height: 40px; border-radius: 11px; font-weight: 900; font-size: 17px; background: rgba(255, 255, 255, 0.07); }
.fuses button.on { background: var(--yellow); color: #3a2a00; }
.shots { padding: 5px 12px; border-radius: 10px; background: rgba(255, 210, 63, 0.9); color: #3a2a00; font-weight: 900; font-size: 13px; }
.hint { position: absolute; left: 12px; right: 12px; bottom: calc(100% + 6px); pointer-events: none; min-height: 0; font-size: 12px; font-weight: 800; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); text-align: center; }
.hint:empty { display: none; }

.pad { display: flex; gap: 10px; }
.pbtn {
  width: 62px; height: 62px; border-radius: 50%; font-size: 26px; font-weight: 900;
  background: rgba(22, 12, 40, 0.55); border: 2px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  display: grid; place-items: center; touch-action: none;
}
.pbtn.down { background: rgba(255, 210, 63, 0.35); border-color: var(--yellow); transform: scale(0.94); }
#hud.idle .pad { opacity: 0.35; }
#hud.idle .pad .pbtn { pointer-events: none; }
.touch-only { display: none; }
@media (pointer: coarse) { .touch-only { display: flex; } }

/* weapon sheet */
.sheet { position: absolute; inset: 0; display: grid; place-items: end center; background: rgba(8, 4, 16, 0.45); padding: 0 8px calc(8px + var(--sab)); }
.sheet-card { width: 100%; max-width: 520px; background: var(--card); border: 1px solid var(--card-edge); border-radius: 22px; padding: 12px; box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5); animation: rise 0.18s ease-out; }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); padding: 0 2px 8px 6px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wcell { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); border: 2px solid transparent; position: relative; min-height: 92px; }
.wcell .ico { font-size: 30px; line-height: 1.1; }
.wcell .nm { font-weight: 900; font-size: 13px; text-align: center; line-height: 1.1; }
.wcell .ds { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.2; }
.wcell .am { position: absolute; top: 6px; right: 8px; font-size: 12px; font-weight: 900; color: var(--yellow); }
.wcell.on { border-color: var(--yellow); background: rgba(255, 210, 63, 0.12); }
.wcell:disabled { opacity: 0.35; }
.wcell.locked .am { color: var(--muted); }

/* game over + confirm */
.over { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; background: rgba(8, 4, 16, 0.6);
  padding: calc(16px + var(--sat)) calc(16px + var(--sar)) calc(16px + var(--sab)) calc(16px + var(--sal)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 5; }
.over-card { max-width: 400px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; text-align: center; animation: rise 0.25s ease-out; }
.over-title { font-size: 34px; font-weight: 900; line-height: 1.05; margin: 4px 0 6px; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.over-title.small { font-size: 24px; }
.results { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 15px; }
.results th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 900; padding: 4px 6px; text-align: right; }
.results th:first-child, .results td:first-child { text-align: left; }
.results td { padding: 8px 6px; text-align: right; font-weight: 900; border-top: 1px solid rgba(255, 255, 255, 0.07); font-variant-numeric: tabular-nums; }
.results tr.win td:first-child::after { content: ' 👑'; }

.toast { position: fixed; left: 50%; bottom: calc(96px + var(--sab)); transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 14px; background: rgba(22, 12, 40, 0.95); border: 1px solid rgba(255, 255, 255, 0.12); font-weight: 800; font-size: 14px; z-index: 10; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); text-align: center; }

/* ---- small screens ----------------------------------------------------- */
@media (max-width: 520px) {
  .wpn .nm { display: none; }
  .wpn { padding: 0 12px 0 10px; }
  .teams { max-width: 128px; gap: 3px; }
  .tbar { flex-wrap: wrap; height: auto; gap: 1px 0; padding: 0; }
  .tbar .tn { width: 100%; font-size: 11px; line-height: 13px; }
  .tbar .tb { flex: 1 1 100%; min-width: 0; height: 6px; }
  .wind-bar { width: 64px; }
  .iconbtn { font-size: 16px; }
  .timer { min-width: 50px; height: 50px; font-size: 22px; }
  .pbtn { width: 58px; height: 58px; }
  .pad { gap: 8px; }
  .hud-right { gap: 4px; }
  /* The turn pill sits in an auto-width middle column: keep it narrow enough
     that the wind + mute + leave buttons never get pushed off the right edge. */
  .turnname { max-width: 96px; }
  .teams { min-width: 0; }
}
@media (max-width: 380px) {
  .hud-top { gap: 4px; }
  .wind { padding: 5px 6px 3px; }
  .wind-bar { width: 52px; }
  .pbtn { width: 54px; height: 54px; font-size: 24px; }
  .turnname { max-width: 84px; }
}
/* Landscape phones: short screens. Tighter top bar, pads hug the corners. */
@media (max-height: 500px) {
  .timer { min-width: 46px; height: 46px; font-size: 20px; }
  .turnname { font-size: 12px; }
  .teams { max-width: 170px; }
  .tbar { height: 13px; }
  .netstat { top: calc(60px + var(--sat)); }
  .sd { top: calc(66px + var(--sat)); }
  .banner { top: 34%; }
  .sheet-grid { grid-template-columns: repeat(5, 1fr); }
  .wcell { min-height: 74px; padding: 6px 2px; }
  .wcell .ds { display: none; }
  .wpn, .action { height: 48px; }
  .fuses button { width: 38px; height: 38px; }
  .over-card { padding: 12px 16px; }
  .over-title { font-size: 26px; margin: 0 0 2px; }
  .results { margin-top: 6px; font-size: 14px; }
  .results td { padding: 4px 6px; }
  .over-card .lobby-actions { margin-top: 10px; }
  .over-card .btn.big, .over-card .lobby-actions .btn.ghost { height: 46px; }
}
.qsum { margin: 2px 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; }
.odds { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 4px 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.odds b { width: 100%; color: var(--fg, #fff); }
.odds i { font-style: normal; color: #ffd23f; }
.players .pedit { min-width: 0; background: transparent; border: 0; border-bottom: 2px dashed var(--muted); color: inherit; font: inherit; font-weight: 900; font-size: 17px; padding: 2px 0; border-radius: 0; }
.players .pedit:focus { outline: none; border-bottom-color: #ffd23f; }
.calm { display: flex; align-items: center; gap: 8px; margin: 8px 0 4px; font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.calm input { width: 18px; height: 18px; accent-color: #ffd23f; }
