:root {
  --bg: #07040f;
  --panel: rgba(20, 11, 38, 0.86);
  --panel-solid: #140b26;
  --line: rgba(166, 77, 255, 0.35);
  --text: #efe9ff;
  --muted: #a79cc4;
  --void: #a64dff;
  --cyan: #3fe0ff;
  --red: #ff3d6e;
  --gold: #ffc94a;
  --mint: #4dffb0;
  --rock: #b08a6a;
  --paper: #f2efe6;
  --scissors: #c9d4e0;
  --radius: 14px;
  --head: 'Bungee', system-ui, sans-serif;
  --body: 'Outfit', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); }
a { color: var(--cyan); }
button { font: inherit; cursor: pointer; }
h1, h2, h3, .brand { font-family: var(--head); font-weight: 400; letter-spacing: 0.02em; }

.btn {
  border: 1px solid var(--line); background: #1e1138; color: var(--text);
  padding: 12px 18px; border-radius: 10px; font-weight: 600; transition: transform .08s, background .15s;
}
.btn:hover { background: #2a1850; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, #7b2cff, #a64dff); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.1); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input[type=text] {
  background: #0d0719; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; font: inherit; width: 100%;
}

/* ── landing ── */
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px; max-width: 1100px; margin: 0 auto; }
.brand { font-size: 22px; color: var(--text); text-decoration: none; }
.brand b { color: var(--void); font-weight: 400; }
.hero { max-width: 1100px; margin: 0 auto; padding: 48px 16px 24px; display: grid; gap: 28px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.hero h1 { font-size: clamp(38px, 7vw, 72px); line-height: 1; margin: 0 0 16px; }
.hero h1 span { color: var(--void); text-shadow: 0 0 24px rgba(166, 77, 255, .6); }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.55; }
.cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.cta .btn { text-decoration: none; display: inline-block; }
.wheel { aspect-ratio: 1; max-width: 420px; width: 100%; justify-self: center; }
.section { max-width: 1100px; margin: 0 auto; padding: 28px 16px; }
.section h2 { font-size: 26px; margin: 0 0 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.card { background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 8px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); line-height: 1.5; }
.board { width: 100%; border-collapse: collapse; }
.board td, .board th { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; }
.board th { color: var(--muted); font-weight: 500; font-size: 13px; }
footer { color: var(--muted); text-align: center; padding: 32px 16px; font-size: 13px; }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; padding-top: 24px; } }

/* ── play ── */
.play-body { overflow: hidden; height: 100dvh; }
#arena { position: fixed; inset: 0; }
#arena canvas { width: 100%; height: 100%; display: block; }
.hud { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: 12px 16px; }
.hud > * { pointer-events: auto; }
.top-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fighter { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; width: min(320px, 46vw); backdrop-filter: blur(6px); }
.fighter.opp { border-color: rgba(255, 61, 110, .5); }
.fighter.me { border-color: rgba(63, 224, 255, .5); }
.fighter .name { font-family: var(--head); font-size: 14px; display: flex; justify-content: space-between; gap: 8px; }
.fighter .name small { font-family: var(--body); color: var(--muted); font-size: 12px; }
.hpbar { height: 12px; background: #2a1840; border-radius: 6px; overflow: hidden; margin: 8px 0 6px; position: relative; }
.hpbar i { position: absolute; inset: 0; width: 100%; background: linear-gradient(90deg, #ff3d6e, #ff8a3d); transition: width .35s; }
.fighter.me .hpbar i { background: linear-gradient(90deg, #3fe0ff, #4dffb0); }
.stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stats b { color: var(--text); }
.pips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.pip { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; background: #0d0719; border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 2px 8px; }
.pip.locked { text-decoration: line-through; opacity: .55; }
.pip.void { border-color: var(--void); color: #d7b3ff; }
.relics { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.relic { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: rgba(255, 201, 74, .12); color: var(--gold); border: 1px solid rgba(255, 201, 74, .3); }
.center { text-align: center; flex: 1; min-width: 0; }
.round { font-family: var(--head); font-size: 15px; color: var(--muted); }
#status { font-size: 15px; margin-top: 4px; min-height: 1.4em; }
#timer { font-family: var(--head); font-size: 26px; color: var(--gold); }

.bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.hand { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.sign-card {
  width: 86px; height: 118px; border-radius: 12px; border: 2px solid rgba(255,255,255,.12); background: linear-gradient(180deg, #23143f, #120a24);
  color: var(--text); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: transform .12s, border-color .12s;
}
.sign-card .glyph { font-size: 38px; line-height: 1; }
.sign-card .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sign-card .key { font-size: 10px; color: var(--muted); opacity: .7; }
.sign-card:not(:disabled):hover { transform: translateY(-6px); border-color: var(--cyan); }
.sign-card.void { border-color: rgba(166, 77, 255, .7); box-shadow: 0 0 18px rgba(166, 77, 255, .35) inset; }
.sign-card:disabled { opacity: .35; }
.sign-card.chosen { border-color: var(--gold); transform: translateY(-10px); }
.deckline { font-size: 12px; color: var(--muted); }
#log { position: fixed; right: 16px; top: 50%; transform: translateY(-50%); width: 230px; max-height: 40vh; overflow: auto; font-size: 12px; color: var(--muted); background: rgba(10, 5, 20, .6); border-radius: 10px; padding: 8px 10px; pointer-events: auto; }
#log p { margin: 0 0 4px; }
#log p b { color: var(--text); }
@media (max-width: 900px) { #log { display: none; } }
@media (max-width: 560px) {
  .sign-card { width: 62px; height: 88px; }
  .sign-card .glyph { font-size: 28px; }
  .fighter { padding: 8px; }
  .top-row { flex-wrap: wrap; }
  .center { order: -1; flex-basis: 100%; }
}

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5, 2, 12, .72); padding: 16px; z-index: 5; }
.overlay[hidden] { display: none; }
.modal { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; padding: 24px; width: min(520px, 100%); max-height: 92dvh; overflow: auto; }
.modal h2 { margin: 0 0 6px; font-size: 26px; }
.modal p { color: var(--muted); line-height: 1.5; }
.modal .row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.modal .row > * { flex: 1; }
.modal label { display: block; color: var(--muted); font-size: 13px; margin: 12px 0 6px; }
.code { font-family: var(--head); font-size: 34px; letter-spacing: .15em; color: var(--gold); text-align: center; margin: 10px 0; }
.boons { display: grid; gap: 10px; margin-top: 14px; }
.boon { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: #1a0f30; color: var(--text); }
.boon:hover { border-color: var(--gold); }
.boon b { display: block; font-family: var(--head); font-weight: 400; font-size: 15px; margin-bottom: 4px; }
.boon small { color: var(--muted); font-size: 13px; }
.boon .tag { float: right; font-size: 11px; color: var(--gold); text-transform: uppercase; }
.badge { display: inline-block; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: rgba(77, 255, 176, .12); color: var(--mint); border: 1px solid rgba(77, 255, 176, .35); }
.badge.bad { background: rgba(255, 61, 110, .12); color: var(--red); border-color: rgba(255, 61, 110, .4); }
.toast { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); font-family: var(--head); font-size: clamp(28px, 6vw, 54px); pointer-events: none; text-shadow: 0 0 22px currentColor; opacity: 0; transition: opacity .2s; z-index: 4; }
.toast.on { opacity: 1; }
