/* Cram Court — a cartoon courtroom. Dark walnut panelling, cream legal paper,
   brass fittings, a red gavel. Olive is lavender, Rocco is grey. */

:root {
  --wood-dark: #2e1c10;
  --wood: #6b4428;
  --wood-light: #9a6a40;
  --panel: #4a2f1b;
  --paper: #f7eedb;
  --paper-edge: #e6d6b4;
  --ink: #2a1d14;
  --ink-soft: #6b5846;
  --brass: #d9a43b;
  --gavel: #c2412d;
  --ok: #2f8f5b;
  --bad: #c2412d;
  --olive-body: #a59cc4;
  --olive-tint: #e9e4f6;
  --rocco-body: #8d929a;
  --rocco-tint: #e4e6ea;
  --corn: #f2c230;
  --violet: #8b5cf6;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
/* Night court: the room is dark wood either way, so dark mode only dims the paper. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --paper: #eee2c8; --paper-edge: #d6c39c; }
}
:root[data-theme="dark"] { --paper: #eee2c8; --paper-edge: #d6c39c; }

* { box-sizing: border-box; }
/* "hidden" always wins over a component's own display setting */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  font-family: "Atkinson Hyperlegible", system-ui, sans-serif;
  color: var(--paper);
  /* walnut wall panels: vertical boards + a soft spotlight on the bench */
  background:
    radial-gradient(ellipse 70% 45% at 50% 30%, rgba(255, 210, 140, .18), transparent 70%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.18) 0 2px, transparent 2px 92px),
    linear-gradient(180deg, var(--panel), var(--wood-dark));
  background-color: var(--wood-dark);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; }

.app { max-width: 560px; margin: 0 auto; padding: 14px 16px 28px; position: relative; min-height: 100vh; }

