/* Jetbrawl */
@font-face { font-family: "Unbounded"; font-weight: 700; font-display: swap; src: url("/assets/fonts/unbounded-700.woff2") format("woff2"); }
@font-face { font-family: "Unbounded"; font-weight: 800; font-display: swap; src: url("/assets/fonts/unbounded-800.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 500; font-display: swap; src: url("/assets/fonts/sora-500.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-weight: 700; font-display: swap; src: url("/assets/fonts/sora-700.woff2") format("woff2"); }
:root { --accent: #31e981; --accent-ink: #0b1a12; --fg: #f3f1ea; --fg-2: rgba(243, 241, 234, 0.72); --glass: rgba(10, 14, 22, 0.62); --line: rgba(255, 255, 255, 0.14); --font-display: "Unbounded", system-ui, sans-serif; --font-body: "Sora", system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: #0a0e15; color: var(--fg); font-family: var(--font-body); font-weight: 500; overflow: hidden; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; }
#game { position: fixed; inset: 0; display: block; }

/* lobby */
.lobby { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 16px; background: radial-gradient(900px 600px at 70% 20%, rgba(49,233,129,.18), transparent 60%), radial-gradient(700px 500px at 20% 90%, rgba(255,92,225,.14), transparent 60%), rgba(6, 9, 15, 0.86); backdrop-filter: blur(10px); overflow: auto; }
.lobby[hidden] { display: none; }
.lobby-card { width: 100%; max-width: 640px; background: linear-gradient(180deg, rgba(22, 26, 40, 0.96), rgba(12, 14, 26, 0.98)); border: 1px solid var(--line); border-radius: 28px; padding: 26px 26px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.lobby-brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; margin-bottom: 14px; }
.lobby-brand svg { width: 28px; height: 28px; }
.lobby-brand b { color: var(--accent); font-weight: 800; }
.kicker { margin: 0 0 6px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.lobby h1 { margin: 0 0 10px; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -0.03em; line-height: 1; }
.lede { margin: 0 0 12px; color: var(--fg-2); line-height: 1.55; font-size: 0.95rem; }
.who { margin: 0 0 14px; font-size: 0.9rem; color: var(--fg-2); }
.who b { color: var(--fg); }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 16px; }
.map { position: relative; z-index: 0; background: #151a28; color: var(--fg); border-radius: 14px; padding: 12px 12px 10px; border: 1px solid var(--line); cursor: pointer; text-align: left; overflow: hidden; min-height: 76px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; transition: transform 0.15s, border-color 0.15s; }
.map b, .map span:not(.sw) { position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.lobby-brand, .foot a { color: inherit; text-decoration: none; }
.map:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.4); }
.map.is-on { outline: 2px solid var(--accent); outline-offset: 1px; }
.map b { font-family: var(--font-display); font-size: 0.85rem; }
.map span { font-size: 0.72rem; color: var(--fg-2); }
.map .sw { position: absolute; left: 0; right: 0; top: 0; height: 100%; opacity: .9; z-index: -1; }
.lobby-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; font-size: 0.93rem; cursor: pointer; text-decoration: none; color: inherit; transition: transform 0.15s, box-shadow 0.15s; }
.btn-lg { padding: 14px 26px; font-size: 1.05rem; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(49, 233, 129, 0.35); }
.btn-ghost { background: rgba(255,255,255,.04); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--fg); }
.join { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 0.88rem; color: var(--fg-2); }
.join input { width: 110px; font: inherit; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--fg); background: rgba(255,255,255,.07); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px; outline: 0; }
.join input:focus { border-color: var(--accent); }
.status { min-height: 1.2em; margin: 0 0 10px; font-size: 0.88rem; color: #ffd166; font-weight: 700; }
.help { border-top: 1px solid var(--line); padding-top: 10px; font-size: 0.86rem; color: var(--fg-2); }
.help summary { cursor: pointer; font-weight: 700; color: var(--fg); }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px 16px; margin-top: 10px; }
kbd { font-family: inherit; font-weight: 700; font-size: 0.8em; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: rgba(255,255,255,.07); margin-right: 2px; }
.foot { margin: 14px 0 0; font-size: 0.82rem; color: var(--fg-2); }
.foot a { color: var(--accent); font-weight: 700; }

