:root {
  --bg: #0c0b0a; --panel: #171513; --panel2: #211e1a; --line: #332e28; --ink: #f6efe4; --dim: #a59a8b;
  --hot: #ff4d2e; --gold: #ffc53d; --ok: #3ddc97;
  --display: 'Anton', Impact, sans-serif; --body: 'Space Grotesk', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); }
body { min-height: 100vh; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; margin: 0; text-transform: uppercase; }
button, input { font: inherit; }
main { max-width: 1160px; margin: 0 auto; padding: 24px 16px 64px; }
main.full { max-width: none; padding: 0; }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.nav.hidden { display: none; }
.logo { font-family: var(--display); font-size: 26px; text-decoration: none; color: var(--ink); }
.logo span { color: var(--hot); }
.nav nav { display: flex; gap: 16px; flex: 1 1 auto; flex-wrap: wrap; }
.who { min-width: 0; flex-wrap: wrap; }
.nav nav a { color: var(--dim); text-decoration: none; font-weight: 500; }
.nav nav a:hover, .nav nav a.on { color: var(--ink); }
.who { display: flex; align-items: center; gap: 10px; }

.btn { border: 2px solid var(--line); background: var(--panel2); color: var(--ink); padding: 11px 18px; border-radius: 8px; cursor: pointer; font-weight: 700; text-decoration: none; display: inline-block; text-align: center; }
.btn { transition: transform .16s cubic-bezier(.2,.8,.3,1.3), border-color .16s, box-shadow .16s; }
.btn:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.4); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.btn.hot { background: var(--hot); border-color: var(--hot); color: #190602; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.big { font-family: var(--display); font-size: 24px; font-weight: 400; padding: 14px 28px; text-transform: uppercase; }

.hero { padding: 56px 0 44px; }
.hero h1 { font-size: clamp(64px, 15vw, 172px); line-height: .95; }
.hero h1 em { color: var(--hot); font-style: normal; display: inline-block; transform: rotate(-2deg); }
.hero p { font-size: 20px; color: var(--dim); max-width: 600px; margin: 22px 0 28px; line-height: 1.45; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); margin-top: 16px; }
.steps div { padding: 22px 22px 22px 0; }
.steps b { font-family: var(--display); font-size: 42px; color: var(--gold); font-weight: 400; display: block; }
.steps h3 { font-size: 22px; margin: 6px 0; }
.steps p, .muted { color: var(--dim); line-height: 1.5; }
.section-title { font-size: 34px; margin: 40px 0 14px; }
.tiers { display: flex; flex-wrap: wrap; gap: 8px; }
.tier { border: 1px solid var(--line); padding: 8px 12px; border-radius: 6px; font-weight: 700; }
.tier small { color: var(--dim); font-weight: 400; margin-left: 6px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.auth { max-width: 420px; margin: 40px auto; }
.auth h1 { font-size: 40px; margin-bottom: 14px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.tabs .btn { flex: 1; }
.tabs .btn.on { border-color: var(--hot); }
label { display: block; margin-bottom: 14px; font-weight: 500; }
input[type=text], input[type=password], input[type=email], textarea { width: 100%; margin-top: 6px; padding: 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; color: var(--dim); line-height: 1.4; }
.check input { margin-top: 4px; }
textarea { resize: vertical; font: inherit; display: block; }
.feed video.blurred { filter: blur(60px); }
.err { color: #ff8b78; min-height: 22px; margin: 4px 0 10px; }
.w100 { width: 100%; }
.gcheck { margin-top: 12px; }
.orline { text-align: center; margin: 8px 0; }

.lobby { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.cam { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: 12px; overflow: hidden; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam video.mirror { transform: scaleX(-1); }
.cam .empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; text-align: center; padding: 20px; color: var(--dim); }
.rankcard { display: flex; gap: 14px; align-items: center; }
.rankcard .av { font-size: 46px; }
.rankcard h2 { font-size: 28px; }
.rankbar { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.rankbar i { display: block; height: 100%; background: var(--gold); }
.modes { display: grid; gap: 10px; }
.join { display: flex; gap: 8px; }
.join input { margin: 0; text-transform: uppercase; letter-spacing: .15em; }
.statline { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; color: var(--dim); }
.statline b { color: var(--ink); }

.meters { display: grid; gap: 12px; }
.meter span { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 5px; }
.bar { height: 14px; background: var(--bg); border-radius: 7px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s linear; }
.bar i.warn { background: var(--gold); }
.bar i.danger { background: var(--hot); }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 13px; border: 1px solid var(--line); color: var(--dim); }
.pill.good { color: var(--ok); border-color: var(--ok); }
.pill.bad { color: var(--hot); border-color: var(--hot); }
.joke { font-size: 22px; min-height: 66px; line-height: 1.35; }
.verdict { font-family: var(--display); font-size: 44px; color: var(--hot); min-height: 58px; }

.searching { position: fixed; inset: 0; z-index: 20; background: rgba(8,7,6,.93); display: flex; flex-direction: column; gap: 16px; align-items: center; justify-content: center; text-align: center; padding: 16px; }
.searching h2 { font-size: 48px; }
.searching .code { font-family: var(--display); font-size: 72px; letter-spacing: .1em; color: var(--gold); }
.spin { font-size: 56px; animation: bob 1s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-14px) rotate(8deg); } }

.arena { height: 100vh; display: grid; grid-template-rows: auto 1fr auto; background: #000; }
.hud { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 16px; background: var(--panel); }
.player { display: flex; align-items: center; gap: 10px; min-width: 0; }
.player.right { justify-content: flex-end; text-align: right; }
.player b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player small { color: var(--dim); }
.player .av { font-size: 30px; }
.points { font-family: var(--display); font-size: 38px; color: var(--gold); padding: 0 8px; }
.clock { font-family: var(--display); font-size: 52px; line-height: 1; min-width: 86px; text-align: center; }
.clock.low { color: var(--hot); }
.stage { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; min-height: 0; }
.feed { position: relative; min-height: 0; background: #0a0a0a; overflow: hidden; }
.feed video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed .mirror { transform: scaleX(-1); }
.feed .tag { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.65); padding: 5px 10px; border-radius: 6px; font-weight: 700; }
.feed .fbar { position: absolute; left: 12px; right: 12px; bottom: 12px; }
.feed .fbar span { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; text-shadow: 0 1px 3px #000; }
.feed.defending { box-shadow: inset 0 0 0 4px var(--gold); }
.feed.danger { box-shadow: inset 0 0 0 6px var(--hot); }
.rolebar { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 6; padding: 10px 20px; border-radius: 10px; font-family: var(--display); font-size: clamp(20px, 3.4vw, 34px); text-transform: uppercase; white-space: nowrap; color: #190602; }
.rolebar[hidden] { display: none; }
.rolebar.funny { background: var(--gold); }
.rolebar.stone { background: var(--hot); }
.banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; text-align: center; pointer-events: none; width: min(92%, 800px); }
.banner h2 { font-size: clamp(38px, 8vw, 88px); line-height: 1; text-shadow: 0 4px 22px #000; }
.banner p { font-size: 20px; font-weight: 700; margin: 8px 0 0; text-shadow: 0 2px 10px #000; }
.banner.crack h2 { color: var(--hot); animation: slam .3s ease-out; }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } }
.foot { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 16px; background: var(--panel); }
.foot .status { color: var(--dim); }

.endcard { position: absolute; inset: 0; z-index: 10; background: rgba(8,7,6,.9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 16px; }
.endcard h1 { font-size: clamp(64px, 14vw, 140px); }
.endcard h1.win { color: var(--ok); } .endcard h1.loss { color: var(--hot); } .endcard h1.draw { color: var(--gold); }
.delta { font-family: var(--display); font-size: 42px; }

table { width: 100%; border-collapse: collapse; }
th { text-align: left; color: var(--dim); font-weight: 500; }
th, td { padding: 11px 8px; border-bottom: 1px solid var(--line); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td a { font-weight: 700; text-decoration: none; }
td a:hover { text-decoration: underline; }
.up { color: var(--ok); } .down { color: var(--hot); }
.table-wrap { overflow-x: auto; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.avatars button { font-size: 24px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; cursor: pointer; }
.avatars button.on { border-color: var(--hot); }
.legal { color: var(--dim); font-size: 14px; margin-top: 44px; line-height: 1.5; }

main.enter { animation: page .38s cubic-bezier(.2,.7,.2,1); }
@keyframes page { from { opacity: 0; transform: translateY(14px); } }
.hero h1 em { animation: tilt .7s .15s cubic-bezier(.2,1.5,.4,1) backwards; }
@keyframes tilt { from { opacity: 0; transform: rotate(6deg) scale(1.2); } }
.steps div, .tier, .panel { animation: page .5s cubic-bezier(.2,.7,.2,1) backwards; }
.steps div:nth-child(2) { animation-delay: .08s; } .steps div:nth-child(3) { animation-delay: .16s; }
.panel { transition: border-color .2s, transform .2s; } .panel:hover { border-color: #4a4238; }
.nav nav a { transition: color .15s; }
.rankbar i { transition: width .7s cubic-bezier(.2,.7,.2,1); }
.searching { animation: fade .22s ease-out; } @keyframes fade { from { opacity: 0; } }
.endcard { animation: fade .3s ease-out; } .endcard h1 { animation: slam .4s cubic-bezier(.2,1.3,.4,1); }
.clock.low { animation: pulse .5s ease-in-out infinite alternate; } @keyframes pulse { to { transform: scale(1.1); } }
.feed { transition: box-shadow .2s; }
.foot-links { display: flex; gap: 18px; justify-content: center; padding: 20px 16px; color: var(--dim); border-top: 1px solid var(--line); }
.doc { max-width: 720px; line-height: 1.6; } .doc h2 { font-size: 24px; margin-top: 26px; } .doc p, .doc li { color: var(--dim); }
.friend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
#friends h2 { font-size: 24px; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 90px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 8px; font-weight: 700; transition: transform .2s; z-index: 40; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); }

@media (max-width: 760px) {
  .steps, .lobby { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .player small { display: none; }
  .clock { font-size: 40px; min-width: 60px; }
  .points { font-size: 28px; padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
