@font-face { font-family: Fredoka; font-weight: 400; font-display: swap; src: url(/vendor/fredoka/fredoka-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 500; font-display: swap; src: url(/vendor/fredoka/fredoka-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 600; font-display: swap; src: url(/vendor/fredoka/fredoka-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: Fredoka; font-weight: 700; font-display: swap; src: url(/vendor/fredoka/fredoka-latin-700-normal.woff2) format('woff2'); }

:root {
  --bg: #12162b;
  --panel: rgba(27, 33, 64, 0.9);
  --panel-2: rgba(255, 255, 255, 0.06);
  --ink: #f5f7ff;
  --muted: #a6afd2;
  --line: rgba(255, 255, 255, 0.12);
  --accent: #ffd21f;
  --accent-ink: #2a2000;
  --danger: #ff5d6c;
  --good: #74dd3a;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.45 Fredoka, ui-rounded, 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 24px; font-weight: 600; text-wrap: balance; }
h3 { font-size: 15px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin: 22px 0 10px; }
.muted { color: var(--muted); }
.center { text-align: center; }
kbd {
  display: inline-block; min-width: 1.7em; padding: 1px 7px; margin: 0 2px; text-align: center;
  font: 500 0.82em/1.5 Fredoka, system-ui, sans-serif; color: var(--ink);
  background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.2); border-bottom-width: 2px; border-radius: 7px;
}

/* ───────── smiley, drawn in CSS: set --c and font-size ───────── */
.smiley {
  --c: #ffd21f;
  position: relative; display: inline-block; flex: none; width: 1em; height: 1em; border-radius: 50%; vertical-align: middle;
  background: radial-gradient(circle at 34% 26%, color-mix(in srgb, var(--c) 62%, white), var(--c) 52%, color-mix(in srgb, var(--c) 76%, black));
}
.smiley::before {
  content: ''; position: absolute; left: 27%; top: 27%; width: 12%; height: 22%; border-radius: 50%;
  background: #1b1b1f; box-shadow: 0.34em 0 0 #1b1b1f;
}
.smiley::after {
  content: ''; position: absolute; left: 21%; top: 28%; width: 58%; height: 52%; border-radius: 50%;
  border: 0.075em solid transparent; border-bottom-color: #1b1b1f;
}

/* ───────── menu screens ───────── */
#backdrop { position: fixed; inset: 0; width: 100%; height: 100%; }
.screen { position: relative; height: 100%; overflow: auto; padding: 28px clamp(16px, 4vw, 56px) 56px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; backdrop-filter: blur(10px); }
.card > h2 { margin-bottom: 16px; }

.logo { display: flex; align-items: center; gap: 18px; }
.logo h1 { font-size: 104px; font-weight: 700; line-height: 0.9; letter-spacing: -0.02em; color: var(--accent); text-shadow: 0 6px 0 rgba(0, 0, 0, 0.28); }
.logo .smiley { filter: drop-shadow(0 6px 0 rgba(0, 0, 0, 0.28)); }
.logo.small { gap: 10px; }
.logo.small h1 { font-size: 38px; text-shadow: 0 3px 0 rgba(0, 0, 0, 0.28); }
.logo.small .smiley { filter: none; }

.hero { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.tagline { font-size: 22px; color: var(--muted); max-width: 26ch; text-wrap: balance; }
.name-card { width: min(440px, 100%); margin-top: 14px; text-align: left; }
.name-card label { display: block; margin-bottom: 8px; font-weight: 500; }
.row { display: flex; gap: 10px; }
.row input { flex: 1; min-width: 0; }
.error { color: var(--danger); min-height: 1.4em; margin-top: 8px; font-size: 15px; }

input:not([type='range']), select {
  font: inherit; color: var(--ink); background: rgba(8, 11, 28, 0.6);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; width: 100%;
}
select { padding: 8px 10px; }
input:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
input[type='range'] { width: 100%; accent-color: var(--accent); }

.btn {
  font: 600 17px/1 Fredoka, system-ui, sans-serif; color: var(--ink); cursor: pointer;
  background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 20px;
  transition: transform 0.08s, filter 0.15s, background 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.12); }
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; box-shadow: 0 4px 0 #b98f00; }
.btn.primary:hover { filter: brightness(1.07); background: var(--accent); }
.btn.primary:active { box-shadow: 0 2px 0 #b98f00; }
.btn.big { width: 100%; font-size: 21px; padding: 16px 20px; margin-top: 20px; }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1180px; margin: 0 auto 24px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; max-width: 1180px; margin: 0 auto; align-items: start; }
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: 1fr; }
  .logo h1 { font-size: 72px; }
}

.field { display: flex; flex-direction: column; gap: 5px; font-size: 14px; font-weight: 500; color: var(--muted); }
.field.wide { margin-bottom: 14px; }
.field input, .field select { font-size: 17px; font-weight: 400; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.rule-fact { background: var(--panel-2); border-radius: 12px; padding: 9px 12px; }
.rule-fact span { display: block; font-size: 13px; color: var(--muted); }
.rule-fact b { font-weight: 600; }

.room-list { display: flex; flex-direction: column; gap: 12px; }
.room-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.room-item h4 { margin: 0; font-size: 19px; font-weight: 600; overflow-wrap: anywhere; }
.room-item p { font-size: 14.5px; color: var(--muted); grid-column: 1; }
.room-item .btn { grid-column: 2; grid-row: 1 / span 2; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 2px 9px; border-radius: 99px; margin-left: 8px; vertical-align: 3px; background: rgba(116, 221, 58, 0.18); color: var(--good); }
.badge.live { background: rgba(255, 143, 46, 0.2); color: #ffb066; }
.badge.you { background: rgba(255, 210, 31, 0.2); color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 34px 12px; border: 1.5px dashed var(--line); border-radius: 14px; }
.empty .smiley { display: block; margin: 0 auto 12px; opacity: 0.85; }

.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.slot { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; min-height: 62px; }
.slot .who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slot .who .nm { font-weight: 500; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .who .tags { display: flex; gap: 5px; line-height: 1; }
.slot .who .tags:empty { display: none; }
.slot .who .badge { margin: 0; vertical-align: baseline; }
#room-sub { margin: -8px 0 16px; }
.slot.empty-seat { border-style: dashed; background: transparent; color: var(--muted); font-size: 15px; }
.slot .seat-dot { width: 40px; height: 40px; border-radius: 50%; border: 2px dashed var(--line); flex: none; display: grid; place-items: center; font-size: 19px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { background: none; border: 2.5px solid transparent; border-radius: 50%; padding: 3px; cursor: pointer; line-height: 0; }
.swatch:hover:not(:disabled) { border-color: rgba(255, 255, 255, 0.4); }
.swatch.mine { border-color: var(--accent); }
.swatch:disabled { opacity: 0.25; cursor: not-allowed; }
.share { margin-top: 18px; font-size: 15px; color: var(--muted); text-align: center; overflow-wrap: anywhere; }
.share b { color: var(--ink); font-weight: 500; user-select: all; }
#room-wait { margin-top: 20px; }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 50; opacity: 0; pointer-events: none;
  background: #2b3260; border: 1px solid var(--line); border-radius: 12px; padding: 12px 20px; transition: opacity 0.2s, transform 0.2s;
}
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ───────── in-game ───────── */
#scr-game { position: fixed; inset: 0; z-index: 5; background: #bfe3ff; user-select: none; -webkit-user-select: none; }
#view { display: block; width: 100%; height: 100%; }
#hud { position: absolute; inset: 0; pointer-events: none; font-variant-numeric: tabular-nums; }
.pill { background: rgba(14, 18, 40, 0.74); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; backdrop-filter: blur(6px); }

#minimap { position: absolute; left: 16px; top: 16px; width: 212px; height: 212px; }
#clock { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); text-align: center; padding: 9px 22px 8px; }
#clock-time { font-size: 32px; font-weight: 700; line-height: 1; }
#clock-time.low { color: var(--danger); animation: pulse 1s infinite; }
#clock-goal { font-size: 13px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
@keyframes pulse { 50% { opacity: 0.55; } }

#killfeed { position: absolute; top: 92px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.kf { background: rgba(14, 18, 40, 0.6); border-radius: 99px; padding: 3px 14px; font-size: 14.5px; white-space: nowrap; animation: fadeout 5s forwards; }
@keyframes fadeout { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

#board { position: absolute; right: 16px; top: 16px; width: 262px; padding: 8px; }
.board-row { display: grid; grid-template-columns: 16px 16px minmax(0, 1fr) auto 38px; gap: 7px; align-items: center; padding: 3px 8px; border-radius: 9px; font-size: 15.5px; }
.board-row .rank { color: var(--muted); font-size: 13px; text-align: right; }
.board-row .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-row .pts { text-align: right; font-weight: 600; }
.board-row.me { background: rgba(255, 210, 31, 0.17); }
.board-row.out .nm, .board-row.out .dot { opacity: 0.45; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2); }
.lives { font-size: 11px; letter-spacing: 1px; color: #ff5d7a; white-space: nowrap; }
.lives i { font-style: normal; color: rgba(255, 255, 255, 0.2); }

#crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(0, 0, 0, 0.35); transition: transform 0.12s, border-color 0.12s; }
#crosshair::after { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
#crosshair.hit { transform: scale(1.7); border-color: var(--accent); }
#hitpop { position: absolute; left: 50%; top: calc(50% - 64px); transform: translateX(-50%); font-size: 30px; font-weight: 700; color: var(--accent); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5); opacity: 0; white-space: nowrap; }
#hitpop.on { animation: pop 0.8s ease-out; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 14px) scale(0.6); } 18% { opacity: 1; transform: translate(-50%, 0) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -34px) scale(1); } }

#feed { position: absolute; left: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.feed-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.75); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6); margin-left: 4px; }
.fe { background: rgba(14, 18, 40, 0.7); border-left: 4px solid var(--good); border-radius: 10px; padding: 5px 12px; font-size: 15.5px; white-space: nowrap; }
.fe.ko { border-left-color: var(--accent); font-weight: 500; }
.fe.bad { border-left-color: var(--danger); }
.fe:nth-last-child(n + 4) { opacity: 0.6; }
.fe b { font-weight: 600; }
.fe .gain { color: var(--accent); font-weight: 600; margin-left: 6px; }

#status { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 22px; padding: 10px 24px; }
#status.shielded { box-shadow: 0 0 0 2px #fff, 0 0 22px rgba(255, 255, 255, 0.55); }
#status.shielded::after { content: 'Spawn shield — shooting drops it'; position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 600; color: #12162b; background: #fff; border-radius: 99px; padding: 1px 12px; }
#hearts { font-size: 30px; line-height: 1; color: #ff4b6a; letter-spacing: 3px; white-space: nowrap; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
#hearts i { font-style: normal; color: rgba(255, 255, 255, 0.18); text-shadow: none; }
.stat { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stat b { font-size: 28px; font-weight: 700; }
.stat.money b { color: var(--accent); }
#owned { display: flex; gap: 6px; flex-wrap: wrap; max-width: 250px; font-size: 18px; }
#owned:empty { display: none; }
#owned span { white-space: nowrap; }
#owned sub { font-size: 11px; color: var(--muted); vertical-align: baseline; margin-left: 1px; }
#hints { position: absolute; right: 16px; bottom: 16px; padding: 7px 12px; font-size: 14px; color: var(--muted); }

#vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(255, 30, 60, 0.6) 100%); opacity: 0; }
#vignette.on { animation: hurt 0.5s ease-out; }
@keyframes hurt { 0% { opacity: 1; } 100% { opacity: 0; } }

#dead { position: absolute; left: 50%; top: 27%; transform: translateX(-50%); text-align: center; background: rgba(14, 18, 40, 0.82); border: 1px solid var(--line); border-radius: 20px; padding: 18px 34px; }
.dead-title { font-size: 34px; font-weight: 700; color: var(--danger); line-height: 1.1; }
#dead-count { font-size: 46px; font-weight: 700; line-height: 1.15; }

.overlay { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(10, 13, 30, 0.6); backdrop-filter: blur(3px); overflow: auto; }
.overlay.passive { pointer-events: none; background: rgba(10, 13, 30, 0.35); backdrop-filter: none; }
.panel { background: rgba(24, 30, 60, 0.97); border: 1px solid var(--line); border-radius: 22px; padding: 26px; width: min(560px, 100%); box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45); }
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; gap: 16px; margin-bottom: 6px; flex-wrap: wrap; }
.panel-head h2 { margin-right: auto; }
.wallet b { color: var(--accent); font-size: 24px; font-weight: 700; margin-left: 4px; }

.shop-panel { width: min(1000px, 100%); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; margin-top: 16px; }
.shop-card { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; background: var(--panel-2); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 12px 10px; transition: background 0.12s, transform 0.08s; }
.shop-card:hover { background: rgba(255, 255, 255, 0.11); }
.shop-card:active { transform: translateY(2px); }
.shop-card .ic { grid-row: 1 / span 2; font-size: 30px; line-height: 1.2; text-align: center; }
.shop-card .nm { font-weight: 600; font-size: 17px; line-height: 1.2; }
.shop-card .pips { font-size: 13px; letter-spacing: 3px; color: var(--accent); line-height: 1.2; }
.shop-card .pips i { font-style: normal; color: rgba(255, 255, 255, 0.22); }
.shop-card .ds { grid-column: 1 / -1; font-size: 14px; color: var(--muted); min-height: 2.8em; line-height: 1.35; margin-top: 4px; }
.shop-card .price { grid-column: 1 / -1; justify-self: start; font-weight: 700; font-size: 16px; color: var(--accent-ink); background: var(--accent); border-radius: 99px; padding: 1px 12px; }
.shop-card .key { position: absolute; right: 9px; top: 8px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; }
.shop-card.poor .price { background: rgba(255, 255, 255, 0.14); color: var(--muted); }
.shop-card.poor { cursor: not-allowed; }
.shop-card.poor .ic, .shop-card.poor .nm { opacity: 0.6; }
.shop-card.maxed { border-color: rgba(116, 221, 58, 0.5); cursor: default; }
.shop-card.maxed .price { background: rgba(116, 221, 58, 0.2); color: var(--good); }
.shop-card.bought { animation: bought 0.45s; }
@keyframes bought { 0% { background: rgba(255, 210, 31, 0.5); transform: scale(1.03); } 100% { transform: scale(1); } }

table.scores { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.scores th { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 4px 10px; text-align: right; }
table.scores th:nth-child(2) { text-align: left; }
table.scores td { padding: 7px 10px; text-align: right; border-top: 1px solid var(--line); }
table.scores td:first-child { color: var(--muted); width: 2em; }
table.scores td:nth-child(2) { text-align: left; }
.name-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.name-cell span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.scores td.big { font-weight: 700; font-size: 19px; }
table.scores tr.me td { background: rgba(255, 210, 31, 0.13); }

.pause-panel { width: min(480px, 100%); text-align: center; }
.pause-panel .btn.big { margin-top: 4px; }
.controls { list-style: none; padding: 0; margin: 20px 0; text-align: left; display: grid; gap: 7px; color: var(--muted); font-size: 16px; }
.pause-panel .field { text-align: left; margin-top: 14px; }
.results-panel { width: min(640px, 100%); text-align: center; }
#results-face { line-height: 0; margin-bottom: 10px; }
#results-title { font-size: 38px; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
#results-table { margin-top: 18px; }

@media (prefers-reduced-motion: reduce) {
  .btn, .shop-card, #crosshair, #toast { transition: none; }
  #clock-time.low, .shop-card.bought { animation: none; }
}