/* HUD */
.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.hud[hidden] { display: none; }
.hud-tl { position: absolute; left: 14px; top: 12px; display: flex; flex-direction: column; gap: 6px; }
.bar { display: flex; align-items: center; gap: 8px; }
.bar-label { font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; width: 26px; color: var(--fg-2); text-shadow: 0 1px 2px #000; }
.bar-track { width: 150px; height: 10px; border-radius: 999px; background: rgba(0,0,0,.5); border: 1px solid rgba(255,255,255,.18); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; transition: width 0.12s; }
.bar-fill.hp { background: linear-gradient(90deg, #31e981, #a3ff8a); width: 100%; }
.bar-fill.fuel { background: linear-gradient(90deg, #ffa23a, #ffd166); width: 100%; }
.bar b { font-family: var(--font-display); font-size: 0.8rem; text-shadow: 0 1px 2px #000; }
.weapon { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; background: var(--glass); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; width: max-content; }
.weapon b { font-family: var(--font-display); font-size: 0.85rem; }
.weapon span { font-size: 0.8rem; color: #ffd166; font-weight: 700; }
.hud-tc { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px; }
.score { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.score b { font-family: var(--font-display); font-size: 1rem; }
.score small { font-size: 0.6rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); }
.timer { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; min-width: 64px; text-align: center; }
.hud-tr { position: absolute; right: 14px; top: 12px; display: flex; gap: 8px; pointer-events: auto; }
.icon-btn { width: 38px; height: 38px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 18px; height: 18px; fill: currentColor; }
#btn-sound .ic-off { display: none; }
#btn-sound[aria-pressed="false"] .ic-on { display: none; }
#btn-sound[aria-pressed="false"] .ic-off { display: block; }
.feed { position: absolute; right: 14px; top: 60px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.feed li { background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; animation: feedin 0.25s ease-out; }
.feed li b { color: var(--accent); }
.feed li i { font-style: normal; color: #ff7a8a; }
@keyframes feedin { from { opacity: 0; transform: translateX(10px); } }
.respawn { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; }
.respawn[hidden] { display: none; }
.respawn b { display: block; font-family: var(--font-display); font-size: 1.1rem; letter-spacing: 0.08em; text-transform: uppercase; color: #ff7a8a; }
.respawn span { font-family: var(--font-display); font-weight: 800; font-size: 3rem; }
.room-tag { position: absolute; left: 14px; bottom: 12px; font-size: 0.72rem; color: var(--fg-2); background: var(--glass); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; pointer-events: auto; }
.room-tag b { color: var(--fg); letter-spacing: 0.15em; }
.stick { position: absolute; bottom: 28px; width: 130px; height: 130px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); pointer-events: none; }
.stick[hidden] { display: none; }
.stick-l { left: 24px; }
.stick-r { right: 24px; border-color: rgba(49,233,129,.5); }
.knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: rgba(255,255,255,.35); }

/* overlays */
.overlay { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(3, 5, 12, 0.6); backdrop-filter: blur(8px); }
.overlay[hidden] { display: none; }
.card { width: 100%; max-width: 480px; background: linear-gradient(180deg, rgba(22, 26, 40, 0.96), rgba(12, 14, 26, 0.98)); border: 1px solid var(--line); border-radius: 26px; padding: 24px 22px 20px; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.card h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -0.02em; }
.board-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.board-table th { text-align: left; font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-2); padding: 6px 8px; }
.board-table td { padding: 8px; border-top: 1px solid var(--line); }
.board-table tr.me td { background: rgba(49,233,129,.1); }
.board-table td:nth-child(3), .board-table td:nth-child(4), .board-table th:nth-child(3), .board-table th:nth-child(4) { text-align: right; }
.board-table .bot { color: var(--fg-2); font-size: 0.72rem; margin-left: 4px; }
.muted { color: var(--fg-2); margin: 10px 0 0; font-size: 0.88rem; }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%) translateY(10px); z-index: 40; background: rgba(8, 10, 20, 0.88); border: 1px solid var(--line); color: var(--fg); padding: 10px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 700; opacity: 0; transition: opacity 0.2s, transform 0.2s; pointer-events: none; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }
@media (max-width: 600px) {
  .lobby-card { padding: 20px 18px 16px; border-radius: 22px; }
  .bar-track { width: 110px; }
  .hud-tc { gap: 10px; padding: 5px 12px; }
  .timer { font-size: 1rem; min-width: 52px; }
  .feed { top: 56px; }
  .feed li { font-size: 0.72rem; }
}