/* ---------- top crest ---------- */
.crest { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px; border-bottom: 2px solid rgba(217,164,59,.35); }
.crest-name { font-family: "Alfa Slab One", serif; font-size: 22px; letter-spacing: .5px; color: var(--brass); text-shadow: 0 2px 0 #00000066; }
.crest-name { line-height: 1.1; }
.crest-by { font-size: 12.5px; color: var(--paper); opacity: .8; margin-top: 2px; white-space: nowrap; }
/* right side of the banner: Support link above the case progress */
.crest-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.support-link { display: inline-block; padding: 4px 10px; border-radius: 99px; border: 1px solid rgba(217,164,59,.6); color: var(--corn); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.support-link:hover { background: rgba(0,0,0,.25); }
.support-link:focus-visible { outline: 3px solid var(--corn); outline-offset: 2px; }
.crest-meta { font-size: 13px; font-weight: 700; color: var(--paper); opacity: .85; text-align: right; }
.crest-meta .pill { display: inline-block; padding: 3px 10px; border-radius: 99px; background: rgba(0,0,0,.3); border: 1px solid rgba(217,164,59,.5); margin-left: 6px; }

/* ---------- screens ---------- */
.screen { display: none; }
.screen.is-on { display: block; animation: rise .45s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- intro ---------- */
/* the two hosts mid-argument, each under a small speech bubble */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; align-items: end; }
.hero-side { display: flex; flex-direction: column; align-items: center; }
.hero-side img { width: 72px; height: 72px; object-fit: contain; }
.hero-bubble { position: relative; margin: 0 0 8px; padding: 6px 10px; border-radius: 12px; background: var(--paper); color: var(--ink); font-size: 13.5px; line-height: 1.25; text-align: center; }
.hero-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: var(--paper); border-bottom: 0; }
.intro-title { font-family: "Alfa Slab One", serif; font-weight: 400; font-size: clamp(21px, 6vw, 28px); line-height: 1.15; margin: 4px 0 10px; text-align: center; color: var(--paper); }
.intro-title span { color: var(--corn); text-shadow: 0 2px 0 #8a5a12; }

.grudge-callout { display: flex; gap: 12px; align-items: center; background: rgba(0,0,0,.28); border: 1px dashed var(--brass); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.grudge-callout p { margin: 0; font-size: 15px; line-height: 1.4; }
.mini-face { flex: 0 0 44px; height: 44px; border-radius: 50%; }
.mini-rocco { background: #3a2617 url("img/rocco_lose.webp") center 18% / 190% no-repeat; border: 2px solid var(--brass); }

.case-file { position: relative; background: var(--paper); color: var(--ink); border-radius: 6px 18px 18px 18px; padding: 20px 18px 14px; margin: 26px 0 18px; box-shadow: var(--shadow); transform: rotate(-.6deg);
  background-image: repeating-linear-gradient(180deg, transparent 0 27px, rgba(120,90,50,.13) 27px 28px); }
.case-tab { position: absolute; top: -22px; left: 0; background: var(--paper-edge); color: var(--ink); font-family: "Alfa Slab One", serif; font-size: 13px; padding: 4px 14px 6px; border-radius: 8px 8px 0 0; }
.case-name { font-family: "Alfa Slab One", serif; font-weight: 400; margin: 0 0 8px; font-size: 22px; }
.case-notes { margin: 0; padding-left: 20px; font-size: 14.5px; line-height: 1.5; }
.case-notes li { margin: 0 0 6px; }

/* the "file a new case" form */
.file-case { margin: 0; }
.file-label { display: block; font-family: "Alfa Slab One", serif; font-size: 16px; color: var(--corn); margin-bottom: 6px; }
/* short until it's in use, so the whole front page fits on a phone */
.notes-box { width: 100%; height: 66px; resize: vertical; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--paper-edge); background: var(--paper); color: var(--ink); font: 16px/1.45 "Atkinson Hyperlegible", sans-serif; }
.notes-box:focus { outline: 3px solid var(--corn); outline-offset: 1px; }
.notes-box:focus, .notes-box:not(:placeholder-shown) { height: 150px; }
.notes-box.is-bad { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.file-meta { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; opacity: .8; margin: 6px 2px 10px; }
.field-error { margin: -2px 2px 10px; padding: 8px 10px; border-radius: 10px; background: #fbe3dd; color: #8f2414; font-weight: 700; font-size: 14px; line-height: 1.4; }
.loading-duo { display: flex; justify-content: center; gap: 4px; }
.loading-duo img { width: 110px; height: 110px; animation: bob .5s ease-in-out infinite; }
.loading-duo img + img { animation-delay: .25s; }
.loading-title { font-size: 26px; }
.btn[disabled] { opacity: .55; cursor: wait; }

.fine { font-size: 13px; opacity: .75; text-align: center; margin: 12px 0 0; line-height: 1.4; }
.fine-left { font-size: 12.5px; text-align: left; margin: 0 2px 12px; line-height: 1.3; }
/* front page, under the main button */
.games-left { font-size: 13px; line-height: 1.35; text-align: center; margin: 12px 4px 0; opacity: .85; }
.case-peek { margin-top: 8px; font-size: 13.5px; }
.case-peek summary { cursor: pointer; text-align: center; opacity: .8; padding: 4px; }
.link-btn { display: block; margin: 8px auto 0; padding: 4px; border: 0; background: none; color: var(--paper); font-size: 13.5px; text-decoration: underline; cursor: pointer; opacity: .8; }

/* ---------- buttons ---------- */
.btn { cursor: pointer; border: 0; border-radius: 14px; font-weight: 700; transition: transform .12s ease, box-shadow .12s ease, opacity .2s; }
.btn:active { transform: translateY(2px); }
.btn:focus-visible { outline: 3px solid var(--corn); outline-offset: 3px; }
.btn-big { display: block; width: 100%; padding: 16px 18px; font-size: 18px; background: var(--gavel); color: #fff; box-shadow: 0 5px 0 #7d2416, var(--shadow); font-family: "Alfa Slab One", serif; font-weight: 400; letter-spacing: .3px; }
.btn-big:active { box-shadow: 0 2px 0 #7d2416; }
.btn-ghost { display: block; width: 100%; padding: 13px; margin-top: 10px; background: transparent; color: var(--paper); border: 2px solid rgba(247,238,219,.4); }

/* ---------- courtroom ---------- */
.grudge-tag { margin: 12px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(242,194,48,.15); border: 1px solid var(--corn); color: var(--corn); font-weight: 700; font-size: 14px; text-align: center; animation: rise .4s ease both; }

.bench { position: relative; margin-top: 14px; }
.gavel { display: block; width: 74px; height: 38px; margin: 0 auto 8px; overflow: visible; }
.gavel-swing { transform-origin: 108px 24px; transform: rotate(-24deg); }
.gavel.slam .gavel-swing { animation: slam .42s cubic-bezier(.5,0,.75,0) both; }
@keyframes slam { 0% { transform: rotate(-24deg); } 45% { transform: rotate(-58deg); } 70% { transform: rotate(14deg); } 100% { transform: rotate(-6deg); } }
.app.shake { animation: shake .3s ease; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -1px); } 75% { transform: translate(-2px, 1px); } }

.podiums { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.side { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.char { width: 100%; max-width: 170px; height: auto; display: block; transition: transform .3s ease, filter .3s; }
.nameplate { margin-top: -4px; padding: 4px 14px; font-family: "Alfa Slab One", serif; font-size: 14px; color: var(--wood-dark); background: linear-gradient(180deg, #f4cf73, var(--brass)); border-radius: 6px; box-shadow: 0 2px 0 #8a5a12; position: relative; z-index: 2; }
.desk { height: 22px; margin-top: -2px; border-radius: 6px; background: linear-gradient(180deg, var(--wood-light), var(--wood)); box-shadow: 0 8px 0 var(--wood-dark), var(--shadow); }

/* speech bubbles */
.bubble { position: relative; width: 100%; min-height: 96px; margin-bottom: 10px; padding: 11px 12px; border-radius: 16px; background: var(--paper); color: var(--ink); font-size: 15px; line-height: 1.35; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px) scale(.96); transition: opacity .3s ease, transform .3s ease; }
.bubble::after { content: ""; position: absolute; bottom: -9px; left: 50%; margin-left: -9px; border: 9px solid transparent; border-bottom: 0; border-top-color: var(--paper); }
.bubble.is-on { opacity: 1; transform: none; }
.side-olive .bubble { border-top: 5px solid var(--olive-body); }
.side-rocco .bubble { border-top: 5px solid var(--rocco-body); }
.bubble.is-react { font-style: italic; min-height: 0; }

/* character moods: game.js sets data-mood = idle | talk | win | lose */
/* Each character is four pictures stacked (idle/talk/win/lose); only the one
   matching data-mood shows. Pictures: img/<name>_<mood>.webp (cut by art-source/cut_poses.py). */
.char { position: relative; aspect-ratio: 1 / 1; filter: drop-shadow(0 8px 6px rgba(0,0,0,.35)); }
.char img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; }
.char[data-mood="idle"] .m-idle, .char[data-mood="talk"] .m-talk,
.char[data-mood="win"] .m-win, .char[data-mood="lose"] .m-lose { opacity: 1; }
.char[data-mood="talk"] { animation: bob .5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-1deg); } }
.char[data-mood="win"] { animation: hop .6s ease 1; filter: drop-shadow(0 0 16px rgba(242,194,48,.6)); }
@keyframes hop { 40% { transform: translateY(-12px); } }
.char[data-mood="lose"] { transform: translateY(4px) scale(.97); filter: drop-shadow(0 8px 6px rgba(0,0,0,.35)) saturate(.8); }

/* ---------- ruling buttons ---------- */
.ruling { margin-top: 22px; transition: opacity .25s; }
.ruling.is-locked { opacity: .35; pointer-events: none; }
.ruling-ask { text-align: center; font-family: "Alfa Slab One", serif; font-size: 18px; margin: 0 0 12px; color: var(--paper); }
.ruling-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-rule { padding: 15px 8px; font-size: 16px; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.45); }
.btn-olive { background: var(--olive-tint); border-bottom: 4px solid var(--olive-body); }
.btn-rocco { background: var(--rocco-tint); border-bottom: 4px solid var(--rocco-body); }
.btn-both { grid-column: 1 / -1; background: var(--corn); color: var(--wood-dark); }
.btn-both[hidden] { display: none; }
.btn-rule.is-picked { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- game menu (intro) ---------- */
.game-menu { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.game-menu legend { float: left; padding: 0; margin: 3px 0 6px; }
.game-menu legend small { font-family: "Atkinson Hyperlegible", sans-serif; font-size: 13px; color: var(--paper); opacity: .8; }
.game-list { clear: both; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
/* line-drawn icons: colour follows the text, so a picked tile turns dark on paper */
.ico { fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ico-fill { fill: currentColor; stroke: none; }
/* each game is an icon tile (a toggle button); aria-pressed="true" = picked */
.game-chip { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; width: 100%; text-align: center; cursor: pointer; padding: 6px 4px 5px; border-radius: 12px; border: 2px solid rgba(247,238,219,.25); background: rgba(247,238,219,.06); color: var(--paper); transition: background .15s, border-color .15s; }
.game-chip:focus-visible { outline: 3px solid var(--corn); outline-offset: 2px; }
.game-chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--corn); box-shadow: 0 3px 0 #8a5a12; }
.game-chip[aria-pressed="true"]::after { content: "✓"; position: absolute; top: 3px; right: 7px; font-weight: 700; color: var(--ok); }
.game-chip .ico { width: 28px; height: 28px; }
.game-chip[disabled] { cursor: not-allowed; opacity: .45; }
.game-name { display: block; font-weight: 700; font-size: 13.5px; line-height: 1.15; }
/* one description for the whole menu; two lines tall so the page doesn't jump */
.game-hint { margin: 8px 2px 0; min-height: 36px; font-size: 13.5px; line-height: 1.33; opacity: .9; }
.game-soon { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: rgba(0,0,0,.35); color: var(--corn); vertical-align: 2px; }
.game-random { float: right; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 6px; border-radius: 99px; border: 2px solid rgba(247,238,219,.25); background: rgba(247,238,219,.06); color: var(--paper); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.game-random .ico { width: 20px; height: 20px; }
.game-random:focus-visible { outline: 3px solid var(--corn); outline-offset: 2px; }
.game-random[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--violet); box-shadow: 0 2px 0 #4c2a99; }
.game-menu .field-error { margin: 10px 0 0; }

/* crest label naming this round's game */
.crest-meta .game-tag { color: var(--corn); }

/* ---------- Mixed Docket: name the part of the case ---------- */
.sorting { margin-top: 22px; }
.group-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.btn-group { padding: 13px 8px; font-size: 15px; background: var(--paper); color: var(--ink); border-bottom: 4px solid var(--brass); box-shadow: 0 4px 0 rgba(0,0,0,.45); }
.btn-group.is-right { background: #d8f0e1; border-bottom-color: var(--ok); }
.btn-group.is-wrong { background: #fbe3dd; border-bottom-color: var(--bad); }
.sorting.is-done .btn-group { pointer-events: none; }
.sorting.is-done .btn-group:not(.is-right):not(.is-wrong) { opacity: .4; }
.sort-result { margin: 10px 0 0; padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.3); font-size: 15px; line-height: 1.4; text-align: center; }
.sort-result strong { color: var(--corn); }

/* ---------- Bet Your Gavel: how sure are you? ---------- */
.betting { margin-top: 22px; }
.bet-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn-bet { padding: 11px 6px; font-size: 15px; background: var(--paper); color: var(--ink); border-bottom: 4px solid var(--brass); box-shadow: 0 4px 0 rgba(0,0,0,.45); line-height: 1.2; }
.btn-bet small { display: block; margin-top: 3px; font-size: 12px; font-weight: 400; color: var(--ink-soft); }
.btn-bet-max { background: var(--corn); color: var(--wood-dark); }
.btn-bet-max small { color: var(--wood-dark); }
.btn-bet.is-picked { outline: 3px solid #fff; outline-offset: 2px; }
.betting.is-done .btn-bet { pointer-events: none; }
.betting.is-done .btn-bet:not(.is-picked) { opacity: .4; }

/* confident and wrong: the biggest reaction in the game */
.app.quake { animation: quake .6s ease; }
@keyframes quake { 0%,100% { transform: none; } 15% { transform: translate(-8px, 4px) rotate(-1deg); } 30% { transform: translate(8px, -3px) rotate(1deg); } 45% { transform: translate(-6px, 2px); } 60% { transform: translate(5px, -2px); } 80% { transform: translate(-2px, 1px); } }
.stamp.is-shock { color: var(--bad); font-size: 34px; background: #fbe3dd; }

/* ---------- But WHY?: pick the real reason ---------- */
.whybox { margin-top: 22px; }
.btn-why { padding: 15px 8px; font-size: 16px; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.45); }
.btn-why.is-picked { outline: 3px solid #fff; outline-offset: 2px; }
.whybox.is-done .btn-why { pointer-events: none; }
.whybox.is-done .btn-why:not(.is-picked):not(.is-real) { opacity: .5; }
/* after the pick: the real reason's button goes green, a wrong pick goes red */
.btn-why.is-real { background: #d8f0e1; border-bottom-color: var(--ok); }
.btn-why.is-wrong { background: #fbe3dd; border-bottom-color: var(--bad); }
.why-next { margin-top: 14px; }

/* ---------- pre-trial (Torn Evidence, Sealed Envelope) ---------- */
.pretrial-says { margin-top: 16px; }
.pretrial-title { font-family: "Alfa Slab One", serif; font-weight: 400; font-size: 28px; margin: 6px 0 6px; color: var(--corn); }
.pretrial-title small { font-family: "Atkinson Hyperlegible", sans-serif; font-size: 14px; color: var(--paper); opacity: .8; }
.pretrial-help { margin: 0 0 4px; font-size: 15px; line-height: 1.45; opacity: .9; }
.case-sealed { margin: 4px 0 6px; font-weight: 700; color: var(--ink-soft); }

/* torn case file: each gap is a button that holds a word tile */
.torn-file { transform: rotate(.4deg); }
.torn-file .case-notes li { margin-bottom: 10px; }
.gap { display: inline-block; min-width: 88px; min-height: 28px; margin: 0 2px; padding: 2px 8px; vertical-align: baseline;
  border: 2px dashed var(--brass); border-radius: 8px; background: #fff8e6; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.gap.is-armed { outline: 3px solid var(--corn); outline-offset: 1px; }
.gap.is-filled { border-style: solid; background: #fbf0c7; }
.gap.is-right { border-color: var(--ok); background: #d8f0e1; cursor: default; }
.gap.is-wrong { border-color: var(--bad); background: #fbe3dd; cursor: default; }
.gap s { opacity: .6; font-weight: 400; }
/* the tray sticks to the bottom of the screen, so the words stay in reach
   while you scroll the case file on a phone */
.tile-tray { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 48px;
  margin: 0 -16px 14px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(46,28,16,.92), var(--wood-dark)); border-top: 2px solid rgba(217,164,59,.45); }
.tile-tray:empty { display: none; }
.tile { padding: 9px 14px; border-radius: 10px; border: 0; background: var(--paper); color: var(--ink); font-weight: 700; font-size: 15px; cursor: grab;
  box-shadow: 0 3px 0 var(--paper-edge), 0 6px 12px rgba(0,0,0,.3); transform: rotate(-1.5deg); }
.tile:nth-child(even) { transform: rotate(1.5deg); }
.tile.is-selected { outline: 3px solid var(--corn); outline-offset: 2px; transform: translateY(-3px); }
.tile:focus-visible, .gap:focus-visible { outline: 3px solid var(--corn); outline-offset: 2px; }

/* the sealed envelope */
.env-card { margin-top: 34px; /* room for the seal poking out the top */ background: var(--paper); color: var(--ink); border-radius: 18px; padding: 18px 16px 16px; box-shadow: var(--shadow); text-align: center; border-top: 6px solid var(--gavel); }
.env-seal { width: 54px; height: 54px; margin: -44px auto 8px; border-radius: 50%; background: var(--gavel); color: #fff; font-size: 26px; line-height: 54px; box-shadow: 0 3px 0 #7d2416; }
.env-q { display: block; font-family: "Alfa Slab One", serif; font-size: 19px; line-height: 1.3; margin: 0 0 12px; }
.env-input { width: 100%; padding: 12px; margin: 0 0 10px; border-radius: 12px; border: 2px solid var(--paper-edge); background: #fff; color: var(--ink); font: 17px "Atkinson Hyperlegible", sans-serif; text-align: center; }
.env-input:focus { outline: 3px solid var(--corn); outline-offset: 1px; }
.env-input.is-bad { border-color: var(--bad); box-shadow: 0 0 0 2px var(--bad); }
.env-card .field-error { margin: 0 0 10px; }
.env-reveal { text-align: left; }
.env-reveal .stamp { display: table; margin: 0 auto; }

/* ---------- verdict sheet ---------- */
.sheet { position: fixed; left: 50%; bottom: 0; width: min(560px, 100%); transform: translateX(-50%); background: var(--paper); color: var(--ink); border-radius: 22px 22px 0 0; padding: 22px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -12px 40px rgba(0,0,0,.5); z-index: 20; max-height: 88vh; overflow-y: auto; /* short screens can still reach "Next" */ animation: sheetUp .35s cubic-bezier(.2,.9,.3,1.2) both; }
.sheet[hidden] { display: none; }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.stamp { display: inline-block; font-family: "Alfa Slab One", serif; font-size: 26px; letter-spacing: 1px; padding: 4px 14px; border: 4px solid currentColor; border-radius: 8px; transform: rotate(-4deg); animation: stamp .35s cubic-bezier(.3,1.6,.5,1) both; }
.stamp.is-ok { color: var(--ok); }
.stamp.is-bad { color: var(--bad); }
@keyframes stamp { from { transform: rotate(-4deg) scale(1.8); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
.verdict-bet { display: inline-block; margin: 12px 0 0 8px; padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: 14px; background: #efe2c4; vertical-align: 6px; }
.verdict-bet.is-up { color: var(--ok); }
.verdict-bet.is-down { color: var(--bad); }
.verdict-answer { margin: 14px 0 6px; font-weight: 700; font-size: 17px; }
.verdict-explain { margin: 0 0 12px; font-size: 16px; line-height: 1.45; }
.verdict-note { margin: 0 0 16px; padding: 10px 12px; background: #efe2c4; border-left: 4px solid var(--brass); border-radius: 8px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.verdict-note span:first-child { display: block; font-weight: 700; color: var(--ink); margin-bottom: 2px; }

/* ---------- stage card ---------- */
.stage-card { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(20,12,6,.82); backdrop-filter: blur(3px); }
.stage-card[hidden] { display: none; }
.stage-card-inner { width: min(460px, 100%); text-align: center; background: var(--paper); color: var(--ink); border-radius: 22px; padding: 26px 20px 20px; box-shadow: var(--shadow); animation: pop .45s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes pop { from { transform: scale(.7) rotate(-3deg); opacity: 0; } to { transform: none; opacity: 1; } }
.stage-num { font-weight: 700; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--ink-soft); }
.stage-name { font-family: "Alfa Slab One", serif; font-weight: 400; font-size: 34px; margin: 6px 0 10px; color: var(--gavel); }
.stage-desc { font-size: 16px; line-height: 1.5; margin: 0 0 18px; }
.stage-desc strong { background: var(--corn); padding: 1px 6px; border-radius: 5px; }

/* ---------- end card ---------- */
.end-card { margin-top: 22px; background: var(--paper); color: var(--ink); border-radius: 22px; padding: 22px 18px; box-shadow: var(--shadow); text-align: center; border: 6px double var(--brass); }
.end-kicker { font-weight: 700; letter-spacing: 2px; text-transform: uppercase; font-size: 13px; color: var(--ink-soft); }
.end-score { font-family: "Alfa Slab One", serif; font-size: 64px; line-height: 1; margin: 8px 0 2px; color: var(--gavel); }
.end-score small { display: block; font-family: "Atkinson Hyperlegible", sans-serif; font-size: 14px; color: var(--ink-soft); font-weight: 700; }
.end-rank { font-family: "Alfa Slab One", serif; font-size: 22px; margin: 8px 0 4px; }
.end-right { margin: 0 0 14px; color: var(--ink-soft); }
.end-sure { background: #fbe3dd; border: 1px solid var(--bad); }
.end-sure strong { display: block; margin-bottom: 2px; }
.end-mastery, .end-grudge, .end-sure { text-align: left; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; font-size: 14.5px; line-height: 1.45; }
.end-mastery { background: #fbf0c7; border: 1px solid var(--corn); }
.end-grudge { background: var(--rocco-tint); border: 1px dashed var(--rocco-body); }
.end-mastery strong, .end-grudge strong { display: block; margin-bottom: 2px; }
.end-list { list-style: none; margin: 0 0 14px; padding: 0; text-align: left; font-size: 14.5px; }
.end-list li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--paper-edge); }
.end-list li:last-child { border-bottom: 0; }
.end-list .mark { flex: 0 0 22px; font-weight: 700; }
.end-list .ok { color: var(--ok); }
.end-list .bad { color: var(--bad); }
.end-brand { font-family: "Alfa Slab One", serif; font-size: 14px; color: var(--ink-soft); }
.end-actions { margin-top: 18px; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 40; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }
.foot { margin-top: 22px; text-align: center; font-size: 13px; }
.foot-line { margin: 0 0 6px; opacity: .75; }
.money { margin: 0 0 12px; opacity: .85; }
.support-note { margin-top: 18px; text-align: center; font-size: 14.5px; line-height: 1.4; }
.support-note p { margin: 0 0 10px; }
.support-note .btn { display: block; text-decoration: none; }
.socials { display: flex; justify-content: center; gap: 6px; }
/* 44px tap targets, though the icons themselves are smaller */
.socials a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; color: var(--paper); opacity: .8; transition: opacity .15s, color .15s; }
.socials a:hover { opacity: 1; color: var(--corn); }
.socials a:focus-visible { outline: 3px solid var(--corn); outline-offset: 1px; opacity: 1; }
.socials svg { width: 22px; height: 22px; fill: currentColor; }

/* small phones: tighter bubbles */
@media (max-width: 380px) {
  .bubble { font-size: 14px; min-height: 104px; padding: 9px 10px; }
  .btn-rule { font-size: 15px; }
}

/* Respect "reduce motion": no bobbing, slamming or shaking. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* read by screen readers, not shown (the page title already says it) */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* no scrollbar on the empty box: it only flashes up because the hint text wraps */
.notes-box:placeholder-shown:not(:focus) { overflow: hidden; }
.file-meta span { white-space: nowrap; }

/* Cloudflare's human check: takes no space unless a tick box appears */
.human-check { display: flex; justify-content: center; }
.human-check:has(iframe) { margin-bottom: 10px; }
