:root {
  color-scheme: dark;
  --bg: #090d0a;
  --panel: #111812;
  --panel-2: #182019;
  --line: rgba(220, 244, 193, .14);
  --text: #f2f6ed;
  --muted: #9ca896;
  --lime: #c9f44a;
  --lime-dark: #758e25;
  --orange: #ffad43;
  --red: #ff6a55;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0,0,0,.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 50% -15%, rgba(133, 166, 54, .2), transparent 36rem),
    linear-gradient(180deg, #0d130e, var(--bg) 45%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(201,244,74,.55); outline-offset: 2px; }
.noise {
  position: fixed; inset: 0; pointer-events: none; opacity: .035; z-index: 20;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}
.shell { width: min(100%, 760px); min-height: 100dvh; margin: 0 auto; display: flex; flex-direction: column; padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: inherit; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--lime); color: #10150b; font-weight: 950; transform: skew(-6deg); box-shadow: 0 0 24px rgba(201,244,74,.16); }
.brand strong, .brand small { display: block; line-height: 1; }
.brand strong { font-size: 15px; letter-spacing: .16em; }
.brand small { color: var(--muted); margin-top: 4px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.connection { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px currentColor; }
.connection.online i { background: var(--lime); }
.connection.offline i { background: var(--red); }
main { flex: 1; display: flex; flex-direction: column; padding: 14px 0 28px; }
footer { display: flex; justify-content: center; gap: 8px; padding: 12px 0 18px; color: #667061; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.screen { flex: 1; display: flex; flex-direction: column; animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(9px); } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; width: fit-content; color: var(--lime); font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 20px; height: 2px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 15px; font-size: clamp(42px, 13vw, 78px); line-height: .91; letter-spacing: -.065em; max-width: 650px; }
h1 span { display: block; color: var(--lime); }
h2 { font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.lead { color: var(--muted); max-width: 530px; font-size: 15px; line-height: 1.55; }
.hero { padding: 44px 4px 28px; }
.hero-art { height: 100px; margin: 8px 0 -9px; color: #879b58; opacity: .68; overflow: hidden; }
.hero-art svg { width: 100%; height: 150px; }
.panel { background: linear-gradient(145deg, rgba(25,34,26,.96), rgba(14,20,15,.96)); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.form-grid { display: grid; gap: 12px; }
label { display: block; color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.input { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #0b100c; color: var(--text); padding: 15px 16px; margin-top: 8px; min-height: 52px; font-size: 16px; transition: border .2s, box-shadow .2s; }
.input:focus { border-color: var(--lime-dark); box-shadow: 0 0 0 4px rgba(201,244,74,.08); outline: none; }
.input.code { text-transform: uppercase; font-weight: 900; letter-spacing: .3em; }
.actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 5px; }
.btn { border: 0; border-radius: 14px; min-height: 52px; padding: 13px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; background: var(--lime); color: #0b100c; cursor: pointer; font-weight: 900; letter-spacing: .015em; transition: transform .15s, filter .15s, opacity .15s; }
.btn:active { transform: scale(.975); }
.btn:hover { filter: brightness(1.05); }
.btn:disabled { cursor: not-allowed; opacity: .4; filter: grayscale(.3); }
.btn.secondary { color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.btn.ghost { min-height: 42px; color: var(--muted); background: transparent; border: 1px solid var(--line); font-size: 13px; }
.btn.danger { color: #ffaaa0; }
.divider { display: flex; align-items: center; gap: 12px; color: #596354; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.rules { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 16px; }
.rule { border: 1px solid var(--line); border-radius: 14px; padding: 13px 8px; text-align: center; color: var(--muted); font-size: 10px; }
.rule b { display: block; color: var(--text); font-size: 16px; margin-bottom: 3px; }
.lobby-head { padding: 35px 4px 20px; text-align: center; }
.room-code { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 15px auto 8px; }
.room-code strong { font-size: 44px; letter-spacing: .2em; margin-left: .2em; color: var(--lime); }
.icon-btn { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); cursor: pointer; font-size: 18px; }
.player-list { display: grid; gap: 9px; margin: 5px 0 18px; }
.player-row { display: flex; align-items: center; gap: 12px; padding: 13px; background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 14px; }
.avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; color: #12180d; background: #809636; font-weight: 950; text-transform: uppercase; }
.player-row:nth-child(2) .avatar { background: #d5a04c; }
.player-row:nth-child(3) .avatar { background: #6aa5a1; }
.player-row:nth-child(4) .avatar { background: #b787b7; }
.player-row strong { flex: 1; }
.player-row small { color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lime); }
.dot.away { background: #596354; }
.waiting { display: inline-flex; gap: 5px; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.waiting i { width: 5px; height: 5px; border-radius: 50%; background: var(--lime); animation: blink 1.2s infinite; }
.waiting i:nth-child(2) { animation-delay: .2s; }.waiting i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .2; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.gamebar { display: flex; justify-content: space-between; align-items: flex-start; padding: 7px 2px 13px; }
.gamebar small { display: block; color: var(--muted); font-size: 9px; letter-spacing: .12em; text-transform: uppercase; }
.gamebar strong { font-size: 16px; }
.gamebar .center { text-align: center; }
.gamebar .right { text-align: right; }
.roster { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 13px; padding: 0 16px; }
.roster::-webkit-scrollbar { display: none; }
.player-pill { flex: 1 0 auto; min-width: 92px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.player-pill.active { border-color: rgba(201,244,74,.55); background: rgba(201,244,74,.07); }
.player-pill span { display: block; max-width: 90px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.player-pill b { font-size: 16px; }.player-pill small { color: var(--muted); font-size: 9px; }
.turn-message { text-align: center; min-height: 42px; color: var(--muted); font-size: 13px; }
.turn-message strong { color: var(--lime); }
.card-wrap { perspective: 1100px; width: min(100%, 400px); margin: 0 auto; }
.tank-card { position: relative; overflow: hidden; border-radius: 26px; border: 1px solid rgba(220,244,193,.2); background: linear-gradient(155deg, #26301f 0%, #151d16 45%, #0c110d 100%); box-shadow: 0 28px 65px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.08); }
.tank-card::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.035) 50%, transparent 60%); }
.card-visual { height: 165px; position: relative; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 90%, rgba(201,244,74,.14), transparent 55%); overflow: hidden; }
.card-visual::before { content: attr(data-index); position: absolute; right: -5px; top: -22px; color: rgba(235,244,225,.035); font-weight: 950; font-size: 110px; letter-spacing: -.08em; }
.card-visual svg { width: 88%; height: 135px; filter: drop-shadow(0 18px 14px rgba(0,0,0,.42)); }
.card-body { padding: 17px; }
.card-kicker { display: flex; justify-content: space-between; color: var(--lime); font-size: 9px; letter-spacing: .13em; text-transform: uppercase; font-weight: 850; }
.card-title { font-size: clamp(25px, 8vw, 34px); line-height: .95; margin: 7px 0 16px; letter-spacing: -.045em; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { min-height: 69px; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 7px; padding: 10px; border-radius: 13px; border: 1px solid var(--line); background: rgba(5,8,5,.35); }
button.stat { width: 100%; text-align: left; cursor: pointer; color: inherit; }
button.stat:hover, button.stat:active { border-color: var(--lime); background: rgba(201,244,74,.09); }
.stat.selected { border-color: var(--orange); background: rgba(255,173,67,.1); }
.stat-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: rgba(201,244,74,.1); color: var(--lime); }
.stat-label { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.stat-value { font-size: 21px; font-weight: 950; }
.tap-hint { text-align: center; color: var(--lime); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; margin-top: 13px; }
.empty-card { min-height: 410px; display: grid; place-items: center; text-align: center; border: 1px dashed var(--line); border-radius: 26px; color: var(--muted); }
.reveal-title { text-align: center; margin: 9px 0 15px; }
.reveal-title .category { color: var(--orange); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.reveal-title h2 { margin: 7px 0 0; }
.comparison { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.mini-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: linear-gradient(155deg, #20291c, #111711); }
.mini-card.winner { border-color: var(--lime); box-shadow: 0 0 0 2px rgba(201,244,74,.1), 0 15px 40px rgba(0,0,0,.25); }
.mini-card .mini-art { height: 76px; display: grid; place-items: end center; background: radial-gradient(circle at 50% 100%, rgba(201,244,74,.15), transparent 64%); }
.mini-art svg { width: 92%; height: 70px; }
.mini-content { padding: 10px; }
.mini-player { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-card h3 { min-height: 32px; font-size: 14px; margin: 3px 0 8px; line-height: 1.05; }
.mini-score { display: flex; align-items: end; justify-content: space-between; }
.mini-score span { color: var(--orange); font-size: 9px; text-transform: uppercase; }
.mini-score strong { color: var(--lime); font-size: 26px; }
.result-banner { margin-top: 13px; padding: 13px; text-align: center; border: 1px solid var(--line); border-radius: 14px; color: var(--muted); }
.result-banner strong { color: var(--lime); }
.victory { flex: 1; display: grid; place-items: center; text-align: center; }
.victory-medal { width: 106px; height: 106px; margin: 0 auto 22px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(201,244,74,.4); background: radial-gradient(circle, rgba(201,244,74,.2), rgba(201,244,74,.03)); color: var(--lime); font-size: 48px; box-shadow: 0 0 70px rgba(201,244,74,.12); }
.victory h1 { font-size: 47px; margin-bottom: 9px; }.victory p { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 50; max-width: calc(100% - 32px); transform: translate(-50%, 18px); opacity: 0; pointer-events: none; padding: 12px 16px; border: 1px solid rgba(255,106,85,.35); border-radius: 13px; background: #251411; color: #ffd1ca; box-shadow: var(--shadow); font-size: 13px; transition: .2s; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (min-width: 620px) {
  .shell { padding-left: 24px; padding-right: 24px; }
  .home-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 28px; align-items: center; flex: 1; }
  .hero { padding-top: 20px; }
  .actions { grid-template-columns: 1fr 1fr; }
  .comparison { grid-template-columns: repeat(4, 1fr); }
  .card-visual { height: 185px; }
}
@media (max-height: 720px) and (max-width: 619px) {
  .hero { padding-top: 16px; }.hero-art { display: none; } h1 { font-size: 43px; }
  .card-visual { height: 125px; }.card-visual svg { height: 105px; }.card-body { padding: 13px; }
  .stat { min-height: 58px; }.card-title { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
