/* ================= DRAFT DUEL — 2010s party-game look ================= */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --green: #3ddc84; --green-d: #1fa35c;
  --blue: #29a3ff;  --blue-d: #1272c4;
  --purple: #9b5cff;--purple-d: #6d34cc;
  --pink: #ff4fa3;  --pink-d: #c92579;
  --orange: #ffa726;--orange-d: #d17c00;
  --red: #ff5252;   --red-d: #c62828;
  --yellow: #ffd644;
  --ink: #2b1a52;
}

html, body { height: 100%; }
body {
  font-family: "Arial Rounded MT Bold", "Baloo 2", "Nunito", "Segoe UI", -apple-system, sans-serif;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, #5b2be0 0%, #8f2bd6 45%, #ff2e88 100%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
  user-select: none;
}

/* floating background emoji bubbles */
#bg-bubbles { position: fixed; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.bubble {
  position: absolute; bottom: -80px; font-size: 42px; opacity: .18;
  animation: floatUp linear infinite;
}
@keyframes floatUp {
  from { transform: translateY(0) rotate(-10deg); }
  to   { transform: translateY(-115vh) rotate(14deg); }
}

#confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; }

/* ============================ screens ============================ */
.screen {
  display: none; position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto; padding: 24px 16px 40px;
  min-height: 100vh; flex-direction: column; align-items: center; gap: 14px;
}
.screen.active { display: flex; animation: screenIn .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes screenIn { from { opacity: 0; transform: scale(.94) translateY(14px); } }

.screen-title {
  font-size: 30px; letter-spacing: 2px;
  text-shadow: 0 3px 0 rgba(0,0,0,.25);
  transform: rotate(-2deg);
}

/* ============================ logo ============================ */
.logo-wrap { text-align: center; margin-top: 4vh; position: relative; }
.logo-burst { position: absolute; top: -18px; right: -30px; font-size: 40px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1) rotate(8deg); } 50% { transform: scale(1.25) rotate(-6deg); } }
.logo {
  font-size: clamp(52px, 14vw, 72px); line-height: .9; letter-spacing: 1px;
  color: var(--yellow);
  text-shadow: 0 4px 0 #d17c00, 0 8px 0 rgba(0,0,0,.28);
  transform: rotate(-3deg);
}
.logo span { color: #fff; text-shadow: 0 4px 0 var(--pink-d), 0 8px 0 rgba(0,0,0,.28); }
.tagline { margin-top: 10px; font-size: 15px; opacity: .95; letter-spacing: .5px; }

/* ============================ cards ============================ */
.card {
  background: rgba(255,255,255,.14);
  border: 3px solid rgba(255,255,255,.55);
  border-radius: 24px;
  padding: 18px;
  width: 100%;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 0 rgba(0,0,0,.18);
}
.home-card { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.field-label { font-size: 12px; letter-spacing: 2px; opacity: .9; }

input {
  font: inherit; font-size: 18px; color: var(--ink);
  background: #fff; border: none; border-radius: 14px;
  padding: 13px 16px; width: 100%; text-align: center;
  box-shadow: inset 0 3px 6px rgba(0,0,0,.15);
}
input:focus { outline: 4px solid var(--yellow); }

/* ============================ buttons ============================ */
.btn {
  font: inherit; font-size: 17px; letter-spacing: 1px; color: #fff;
  border: none; border-radius: 999px; padding: 13px 20px;
  cursor: pointer; position: relative; width: 100%;
  text-shadow: 0 2px 0 rgba(0,0,0,.25);
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.3) !important; }
.btn:disabled { filter: grayscale(.8) brightness(.7); pointer-events: none; }
.btn-big { font-size: 21px; padding: 16px 22px; }
.btn-green  { background: var(--green);  box-shadow: 0 6px 0 var(--green-d); }
.btn-blue   { background: var(--blue);   box-shadow: 0 6px 0 var(--blue-d); }
.btn-purple { background: var(--purple); box-shadow: 0 6px 0 var(--purple-d); }
.btn-pink   { background: var(--pink);   box-shadow: 0 6px 0 var(--pink-d); }
.btn-orange { background: var(--orange); box-shadow: 0 6px 0 var(--orange-d); }
.btn-red    { background: var(--red);    box-shadow: 0 6px 0 var(--red-d); }
.btn-ghost  { background: rgba(255,255,255,.14); box-shadow: 0 4px 0 rgba(0,0,0,.2); font-size: 14px; }
.btn-row { display: flex; gap: 10px; width: 100%; }
.btn-row .btn { flex: 1; }

.elo-chip {
  align-self: center; background: var(--yellow); color: var(--ink);
  border-radius: 999px; padding: 4px 14px; font-size: 13px;
  text-shadow: none; box-shadow: 0 3px 0 var(--orange-d);
}
.fine-print { font-size: 11px; opacity: .7; margin-top: auto; padding-top: 16px; }

/* ============================ lobby ============================ */
.code-card { text-align: center; }
.room-code {
  font-size: 54px; letter-spacing: 14px; padding-left: 14px; color: var(--yellow);
  text-shadow: 0 4px 0 var(--orange-d); cursor: pointer;
}
.lobby-players { display: flex; gap: 12px; width: 100%; }
.player-chip {
  flex: 1; text-align: center; background: rgba(255,255,255,.16);
  border: 3px solid rgba(255,255,255,.5); border-radius: 20px; padding: 12px;
  box-shadow: 0 6px 0 rgba(0,0,0,.15);
}
.player-chip.empty { opacity: .55; border-style: dashed; }
.player-chip .avatar { font-size: 34px; }
.player-chip .pname { font-size: 16px; margin-top: 4px; }
.player-chip .pelo { font-size: 12px; color: var(--yellow); }
.lobby-judges { font-size: 13px; opacity: .9; }

.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.topic-tile {
  font: inherit; color: #fff; border: 3px solid rgba(255,255,255,.6);
  border-radius: 16px; padding: 12px 6px; font-size: 13px; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,.22); transition: transform .08s;
}
.topic-tile:hover { transform: scale(1.05) rotate(-1.5deg); }
.topic-tile:active { transform: translateY(4px); }
.topic-tile .t-emoji { display: block; font-size: 26px; margin-bottom: 4px; }
.topic-custom { display: flex; gap: 8px; }
.topic-custom .btn { width: auto; }
.wait-card, .gen-card, .deliberate-card { text-align: center; padding: 30px; }

