:root {
  --ink: #1f140f;
  --muted: #6b5749;
  --paper: #fffaf3;
  --line: #eadac8;
  --kaden: #8b1515;
  --allie: #0d9488;
  --gold: #f5c518;
  --ok: #15803d;
  --bad: #b91c1c;
  --pending: #b45309;
  --shadow: 0 8px 24px rgba(31, 20, 15, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Arial, Helvetica, sans-serif;
  background: #1a1210;
  color: var(--ink);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
.wrap { max-width: 640px; margin: 0 auto; min-height: 100vh; background: var(--paper); }
.topbar { padding: 10px 16px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-align: center; background: var(--gold); color: #1a1210; }
.hero { padding: 20px 18px 16px; text-align: center; color: #fff; }
.hero.kaden { background: var(--kaden); }
.hero.allie { background: var(--allie); }
.hero.versus { background: linear-gradient(120deg, var(--kaden) 0 50%, var(--allie) 50% 100%); }
.hero.parent { background: #1e3a5f; }
.hero .kicker { pointer-events: none; font-size: 12px; letter-spacing: 1.6px; font-weight: 700; text-transform: uppercase; opacity: .9; }
.hero h1 { margin: 8px 0 4px; font-size: 26px; line-height: 1.15; }
.hero p { margin: 0; font-size: 14px; opacity: .92; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 12px 16px 0; }
.nav a, .btn, button.btn {
  display: inline-block; text-decoration: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 14px; padding: 10px 14px; border-radius: 999px;
  background: #1a1210; color: #fff;
}
.nav a.ghost, .btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); }
.btn.kaden { background: var(--kaden); }
.btn.allie { background: var(--allie); }
.btn.gold { background: var(--gold); color: #1a1210; }
.btn.ok { background: var(--ok); }
.btn.bad { background: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.pad { padding: 16px 18px 28px; }
.card { background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 8px; font-size: 18px; }
.muted { color: var(--muted); font-size: 14px; }
.sample-note, .note { background: #fff3c4; border: 2px solid var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 13px; margin: 0 0 14px; }
.tally { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: #1a1210; color: #fff; border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
.tally b { color: var(--gold); font-size: 18px; }
.tier { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #1a1210; color: #fff; }
.tier.warmup, .tier.walk { background: #0f766e; }
.tier.takedown, .tier.trot { background: #b45309; }
.tier.pin, .tier.gallop { background: #8b1515; }
.passage { background: #fff; border-left: 4px solid #0284c7; padding: 10px 12px; margin: 0 0 12px; font-size: 15px; }
.choices { display: grid; gap: 8px; margin: 10px 0; }
.choices label, .choice {
  display: block; background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: pointer; font-weight: 700;
}
.choices label.selected { border-color: #0d9488; background: #ccfbf1; }
.choices label.correct, .choice.correct { border-color: var(--ok); background: #dcfce7; }
.choices label.wrong, .choice.wrong { border-color: var(--bad); background: #fee2e2; }
input[type="text"], input[type="password"], textarea, input[type="tel"] {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 10px; border: 2px solid var(--line); background: #fff;
}
textarea { min-height: 70px; resize: vertical; }
.star {
  font-size: 64px; text-align: center; animation: pop .45s ease;
  filter: drop-shadow(0 0 8px #f5c518);
}
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.why { background: #fff7ed; border: 2px solid #fdba74; border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.why strong { color: #9a3412; }
.reveal.yes { background: #dcfce7; color: #14532d; border-radius: 12px; padding: 12px; margin-top: 10px; font-weight: 700; }
.reveal.no { background: #fee2e2; color: #7f1d1d; border-radius: 12px; padding: 12px; margin-top: 10px; font-weight: 700; }
.guide { background: #ecfeff; border: 2px solid #5eead4; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: 14px; }
.flag-box { background: #fff7ed; border: 2px solid #fdba74; border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.vs-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: stretch; }
.fighter { border-radius: 14px; padding: 14px 10px; text-align: center; color: #fff; }
.fighter.kaden { background: var(--kaden); }
.fighter.allie { background: var(--allie); }
.fighter .name { font-size: 18px; font-weight: 800; }
.fighter .score { font-size: 34px; font-weight: 800; line-height: 1; margin: 8px 0 4px; color: var(--gold); }
.fighter.allie .score { color: #ccfbf1; }
.fighter .sub { font-size: 12px; opacity: .9; }
.vs-pill { align-self: center; background: #1a1210; color: var(--gold); font-weight: 800; border-radius: 50%; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; }
.winner-banner { text-align: center; background: #1a1210; color: var(--gold); border-radius: 14px; padding: 14px; margin: 0 0 14px; font-weight: 800; font-size: 18px; }
.winner-banner small { display: block; color: #ffe4e6; font-weight: 600; font-size: 13px; margin-top: 4px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat { background: #fff8ef; border-radius: 10px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.win-k { color: var(--kaden); font-weight: 800; }
.win-a { color: var(--allie); font-weight: 800; }
.prize-box { text-align: center; }
.prize-svg { width: 140px; height: 84px; }
.home-grid { display: grid; gap: 12px; }
.home-card { display: block; text-decoration: none; color: #fff; border-radius: 16px; padding: 18px 16px; }
.home-card.k { background: var(--kaden); }
.home-card.a { background: var(--allie); }
.home-card.v { background: #1a1210; }
.home-card.p { background: #1e3a5f; }
.home-card h2 { margin: 0 0 4px; }
.timer { font-weight: 800; font-size: 20px; color: var(--kaden); text-align: center; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.match button { width: 100%; text-align: left; }
.match button.on { outline: 3px solid var(--gold); }
.sort-item, .bucket { border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0; background: #fff; font-weight: 700; cursor: pointer; }
.bucket { min-height: 80px; background: #fff8ef; }
.bucket h3 { margin: 0 0 6px; font-size: 14px; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
.mute { position: absolute; right: 12px; top: 12px; z-index: 6; }
.hero { position: relative; }
.login-box input { margin: 8px 0 12px; font-size: 20px; letter-spacing: 4px; text-align: center; }
.charcount { font-size: 12px; color: var(--muted); text-align: right; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: #1a1210; color: #fff; }
.tag.pending { background: var(--pending); }
.tag.approved { background: var(--ok); }
.tag.rejected { background: var(--bad); }
footer.site { text-align: center; color: #9a8878; font-size: 12px; padding: 8px 16px 24px; }
.progress { height: 8px; background: #eadac8; border-radius: 99px; overflow: hidden; margin: 0 0 12px; }
.progress > span { display: block; height: 100%; background: var(--gold); }
.banner-sib { border-radius: 14px; padding: 14px 16px; margin: 0 0 14px; color: #fff; background: #1a1210; }
.banner-sib h2 { margin: 0 0 6px; font-size: 16px; color: var(--gold); }
@media (max-width: 520px) {
  .vs-grid { grid-template-columns: 1fr; }
  .vs-pill { margin: 0 auto; }
}

/* ---- fun layer ---- */
.star.pop { animation: starpop .6s ease-out; display:inline-block; }
@keyframes starpop { 0%{transform:scale(.2) rotate(-30deg);opacity:0} 60%{transform:scale(1.35) rotate(10deg);opacity:1} 100%{transform:scale(1) rotate(0)} }
.cheer-line { font-weight:900; font-size:20px; margin:6px 0 2px; }
.praise { margin:2px 0 8px; } .praise-it { font-weight:800; color:#0d9488; font-size:18px; } .praise-en { color:#555; font-style:italic; }
.roast { border-radius:12px; padding:10px 12px; margin:10px 0; background:#fff7ed; border:2px dashed #fb923c; }
.roast.allie { background:#fdf2f8; border-color:#f472b6; }
.roast-head { font-weight:800; font-size:14px; margin-bottom:4px; }
.roast-it { font-size:17px; font-weight:700; } .roast-en { color:#555; font-style:italic; margin-top:2px; }
.btn.small { padding:8px 12px; font-size:14px; min-height:40px; }
.why-btn { background:#fef3c7; color:#92400e; border:2px solid #f59e0b; }
.toolrow { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.toolrow .btn { text-decoration:none; }
.chip { border:1px solid #cbd5e1; background:#fff; border-radius:999px; padding:6px 10px; font-size:14px; margin:3px 2px; min-height:36px; }
.chip.on { background:#111827; color:#fff; border-color:#111827; }
.accent-bar { display:flex; flex-wrap:wrap; align-items:center; gap:2px; }
.locker-list { display:flex; flex-direction:column; gap:8px; }
.locker-item { display:flex; gap:10px; align-items:flex-start; border-bottom:1px solid #eee; padding-bottom:8px; }
.keep-going { border:2px solid #f5c518; background:linear-gradient(180deg,#fffbeb,#fff); }
.tally.bonus { background:linear-gradient(90deg,#92400e,#d97706); }
.tier.bonus { background:#f5c518; color:#3b2f00; }
.hist-chart { width:100%; height:auto; background:#fafafa; border-radius:10px; }
