:root {
  --bg: #07050f;
  --bg-2: #0d0a1c;
  --bg-elev: #110d26;
  --surface: #140f2e;
  --surface-2: #1d1642;
  --surface-3: #2a2060;
  --border: #3a2d80;
  --border-soft: #241c52;
  --text: #f6f2ff;
  --text-2: #c9c1ee;
  --muted: #8a82bb;

  --pink: #ff2bd6;
  --cyan: #22e4ff;
  --violet: #9b5cff;
  --yellow: #ffe94d;
  --green: #3dff9a;
  --red: #ff4d6d;
  --gold: #ffd36b;
  --orange: #ff8a1f;

  --primary: var(--pink);
  --primary-2: var(--cyan);
  --primary-soft: #ff2bd61f;
  --x: var(--cyan);
  --o: var(--pink);
  --good: var(--green);
  --good-soft: #3dff9a1c;
  --bad: var(--red);
  --bad-soft: #ff4d6d1f;
  --warn: var(--yellow);
  --warn-soft: #ffe94d1c;
  --online: var(--green);
  --playing: var(--violet);

  --px: 3px;
  --glow-pink: 0 0 10px #ff2bd699, 0 0 26px #ff2bd644;
  --glow-cyan: 0 0 10px #22e4ff99, 0 0 26px #22e4ff44;
  --radius-sm: 0;
  --radius: 0;
  --radius-lg: 0;
  --shadow: 6px 6px 0 #000;
  --shadow-lg: 10px 10px 0 #000;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Silkscreen", "Courier New", monospace;
  --font-digits: "VT323", "Courier New", monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 520px at 50% -10%, #3a1a8a55, transparent 65%),
    radial-gradient(700px 400px at 0% 100%, #ff2bd61f, transparent 65%),
    radial-gradient(700px 400px at 100% 100%, #22e4ff1a, transparent 65%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: ""; position: fixed; left: -50%; right: -50%; bottom: -10vh; height: 50vh; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, #ff2bd633 2px, transparent 2px) 0 0 / 100% 44px,
    linear-gradient(to right, #22e4ff26 2px, transparent 2px) 0 0 / 60px 100%;
  transform: perspective(380px) rotateX(64deg);
  transform-origin: bottom;
  -webkit-mask: linear-gradient(to top, #000 5%, transparent 85%);
  mask: linear-gradient(to top, #000 5%, transparent 85%);
  animation: floor-run 4s linear infinite;
}

body::after {
  content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, #00000038 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 62%, #000000a0 100%);
  animation: crt-flicker 7s steps(1) infinite;
}
@keyframes floor-run { to { background-position: 0 44px, 0 0; } }
@keyframes crt-flicker { 0%, 100% { opacity: 1; } 47% { opacity: .9; } 48% { opacity: 1; } 83% { opacity: .94; } }

[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.35; font-family: var(--font-display); font-weight: 400; letter-spacing: .02em; }
h1 { font-size: clamp(1.47rem, 3.64vw, 2.1rem); text-shadow: 3px 3px 0 var(--pink); }
h2 { font-size: 1.19rem; text-transform: uppercase; text-shadow: 2px 2px 0 #000; }
h3 { font-size: 0.98rem; text-transform: uppercase; }
p { margin: 0; }
button { font: inherit; color: inherit; }
::selection { background: var(--yellow); color: #000; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 2px solid var(--bg); }

.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.small { font-size: .85rem; }
.tiny { font-size: .74rem; }
.mono { font-family: var(--font-digits); font-size: 1.15em; line-height: 1; font-variant-numeric: tabular-nums; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.gold { color: var(--gold); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gradient-text, .neon-text { color: var(--yellow); text-shadow: 3px 3px 0 var(--pink), 6px 6px 0 #00000088; }
.nav-game-icon { display: inline-block; flex: none; width: 22px; height: 22px; overflow: hidden; image-rendering: pixelated; }
.nav-game-icon svg { display: block; width: 100%; height: 100%; }
.divider { height: 0; border-top: 2px dashed var(--border); margin: 6px 0; }
@media (max-width: 640px) { .hide-sm { display: none; } }

.card, .btn, .modal, .tabs, .pill, .coin-chip, .profile-chip, .menu, .toast, .stat-cell, .tile, .stat-tile, .cab-stat, .kpi,
.shop-item, .live-tile, .live-item, .quick-game, .reward, .result-banner, .match-banner, .ptile, .queue-pill, .aisle, .ticker,
.input, .form input, .form textarea, .form select, .radio-card, .grade, .levelup, .chat-log-static, .lang-btn {
  border-radius: 0;
}

.app { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.view { width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px clamp(14px, 3vw, 32px) 90px; outline: none; }
.view > .stack { gap: 18px; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; font-family: var(--font-display); font-size: 1.33rem; letter-spacing: .08em; text-transform: uppercase; }
.brand > :last-child, .brand-name { color: var(--yellow); text-shadow: 2px 2px 0 var(--pink), 4px 4px 0 #000; }
.brand-logo { width: 34px; height: 34px; display: grid; place-items: center; background: #000; box-shadow: 0 0 0 2px var(--cyan), 4px 4px 0 2px #000, 0 0 16px #22e4ff66; }
.brand-logo img { width: 26px; height: 26px; image-rendering: pixelated; }

.topnav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 10px clamp(14px, 3vw, 28px);
  background: #07050ff2;
  border-bottom: 3px solid #000;
  box-shadow: 0 3px 0 var(--pink), 0 6px 0 #000, 0 10px 24px -8px #ff2bd655;
}
.topnav-links { display: flex; gap: 4px; }
.topnav-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px;
  color: var(--text-2); font: 0.84rem var(--font-display); text-transform: uppercase;
}
.topnav-link svg { width: 18px; height: 18px; }
.topnav-link:hover { color: #fff; background: #ffffff0d; }
.topnav-link.active { color: #000; background: var(--yellow); box-shadow: 3px 3px 0 var(--pink); }
.topnav-link.active svg { color: #000; }
.online-count { font: 1rem var(--font-digits); color: var(--online); }
.topnav-link.active .online-count { color: #064d2a; }
.topnav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-play { padding: 8px 14px; }
.nav-sound { color: var(--text-2); }
.nav-sound[aria-pressed="true"] { color: var(--cyan); }

.coin-chip { display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; background: #000; color: var(--gold); box-shadow: 0 0 0 2px #8a6408; font: 1.25rem/1 var(--font-digits); font-variant-numeric: tabular-nums; }
.coin { width: 14px; height: 14px; flex: none; display: inline-block; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c9, var(--gold) 45%, #b8860b); box-shadow: 0 0 0 2px #5a3a00; }

.profile-chip { display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px; background: var(--surface); border: 0; box-shadow: 0 0 0 2px var(--border); cursor: pointer; }
.profile-chip:hover, .profile-chip[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--cyan), 4px 4px 0 2px #000; }
.profile-chip .pc-text { display: flex; flex-direction: column; line-height: 1.2; text-align: left; max-width: 160px; }
.profile-chip .pc-text .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; font-size: .88rem; }
.profile-chip .pc-level { font: 1rem/1 var(--font-digits); color: var(--muted); }
.profile-chip > svg { width: 14px; height: 14px; color: var(--muted); }

.menu {
  position: fixed; right: clamp(14px, 3vw, 28px); top: 68px; width: 300px; z-index: 60; overflow: hidden;
  background: var(--bg-2); box-shadow: 0 0 0 3px var(--pink), 10px 10px 0 3px #000; animation: pop-in .12s steps(3);
}
.menu-head { position: relative; padding: 28px 16px 16px; display: flex; align-items: center; gap: 12px; }
.menu-head::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, #07050f33, #07050fe6); z-index: 0; }
.menu-head .xpbar { margin-top: 6px; }
.menu-body { padding: 6px; display: flex; flex-direction: column; }
.menu-item { display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px; background: none; border: 0; color: var(--text-2); cursor: pointer; text-align: left; font-weight: 500; }
.menu-item svg { width: 18px; height: 18px; }
.menu-item:hover { background: var(--yellow); color: #000; }
.menu-item:hover::before { content: "▶"; margin-left: -4px; font-size: .7rem; }
.menu-item.danger:hover { background: var(--red); color: #fff; }
.menu-langs { display: flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--text-2); }
.menu-langs > svg { width: 18px; height: 18px; }
.menu-langs > span { flex: 1; margin-left: 5px; }
.lang-btn { border: 0; background: var(--surface); box-shadow: 0 0 0 2px var(--border); color: var(--text-2); padding: 5px 7px; font: 0.77rem var(--font-display); cursor: pointer; }
.lang-btn:hover { color: #fff; box-shadow: 0 0 0 2px var(--cyan); }
.lang-btn.active { color: #000; background: var(--yellow); box-shadow: 0 0 0 2px #000, 3px 3px 0 2px var(--pink); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px); } }

.announcement { display: flex; align-items: center; gap: 12px; padding: 10px clamp(14px, 3vw, 28px); font-size: .9rem; background: repeating-linear-gradient(45deg, #ffe94d18 0 12px, transparent 12px 24px), #120d26; border-bottom: 3px solid var(--yellow); }
.announcement .grow { min-width: 0; }
.announcements { display: flex; flex-direction: column; }
.announcement .ann-mode { flex: none; }
.announcement.permanent { border-bottom-color: var(--cyan); }
.announcement.permanent .ann-mode { color: var(--cyan); box-shadow: 0 0 0 2px #0b6177; }

.tabbar { display: none; }
@media (max-width: 1080px) {
  .topnav { gap: 12px; }
  .topnav-link { padding: 9px 10px; }
  .topnav-link > span:not(.badge):not(.online-count) { display: none; }
  .profile-chip .pc-text, .profile-chip .pc-text .name { max-width: 110px; }
}
@media (max-width: 860px) {
  .topnav-links, .profile-chip .pc-text, .profile-chip > svg, .nav-play span, .brand-name { display: none; }
  .nav-play { padding: 8px 10px; }
  .profile-chip { padding: 3px; }
  .menu { left: 12px; right: 12px; width: auto; top: 62px; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    background: #07050ff5; border-top: 3px solid #000; box-shadow: 0 -3px 0 var(--pink);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; color: var(--muted); font: 0.63rem var(--font-display); text-transform: uppercase; }
  .tabbar a.active { color: var(--yellow); }
  .tabbar a.active svg { color: var(--yellow); filter: drop-shadow(2px 2px 0 var(--pink)); }
  .tabbar svg { width: 22px; height: 22px; }
  .tabbar .badge { position: absolute; top: 0; left: calc(50% + 6px); }
}

.card {
  position: relative; padding: 16px; margin: var(--px);
  background: linear-gradient(180deg, #161036f2, #0e0a24f2);
  box-shadow:
    calc(var(--px) * -1) 0 0 0 var(--border), var(--px) 0 0 0 var(--border),
    0 calc(var(--px) * -1) 0 0 var(--border), 0 var(--px) 0 0 var(--border),
    calc(var(--px) * 3) calc(var(--px) * 3) 0 0 #000;
}
.card-flat { padding: 12px; background: var(--surface); box-shadow: 0 0 0 2px var(--border-soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -16px -16px 14px; padding: 10px 14px; background: #0007; border-bottom: 2px dashed var(--border); }
.card-head h3 { display: flex; align-items: center; gap: 8px; color: var(--yellow); }
.card-head h3 > svg { color: var(--cyan); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1 > svg, h2 > svg, h3 > svg, .card-head svg, .tab > svg, .pill > svg { width: 1.3em; height: 1.3em; flex: none; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1050px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.btn {
  --btn: var(--surface-2); --btn-edge: #0b0820; --btn-text: var(--text);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; white-space: nowrap;
  padding: 10px 14px; margin: 2px; border: 0;
  background: var(--btn); color: var(--btn-text);
  box-shadow: 0 0 0 2px #000, inset -3px -3px 0 #0006, inset 3px 3px 0 #ffffff1f, 0 4px 0 2px var(--btn-edge);
  font: 0.84rem/1.2 var(--font-display); text-transform: uppercase;
  transform: translateY(0); transition: transform .05s, filter .1s;
}
.btn:hover { filter: brightness(1.18); color: #fff; }
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 2px #000, inset 3px 3px 0 #0006, 0 0 0 2px var(--btn-edge); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; filter: grayscale(.6); }
.btn svg { width: 15px; height: 15px; }
.btn-primary { --btn: var(--pink); --btn-edge: #7d0f68; --btn-text: #fff; text-shadow: 2px 2px 0 #7d0f68; }
.btn-primary:hover { --btn: #ff52df; }
.btn-good { --btn: var(--green); --btn-edge: #0b6b3c; --btn-text: #02210f; }
.btn-danger { --btn: #4a0f1f; --btn-edge: #1e0610; --btn-text: #ffc2cd; }
.btn-danger:hover { --btn: var(--red); color: #fff; }
.btn-ghost { --btn: transparent; --btn-edge: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: #ffffff10; }
.btn-ghost:active { box-shadow: none; }
.btn-lg { padding: 14px 20px; font-size: 0.98rem; }
.btn-xl { padding: 17px 26px; font-size: 1.12rem; }
.btn-sm { padding: 7px 10px; font-size: 0.728rem; }
.btn-icon { padding: 8px; }
.btn-block { width: calc(100% - 4px); }
.link { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; padding: 0; }

.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; background: var(--red); color: #fff; font: 0.7rem var(--font-display); box-shadow: 2px 2px 0 #000; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; white-space: nowrap; font: 0.672rem/1.2 var(--font-display); text-transform: uppercase; background: #000a; box-shadow: 0 0 0 2px var(--border); color: var(--text-2); }
.pill.win { color: var(--green); box-shadow: 0 0 0 2px #1d7a4c; }
.pill.loss { color: var(--red); box-shadow: 0 0 0 2px #8a2337; }
.pill.draw { color: var(--yellow); box-shadow: 0 0 0 2px #8a7a1f; }
.pill.primary { color: #ff9cec; box-shadow: 0 0 0 2px #a01588; }
.pill.gold { color: var(--gold); box-shadow: 0 0 0 2px #8a6408; }
.pill.live { color: #ffb3c1; box-shadow: 0 0 0 2px #a3243d; }
.pill.live::before { content: ""; width: 6px; height: 6px; background: var(--red); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.tabs { display: flex; gap: 6px; padding: 6px; overflow-x: auto; scrollbar-width: none; background: #000; box-shadow: 0 0 0 2px var(--border); margin: 2px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap; font: 0.77rem var(--font-display); text-transform: uppercase; }
.tab:hover { color: #fff; }
.tab.active { color: #000; background: var(--cyan); box-shadow: 3px 3px 0 var(--pink); }
.tab.active::before { content: "▶"; font-size: .5rem; }

.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 7px; font: 0.77rem var(--font-display); text-transform: uppercase; color: var(--text-2); }
.field .muted { text-transform: none; font-family: var(--font); font-size: .78rem; }
.input, .form input:not([type="radio"]):not([type="checkbox"]), .form textarea, .form select {
  width: 100%; padding: 10px 12px; font: 1.25rem/1.1 var(--font-digits); color: var(--green); text-transform: none;
  background: #000; border: 0; box-shadow: 0 0 0 2px var(--border), inset 0 0 12px #3dff9a14;
  caret-color: var(--green);
}
.input::placeholder, .form input::placeholder { color: #3dff9a66; }
.input:focus, .form input:not([type="radio"]):not([type="checkbox"]):focus, .form textarea:focus, .form select:focus { outline: none; box-shadow: 0 0 0 2px var(--green), 0 0 18px -4px var(--green); }
textarea { resize: vertical; }
.form-error { min-height: 1.2em; color: var(--red); font-size: .86rem; }
.radio-list { display: flex; flex-direction: column; gap: 8px; }
.radio-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; box-shadow: 0 0 0 2px var(--border); cursor: pointer; }
.radio-card input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--yellow); cursor: pointer; }
.radio-card:has(input:checked) { box-shadow: 0 0 0 2px var(--yellow), 4px 4px 0 2px var(--pink); background: #ffe94d10; }

.empty { padding: 24px 12px; text-align: center; color: var(--muted); font-size: .9rem; }
.empty svg { display: block; width: 34px; height: 34px; margin: 0 auto 10px; color: var(--violet); }
.skeleton { min-height: 120px; background: var(--surface); box-shadow: 0 0 0 3px var(--border-soft); position: relative; }
.skeleton::after { content: "Loading…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--yellow); font: 0.98rem var(--font-display); animation: blink 1s steps(1) infinite; }
.spinner { width: 22px; height: 22px; flex: none; background: conic-gradient(var(--pink) 0 25%, var(--cyan) 0 50%, var(--yellow) 0 75%, var(--green) 0); animation: spin .8s steps(4) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }

.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-bottom: 2px dotted var(--border-soft); }
.list-item:last-child { border-bottom: 0; }
a.list-item:hover, .list-item.clickable:hover { background: #ffe94d10; cursor: pointer; }
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { padding: 8px; text-align: left; color: var(--cyan); border-bottom: 2px solid var(--border); font: 0.7rem var(--font-display); text-transform: uppercase; }
.table td { padding: 9px 8px; border-bottom: 2px dotted var(--border-soft); vertical-align: middle; }
.table td.mono { font-size: 1.35rem; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #ffe94d10; }
.table tr.me td { background: #ff2bd61f; }
.table tr.me td:first-child { box-shadow: inset 4px 0 0 var(--pink); }
.table.compact td, .table.compact th { padding: 6px 8px; }
.table.compact .avatar { --size: 28px; }

.rank-medal { display: inline-grid; place-items: center; min-width: 30px; height: 24px; padding: 0 3px; background: #000; color: var(--text-2); font: 0.77rem var(--font-display); box-shadow: 0 0 0 2px var(--border-soft); }
.rank-1 { background: var(--yellow); color: #000; box-shadow: 0 0 0 2px #000, 3px 3px 0 2px var(--pink); }
.rank-2 { background: #dfe4ff; color: #000; box-shadow: 0 0 0 2px #000, 3px 3px 0 2px var(--violet); }
.rank-3 { background: var(--orange); color: #000; box-shadow: 0 0 0 2px #000, 3px 3px 0 2px #7a2e00; }
.table tr:has(.rank-1) .mono { color: var(--yellow); }
.table tr:has(.rank-2) .mono { color: #dfe4ff; }
.table tr:has(.rank-3) .mono { color: var(--orange); }

.avatar {
  --size: 40px; position: relative; flex: none; display: inline-grid; place-items: center;
  width: var(--size); height: var(--size); border-radius: 0;
  background: linear-gradient(135deg, hsl(var(--hue) 85% 58%), hsl(calc(var(--hue) + 50) 80% 36%));
  box-shadow: 0 0 0 2px #000, inset -3px -3px 0 #0005, inset 3px 3px 0 #fff3; color: #fff; user-select: none;
  font: calc(var(--size) * .3) var(--font-display); text-shadow: 2px 2px 0 #0008;
}
.avatar.xs { --size: 26px; }
.avatar.sm { --size: 34px; }
.avatar.lg { --size: 64px; }
.avatar.xl { --size: 112px; box-shadow: 0 0 0 3px #000, inset -6px -6px 0 #0005, inset 6px 6px 0 #fff3, 6px 6px 0 3px #000; }
.avatar.bot { background: linear-gradient(135deg, #475569, #1e293b); }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; z-index: 3; width: 28%; height: 28%; min-width: 9px; min-height: 9px; border-radius: 0; box-shadow: 0 0 0 2px #000; }
.dot.online { background: var(--online); }
.dot.playing, .dot.queue { background: var(--playing); }
.dot.offline { background: #3d3766; }

.name { font-weight: 650; }
.player-chip { display: inline-flex; align-items: center; min-width: 0; }
.flag { flex: none; width: 1.15em; height: auto; aspect-ratio: 4 / 3; margin-left: 6px; vertical-align: -1px; box-shadow: 0 0 0 1px #000, 2px 2px 0 1px #0008; image-rendering: auto; }
h1 .flag, .profile-name .flag { width: .9em; }

.avatar.sprite { background: radial-gradient(circle at 50% 40%, hsl(var(--hue) 55% 26%), hsl(var(--hue) 60% 9%)); }
.avatar > svg.sprite { width: 86%; height: 86%; image-rendering: pixelated; filter: drop-shadow(1px 1px 0 #0008); }
.levelup.unlock { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--cyan); animation: none; }
.avatar-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 16px; padding: 3px; }
.avatar-choice { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 8px 10px; border: 0; cursor: pointer; color: var(--text); background: var(--surface); box-shadow: 0 0 0 2px var(--border-soft), 5px 5px 0 2px #000; font: inherit; }
.avatar-choice:hover:not(:disabled) { box-shadow: 0 0 0 2px var(--cyan), 5px 5px 0 2px #000; }
.avatar-choice.exclusive { background: linear-gradient(180deg, #3a2a0a, var(--surface)); }
.avatar-choice.exclusive.role-moderator { background: linear-gradient(180deg, #06303a, var(--surface)); }
.avatar-choice.current { box-shadow: 0 0 0 2px var(--yellow), 5px 5px 0 2px var(--pink); }
.avatar-choice strong { font: 0.7rem/1.4 var(--font-display); text-align: center; }
.avatar-choice:disabled { cursor: not-allowed; }
.avatar-choice:disabled .avatar { filter: grayscale(1) brightness(.35); }
.avatar-choice .lock { position: absolute; top: 34px; left: 50%; transform: translateX(-50%); padding: 3px 6px; background: #000; color: var(--yellow); box-shadow: 0 0 0 2px var(--border); font: 0.62rem var(--font-display); white-space: nowrap; }
.tag-bot, .tag-guest { margin-left: 6px; padding: 2px 5px; vertical-align: 1px; font: 0.588rem var(--font-display); text-transform: uppercase; }
.tag-bot { background: #334155; color: #cbd5e1; }
.tag-guest { background: #ffffff14; color: var(--muted); }

.level-ring { --p: 0; flex: none; display: grid; place-items: center; width: 44px; height: 44px; background: conic-gradient(var(--pink) calc(var(--p) * 1%), var(--surface-3) 0); font: 0.84rem var(--font-display); }
.level-ring span { display: grid; place-items: center; width: 36px; height: 36px; background: var(--surface); }

.xpbar { height: 12px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px var(--border); }
.xpbar > div { height: 100%; background: repeating-linear-gradient(90deg, var(--green) 0 8px, transparent 8px 10px); }
.grade { display: inline-flex; align-items: center; padding: 4px 7px; background: #000c; box-shadow: 0 0 0 2px var(--border); color: var(--text-2); font: 0.63rem/1.2 var(--font-display); text-transform: uppercase; }
.grade-initie { color: #8fd3ff; box-shadow: 0 0 0 2px #3b82f6; }
.grade-veteran { color: #6fffc0; box-shadow: 0 0 0 2px #10b981; }
.grade-maitre { color: #d3b5ff; box-shadow: 0 0 0 2px #9b5cff; }
.grade-grand-maitre { color: #ff9cb5; box-shadow: 0 0 0 2px #ff4d6d; }
.grade-legende { color: #000; background: var(--gold); box-shadow: 0 0 0 2px #000, 3px 3px 0 2px var(--pink); }

.auth { position: relative; min-height: 100vh; display: grid; grid-template-columns: 1.15fr 1fr; }
.auth-langs { position: absolute; top: 16px; right: 16px; z-index: 2; display: flex; gap: 8px; }
.auth-hero { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: clamp(28px, 6vw, 72px); overflow: hidden; }
.auth-hero h1 { font-size: clamp(1.96rem, 5.04vw, 3.5rem); line-height: 1.4; text-transform: uppercase; text-shadow: none; }
.auth-hero h1 .line { display: block; }
.auth-hero h1 .neon-pink { color: var(--yellow); text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 #000; }
.auth-hero h1 .neon-cyan { color: #fff; text-shadow: 4px 4px 0 var(--cyan), 8px 8px 0 #000; animation: neon-flicker 6s steps(1) infinite; }
@keyframes neon-flicker { 0%, 92%, 96%, 100% { opacity: 1; } 94% { opacity: .4; } }
.auth-hero .lead { max-width: 520px; color: var(--text-2); font-size: 1.05rem; }
.auth-hero .lead::after { content: "Insert coin"; display: block; margin-top: 18px; color: var(--yellow); font: 1.05rem var(--font-display); text-transform: uppercase; animation: blink 1.1s steps(1) infinite; }
.auth-features { display: flex; flex-wrap: wrap; gap: 10px; }
.auth-art { display: flex; gap: 18px; margin-top: 6px; }
.auth-art .mini-board { width: 110px; transform: rotate(-4deg); box-shadow: 6px 6px 0 var(--pink); }
.auth-art .mini-board:nth-child(2) { transform: rotate(3deg) translateY(10px); box-shadow: 6px 6px 0 var(--cyan); }
.auth-art .mini-board:nth-child(3) { transform: rotate(-2deg); box-shadow: 6px 6px 0 var(--yellow); }
.auth-panel { display: grid; place-items: center; padding: 24px; background: #07050fcc; border-left: 3px solid #000; box-shadow: -3px 0 0 var(--pink); }
.auth-card { width: min(400px, 100%); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-panel { border-left: 0; box-shadow: none; } .auth-art { display: none; } }

.ticker { overflow: hidden; margin: 0 2px; padding: 9px 0; background: #000; box-shadow: 0 0 0 2px var(--yellow), 4px 4px 0 2px var(--pink); }
.ticker-track { display: flex; width: max-content; gap: 38px; animation: ticker 30s linear infinite; }
.ticker-track span { white-space: nowrap; color: var(--yellow); font: 0.77rem var(--font-display); text-transform: uppercase; }
.ticker-track span::before { content: "★"; margin-right: 38px; color: var(--pink); }
@keyframes ticker { to { transform: translateX(-50%); } }

.hero-profile { position: relative; min-height: 0; display: flex; align-items: flex-end; margin: var(--px); box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--cyan), 12px 12px 0 6px #000; }
.hero-profile-inner { width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 20px; padding: 36px 20px 18px; background: linear-gradient(180deg, transparent, #07050fcc 50%, #07050ff7); }
.hero-profile .who { flex: 1; min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.hero-profile .who h1 { font-size: clamp(1.33rem, 3.08vw, 1.82rem); text-shadow: none; }
.hero-profile .who h1 .name { font-weight: 400; }
.p1-tag, .pt-tag, .vs-tag { display: inline-block; padding: 4px 6px; background: var(--pink); color: #fff; font: 0.7rem/1 var(--font-display); box-shadow: 0 0 0 2px #000; animation: blink 1.4s steps(1) infinite; }
.hero-profile .xp-line { display: flex; align-items: center; gap: 10px; max-width: 440px; }
.hero-profile .xp-line .xpbar { flex: 1; }
.hero-profile .xp-line .lvl { color: var(--green); font: 0.84rem var(--font-display); }
.hero-profile .hero-actions { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-end; }
.kpis { display: flex; flex-wrap: wrap; gap: 10px; }
.kpi { padding: 5px 10px 3px; background: #000c; box-shadow: 0 0 0 2px var(--border); }
.kpi .v { color: #fff; font: 1.55rem/1 var(--font-digits); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--cyan); font: 0.588rem var(--font-display); text-transform: uppercase; }
.kpi.credits .v { color: var(--gold); }
.kpi.credits .l { color: var(--gold); }

@media (max-width: 640px) {
  .hero-profile-inner { padding: 20px 14px 14px; gap: 12px; flex-wrap: nowrap; align-items: flex-start; flex-direction: column; }
  .hero-profile-inner > .avatar.xl { --size: 64px; position: absolute; top: 18px; right: 14px; }
  .hero-profile .who { min-width: 0; width: 100%; padding-right: 76px; }
  .kpis { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -76px; padding: 2px; }
  .kpi { flex: none; }
  .hero-profile .hero-actions { width: 100%; align-self: stretch; flex-wrap: nowrap; }
  .hero-profile .hero-actions .btn { flex: 1; padding: 9px 8px; }
}

.hall-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hall-title h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(1.12rem, 2.8vw, 1.47rem); }
.cabinets { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 26px; padding: 4px; }
.cabinet {
  --accent: var(--pink); --accent-dark: #7d0f68;
  position: relative; display: flex; flex-direction: column;
  background: linear-gradient(180deg, #1a1240, #0c0820);
  box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--accent-dark), 10px 10px 0 6px #000;
  transition: transform .1s steps(2), box-shadow .1s;
}
.cabinet.alt { --accent: var(--cyan); --accent-dark: #0b6177; }
.cabinet.selected { transform: translate(-3px, -3px); box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--accent), 13px 13px 0 6px #000, 0 0 40px 4px color-mix(in srgb, var(--accent) 40%, transparent); }
.cab-marquee {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, #000) 0 4px, color-mix(in srgb, var(--accent) 22%, #000) 4px 8px);
  border-bottom: 3px solid #000;
}
.cab-marquee h3 { font-size: 1.33rem; color: #fff; text-shadow: 3px 3px 0 var(--accent-dark), 0 0 14px var(--accent); }
.cab-screen { position: relative; display: block; aspect-ratio: 16 / 8; overflow: hidden; margin: 14px 14px 0; background: #000; box-shadow: 0 0 0 3px #000, 0 0 0 6px #2a2a3a, inset 0 0 40px #000; border-radius: 10px / 14px; }
.cab-screen svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: saturate(1.2) contrast(1.05); }
.cab-screen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(to bottom, #0005 0 2px, transparent 2px 4px), radial-gradient(ellipse at center, transparent 50%, #000c); pointer-events: none; }
.cab-screen .pill { position: absolute; left: 10px; top: 10px; z-index: 1; }
.press-start { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 1; text-align: center; color: var(--yellow); font: 0.84rem var(--font-display); text-transform: uppercase; text-shadow: 2px 2px 0 #000; opacity: 0; }
.cabinet.selected .press-start { animation: blink 1s steps(1) infinite; opacity: 1; }
.cab-body { display: flex; flex-direction: column; gap: 14px; padding: 14px 16px 18px; }
.cab-body > p { color: var(--text-2); font-size: .88rem; }
.cab-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cab-stat { padding: 6px 6px 4px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); text-align: center; }
.cab-stat .v { font: 1.5rem/1 var(--font-digits); color: #fff; font-variant-numeric: tabular-nums; }
.cab-stat .l { color: var(--muted); font: 0.56rem/1.4 var(--font-display); text-transform: uppercase; }
.cab-controls { display: flex; gap: 10px; padding: 0 2px 2px; }
.cab-controls .btn-primary { flex: 1; }
.cabinet.alt .cab-controls .btn-primary { --btn: var(--cyan); --btn-edge: #0b6177; --btn-text: #00222b; text-shadow: none; }
.cabinet.soon { display: grid; place-items: center; min-height: 260px; text-align: center; color: var(--muted); background: repeating-linear-gradient(45deg, #ffffff06 0 12px, transparent 12px 24px), #0a0718; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--border-soft); }
.cabinet.soon h3 { margin-top: 6px; animation: blink 1.6s steps(1) infinite; }
.cabinet.soon svg { width: 40px; height: 40px; margin: 0 auto 8px; display: block; color: var(--violet); }
@media (max-width: 520px) { .cab-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.game-header {
  --accent: var(--pink);
  position: relative; overflow: hidden; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px;
  margin: 6px; padding: 20px; background: #000;
  box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--accent), 10px 10px 0 6px #000;
}
.game-header .gh-bg { position: absolute; inset: 0; opacity: .45; pointer-events: none; }
.game-header .gh-bg svg { width: 100%; height: 100%; }
.game-header::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, #0006 0 2px, transparent 2px 4px), linear-gradient(90deg, #07050ff2 25%, #07050fb0 60%, #07050f44); }
.game-header > :not(.gh-bg) { position: relative; z-index: 1; }
.game-header .gh-icon { width: 58px; height: 58px; overflow: hidden; flex: none; box-shadow: 0 0 0 3px #000, 4px 4px 0 3px var(--accent); }
.game-header .gh-icon svg { display: block; width: 100%; height: 100%; }
.game-header h1 { font-size: clamp(1.4rem, 3.64vw, 2.1rem); text-transform: uppercase; color: #fff; text-shadow: 3px 3px 0 var(--accent), 6px 6px 0 #000; }
.game-header .gh-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
@media (max-width: 760px) { .game-header { grid-template-columns: auto minmax(0, 1fr); } .game-header .gh-actions { grid-column: 1 / -1; } .game-header .gh-actions .btn { flex: 1; } }

.stat-bar { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 10px; padding: 0 3px; }
.stat-group { display: grid; gap: 10px; }
.stat-group.mine { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat-group.global { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-cell { display: flex; flex-direction: column; justify-content: space-between; gap: 6px; min-width: 0; padding: 9px 10px 7px; background: #000; box-shadow: 0 0 0 2px var(--border); }
.stat-cell .sc-head { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--cyan); }
.stat-cell .sc-head svg { width: 13px; height: 13px; flex: none; }
.stat-cell .sc-head span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 0.588rem/1.4 var(--font-display); text-transform: uppercase; }
.stat-cell .sc-value { font: 1.9rem/.9 var(--font-digits); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat-cell .sc-value small { font-size: .7em; color: var(--muted); }
.stat-cell.accent { background: #2a0623; box-shadow: 0 0 0 2px var(--pink), 4px 4px 0 2px #000; }
.stat-cell.accent .sc-head { color: #ff9cec; }
.stat-cell.accent .sc-value { color: var(--yellow); }
.stat-group.global .stat-cell { background: transparent; box-shadow: 0 0 0 2px var(--border-soft); }
.stat-group.global .stat-cell.live .sc-head { color: #ffb3c1; }
@media (max-width: 1100px) { .stat-bar { grid-template-columns: 1fr; } .stat-group.mine { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .stat-group.mine { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.game-layout > .stack { gap: 18px; }
@media (max-width: 980px) { .game-layout { grid-template-columns: 1fr; } }

.online-list { display: flex; flex-direction: column; gap: 2px; max-height: 260px; overflow-y: auto; }
.online-row { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; font-size: .88rem; }
.online-row:hover { background: #ffe94d10; }
.live-list { display: flex; flex-direction: column; gap: 8px; }
.live-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); }
.live-item:hover { box-shadow: 0 0 0 2px var(--cyan), 4px 4px 0 2px #000; }
.live-vs { font: 0.77rem var(--font-display); color: var(--yellow); }
.live-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; padding: 2px; }
.live-tile { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); }
.live-tile:hover { box-shadow: 0 0 0 2px var(--cyan), 4px 4px 0 2px #000; transform: translate(-2px, -2px); }
.live-tile .lt-board, .live-tile .lt-board .mini-board { width: 100%; }
.live-tile .lt-players { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: .78rem; }
.live-tile .lt-player { display: flex; align-items: center; gap: 5px; min-width: 0; }
.live-tile .lt-player .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-tile .lt-player.turn::before { content: "▶"; flex: none; color: var(--green); font-size: .6rem; animation: blink 1s steps(1) infinite; }
.live-tile .lt-meta { display: flex; justify-content: space-between; color: var(--muted); font: 1rem/1 var(--font-digits); }
.rules-compact { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: .86rem; }
.rules-compact li::before { content: "▸ "; color: var(--pink); }
details.card > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--yellow); font: 0.91rem var(--font-display); text-transform: uppercase; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▼"; margin-left: auto; color: var(--muted); font-size: .5rem; }
details.card[open] > summary { margin-bottom: 12px; }
details.card:not([open]) > summary::after { content: "▶"; }

.tile { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; margin: 2px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); }
.tile > svg { width: 20px; height: 20px; flex: none; color: var(--cyan); }
.tile .v { font: 1.6rem/1 var(--font-digits); font-variant-numeric: tabular-nums; }
.tile .l { color: var(--muted); font: 0.588rem/1.4 var(--font-display); text-transform: uppercase; }
.tile.accent { box-shadow: 0 0 0 2px var(--pink); background: #2a0623; }
.tile.accent > svg { color: var(--pink); }
.tile.live > svg { color: var(--red); }
.stat-tiles, .admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; padding: 2px; }
.stat-tile { padding: 10px 12px 8px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); }
.stat-tile .v { font: 1.9rem/1 var(--font-digits); font-variant-numeric: tabular-nums; }
.stat-tile .l { color: var(--cyan); font: 0.588rem/1.4 var(--font-display); text-transform: uppercase; }

.match { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 1000px) { .match { grid-template-columns: 1fr; } }
.match-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.match-banner { width: min(480px, 100%); display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: .9rem; font-weight: 600; }
.match-banner svg { width: 18px; height: 18px; flex: none; }
.match-banner.admin { background: #2a1e05; box-shadow: 0 0 0 2px var(--gold); color: #ffe9b8; }
.match-banner.warn { background: #2a2505; box-shadow: 0 0 0 2px var(--yellow); color: #fff4a8; }
.match-banner.info { background: #04232b; box-shadow: 0 0 0 2px var(--cyan); color: #c8f8ff; }

.match-players { width: min(480px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: stretch; }
.match-vs { display: grid; place-items: center; font: 1.4rem var(--font-display); color: var(--yellow); text-shadow: 3px 3px 0 var(--pink); }
.ptile { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; margin: 3px; box-shadow: 0 0 0 3px var(--border); }
.ptile::before { content: ""; position: absolute; inset: 0; z-index: 0; background: linear-gradient(180deg, #07050fa0, #07050ff2 70%); }
.ptile > * { position: relative; z-index: 1; }
.ptile.turn { box-shadow: 0 0 0 3px var(--yellow), 5px 5px 0 3px var(--pink); }
.ptile:not(.turn) .pt-tag { animation: none; background: var(--surface-3); }
.ptile[data-side="1"] .pt-tag { background: var(--cyan); color: #00222b; }
.ptile .pt-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ptile .pt-mark { width: 26px; height: 26px; margin-left: auto; flex: none; }
.ptile .pt-mark svg { width: 100%; height: 100%; }
.ptile .pt-name { min-width: 0; font-size: .9rem; }
.ptile .pt-name .name { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }
.ptile .pt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--text-2); font: 1rem/1 var(--font-digits); }
.ptile .pt-timer { height: 10px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px #000, 0 0 0 3px var(--border-soft); }
.ptile .pt-timer > div { width: 0; height: 100%; background: repeating-linear-gradient(90deg, var(--green) 0 6px, transparent 6px 8px); }
.ptile .pt-timer > div.low { background: repeating-linear-gradient(90deg, var(--red) 0 6px, transparent 6px 8px); animation: blink .5s steps(1) infinite; }
.ptile .pt-status { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: .72rem; }
.ptile .pt-status .warn { color: var(--yellow); }
.ptile .pt-report { position: absolute; top: 4px; right: 4px; z-index: 2; padding: 3px; opacity: .6; }
.ptile .pt-report:hover { opacity: 1; }
.ptile .pt-report svg { width: 14px; height: 14px; }
.player-card.banner { padding-top: 18px; background-size: cover; }
.strikes { display: inline-flex; gap: 3px; vertical-align: middle; }
.strikes i { width: 8px; height: 8px; background: #ffffff1f; }
.strikes i.on { background: var(--red); }
.turn-chip { display: flex; align-items: center; gap: 12px; font: 0.84rem var(--font-display); text-transform: uppercase; text-align: center; }
.turn-chip .good { color: var(--green); animation: blink 1s steps(1) infinite; }
.turn-clock { display: inline-block; min-width: 2.2em; padding: 2px 8px 0; background: #000; color: var(--yellow); box-shadow: 0 0 0 2px var(--border); font: 2rem/1 var(--font-digits); }
.turn-clock.low { color: var(--red); box-shadow: 0 0 0 2px var(--red); animation: blink .5s steps(1) infinite; }
.match-stage .ttt-board { width: min(440px, 100%); gap: 8px; padding: 8px; border-radius: 0; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--border), 10px 10px 0 6px #000; }
.match-stage .dm-board { box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--border), 10px 10px 0 6px #000; }
.match-stage .result-banner { width: min(480px, 100%); }
.match-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.result-banner { padding: 16px; margin: 3px; text-align: center; background: #000; box-shadow: 0 0 0 3px var(--yellow), 6px 6px 0 3px var(--pink); }
.result-kicker { text-align: center; color: var(--red); font: 0.91rem var(--font-display); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px; animation: blink 1.2s steps(1) infinite; }
.result-title { font: clamp(1.54rem, 5.6vw, 2.24rem)/1.3 var(--font-display); text-transform: uppercase; text-align: center; color: #fff; }
.result-title.good { color: var(--yellow); text-shadow: 3px 3px 0 #0b6b3c, 0 0 18px var(--green); }
.result-title.bad { color: #fff; text-shadow: 3px 3px 0 var(--red), 0 0 18px var(--red); }
.result-title.warn { color: #fff; text-shadow: 3px 3px 0 #8a7a1f; }
.result-title.gold { color: var(--gold); text-shadow: 3px 3px 0 var(--pink); }
.continue { margin-top: 16px; text-align: center; color: var(--cyan); font: 0.84rem var(--font-display); text-transform: uppercase; }
.continue span { display: inline-block; min-width: 1.4em; color: var(--yellow); font: 2rem/1 var(--font-digits); vertical-align: middle; }
.continue.done { visibility: hidden; }

.match-side { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 1000px) { .match-side { position: static; } }
.match-info { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.match-info .tile { flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; }
.match-info .tile .v { font-size: 1.5rem; }
.chat { display: flex; flex-direction: column; height: 380px; padding: 0; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #0007; border-bottom: 2px dashed var(--border); }
.chat-head strong { color: var(--yellow); font: 0.84rem var(--font-display); text-transform: uppercase; }
.chat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; scroll-behavior: smooth; background: #0005; }
.chat-log-static { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 10px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); }
.chat-msg { font-size: .9rem; line-height: 1.4; overflow-wrap: anywhere; }
.chat-msg .who { margin-right: 6px; font-weight: 700; }
.chat-msg .who::after { content: ">"; margin-left: 4px; color: var(--muted); }
.chat-msg.system { padding: 4px 8px; text-align: center; color: var(--gold); background: #ffd36b10; font: 1.05rem/1.2 var(--font-digits); }
.chat-msg.spec .who::after { content: "spectateur >"; margin-left: 5px; color: var(--muted); font: 0.588rem var(--font-display); text-transform: uppercase; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 2px dashed var(--border); }
.chat-form input { flex: 1; min-width: 0; }
@media (max-width: 1000px) { .chat { height: 300px; } }

.vs-splash { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; overflow: hidden; background: #07050ff2; animation: vs-in .2s steps(2); }
.vs-splash::before { content: ""; position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, #ff2bd61a 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite; }
.vs-splash.out { animation: vs-out .3s steps(3) forwards; }
.vs-inner { position: relative; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(16px, 5vw, 60px); padding: 20px; width: min(900px, 100%); }
.vs-player { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; animation: vs-slide-l .35s steps(5); }
.vs-player.p2 { animation-name: vs-slide-r; }
.vs-player.p2 .vs-tag { background: var(--cyan); color: #00222b; }
.vs-player .name { font: clamp(0.84rem, 2.52vw, 1.26rem) var(--font-display); }
.vs-player .vs-elo { color: var(--yellow); font: 1.5rem/1 var(--font-digits); }
.vs-mark { font: clamp(3.36rem, 12.6vw, 7rem) var(--font-display); color: var(--yellow); text-shadow: 6px 6px 0 var(--pink), 12px 12px 0 #000; animation: vs-pulse .4s steps(4); }
.vs-game { grid-column: 1 / -1; text-align: center; color: var(--cyan); font: 0.91rem var(--font-display); text-transform: uppercase; }
.vs-count { position: absolute; left: 0; right: 0; bottom: 12%; text-align: center; color: #fff; font: clamp(2.8rem, 9.8vw, 5.6rem) var(--font-display); text-shadow: 5px 5px 0 var(--cyan), 10px 10px 0 #000; }
.vs-count.pop { animation: vs-pulse .3s steps(3); }
@keyframes vs-in { from { opacity: 0; } }
@keyframes vs-out { to { opacity: 0; } }
@keyframes vs-slide-l { from { opacity: 0; transform: translateX(-120px); } }
@keyframes vs-slide-r { from { opacity: 0; transform: translateX(120px); } }
@keyframes vs-pulse { from { transform: scale(2.4); opacity: 0; } }

.profile-hero { position: relative; overflow: hidden; margin: 6px; background: var(--surface); box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--violet), 10px 10px 0 6px #000; }
.profile-banner { height: 170px; }
.profile-body { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px; margin-top: -60px; padding: 0 24px 22px; }
.profile-name { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font: clamp(1.33rem, 3.36vw, 1.82rem) var(--font-display); }
.profile-name .name { font-weight: 400; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto; }
.bio { color: var(--text-2); white-space: pre-wrap; }
.equipped-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.equipped-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; background: #000; box-shadow: 0 0 0 2px var(--border-soft); }
.equipped-item .shop-preview { height: 72px; }

.equipped-item .dm-board.sample { width: 66px; }
.equipped-item .shop-preview .dm-piece-preview > svg { width: 30px; height: 30px; }

.showcase { min-height: 180px; display: flex; align-items: flex-end; margin: 6px; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--gold), 10px 10px 0 6px #000; }
.showcase-inner { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 54px 24px 20px; background: linear-gradient(180deg, transparent, #07050fe6 60%); }
.showcase .name { font: clamp(1.26rem, 3.08vw, 1.68rem) var(--font-display); }
.showcase-game { display: grid; place-items: center; padding: 8px; background: #000; box-shadow: 0 0 0 2px var(--border); }
.showcase-game .dm-board.sample { width: 130px; }
.showcase-game .mini-board { width: 110px; }
.aisles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 3px; }
.aisle { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px; border: 0; cursor: pointer; background: var(--surface); color: var(--text-2); box-shadow: 0 0 0 2px var(--border), 4px 4px 0 2px #000; font: 0.84rem var(--font-display); text-transform: uppercase; }
.aisle small { color: var(--muted); font: 1.1rem/1 var(--font-digits); }
.aisle:hover { color: #fff; box-shadow: 0 0 0 2px var(--cyan), 4px 4px 0 2px #000; }
.aisle.active { background: var(--yellow); color: #000; box-shadow: 0 0 0 2px #000, 4px 4px 0 2px var(--pink); }
.aisle.active small { color: #5a4a00; }
@media (max-width: 560px) { .aisle { flex-direction: column; gap: 6px; padding: 10px 6px; font-size: .5rem; } }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding: 3px; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 12px; text-align: center; background: var(--surface); box-shadow: 0 0 0 2px var(--border-soft), 5px 5px 0 2px #000; transition: transform .08s steps(2); }
.shop-item:hover { transform: translate(-2px, -2px); box-shadow: 0 0 0 2px var(--cyan), 7px 7px 0 2px #000; }
.shop-item.equipped { box-shadow: 0 0 0 2px var(--yellow), 5px 5px 0 2px var(--pink); }
.shop-item.exclusive { background: linear-gradient(180deg, #3a2a0a, var(--surface)); }
.shop-item strong { font: 0.77rem/1.5 var(--font-display); }
.shop-preview { width: 100%; height: 88px; display: grid; place-items: center; }
.shop-preview > svg { width: 64px; height: 64px; }
.shop-preview .mini-board { width: 80px; }
.shop-banner-preview { width: 100%; height: 72px; box-shadow: 0 0 0 2px #000; }
.name-preview { padding: 10px 4px; font: 700 1.2rem var(--font); }

.drawer-backdrop { position: fixed; inset: 0; z-index: 50; background: #07050fcc; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(560px, 100%); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 22px; background: var(--bg-2); border-left: 3px solid #000; box-shadow: -3px 0 0 var(--pink), -12px 0 0 #000; animation: slide-in .15s steps(3); }
@keyframes slide-in { from { transform: translateX(40px); opacity: 0; } }
.mod-flags { display: flex; flex-wrap: wrap; gap: 8px; }
.replay { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 18px; }
.replay .mini-board { width: 170px; }
.fast { color: var(--red); font-weight: 700; }

.queue-pill {
  position: fixed; left: 50%; bottom: 22px; z-index: 40; transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; padding: 10px 12px; max-width: calc(100vw - 24px);
  background: #000; box-shadow: 0 0 0 3px var(--yellow), 6px 6px 0 3px var(--pink);
  animation: rise .2s steps(3);
}
.queue-pill strong { color: var(--yellow); font: 0.77rem/1.5 var(--font-display); text-transform: uppercase; }
.queue-pill [data-q-time] { color: var(--green); font: 1.8rem/1 var(--font-digits) !important; }
.radar { position: relative; flex: none; width: 36px; height: 36px; border-radius: 50%; background: radial-gradient(circle, #3dff9a22 0 30%, transparent 31%), #001a0d; box-shadow: 0 0 0 2px var(--green); overflow: hidden; }
.radar::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, #3dff9acc, transparent 30%); animation: spin 1.2s linear infinite; }
.radar::after { content: ""; position: absolute; inset: 42%; background: var(--green); }
@keyframes rise { from { transform: translate(-50%, 20px); opacity: 0; } }
@media (max-width: 860px) { .queue-pill { bottom: 84px; } }

.toasts { position: fixed; top: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; gap: 14px; width: min(370px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; background: #0d0a1cf8; box-shadow: 0 0 0 3px var(--cyan), 6px 6px 0 3px #000; animation: toast-in .2s steps(3); }
.toast.error { box-shadow: 0 0 0 3px var(--red), 6px 6px 0 3px #000; }
.toast.success { box-shadow: 0 0 0 3px var(--green), 6px 6px 0 3px #000; }
.toast.special { background: #1f1606f8; box-shadow: 0 0 0 3px var(--gold), 6px 6px 0 3px var(--pink); }
.toast .t-icon { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--cyan); }
.toast .t-title { color: var(--yellow); font: 0.77rem/1.5 var(--font-display); text-transform: uppercase; }
.toast .t-body { font-size: .86rem; color: var(--text-2); }
.toast .t-actions { display: flex; gap: 8px; margin-top: 8px; }
.toast .t-close { padding: 0 2px; background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.toast.out { animation: toast-out .2s steps(3) forwards; }
@keyframes toast-in { from { transform: translateX(30px); opacity: 0; } }
@keyframes toast-out { to { transform: translateX(30px); opacity: 0; } }

.modal { width: min(460px, calc(100vw - 40px)); padding: 26px; color: var(--text); background: var(--bg-2); border: 0; box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--pink), 12px 12px 0 6px #000; }
.modal::backdrop { background: #07050fd9; }
.modal h2 { text-align: center; color: var(--yellow); text-shadow: 3px 3px 0 var(--pink); }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 16px; padding: 3px; }
.reward { flex: 1; min-width: 92px; padding: 10px 8px 8px; text-align: center; background: #000; box-shadow: 0 0 0 2px var(--border); }
.reward .v { font: 2.2rem/1 var(--font-digits); font-variant-numeric: tabular-nums; }
.reward .l { color: var(--cyan); font: 0.588rem/1.6 var(--font-display); text-transform: uppercase; }
.levelup { margin-top: 16px; padding: 10px; text-align: center; color: #000; background: var(--gold); box-shadow: 0 0 0 2px #000, 4px 4px 0 2px var(--pink); font: 0.77rem/1.6 var(--font-display); text-transform: uppercase; animation: blink 1s steps(1) 3; }

.quick-games { display: grid; gap: 12px; margin-top: 16px; padding: 3px; }
.quick-game { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; cursor: pointer; text-align: left; background: var(--surface); color: var(--text); box-shadow: 0 0 0 2px var(--border); }
.quick-game:hover, .quick-game:focus-visible { outline: none; background: #2a2205; box-shadow: 0 0 0 2px var(--yellow), 4px 4px 0 2px var(--pink); }
.quick-game .gh-icon { width: 44px; height: 44px; overflow: hidden; flex: none; box-shadow: 0 0 0 2px #000; }
.quick-game .gh-icon svg { display: block; width: 100%; height: 100%; }
.quick-game strong { font: 0.91rem var(--font-display); text-transform: uppercase; }
.qg-start { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font: 0.7rem var(--font-display); text-transform: uppercase; }
.qg-start svg { width: 12px; height: 12px; }
.quick-game:hover .qg-start, .quick-game:focus-visible .qg-start { color: var(--yellow); animation: blink 1s steps(1) infinite; }

@media (prefers-reduced-motion: reduce) {
  body::before, body::after, .auth-hero h1 .neon-cyan, .auth-hero .lead::after, .radar::before, .pill.live::before, .ticker-track,
  .p1-tag, .pt-tag, .vs-tag, .cabinet.selected .press-start, .turn-chip .good, .turn-clock.low, .ptile .pt-timer > div.low,
  .result-kicker, .vs-splash::before, .skeleton::after, .live-tile .lt-player.turn::before, .qg-start { animation: none !important; }
}

.error-screen { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 560px; margin: 40px auto; padding: 28px 20px; text-align: center; }
.error-sprite { width: 112px; height: 112px; background: radial-gradient(circle, #2a1a5a, transparent 70%); }
.error-sprite svg { width: 100%; height: 100%; image-rendering: pixelated; filter: drop-shadow(4px 4px 0 #000); }
.error-sprite.scene { width: 168px; height: 168px; background: none; }
.error-code { font: clamp(3rem, 14vw, 6rem)/1 var(--font-display); color: var(--yellow); text-shadow: 5px 5px 0 var(--pink), 10px 10px 0 #000; animation: error-glitch 3s steps(1) infinite; }
.error-screen h1 { color: var(--cyan); text-shadow: 3px 3px 0 #000; text-transform: uppercase; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 6px; }
.offline-screen { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; align-content: center; padding: 16px; background: radial-gradient(900px 500px at 50% 0%, #3a1a8a55, transparent 65%), var(--bg); animation: vs-in .2s steps(2); }
.offline-screen .error-screen { margin: 0; }
.offline-retry { color: var(--yellow); font: .85rem var(--font-display); text-transform: uppercase; animation: blink 1.1s steps(1) infinite; }
@keyframes error-glitch {
  0%, 100% { transform: none; }
  92% { transform: translate(-3px, 1px); text-shadow: -5px 0 var(--cyan), 5px 5px 0 var(--pink), 10px 10px 0 #000; }
  94% { transform: translate(3px, -1px); }
}
@media (prefers-reduced-motion: reduce) {
  .error-code, .offline-retry { animation: none; }
}