.spinner { font-size: 40px; display: inline-block; animation: spin 1.4s ease-in-out infinite; }
.spinner.big { font-size: 64px; }
@keyframes spin { 0%,100% { transform: rotate(-14deg) scale(1); } 50% { transform: rotate(14deg) scale(1.15); } }
.gen-sub { opacity: .85; font-size: 14px; margin-top: 6px; }

/* ============================ auction ============================ */
#screen-auction { max-width: 560px; gap: 10px; }
.auction-top { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.pill {
  background: rgba(0,0,0,.25); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; border: 2px solid rgba(255,255,255,.35);
}
.pill-btn { cursor: pointer; color: #fff; font: inherit; font-size: 15px; }

.duel-bar { display: flex; gap: 10px; width: 100%; }
.duelist {
  flex: 1; background: rgba(255,255,255,.14); border: 3px solid rgba(255,255,255,.5);
  border-radius: 18px; padding: 10px 12px; box-shadow: 0 5px 0 rgba(0,0,0,.16);
  transition: outline .15s;
}
.duelist.me { outline: 3px solid var(--yellow); }
.duelist.leading { background: rgba(61,220,132,.28); }
.duelist .d-name { font-size: 15px; display: flex; justify-content: space-between; }
.duelist .d-budget { font-size: 22px; color: var(--yellow); text-shadow: 0 2px 0 rgba(0,0,0,.3); }
.duelist .d-slots { display: flex; gap: 4px; margin-top: 6px; }
.slot {
  width: 100%; height: 10px; flex: 1; border-radius: 6px;
  background: rgba(255,255,255,.25); border: 2px solid rgba(255,255,255,.4);
}
.slot.filled { background: var(--green); border-color: #fff; }
.slot.random { background: var(--orange); }
.d-status { font-size: 11px; opacity: .85; min-height: 14px; }

.item-stage { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 26px; }
.timer-ring { position: absolute; top: -34px; right: 4px; width: 64px; height: 64px; z-index: 3; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: rgba(0,0,0,.35); stroke: rgba(255,255,255,.25); stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--yellow); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 0;
}
.timer-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 22px; text-shadow: 0 2px 0 rgba(0,0,0,.4);
}
.timer-ring.urgent .ring-fg { stroke: var(--red); }
.timer-ring.urgent .timer-num { color: var(--red); animation: pulse .5s infinite; }

.item-card {
  width: min(88%, 360px); text-align: center; color: var(--ink);
  border: 6px solid #fff; border-radius: 28px; padding: 26px 18px 20px;
  transform: rotate(-2deg);
  box-shadow: 0 10px 0 rgba(0,0,0,.22);
  animation: cardIn .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes cardIn { from { transform: rotate(6deg) scale(.5) translateY(-60px); opacity: 0; } }
.item-emoji { font-size: 64px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.15)); }
.item-name { font-size: 26px; line-height: 1.1; margin-top: 6px; }
.item-tagline { font-size: 13px; opacity: .75; margin-top: 6px; min-height: 16px; }

.high-bid {
  font-size: 19px; background: rgba(0,0,0,.3); padding: 8px 20px;
  border-radius: 999px; border: 2px solid rgba(255,255,255,.4);
}
.high-bid b { color: var(--yellow); }

.bid-feed {
  width: 100%; min-height: 22px; max-height: 66px; overflow: hidden;
  display: flex; flex-direction: column-reverse; align-items: center; gap: 2px;
  font-size: 13px; opacity: .95;
}
.bid-feed div { animation: feedIn .25s; }
@keyframes feedIn { from { transform: translateY(8px); opacity: 0; } }

.bid-controls { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.bid-btns { display: flex; gap: 10px; }
.bid-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 11px 8px; }
.bid-btn small { font-size: 19px; letter-spacing: 0; }
.judge-spectate { background: rgba(0,0,0,.3); border-radius: 999px; padding: 10px 18px; font-size: 14px; }

