:root {
  --bg: #0f1115;
  --card: #1a1d24;
  --line: #2a2e38;
  --text: #f2f4f8;
  --muted: #8b93a3;
  --accent: #c6ff3d;
  --accent-ink: #11140a;
  --danger: #ff5a5f;
  --radius: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
h1, h2 { margin: 0; letter-spacing: -0.02em; }
h1 { font-size: 32px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 700; }

.page {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 76px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.head { padding: 8px 0 4px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.empty { text-align: center; padding: 36px 20px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.px { image-rendering: pixelated; }
.empty .big { width: 64px; height: 64px; }
.muted { color: var(--muted); margin: 0; }
.small { font-size: 14px; font-weight: 400; }
.center { text-align: center; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
input {
  font: inherit;
  font-size: 17px; /* ≥16px stops iOS zooming on focus */
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }

.btn {
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
[hidden] { display: none !important; }

.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  animation: toast 3.5s forwards;
}
@keyframes toast { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }

.auth .page { justify-content: center; min-height: 100dvh; padding-bottom: 32px; }
.brand { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.brand img { border-radius: 18px; }

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  background: rgba(15, 17, 21, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 5px 0 max(env(safe-area-inset-bottom), 6px);
}
.tabbar a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--accent); }

/* install + push prompt */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.step { display: flex; align-items: center; gap: 14px; }
.step p { margin: 0; flex: 1; font-size: 18px; line-height: 1.35; }
.step .px { flex: none; border-radius: 10px; } /* rounds the app icon in step 3 like a Home Screen tile */
.step-n {
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 800;
  font-size: 18px;
}
details.card summary { font-weight: 600; cursor: pointer; }
details.card p { margin-top: 10px; }
.push-card { display: flex; align-items: flex-start; gap: 14px; }
.push-card .px { flex: none; margin-top: 2px; }
.push-card .stack { flex: 1; gap: 8px; }
/* fights */
a.btn { display: block; text-align: center; text-decoration: none; }
.btn.shrink { width: auto; flex: none; padding: 12px 16px; }
select {
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  width: 100%;
}
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; padding: 0; accent-color: var(--accent); flex: none; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 16px; min-height: 44px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--muted); }
.hint { color: var(--muted); }
.back { font-size: 15px; font-weight: 600; text-decoration: none; display: inline-block; padding: 6px 0; }
.section { padding: 8px 0 0; }
.split { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inline { display: flex; align-items: center; gap: 8px; }
.inline > input { min-width: 0; flex: 1; }
.suffix { color: var(--muted); font-size: 15px; white-space: nowrap; }
.alert { background: rgba(255, 90, 95, 0.12); border: 1px solid var(--danger); color: var(--text); border-radius: 12px; padding: 12px 14px; }
.card-link { color: inherit; text-decoration: none; display: block; }
.card-link p { margin: 2px 0 0; }
.card-link.split { display: flex; }  /* .card-link is declared after .split and would win */

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; }
.seg span { display: block; text-align: center; padding: 11px 8px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--muted); }
.seg input:checked + span { background: var(--accent); color: var(--accent-ink); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px 8px 10px; min-height: 44px; }
.chip:disabled { opacity: 0.4; }
.chip:active:not(:disabled) { border-color: var(--accent); }
.custom { background: var(--bg); border-radius: 12px; padding: 14px; border: 1px dashed var(--line); }

.goal.card { background: var(--bg); }
.goal-head { display: flex; align-items: center; gap: 12px; }
.goal-head > div, .goal-head > strong { flex: 1; min-width: 0; }
.goal-head .btn { margin-left: auto; }
.goal-rule { padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.goal-rule .small, .goal-head p { margin: 0; }
.target { margin: 0; }

details.more summary { font-size: 19px; font-weight: 700; cursor: pointer; min-height: 28px; }
details.more[open] summary { margin-bottom: 12px; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }

.tag { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.accepted { color: var(--accent); border-color: var(--accent); }
.tag.no { color: var(--danger); border-color: var(--danger); }
.diff { margin: 0; padding-left: 12px; border-left: 3px solid var(--accent); }

.hp-list { display: flex; flex-direction: column; gap: 8px; }
.hp-row { display: flex; align-items: center; gap: 10px; }
.hp-name { width: 76px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--muted); }
.hp-row.me .hp-name { color: var(--text); font-weight: 700; }
.hp-num { width: 30px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* pull to refresh */
.ptr {
  position: fixed;
  top: calc(env(safe-area-inset-top) - 48px);
  left: 50%;
  margin-left: -22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  z-index: 50;
  pointer-events: none;
  transition: transform 0.2s;
}
.ptr.dragging { transition: none; }
.ptr.ready { border-color: var(--accent); }
.ptr.loading { transform: translateY(84px) !important; }
.ptr.loading img { animation: ptr-spin 0.6s linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* add to home screen banner */
.a2hs {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--accent);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  line-height: 1.35;
}
.a2hs img { flex: none; }

/* copy rules from another fight */
.copy-from { display: flex; align-items: flex-end; gap: 10px; }
.copy-from label { flex: 1; }

/* log tab */
.seg a { display: block; text-align: center; padding: 11px 8px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--muted); text-decoration: none; }
.seg a.on { background: var(--accent); color: var(--accent-ink); }
.log-line { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.log-line .px { flex: none; }
.bad { color: var(--danger); font-weight: 700; }

/* me: fighters, photo, venmo */
.me-pic { align-self: center; width: 112px; height: 112px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); object-fit: cover; }
.fighters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fighters label { position: relative; display: block; }
.fighters input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; }
.fighters img { display: block; width: 100%; height: auto; aspect-ratio: 1; background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 4px; }
.fighters input:checked + img { border-color: var(--accent); background: rgba(198, 255, 61, 0.1); }
.fighters input:focus-visible + img { outline: 2px solid var(--text); outline-offset: 2px; }
.me-photo input[type=file] { font-size: 16px; padding: 10px; }
/* arena */
@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/PressStart2P-Regular.ttf") format("truetype");
  font-display: swap;
}
.arena {
  --px: "Press Start 2P", ui-monospace, Menlo, monospace;
  --gold: #ffd23f;
  --red: #ff2e4d;
  position: relative;
  padding: 16px 12px 14px;
  border: 3px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 0 0 3px #000, 0 0 0 6px var(--red), 0 8px 30px rgba(255, 46, 77, 0.25);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #1b0b3a 0%, #3a0f4f 55%, #5a1233 100%);
  margin: 6px 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.a-banner { text-align: center; }
.a-round {
  font: 22px/1.2 var(--px);
  color: var(--gold);
  text-shadow: 3px 3px 0 var(--red), 5px 5px 0 #000;
  letter-spacing: 1px;
}
.a-sub { margin-top: 10px; font: 10px/1.4 var(--px); color: #fff; }
.a-series {
  align-self: center;
  background: #000;
  border: 2px solid #fff;
  padding: 8px 12px;
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  text-align: center;
}
.a-h { margin: 0 0 8px; font: 10px/1.4 var(--px); color: var(--gold); display: flex; align-items: center; gap: 8px; }

.a-duel { display: grid; grid-template-columns: 1fr auto 1fr; gap: 6px; align-items: start; }
.a-vs {
  align-self: center;
  margin-top: 40px;
  font: 18px var(--px);
  color: var(--red);
  text-shadow: 2px 2px 0 #000, 0 0 12px rgba(255, 46, 77, 0.8);
}
.fighter { position: relative; min-width: 0; }
.f-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin: 6px 0; }
.fighter.flip .f-meta { flex-direction: row-reverse; }
.f-name { font-weight: 800; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.f-hp { font: 14px var(--px); color: var(--gold); text-shadow: 2px 2px 0 #000; }

.hpbar {
  display: flex;
  gap: 2px;
  padding: 3px;
  background: #1a0505;
  border: 3px solid var(--gold);
  box-shadow: 0 0 0 2px #000;
  --seg: #3ddc4b;
}
.hpbar.mid { --seg: #ffd23f; }
.hpbar.lo { --seg: #ff2e4d; }
.hpbar.flip { flex-direction: row-reverse; }
.hpbar i { flex: 1; height: 14px; background: rgba(255, 255, 255, 0.07); }
.hpbar i.on { background: var(--seg); box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.35); }

.f-portrait {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border: 3px solid #000;
  background: linear-gradient(180deg, #2b1a6b, #6b1f5e);
}
.f-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.fighter.flip .f-img { transform: scaleX(-1); }
.fighter.me .f-portrait { border-color: var(--gold); }
.fighter.ko .f-img { filter: grayscale(1) brightness(0.55); }
.a-ko {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
}
.a-ko b { font: 22px var(--px); color: var(--red); text-shadow: 3px 3px 0 #000; transform: rotate(-8deg); }
.f-dmg {
  position: absolute;
  left: 50%;
  top: 30%;
  transform: translateX(-50%);
  font: 20px var(--px);
  color: var(--red);
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.f-dmg.show { animation: a-float 1.4s ease-out forwards; }
@keyframes a-float { 0% { opacity: 1; top: 40%; } 70% { opacity: 1; } 100% { opacity: 0; top: -10%; } }
.fighter.hit .f-portrait { animation: a-shake 0.5s steps(2, end) 2; }
.fighter.hit .f-img { animation: a-flash 0.5s steps(2, end) 2; }
@keyframes a-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes a-flash { 50% { filter: brightness(2.5) saturate(0); } }
@media (prefers-reduced-motion: reduce) {
  .f-dmg.show, .fighter.hit .f-portrait, .fighter.hit .f-img { animation: none; }
}

.a-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.a-rank .rank { display: grid; grid-template-columns: 26px 48px 1fr auto; gap: 8px; align-items: center; }
.r-pos { font: 12px var(--px); color: var(--gold); text-align: center; }
.rank .f-portrait { width: 48px; height: 48px; border-width: 2px; }
.rank .f-dmg { font-size: 12px; }
.r-body { min-width: 0; }
.rank .f-meta { margin: 0 0 4px; justify-content: flex-start; align-items: center; }
.rank .hpbar { padding: 2px; border-width: 2px; }
.rank .hpbar i { height: 8px; }
.r-ko { font: 9px var(--px); color: var(--red); }
.r-skull { position: absolute; right: -6px; bottom: -6px; }
.rank.ko .f-name { text-decoration: line-through; opacity: 0.7; }

.a-today, .a-feed, .ledger { background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.25); padding: 12px; }
.a-check summary { cursor: pointer; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 14px; padding: 4px 0; }
.a-goal { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; }
.a-goal .g-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-goal .g-state { display: flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.a-goal.hit .g-state { color: #3ddc4b; font-weight: 700; }
.a-goal.miss .g-state { color: var(--red); font-weight: 700; }
.a-feed p { margin: 0; padding: 4px 0; font-size: 14px; color: #ddd; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.a-feed p.mine { color: #ff8a9b; }
.a-feed .a-h + p { border-top: 0; }
.rules > summary { cursor: pointer; list-style: none; }
.rules > summary::-webkit-details-marker { display: none; }
.rules[open] > summary { margin-bottom: 12px; }

/* ledger */
.l-pair { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.a-h + .l-pair { border-top: 0; }
.l-line { margin: 0; font-size: 17px; }
.l-line b { font: 14px var(--px); color: var(--gold); margin-left: 4px; }
.l-pair.owed .l-line b { color: #3ddc4b; }
.l-claim { margin: 0; font-weight: 700; color: var(--gold); }
.btn.sm { padding: 10px 14px; font-size: 15px; }
.btn.venmo { display: block; text-align: center; text-decoration: none; background: #3d95ce; color: #fff; }
.l-why { margin-top: 6px; }
.l-why summary { cursor: pointer; font-size: 14px; color: var(--muted); }
.l-why p { margin: 6px 0 0; }
.rank .f-hp { min-width: 44px; text-align: right; }

/* pauses */
.pause-days { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pause-days label { min-width: 0; }
.pause-days input { min-width: 0; }
/* reviews */
.proof-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.proof-row .ask { flex-basis: 100%; margin: 0; color: var(--accent); font-weight: 700; }
.proof-thumb { display: block; width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.btn.file { display: inline-block; width: auto; flex: none; color: var(--text); cursor: pointer; }
.proof-img { display: block; width: 100%; max-height: 420px; object-fit: contain; border-radius: 12px; background: var(--bg); }
.status { font-weight: 700; }
.status.open { color: var(--accent); }
.status.failed { color: var(--danger); }
.a-reviews { background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.25); padding: 12px; }
.rv-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; color: #ddd; text-decoration: none; font-size: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.a-h + .rv-row { border-top: 0; }
.rv-row small, .rv-item small { display: block; font-size: 12px; color: var(--muted); }
.rv-row b { font: 9px var(--px); flex: none; }
.rv-row.open b { color: var(--gold); }
.rv-row.proved b { color: #3ddc4b; }
.rv-row.failed b { color: var(--red); }
.rv-row.mine span { color: #fff; font-weight: 700; }
.rv-ask-h { margin-top: 14px; justify-content: space-between; flex-wrap: wrap; }
.rv-ask-h span { font: 12px -apple-system, system-ui, sans-serif; color: #ddd; }
.rv-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.rv-item form { margin: 0; flex: none; }
.rv-item .btn { width: auto; flex: none; }
.rv-none { margin: 0; font-size: 14px; color: var(--muted); }
.status.proved { color: #3ddc4b; }
.proof-row .btn { width: auto; flex: none; }

/* admin */
.admin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.admin-row:first-of-type { border-top: 0; }
/* inbox + reminders */
.bell { position: relative; align-self: flex-end; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: -60px; z-index: 2; }
.bell .badge { position: absolute; top: 2px; right: 0; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.inbox-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; color: var(--text); text-decoration: none; }
.inbox-item.unread { border-color: var(--accent); }
.inbox-item.unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); }
.remind-on { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 16px; }
.remind-on input { width: 22px; height: 22px; flex: none; }
/* templates, stats, how */
.tpls { display: flex; gap: 10px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scroll-snap-type: x proximity; scroll-padding-left: 16px; scrollbar-width: none; }
.tpls::-webkit-scrollbar { display: none; }
.tpl { flex: none; width: 158px; display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; scroll-snap-align: start; }
.tpl.on, .tpl:active { border-color: var(--accent); }
.tpl strong { font-size: 16px; }
.tpl .muted { line-height: 1.35; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid.three { grid-template-columns: 1fr 1fr 1fr; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.stat span { font-size: 13px; color: var(--muted); }
.stat.pos b { color: var(--accent); }
.stat.neg b { color: var(--danger); }
.how p { margin: 0; line-height: 1.5; }
.how .goal-head h2 { font-size: 18px; }
/* recap + talk */
.a-result { display: flex; align-items: center; justify-content: center; gap: 10px; }
.a-result b { font: 16px/1.4 var(--px); color: #fff; text-shadow: 3px 3px 0 #000; text-align: center; overflow-wrap: anywhere; }
.a-btn {
  font: 12px/1 var(--px);
  color: #1b0b3a;
  background: var(--gold);
  border: 0;
  padding: 14px 16px;
  box-shadow: 4px 4px 0 #000;
  cursor: pointer;
}
.a-btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 #000; }
.a-btn.big { width: 100%; font-size: 18px; padding: 20px 16px; background: var(--red); color: #fff; }
.a-menu { display: flex; justify-content: center; margin: 0; }
.a-menu .a-btn { background: transparent; color: var(--gold); border: 2px solid var(--gold); box-shadow: none; }
.a-talk { background: rgba(0, 0, 0, 0.45); border: 2px solid rgba(255, 255, 255, 0.25); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.t-msg { display: flex; gap: 8px; align-items: flex-start; }
.t-msg img { flex: none; image-rendering: pixelated; border-radius: 4px; background: rgba(255, 255, 255, 0.08); object-fit: cover; }
.t-msg p { margin: 0; padding: 6px 10px; background: rgba(255, 255, 255, 0.1); border-radius: 10px; font-size: 15px; color: #fff; overflow-wrap: anywhere; min-width: 0; }
.t-msg p b { display: block; font-size: 12px; color: var(--muted); font-weight: 700; }
.t-msg.mine p { background: rgba(255, 210, 63, 0.2); }
.t-send { display: flex; gap: 8px; margin: 0; }
.t-send input { flex: 1; min-width: 0; }
.t-send .a-btn { padding: 0 12px; }
.t-taunts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.t-taunts button { font: 13px -apple-system, system-ui, sans-serif; color: #fff; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 999px; padding: 8px 12px; cursor: pointer; }
.recap {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  text-align: center;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #1b0b3a 0%, #3a0f4f 55%, #5a1233 100%);
  animation: rc-in 0.25s steps(5);
}
.recap[hidden] { display: none; }
.rc-round { font: 14px/1.4 var(--px); color: #fff; }
.rc-verdict { font: 34px/1.2 var(--px); color: var(--gold); text-shadow: 4px 4px 0 var(--red), 7px 7px 0 #000; animation: rc-pop 0.5s steps(6) 0.15s both; }
.rc-verdict.ko { color: var(--red); text-shadow: 4px 4px 0 var(--gold), 7px 7px 0 #000; }
.rc-stars { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.rc-star { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rc-star .rc-img { width: 128px; height: 128px; object-fit: cover; border: 3px solid var(--gold); background: rgba(0, 0, 0, 0.4); }
.rc-star b { font: 12px/1.4 var(--px); color: #fff; max-width: 150px; overflow-wrap: anywhere; }
.rc-crown { margin-bottom: -14px; animation: rc-drop 0.5s steps(6) 0.5s both; }
.rc-hp { list-style: none; margin: 0; padding: 0; width: 100%; max-width: 320px; }
.rc-hp li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid rgba(255, 255, 255, 0.15); color: #fff; }
.rc-hp li span { flex: 1; text-align: left; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rc-hp li b { font: 12px var(--px); color: var(--gold); }
.rc-hp img { image-rendering: pixelated; }
.rc-money { margin: 0; display: flex; align-items: center; gap: 8px; font: 16px var(--px); color: var(--red); }
.rc-money.up { color: #3ddc4b; }
.rc-series { margin: 0; font: 11px/1.5 var(--px); color: #fff; }
.rc-tap { margin: auto 0 0; padding-top: 10px; font: 10px var(--px); color: var(--gold); animation: rc-blink 1s steps(2) infinite; }
@keyframes rc-in { from { opacity: 0; } }
@keyframes rc-pop { from { transform: scale(0.2); opacity: 0; } }
@keyframes rc-drop { from { transform: translateY(-40px); opacity: 0; } }
@keyframes rc-blink { 50% { opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) {
  .recap, .rc-verdict, .rc-crown, .rc-tap { animation: none; }
}

/* quick add + summary */
.quick { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.quick .btn { padding: 14px 8px; min-height: 48px; }
/* share */
.a-btn.share { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--gold); border: 2px solid var(--gold); box-shadow: none; }
.a-btn.share img { image-rendering: pixelated; }
/* admin */
.ad summary { font-size: 19px; font-weight: 700; cursor: pointer; min-height: 28px; }
.ad[open] summary { margin-bottom: 12px; }
.ad-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.ad-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ad-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ad-h { margin: 14px 0 0; font-size: 16px; color: var(--muted); }
.ad-thumb { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; margin-bottom: 4px; }
.ad textarea { width: 100%; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.ad textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
/* badges */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0; }
.badge img { width: 56px; height: 56px; }
.badge b { font-size: 13px; line-height: 1.2; }
.badge span { line-height: 1.25; }
.badge.locked img { filter: brightness(0) invert(0.16); }
.badge.locked b { color: var(--muted); }
.fighters.earned { grid-template-columns: repeat(3, 1fr); }
.fighters.earned label { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.fighters .pic { position: relative; display: block; width: 100%; }
.fighters .pic img:first-child { display: block; width: 100%; height: auto; aspect-ratio: 1; background: var(--bg); border: 2px solid var(--line); border-radius: 14px; padding: 4px; }
.fighters input:checked + .pic img:first-child { border-color: var(--accent); background: rgba(198, 255, 61, 0.1); }
.fighters input:focus-visible + .pic img:first-child { outline: 2px solid var(--text); outline-offset: 2px; }
.fighters .locked .pic img:first-child { filter: brightness(0.3); }
.fighters .pic img.lock { position: absolute; right: 6px; bottom: 6px; width: 24px; height: 24px; padding: 0; border: 0; background: none; filter: none; aspect-ratio: auto; }
.fighters .need { color: var(--muted); line-height: 1.25; }
.fighters .locked { cursor: not-allowed; }

/* arena: log button */
.a-btn.a-log { display: block; text-align: center; text-decoration: none; background: var(--gold); color: #1b0b3a; margin: 4px 0 12px; }
