/* Burn: cut paper on a lilac sky */
@font-face { font-family: "Young Serif"; font-display: swap; src: url(../fonts/young-serif-latin-400-normal.woff2) format("woff2"); }

:root {
  --bg: #E9E3F5;
  --card: #FFFFFF;
  --ink: #241F4D;
  --muted: #625C86;
  --line: #D3CBE8;
  --ground: #3D348B;
  --ground2: #2B2466;
  --target: #EE4266;
  --door: #1FB5A6;
  --flame: #FFC93C;
  --bolt: #FFC93C;
  --arc: #2EC4B6;
  --blast: #EE4266;
  --display: "Young Serif", Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #17142B; --card: #221E3D; --ink: #ECE8FA; --muted: #A59FC8; --line: #322C55; --ground: #5A50B8; --ground2: #3F378F; color-scheme: dark; }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ui); line-height: 1.45; min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--target); outline-offset: 2px; }

.wrap { max-width: 560px; margin: 0 auto; padding: 0 14px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 0; }
.back { text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.top-actions { display: flex; gap: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; }
.icon-btn:hover { background: var(--card); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.title-row { display: flex; align-items: baseline; justify-content: space-between; padding: 4px 0 8px; }
h1 { font-family: var(--display); font-weight: 400; font-size: 2.2rem; margin: 0; line-height: 1; }
.sub { margin: 0; color: var(--muted); font-size: 0.95rem; }

.hud { display: flex; justify-content: space-between; margin-bottom: 8px; }
.hud p { margin: 0; color: var(--muted); }
.hud b { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 1.4rem; margin-left: 4px; font-variant-numeric: tabular-nums; }

.stage { border-radius: 16px; overflow: hidden; background: linear-gradient(#F6F2FF, #DCD3F2); box-shadow: 0 1px 0 var(--line); }
@media (prefers-color-scheme: dark) { .stage { background: linear-gradient(#2A2550, #1B1838); } }
.level { width: 100%; display: block; }
.level .wall { fill: var(--ground); }
.level .wall-sh { fill: var(--ground2); }
.level .tgt { fill: var(--target); }
.level .tgt-eye { fill: #fff; }
.level .tgt.dead { opacity: 0; transition: opacity .25s; }
.level .door { fill: var(--door); }
.level .door.locked { fill: #9F98BF; }
.level .door-knob { fill: #fff; }
.level .me { transition: transform .13s ease-out; }
.level .body { fill: #fff; stroke: var(--ink); stroke-width: 2.5; stroke-linejoin: round; }
.level .flame { fill: var(--flame); }
.level .hang-ring { fill: none; stroke: var(--flame); stroke-width: 2; stroke-dasharray: 4 4; }
.level .shot { stroke: var(--flame); stroke-width: 4; stroke-linecap: round; animation: shot .35s ease-out forwards; }
@keyframes shot { from { opacity: 1; } to { opacity: 0; } }
.msg { color: var(--muted); font-size: 0.88rem; text-align: center; margin: 8px 0 0; min-height: 1.3em; }

.hand { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 10px; }
.cardbtn { border: 0; border-radius: 12px; padding: 10px 2px 8px; cursor: pointer; font-weight: 800; color: #241F4D; box-shadow: inset 0 -4px 0 rgba(0,0,0,.15); }
.cardbtn small { display: block; font-weight: 600; font-size: 0.7rem; opacity: .8; }
.cardbtn.B { background: var(--bolt); } .cardbtn.A { background: var(--arc); } .cardbtn.X { background: var(--blast); color: #fff; }
.cardbtn.sel { outline: 3px solid var(--ink); outline-offset: 2px; }
.cardbtn:disabled { background: var(--line); color: var(--muted); box-shadow: none; cursor: default; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.act { border: 0; border-radius: 12px; padding: 10px; cursor: pointer; text-align: left; background: var(--card); box-shadow: 0 1px 0 var(--line); }
.act b { display: block; font-size: 1.05rem; }
.act span { color: var(--muted); font-size: 0.85rem; }
.act.fire b { color: var(--target); } .act.burn b { color: #C98A00; }
@media (prefers-color-scheme: dark) { .act.burn b { color: var(--flame); } }
.pad { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; }
.move { width: 86px; height: 64px; border: 0; border-radius: 16px; background: var(--ink); color: var(--card); font-size: 1.5rem; cursor: pointer; touch-action: manipulation; }
.small { display: flex; gap: 8px; }
.tool { border: 1.5px solid var(--line); background: var(--card); border-radius: 12px; padding: 9px 14px; font-weight: 700; cursor: pointer; }
.tool.wide { width: 100%; margin-bottom: 12px; }
.go { width: 100%; border: 0; border-radius: 16px; padding: 14px; background: var(--ink); color: var(--card); font-weight: 800; font-size: 1.1rem; cursor: pointer; }

.card { background: var(--card); border-radius: 20px; padding: 20px 18px; box-shadow: 0 1px 0 var(--line); }
.done { margin-top: 14px; }
.kicker { margin: 0; color: var(--muted); font-weight: 600; }
.big { font-family: var(--display); font-size: 2.3rem; line-height: 1.1; margin: 6px 0 6px; }
.res-line { margin: 0 0 14px; }
.fine { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 10px 0 0; }

/* ads */
.ad-inline { margin-top: 26px; }
.ad-slot { display: block; margin: 0 auto; overflow: hidden; }
.ad-banner { width: 100%; max-width: 728px; min-height: 100px; }
.ad-slot.placeholder { border: 1.5px dashed var(--line); border-radius: 12px; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.ad-slot.placeholder::before { content: "Ad space " attr(data-size); }
.ad-slot.collapsed { min-height: 0; }
.ad-slot ins[data-ad-status="unfilled"] { display: none !important; }
.ad-label { font-size: 11px; color: var(--muted); text-align: center; margin: 0 0 4px; }

.foot { display: flex; justify-content: center; gap: 22px; padding: 26px 0 40px; color: var(--muted); font-size: 0.9rem; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.dlg { border: 0; border-radius: 16px; padding: 22px; width: min(440px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
.dlg::backdrop { background: rgba(14, 10, 30, .5); }
.dlg h2 { font-family: var(--display); font-weight: 400; margin: 0 0 10px; font-size: 1.6rem; }
.dlg p, .dlg li { color: var(--muted); }
.dlg b { color: var(--ink); }
.cards-help { padding-left: 18px; margin: 0 0 12px; }
.dlg .x { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; font-size: 26px; cursor: pointer; color: var(--muted); width: 40px; height: 40px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 0; }
.stats div { display: flex; flex-direction: column-reverse; background: var(--bg); border-radius: 10px; padding: 10px; }
.stats dt { color: var(--muted); font-size: 0.85rem; }
.stats dd { margin: 0; font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .level .me, .level .tgt.dead, .toast { transition: none; } .level .shot { animation: none; opacity: 0; } }