/* sold overlay */
.sold-overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
  background: rgba(30,10,60,.45);
}
.sold-card {
  background: var(--yellow); color: var(--ink); text-align: center;
  font-size: 30px; padding: 30px 40px; border-radius: 28px; border: 6px solid #fff;
  box-shadow: 0 12px 0 rgba(0,0,0,.3); transform: rotate(-4deg);
  animation: slam .4s cubic-bezier(.2,1.8,.4,1); max-width: 86%;
}
.sold-card small { display: block; font-size: 16px; margin-top: 8px; }
@keyframes slam { from { transform: rotate(10deg) scale(2.4); opacity: 0; } }

/* ============================ judging ============================ */
.rosters-compare { display: flex; gap: 12px; width: 100%; }
.roster-col {
  flex: 1; background: rgba(255,255,255,.14); border: 3px solid rgba(255,255,255,.5);
  border-radius: 20px; padding: 12px; box-shadow: 0 6px 0 rgba(0,0,0,.16);
}
.roster-col h4 { text-align: center; font-size: 16px; margin-bottom: 8px; color: var(--yellow); }
.roster-item {
  font-size: 12.5px; background: rgba(0,0,0,.22); border-radius: 10px;
  padding: 6px 8px; margin-bottom: 5px; display: flex; justify-content: space-between; gap: 6px;
}
.roster-item .price { color: var(--yellow); white-space: nowrap; }
.roster-item.random-pick { opacity: .75; border: 1px dashed rgba(255,255,255,.5); }

.vote-card { display: flex; flex-direction: column; gap: 10px; text-align: center; }
.vote-btns .btn.selected { outline: 4px solid var(--yellow); }
.voted-msg { color: var(--green); }

/* ============================ results ============================ */
.winner-banner {
  text-align: center; font-size: 34px; margin-top: 3vh;
  background: var(--yellow); color: var(--ink); border: 6px solid #fff;
  border-radius: 28px; padding: 22px 30px; width: 100%;
  box-shadow: 0 10px 0 rgba(0,0,0,.25); transform: rotate(-2deg);
  animation: slam .5s cubic-bezier(.2,1.8,.4,1);
}
.winner-banner small { display: block; font-size: 15px; margin-top: 6px; }
.verdicts { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.verdict-card {
  background: rgba(255,255,255,.15); border: 3px solid rgba(255,255,255,.55);
  border-radius: 20px; padding: 14px; display: flex; gap: 12px; align-items: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.16);
  opacity: 0; transform: translateX(-30px) rotate(-2deg);
  transition: opacity .4s, transform .4s cubic-bezier(.2,1.6,.4,1);
}
.verdict-card.revealed { opacity: 1; transform: none; }
.verdict-card .v-emoji { font-size: 38px; }
.verdict-card .v-name { font-size: 15px; color: var(--yellow); }
.verdict-card .v-quip { font-size: 13px; opacity: .95; font-weight: 600; }
.verdict-card .v-scores { margin-left: auto; text-align: right; font-size: 13px; white-space: nowrap; }
.verdict-card .v-scores b { font-size: 17px; }
.elo-card { text-align: center; font-size: 18px; }
.elo-card .delta-up { color: var(--green); }
.elo-card .delta-down { color: var(--red); }

/* ============================ modals ============================ */
.modal {
  position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(30,10,60,.6); padding: 20px;
}
.modal-card { max-width: 400px; display: flex; flex-direction: column; gap: 12px; text-align: center; }
#join-code { text-transform: uppercase; letter-spacing: 10px; font-size: 28px; }
.board-list { list-style: none; text-align: left; max-height: 50vh; overflow-y: auto; }
.board-list li {
  display: flex; justify-content: space-between; padding: 8px 10px;
  border-radius: 10px; font-size: 15px;
}
.board-list li:nth-child(odd) { background: rgba(0,0,0,.18); }
.board-list .medal { margin-right: 6px; }

.tutorial-card { min-height: 320px; justify-content: center; }
.tut-emoji { font-size: 64px; animation: pulse 2s infinite; }
.tut-dots { display: flex; gap: 6px; justify-content: center; }
.tut-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.35); }
.tut-dots span.on { background: var(--yellow); }

/* ============================ toasts ============================ */
#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 380px); }
.toast {
  background: var(--red); border: 3px solid #fff; border-radius: 16px;
  padding: 10px 16px; font-size: 14px; text-align: center;
  box-shadow: 0 6px 0 rgba(0,0,0,.3); animation: slam .3s;
}
.toast.info { background: var(--blue); }

/* ==================== home: profile + avatar picker =================== */
.chip-row { display: flex; gap: 8px; justify-content: center; }
.level-chip { background: var(--purple); color: #fff; box-shadow: 0 3px 0 var(--purple-d); }
.avatar-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.avatar-pick {
  font-size: 26px; background: rgba(255,255,255,.14); border: 3px solid rgba(255,255,255,.4);
  border-radius: 14px; padding: 4px 8px; cursor: pointer; transition: transform .08s;
}
.avatar-pick:hover { transform: scale(1.15) rotate(-4deg); }
.avatar-pick.selected { border-color: var(--yellow); background: rgba(255,214,68,.25); }
.avatar-pick.locked { opacity: .35; filter: grayscale(1); cursor: default; }
.btn-sub { display: block; font-size: 11px; letter-spacing: 0; opacity: .85; }

/* ============================ battle screen =========================== */
.battle-top { display: flex; gap: 8px; }
.hp-bars { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.hp-row {
  background: rgba(255,255,255,.14); border: 3px solid rgba(255,255,255,.5);
  border-radius: 18px; padding: 10px 14px; box-shadow: 0 5px 0 rgba(0,0,0,.16);
}
.hp-row.me { outline: 3px solid var(--yellow); }
.hp-row .hp-name { display: flex; justify-content: space-between; font-size: 15px; margin-bottom: 6px; }
.hp-row .hp-name .locked-tag { color: var(--green); font-size: 12px; }
.hp-track { height: 18px; background: rgba(0,0,0,.35); border-radius: 10px; overflow: hidden; position: relative; border: 2px solid rgba(255,255,255,.3); }
.hp-fill { height: 100%; background: linear-gradient(90deg, var(--green), #7dffb4); transition: width .5s cubic-bezier(.2,1.2,.4,1); }
.hp-fill.low { background: linear-gradient(90deg, var(--red), #ff9a9a); }
.hp-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.shield-track { height: 10px; margin-top: 4px; background: rgba(0,0,0,.3); border-radius: 8px; overflow: hidden; border: 2px solid rgba(255,255,255,.2); }
.shield-fill { height: 100%; background: linear-gradient(90deg, var(--blue), #9bd9ff); transition: width .5s; }

.battle-log {
  width: 100%; min-height: 60px; max-height: 110px; overflow-y: auto;
  background: rgba(0,0,0,.28); border-radius: 16px; padding: 10px 14px;
  font-size: 13px; display: flex; flex-direction: column; gap: 3px;
  border: 2px solid rgba(255,255,255,.25);
}
.battle-log div { animation: feedIn .3s; }
.battle-log .log-round { color: var(--yellow); font-size: 11px; letter-spacing: 1px; margin-top: 4px; }

.battle-actions { display: flex; flex-direction: column; gap: 10px; }
.loadout-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.loadout-btn {
  font: inherit; color: #fff; text-align: left; cursor: pointer;
  background: rgba(0,0,0,.28); border: 3px solid rgba(255,255,255,.4);
  border-radius: 14px; padding: 8px 10px; transition: transform .08s;
}
.loadout-btn:hover:not(:disabled) { transform: scale(1.03); border-color: var(--yellow); }
.loadout-btn:disabled { opacity: .35; cursor: default; }
.loadout-btn .l-name { font-size: 13px; }
.loadout-btn .l-stat { font-size: 10.5px; opacity: .8; font-weight: 600; }
.loadout-btn.heal-btn { border-color: rgba(61,220,132,.6); }
.action-basic small { display: block; font-size: 10px; letter-spacing: 0; opacity: .85; }
.battle-locked-msg { text-align: center; font-size: 14px; color: var(--green); }

@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.shake { animation: shake .3s; }

/* ======================= results: battle + xp ======================== */
.battle-summary { text-align: center; font-size: 15px; }
.xp-card { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.xp-track { height: 16px; background: rgba(0,0,0,.35); border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,.3); }
.xp-fill { height: 100%; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width 1.2s cubic-bezier(.2,1,.4,1); }
.xp-gain { color: var(--yellow); }
.unlock-banner {
  background: var(--yellow); color: var(--ink); border-radius: 14px; padding: 8px 12px;
  font-size: 14px; animation: slam .4s;
}

.hidden { display: none !important; }

@media (max-width: 420px) {
  .room-code { font-size: 40px; letter-spacing: 9px; }
  .item-name { font-size: 21px; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ==================================================================== */
/* ==================== v2: arena, collection, rubric ================= */
/* ==================================================================== */

.screen.wide { max-width: 1100px; }
.section-split {
  margin: 14px 0 2px; font-size: 13px; letter-spacing: 1.5px; opacity: .95;
  border-top: 2px dashed rgba(255,255,255,.25); padding-top: 12px; text-align: center;
}
.section-split small { display: block; font-size: 11px; opacity: .7; letter-spacing: .5px; }
.coin-chip { background: rgba(255,214,68,.22); }
.btn-sm { padding: 8px 10px !important; font-size: 12px !important; }

/* ------------------------------ variants ------------------------------ */
.variant-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.variant-tile {
  background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.2);
  border-radius: 14px; color: #fff; font: inherit; font-size: 13px; padding: 8px 6px;
  cursor: pointer; text-align: center; line-height: 1.25;
}
.variant-tile span { display: block; font-size: 20px; }
.variant-tile small { display: block; font-size: 10px; opacity: .75; font-weight: 700; }
.variant-tile.on { background: var(--green); border-color: #fff; color: #08281a; box-shadow: 0 4px 0 var(--green-d); }

/* ------------------------------- rubric ------------------------------- */
.rubric-card { text-align: left; font-size: 13px; }
.rubric-intro { opacity: .9; font-weight: 700; margin: 4px 0 10px; line-height: 1.4; }
.rubric-cats { display: grid; gap: 6px; margin-bottom: 10px; }
.rubric-cat { background: rgba(0,0,0,.18); border-radius: 10px; padding: 7px 10px; }
.rubric-cat b { display: block; }
.rubric-cat span { font-size: 11.5px; opacity: .8; font-weight: 700; }
.panel-list { display: grid; gap: 6px; }
.panel-judge {
  display: grid; grid-template-columns: 30px 1fr; gap: 2px 8px; align-items: center;
  background: rgba(0,0,0,.18); border-radius: 10px; padding: 7px 10px;
}
.pj-emoji { font-size: 22px; grid-row: span 3; }
.pj-name { font-size: 13.5px; }
.pj-style, .pj-bias { font-size: 11px; opacity: .78; font-weight: 700; }
.pj-bias { color: var(--yellow); opacity: .95; }

.cat-vote { display: grid; gap: 6px; margin: 6px 0 10px; }
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; }
.cat-pick { display: flex; gap: 4px; }
.cat-pick button {
  border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff;
  border-radius: 9px; padding: 5px 9px; font: inherit; font-size: 12px; cursor: pointer;
}
.cat-pick button.on { background: var(--yellow); color: #3a2a00; border-color: #fff; }

/* ------------------------------ verdicts ------------------------------ */
.verdict-tally { font-size: 15px; letter-spacing: 1px; opacity: .95; }
.verdict-card { display: block; text-align: left; }
.v-head { display: grid; grid-template-columns: 42px 1fr auto; gap: 8px; align-items: center; }
.v-id .v-name small { font-size: 9px; background: var(--blue); padding: 1px 5px; border-radius: 6px; vertical-align: middle; }
.v-style { font-size: 11px; opacity: .75; font-weight: 700; }
.v-total { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; }
.v-total .lead { color: var(--yellow); font-size: 17px; }
.v-cats { display: grid; gap: 3px; margin: 8px 0; }
.v-cat { display: grid; grid-template-columns: 118px 1fr 44px; gap: 6px; align-items: center; font-size: 10.5px; }
.vc-label small { opacity: .6; margin-left: 3px; }
.vc-bars { display: grid; gap: 2px; }
.vc-a, .vc-b { display: block; height: 6px; border-radius: 3px; min-width: 2px; }
.vc-a { background: var(--blue); }
.vc-b { background: var(--pink); }
.vc-nums { text-align: right; font-size: 11px; }
.vc-nums i { opacity: .5; font-style: normal; }
.v-vote { font-size: 11.5px; opacity: .85; }

.rewards-card { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.reward-chip {
  background: rgba(255,255,255,.16); border-radius: 999px; padding: 6px 11px; font-size: 12px;
}
.reward-chip.quest { background: rgba(61,220,132,.28); }
.reward-chip.chest { background: rgba(255,214,68,.28); }
.reward-chip.warn { background: rgba(255,82,82,.28); }

/* ------------------------------- arena -------------------------------- */
.arena-top { display: flex; gap: 8px; align-items: center; width: 100%; justify-content: center; }
.arena-hud { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.afighter { background: rgba(0,0,0,.28); border-radius: 14px; padding: 8px 10px; text-align: left; }
.afighter.mine { outline: 2px solid var(--green); }
.aname { font-size: 12.5px; margin-bottom: 4px; }
.aname small { opacity: .7; }
.ahp { position: relative; height: 16px; background: rgba(0,0,0,.45); border-radius: 8px; overflow: hidden; }
.ahp-fill { height: 100%; background: var(--green); transition: width .12s linear; }
.ahp-fill.low { background: var(--red); }
.ahp span { position: absolute; inset: 0; text-align: center; font-size: 10.5px; line-height: 16px; }
.ashield { height: 5px; background: #7fd4ff; border-radius: 3px; margin-top: 3px; }
.aability { position: relative; height: 14px; background: rgba(0,0,0,.45); border-radius: 7px; overflow: hidden; margin-top: 4px; }
.aability-fill { height: 100%; background: var(--purple); transition: width .15s linear; }
.aability span { position: absolute; inset: 0; text-align: center; font-size: 9.5px; line-height: 14px; }

.arena-stage { position: relative; width: 100%; display: flex; justify-content: center; }
#arena-canvas { border-radius: 16px; box-shadow: 0 8px 0 rgba(0,0,0,.35); touch-action: none; background: #160d33; }
.arena-status, .arena-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.arena-status-card, .ares-card { background: rgba(20,10,45,.94); border-radius: 18px; padding: 20px 24px; }
.ares-card { min-width: 280px; max-width: 92%; }
.ares-title { font-size: 30px; }
.ares-sub { font-size: 12px; opacity: .8; margin-bottom: 10px; }
.ares-row { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; padding: 4px 0; }
.ares-row.mine { color: var(--yellow); }
.ares-rewards { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0; }
.arena-controls { display: flex; align-items: center; gap: 12px; width: 100%; justify-content: space-between; }
.arena-help { font-size: 11px; opacity: .8; text-align: left; line-height: 1.5; font-weight: 700; }
.special-btn {
  width: 78px; height: 78px; border-radius: 50%; border: 3px solid rgba(255,255,255,.35);
  background: rgba(155,92,255,.4); color: #fff; font-size: 26px; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
}
.special-btn small { font-size: 9px; opacity: .85; }
.special-btn.ready { background: var(--purple); box-shadow: 0 0 22px rgba(155,92,255,.8); animation: pulse 1.2s infinite; }

/* ---------------------------- collection ------------------------------ */
.coll-top { display: flex; gap: 8px; width: 100%; justify-content: center; flex-wrap: wrap; }
.coll-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.coll-tab {
  background: rgba(255,255,255,.12); border: 2px solid rgba(255,255,255,.2); color: #fff;
  border-radius: 999px; padding: 7px 13px; font: inherit; font-size: 12.5px; cursor: pointer;
}
.coll-tab.on { background: var(--yellow); color: #3a2a00; border-color: #fff; }
.coll-body { width: 100%; }
.coll-note { font-size: 12px; opacity: .85; margin-bottom: 10px; line-height: 1.45; }

.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.skin-card {
  background: rgba(255,255,255,.12); border: 3px solid var(--rarity); border-radius: 16px;
  padding: 10px; display: grid; grid-template-columns: 86px 1fr; gap: 8px; text-align: left;
}
.skin-card.locked { opacity: .9; background: rgba(255,255,255,.07); }
.skin-card.locked .skin-art { filter: grayscale(.55) brightness(.85); }
.skin-card.selected { box-shadow: 0 0 0 3px var(--green), 0 6px 0 rgba(0,0,0,.3); }
.skin-art { display: flex; align-items: center; justify-content: center; }
.skin-name { font-size: 14px; }
.skin-rarity { font-size: 11px; color: var(--rarity); }
.skin-ability { font-size: 10.5px; opacity: .85; margin: 4px 0; line-height: 1.35; font-weight: 700; }
.skin-stats { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10.5px; opacity: .9; }
.shard-bar { position: relative; height: 15px; background: rgba(0,0,0,.4); border-radius: 8px; margin-top: 6px; overflow: hidden; }
.shard-fill { height: 100%; background: var(--blue); }
.shard-bar.owned .shard-fill { background: var(--purple); }
.shard-bar span { position: absolute; inset: 0; text-align: center; font-size: 9.5px; line-height: 15px; }
.skin-actions { grid-column: span 2; display: flex; gap: 6px; }
.skin-actions .btn { flex: 1; }
.skin-locked-tag { flex: 1; text-align: center; font-size: 11px; opacity: .8; padding: 6px; }

.chest-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.chest-slot {
  background: rgba(255,255,255,.12); border-radius: 16px; padding: 12px 8px; font-size: 12px;
  border: 2px dashed rgba(255,255,255,.25);
}
.chest-slot.empty { opacity: .6; }
.chest-slot small { display: block; font-size: 10px; opacity: .75; margin: 4px 0 8px; }
.chest-emoji { font-size: 40px; }
.reveal-card { margin-top: 12px; }
.reveal-title { font-size: 20px; }
.reveal-coins { font-size: 22px; color: var(--yellow); margin: 6px 0 10px; }
.drop {
  display: grid; grid-template-columns: 40px 1fr; gap: 8px; align-items: center; text-align: left;
  background: rgba(0,0,0,.22); border-radius: 12px; padding: 8px; margin-bottom: 6px; font-size: 12px;
  animation: dropIn .4s backwards cubic-bezier(.2,1.5,.4,1);
}
@keyframes dropIn { from { opacity: 0; transform: translateY(14px) scale(.9); } }
.drop-emoji { font-size: 28px; text-align: center; }
.drop.rare { box-shadow: inset 0 0 0 2px #4bb3ff; }
.drop.epic { box-shadow: inset 0 0 0 2px #b06bff; }
.drop.legendary { box-shadow: inset 0 0 0 2px #ffc93c; }
.drop-bar { height: 6px; background: rgba(0,0,0,.4); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.drop-bar div { height: 100%; background: var(--green); }

.th-card { text-align: center; }
.th-emoji { font-size: 46px; }
.th-name { font-size: 20px; }
.th-perk { font-size: 12px; opacity: .85; margin-bottom: 10px; }
.th-hint { display: block; font-size: 11px; opacity: .8; margin-top: 6px; }
.th-maxed { color: var(--yellow); font-size: 14px; }
.th-track { display: grid; gap: 5px; margin-top: 12px; }
.th-row {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  background: rgba(255,255,255,.1); border-radius: 12px; padding: 8px 10px; text-align: left; font-size: 12px;
}
.th-row .th-info div { font-size: 10.5px; opacity: .8; }
.th-level { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.35); line-height: 30px; text-align: center; }
.th-row.done { opacity: .65; }
.th-row.done .th-level { background: var(--green); color: #08281a; }
.th-row.current { outline: 2px solid var(--yellow); }
.th-row.locked { opacity: .5; }

.quest-list { display: grid; gap: 8px; }
.quest-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  background: rgba(255,255,255,.12); border-radius: 14px; padding: 10px 12px; text-align: left;
}
.quest-row.claimed { opacity: .55; }
.quest-bar { position: relative; height: 14px; background: rgba(0,0,0,.4); border-radius: 7px; margin-top: 5px; overflow: hidden; }
.quest-bar div { height: 100%; background: var(--green); }
.quest-bar span { position: absolute; inset: 0; text-align: center; font-size: 9.5px; line-height: 14px; }
.quest-done { font-size: 11px; opacity: .8; }

@media (max-width: 640px) {
  .arena-hud { grid-template-columns: 1fr; }
  .arena-help { display: none; }
  .arena-controls { justify-content: flex-end; }
  .v-cat { grid-template-columns: 96px 1fr 40px; }
}

/* ==================================================================== */
/* ======================= v3: the game shell ========================= */
/* ==================================================================== */

body {
  /* a lit stage instead of a flat gradient */
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.22), transparent 60%),
    radial-gradient(90% 60% at 50% 115%, rgba(0,0,0,.45), transparent 55%),
    linear-gradient(160deg, #5b2be0 0%, #8f2bd6 45%, #ff2e88 100%);
  background-attachment: fixed;
}
body.in-game .tabbar { transform: translateY(130%); }
.screen { padding-bottom: 104px; }

/* every chunky button gets a gloss highlight, like a real game button */
.btn::before, .mini-card::before, .topic-tile::before {
  content: ''; position: absolute; left: 8%; right: 8%; top: 4px; height: 30%;
  border-radius: 999px; background: linear-gradient(rgba(255,255,255,.2), rgba(255,255,255,0));
  pointer-events: none;
}
.mode-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 42%;
  background: linear-gradient(rgba(255,255,255,.16), rgba(255,255,255,0));
  pointer-events: none;
}
.mode-card, .mini-card, .topic-tile { position: relative; overflow: hidden; }

/* the logo catches a light sweep every few seconds */
.logo { position: relative; overflow: hidden; }
.logo::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent);
  animation: sweep 4.5s ease-in-out infinite;
}
@keyframes sweep { 0%, 65% { left: -50%; } 90%, 100% { left: 120%; } }
.logo-wrap { margin-top: 0; }
.home-screen { gap: 11px; }
.home-screen .tagline { font-size: 13px; margin-top: 6px; }
.home-screen .logo { font-size: clamp(38px, 10vw, 52px); }
.home-screen .logo-burst { font-size: 30px; top: -10px; right: -22px; }
.home-screen .fine-print { padding-top: 8px; font-size: 10px; }
/* short viewports (most phones in portrait): trim the chrome, keep the games */
@media (max-height: 780px) {
  .home-screen .tagline { display: none; }
  .home-screen .logo { font-size: clamp(34px, 9vw, 44px); }
  .home-screen .fine-print { display: none; }
  .mc-icon { font-size: 30px; }
  .mode-card { padding: 10px 12px; }
}

/* avatar strip: one scrollable row, not a wall of tiles */
.avatar-row {
  flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start;
  width: 100%; padding: 2px 2px 6px; scrollbar-width: none;
}
.avatar-row::-webkit-scrollbar { display: none; }
.avatar-row .avatar-pick { flex: none; width: 36px; height: 36px; font-size: 18px; }
.avatar-pick.locked { opacity: .5; }

/* ---------------------------- player card ---------------------------- */
.pcard {
  display: grid; grid-template-columns: 86px 1fr; gap: 12px; align-items: center;
  width: 100%; padding: 12px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.2), rgba(255,255,255,.09));
  border: 3px solid rgba(255,255,255,.5);
  box-shadow: 0 8px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.35);
}
.pcard-portrait {
  width: 82px; height: 82px; border-radius: 18px; display: flex;
  align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 35%, rgba(255,255,255,.3), rgba(0,0,0,.28));
  border: 2px solid rgba(255,255,255,.4); box-shadow: inset 0 3px 10px rgba(0,0,0,.35);
}
.pcard-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pcard-main input { font-size: 16px; padding: 10px 12px; }
.lvl-row { display: flex; align-items: center; gap: 8px; }
.lvl-badge {
  flex: none; width: 30px; height: 30px; border-radius: 50%; line-height: 30px;
  text-align: center; font-size: 14px; color: #3a2a00;
  background: linear-gradient(180deg, #ffe89a, var(--yellow));
  box-shadow: 0 3px 0 var(--orange-d), inset 0 -2px 0 rgba(0,0,0,.15);
}
.lvl-track {
  position: relative; flex: 1; height: 18px; border-radius: 9px; overflow: hidden;
  background: rgba(0,0,0,.42); box-shadow: inset 0 2px 5px rgba(0,0,0,.5);
}
.lvl-fill {
  height: 100%; border-radius: 9px; width: 0;
  background: linear-gradient(90deg, #7cf5b0, var(--green));
  transition: width .5s cubic-bezier(.2,1,.3,1);
}
.lvl-track span {
  position: absolute; inset: 0; text-align: center; line-height: 18px; font-size: 10px;
  text-shadow: 0 1px 2px rgba(0,0,0,.7);
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.elo-chip { font-size: 11.5px; padding: 3px 10px; }
.level-chip { background: var(--green); box-shadow: 0 3px 0 var(--green-d); }
.avatar-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

/* ----------------------------- mode cards ---------------------------- */
.mode-deck { display: grid; gap: 12px; width: 100%; }
.mode-card {
  display: grid; gap: 2px; justify-items: center; text-align: center;
  font: inherit; color: #fff; cursor: pointer; border: 3px solid rgba(255,255,255,.65);
  border-radius: 24px; padding: 12px 14px 12px;
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
  transition: transform .1s, box-shadow .1s, filter .2s;
}
.mode-card:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.3) !important; }
.mode-card:hover { filter: brightness(1.07); }
.mc-draft {
  background: linear-gradient(160deg, #ffb63b 0%, #ff7a2f 55%, #ff4d6d 100%);
  box-shadow: 0 9px 0 #b8460f, inset 0 -4px 0 rgba(0,0,0,.18);
}
.mc-arena {
  background: linear-gradient(160deg, #4fd6ff 0%, #3a7bff 55%, #7b3bff 100%);
  box-shadow: 0 9px 0 #23319c, inset 0 -4px 0 rgba(0,0,0,.18);
}
.mc-tag {
  position: absolute; top: 10px; right: 12px; font-size: 9.5px; letter-spacing: 1.5px;
  background: rgba(0,0,0,.35); padding: 3px 9px; border-radius: 999px;
}
.mc-icon { font-size: 36px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.35)); animation: bobble 3s ease-in-out infinite; }
@keyframes bobble { 0%,100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-6px) rotate(5deg); } }
.mc-title { font-size: 22px; letter-spacing: 1.5px; }
.mc-sub { font-size: 11.5px; opacity: .92; }
.mc-cta {
  margin-top: 6px; background: rgba(0,0,0,.28); border-radius: 999px;
  padding: 6px 18px; font-size: 14px; border: 2px solid rgba(255,255,255,.4);
}

/* ----------------------------- mini cards ---------------------------- */
.mini-deck { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.mini-card {
  display: grid; gap: 1px; justify-items: center; font: inherit; font-size: 11.5px;
  color: #fff; cursor: pointer; padding: 10px 4px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  border: 2px solid rgba(255,255,255,.4);
  box-shadow: 0 5px 0 rgba(0,0,0,.22), inset 0 2px 0 rgba(255,255,255,.25);
  text-shadow: 0 2px 0 rgba(0,0,0,.3); transition: transform .08s, filter .15s;
}
.mini-card span { font-size: 21px; }
.mini-card small { font-size: 8.5px; opacity: .75; font-weight: 700; letter-spacing: .2px; }
.mini-card:hover { filter: brightness(1.15); }
.mini-card:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }

/* ------------------------------ tab bar ------------------------------ */
.tabbar {
  position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%);
  z-index: 40; display: flex; gap: 2px; padding: 6px;
  width: min(520px, calc(100% - 20px));
  background: linear-gradient(180deg, rgba(38,20,80,.96), rgba(24,12,52,.96));
  border: 2px solid rgba(255,255,255,.28); border-radius: 22px;
  box-shadow: 0 10px 26px rgba(0,0,0,.45), inset 0 2px 0 rgba(255,255,255,.16);
  transition: transform .28s cubic-bezier(.2,1,.3,1);
}
/* the fixed bar is centred on the viewport, so undo the centring shift on move */
body.in-game .tabbar { transform: translate(-50%, 130%); }
.tab {
  position: relative; flex: 1; display: grid; gap: 1px; justify-items: center;
  font: inherit; font-size: 9.5px; letter-spacing: .4px; color: rgba(255,255,255,.72);
  background: none; border: none; border-radius: 16px; padding: 7px 2px; cursor: pointer;
}
.tab span { font-size: 21px; transition: transform .15s; }
.tab:hover span { transform: translateY(-2px) scale(1.1); }
.tab.on { color: #fff; background: rgba(255,255,255,.14); }
.tab.on span { transform: scale(1.12); }
.tab-badge {
  position: absolute; top: 2px; right: 22%; min-width: 17px; height: 17px; line-height: 17px;
  border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-style: normal;
  box-shadow: 0 0 0 2px rgba(24,12,52,.9); animation: pulse 1.4s infinite;
}

@media (max-width: 400px) {
  .mini-deck { grid-template-columns: repeat(2, 1fr); }
  .mc-title { font-size: 21px; }
  .pcard { grid-template-columns: 70px 1fr; }
  .pcard-portrait { width: 68px; height: 68px; }
}

/* ------------------- in-match polish: the auction stage ------------------- */
.duel-bar { position: relative; }
.duel-bar::after {
  content: 'VS'; position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) rotate(-8deg); z-index: 2;
  font-size: 15px; line-height: 30px; width: 34px; height: 34px; text-align: center;
  color: #3a2a00; border-radius: 50%;
  background: linear-gradient(180deg, #ffe89a, var(--yellow));
  border: 2px solid #fff; box-shadow: 0 3px 0 var(--orange-d);
}
.duelist { padding-bottom: 12px; }
.duelist.leading { box-shadow: 0 5px 0 var(--green-d), 0 0 18px rgba(61,220,132,.55); }
.d-budget {
  background: linear-gradient(180deg, #fff3c4, var(--yellow));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.35));
}
/* the item on the block catches the light, like a prize card */
.item-card { position: relative; overflow: hidden; }
.item-card::after {
  content: ''; position: absolute; top: -60%; bottom: -60%; width: 45%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.65), transparent);
  transform: rotate(8deg); animation: sweep 3.2s ease-in-out infinite;
}
.item-stage { margin-top: 48px; }
.timer-ring { width: 74px; height: 74px; top: -46px; right: 12px; }
.timer-num { font-size: 26px; }
