:root {
  --night: #1d1b2e; --night-2: #26233d; --panel: #2f2b4a; --panel-2: #3a3560; --wood: #5a3c2a; --wood-2: #3b2a22;
  --text: #f6f1e3; --soft: #c9c2e6; --dim: #9a93c2; --ink: #0d0c1a; --lamp: #ffb347; --gold: #ffd23f; --slime: #b9f26b; --red: #ff5a5f;
  --roar: #ff5a36; --stomp: #f2b134; --sneak: #8a6cff;
  --display: Bangers, Impact, "Arial Black", "Helvetica Neue", system-ui, sans-serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --chunk: 3px solid var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--night); }
body { margin: 0; color: var(--text); background: radial-gradient(circle at 50% -10%, #3a2a3a 0, var(--night) 60%) fixed, var(--night); font-family: var(--sans); line-height: 1.5; }
button, a { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 4px solid var(--gold); outline-offset: 3px; border-radius: 10px; }
[tabindex="-1"]:focus { outline: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.art svg, .pic svg, .map-art svg, .mv-ico svg, .daily-art svg, .train-art svg, .end-art svg { stroke: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 9; padding: 10px 14px; border-radius: 12px; background: var(--gold); color: var(--ink); font-weight: 800; text-decoration: none; }
.skip:focus { top: 10px; }

.app { max-width: 1040px; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding-right: 10px; text-decoration: none; font-size: 14px; font-weight: 700; color: var(--soft); }
.back svg { width: 20px; height: 20px; }
.tools { display: flex; gap: 8px; align-items: center; }
.kid .mk-chip { color: var(--slime); border-color: #b9f26b88; background: #b9f26b14; max-width: 52vw; }
.kid .mk-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 2px solid #ffffff33; background: var(--panel); color: var(--text); }
.icon svg { width: 22px; height: 22px; }
#sound[aria-pressed="false"] .wave { opacity: .25; }

.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 560px; margin: 4px 0 0; }
.places > a, .places > span { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; padding: 6px 4px 5px; border: 2px solid #ffffff22; border-radius: 14px; background: var(--night-2); color: var(--soft); font-size: 12.5px; font-weight: 700; line-height: 1.1; text-decoration: none; }
.places svg { width: 22px; height: 22px; }
.places .here { border: var(--chunk); background: var(--slime); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
@media (hover: hover) { .places > a:hover { border-color: var(--gold); color: var(--text); } }

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .03em; line-height: 1; margin: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 20px; border-radius: 14px; border: var(--chunk); background: var(--panel-2); color: var(--text); font-weight: 900; font-size: 16px; text-decoration: none; box-shadow: 0 4px 0 var(--ink); }
.btn.primary { background: var(--gold); color: var(--ink); }
.btn.small { min-height: 46px; padding: 0 12px; font-size: 14px; }
.btn.small svg { width: 18px; height: 18px; }
.btn[aria-pressed="true"] { background: var(--slime); color: var(--ink); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

/* ---------- the hub: hero, map, rooms ---------- */
.hero { padding: 18px 0 10px; }
.club-tag { display: inline-block; margin: 0 0 8px; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--ink); background: var(--slime); color: var(--ink); font-family: var(--display); font-size: 18px; letter-spacing: .05em; transform: rotate(-2deg); box-shadow: 0 3px 0 var(--ink); }
.hero h1 { font-size: clamp(52px, 9vw, 88px); color: var(--gold); text-shadow: 3px 3px 0 var(--ink), 6px 6px 0 #ff5a3655; }
.hero-line { margin: 6px 0 0; font-size: 16.5px; color: var(--soft); max-width: 52ch; }
.hero-line b { color: var(--slime); }
.first-duel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 14px 0 4px; }
.first-duel[hidden] { display: none; }
.first-go { min-height: 60px; padding: 0 26px; font-family: var(--display); font-size: 26px; letter-spacing: .04em; }
.first-learn { display: inline-flex; align-items: center; min-height: 44px; color: var(--soft); font-weight: 700; }
.tip-skip { margin: -5px 0 -5px 6px; vertical-align: middle; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--ink); background: var(--slime); color: var(--ink); font: inherit; font-weight: 900; cursor: pointer; }
.progress { display: inline-block; margin: 10px 0 0; padding: 6px 14px; border-radius: 999px; border: 2px solid var(--ink); background: var(--panel); font-weight: 800; font-size: 14px; color: var(--gold); }

.map { position: relative; margin-top: 10px; aspect-ratio: 400 / 260; border-radius: 22px; border: var(--chunk); overflow: hidden; box-shadow: 0 6px 0 var(--ink), 0 18px 40px #0008; background: #2a1f2d; }
.map-art, .map-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.spot { position: absolute; transform: translate(-50%, -50%); display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 64px; padding: 4px 12px; border-radius: 999px; border: 2.5px solid var(--ink); background: #fffdf3; color: var(--ink); font-weight: 900; font-size: 13px; text-decoration: none; box-shadow: 0 3px 0 var(--ink); white-space: nowrap; z-index: 2; }
.spot:hover { background: var(--gold); }
.eyes { position: absolute; transform: translate(-50%, -50%); width: 56px; height: 48px; border-radius: 50%; border: 2px dashed transparent; background: transparent; z-index: 2; font-size: 0; }
.eyes:hover, .eyes:focus-visible { border-color: var(--slime); background: #b9f26b22; font-size: 18px; }
.map-say { min-height: 1.5em; margin: 10px 0 0; font-weight: 800; color: var(--slime); }
.rafter-eyes.blink { animation: blink .5s ease-in-out 2; }
.rafter-eyes.found ellipse { fill: var(--gold); }

.rooms { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 14px 0 4px; }
.rooms a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; padding: 6px 2px; border-radius: 14px; border: 2px solid #ffffff2a; background: var(--panel); color: var(--soft); font-size: 12.5px; font-weight: 800; line-height: 1.1; text-align: center; text-decoration: none; box-shadow: 0 3px 0 var(--ink); }
.rooms a span { font-size: 22px; line-height: 1; display: inline-flex; }.rooms a span img, .club img, .medal img { display: block; }.club img { flex: none; }
.rooms a[aria-current="true"] { border: var(--chunk); background: var(--gold); color: var(--ink); box-shadow: 0 4px 0 var(--ink); transform: translateY(-2px); }
.rooms a:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
@media (hover: hover) { .rooms a:not([aria-current]):hover { border-color: var(--gold); color: var(--text); } }
@media (min-width: 640px) { .rooms { gap: 10px; } .rooms a { flex-direction: row; gap: 8px; min-height: 58px; font-size: 16px; } .rooms a span { font-size: 24px; } }
.spot.on { background: var(--gold); transform: translate(-50%, -50%) scale(1.08); }

.room { margin-top: 10px; padding: 18px; border-radius: 22px; border: var(--chunk); background: linear-gradient(var(--panel), var(--night-2)); box-shadow: 0 6px 0 var(--ink); }
.room-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.room-head h2 { font-size: clamp(32px, 5vw, 44px); color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.room-head p { margin: 0; color: var(--soft); font-size: 14.5px; }

.crew-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.mon { position: relative; width: 100%; min-height: 196px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; border-radius: 18px 18px 14px 14px; border: var(--chunk); background: linear-gradient(#5a3c2a, #3b2a22); color: var(--text); text-align: center; box-shadow: 0 5px 0 var(--ink); transition: transform .15s; }
.mon::before { content: ""; position: absolute; inset: 6px; border-radius: 12px 12px 8px 8px; border: 2px solid #ffffff14; pointer-events: none; }
.mon .door-no { position: absolute; top: 6px; left: 8px; min-width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--gold); font: 400 16px/26px var(--display); }
.mon .art { width: 100px; height: 100px; }
.mon .art svg { width: 100%; height: 100%; }
.mon b { font-family: var(--display); font-weight: 400; font-size: 26px; letter-spacing: .03em; line-height: 1; }
.mon small { font-size: 12.5px; color: #e9dcc9; line-height: 1.35; }
.mon .st { font-size: 17px; letter-spacing: 2px; color: var(--gold); }
.mon .st .off { color: #ffffff40; }
.mon.next { background: linear-gradient(#7a4b2a, #5a3c22); outline: 3px solid var(--slime); outline-offset: 2px; }
.mon.next::after { content: "Next!"; position: absolute; top: -12px; right: 10px; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); background: var(--slime); color: var(--ink); font-size: 12px; font-weight: 900; }
.mon.secret { background: linear-gradient(#1f5b55, #163a37); }
.mon[aria-disabled="true"] { background: #24212f; cursor: default; box-shadow: 0 3px 0 var(--ink); }
.mon[aria-disabled="true"] small { color: var(--dim); }
@media (hover: hover) { .mon:not([aria-disabled="true"]):hover { transform: translateY(-4px); } }
.hub-say { min-height: 1.4em; margin: 10px 0 0; font-weight: 800; color: var(--gold); }

.beats-how { margin: 12px 0 0; padding-left: 0; list-style: none; display: grid; gap: 8px; }
.beats-how li { padding: 10px 14px; border-radius: 14px; background: #ffffff0d; border: 2px solid #ffffff1a; }
.beats-how b { color: var(--gold); }
.circle { list-style: none; margin: 14px 0 8px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.circle li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: var(--chunk); font-size: 15px; color: var(--ink); background: var(--mv); box-shadow: 0 4px 0 var(--ink); }
.circle li b { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: .04em; }
.mv-roar { --mv: #ff8a6b; --mvd: var(--roar); } .mv-stomp { --mv: #ffd36b; --mvd: var(--stomp); } .mv-sneak { --mv: #b6a4ff; --mvd: var(--sneak); }
.mv-ico { display: inline-grid; place-items: center; flex: none; width: 42px; height: 42px; }
.mv-ico svg { width: 100%; height: 100%; }
.powers { margin: 10px 0 0; padding-left: 20px; color: var(--soft); }
.powers b { color: var(--text); }
.train-card { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; margin-top: 14px; padding: 12px; border-radius: 16px; background: #00000033; }
.train-art { width: 110px; height: 110px; }
.train-art svg { width: 100%; height: 100%; }
.train-card p { margin: 0 0 8px; }
.train-done { color: var(--slime); font-weight: 800; }

.daily { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; margin-top: 12px; padding: 14px; border-radius: 16px; background: #c99a6b; color: var(--ink); border: var(--chunk); box-shadow: 0 4px 0 var(--ink); }
.daily-art { width: 92px; height: 92px; }
.daily-art svg { width: 100%; height: 100%; }
.daily p { margin: 4px 0 0; font-size: 15.5px; }
.daily-line { font-weight: 800; font-size: 17px !important; }
.daily-done { font-weight: 800; }
.daily-count { font-size: 13.5px !important; opacity: .8; }

.trophies { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trophies li { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 14px; border: 2px dashed #ffffff30; background: #00000026; color: var(--dim); min-height: 120px; }
.trophies li .medal { font-size: 28px; filter: grayscale(1); opacity: .6; }
.trophies li b { color: var(--soft); font-size: 15px; }
.trophies li small { font-size: 12.5px; }
.trophies li.got { border: var(--chunk); background: linear-gradient(#ffd23f, #f2a541); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.trophies li.got .medal { filter: none; opacity: 1; }
.trophies li.got b { color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 14px 0 0; }
.stats div { padding: 8px 10px; border-radius: 12px; background: #ffffff0d; }
.stats dt { font-size: 12px; color: var(--dim); font-weight: 700; }
.stats dd { margin: 0; font: 400 26px var(--display); color: var(--gold); }

.fighters { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-top: 12px; }
.fighter { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 120px; padding: 8px; border-radius: 16px; border: 2px solid #ffffff2a; background: var(--night-2); color: var(--text); font-weight: 800; }
.fighter .art { width: 72px; height: 72px; }
.fighter .art svg { width: 100%; height: 100%; }
.fighter small { color: var(--slime); font-size: 12px; }
.fighter[aria-checked="true"] { border: var(--chunk); background: var(--slime); color: var(--ink); box-shadow: 0 4px 0 var(--ink); }
.fighter[aria-checked="true"] small { color: var(--ink); }

.club { display: flex; align-items: center; gap: 8px; margin: 18px 0 0; padding: 12px 16px; min-height: 52px; border-radius: 14px; border: var(--chunk); background: #c99a6b; color: var(--ink); font-weight: 800; font-size: 14.5px; text-decoration: none; box-shadow: 0 4px 0 var(--ink); }
.save-note { margin: 8px 0 0; font-size: 13.5px; color: #ffb4a2; font-weight: 700; }
.save-note:empty { display: none; }

/* ---------- a duel ---------- */
.duel { margin-top: 10px; }
.duel-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.duel-top h2 { text-align: center; font-size: clamp(26px, 5vw, 42px); color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.beats { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0 0; padding: 0; }
.beats li { text-align: center; padding: 4px 2px; border-radius: 999px; background: #ffffff10; color: var(--dim); font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.beats li.on { background: var(--gold); color: var(--ink); }
.arena { position: relative; display: grid; grid-template-columns: 1fr minmax(84px, auto) 1fr; align-items: end; gap: 4px; margin-top: 8px; padding: 50px 10px 10px; border-radius: 22px; border: var(--chunk); overflow: hidden; box-shadow: 0 6px 0 var(--ink);
  background: radial-gradient(ellipse at 50% 30%, #ffb34733, transparent 60%), linear-gradient(#2a1f2d, #3b2a22 70%, #7a1f2b 70.3%, #5e1720); }
.arena::before { content: ""; position: absolute; inset: 0 0 auto; height: 44px; background: repeating-linear-gradient(90deg, transparent 0 70px, #5a3c2a 70px 80px); opacity: .7; pointer-events: none; }
.side { margin: 0; display: flex; flex-direction: column; align-items: center; position: relative; }
.side .pic { width: min(100%, 220px); aspect-ratio: 1; }
.side .pic svg { width: 100%; height: 100%; overflow: visible; }
.side figcaption { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 2px; padding: 6px 10px; border-radius: 14px; background: #0d0c1acc; border: 2px solid #ffffff22; min-width: 0; max-width: 100%; }
.side figcaption b { font-family: var(--display); font-weight: 400; font-size: 24px; letter-spacing: .03em; line-height: 1; text-align: center; }
.hearts { display: flex; gap: 3px; font-size: 22px; line-height: 1; }
.hearts i { font-style: normal; color: var(--red); }
.hearts i.off { color: #ffffff40; }
.hearts i.inf { color: var(--slime); font-weight: 900; }
.grit { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; max-width: 120px; }
.grit i { width: 14px; height: 18px; border-radius: 4px 4px 7px 7px; border: 2px solid var(--ink); background: #ffffff20; }
.grit i.on { background: linear-gradient(#ff8a6b, #c7362e); }
.grit i.crack { background: #fff; }
.meters { display: flex; gap: 6px; align-items: center; }
.combo { display: flex; gap: 1px; font-size: 13px; }
.combo i { font-style: normal; filter: grayscale(1); opacity: .35; }
.combo i.on { filter: none; opacity: 1; }
.charge { font-size: 12px; font-weight: 900; padding: 1px 6px; border-radius: 999px; background: var(--gold); color: var(--ink); }
.trust { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--soft); }
.trust .dots { display: inline-flex; gap: 2px; }
.trust .dots i { width: 8px; height: 8px; border-radius: 50%; background: #ffffff30; }
.trust .dots i.on { background: var(--slime); }
.clash { align-self: center; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; text-align: center; z-index: 3; }
.clash .vs, .clash .count, .clash .locked { font-family: var(--display); color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.clash .vs { font-size: 34px; }
.clash .count { font-size: 64px; line-height: 1; }
.clash .locked { font-size: 22px; color: var(--slime); }
.clash .mv { display: flex; flex-direction: column; align-items: center; padding: 4px 6px; border-radius: 12px; border: 2.5px solid var(--ink); background: var(--mv); color: var(--ink); }
.clash .mv svg { width: 34px; height: 34px; }
.clash .mv b { font: 400 15px var(--display); letter-spacing: .04em; }
.clash.reveal .vs { font-size: 18px; }
.clash .fib { font-size: 12px; font-weight: 900; padding: 2px 8px; border-radius: 999px; background: var(--red); color: #fff; }
.clash .stamp { font: 400 clamp(26px, 6vw, 46px)/1 var(--display); letter-spacing: .03em; padding: 6px 10px; border-radius: 12px; border: var(--chunk); transform: rotate(-6deg); box-shadow: 0 4px 0 var(--ink); }
.clash .stamp.win { background: var(--slime); color: var(--ink); }
.clash .stamp.lose { background: var(--red); color: #fff; }
.clash .stamp.tie { background: var(--gold); color: var(--ink); }
.clash .dmg { font: 400 28px var(--display); color: #fff; text-shadow: 2px 2px 0 var(--ink); }
.tell-bubble { position: absolute; top: -44px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; padding: 4px 14px 4px 6px; border-radius: 18px; border: var(--chunk); background: var(--mv, #fffdf3); color: var(--ink); font-family: var(--display); font-size: 26px; letter-spacing: .03em; white-space: nowrap; z-index: 2; box-shadow: 0 4px 0 var(--ink); }
.tell-bubble::after { content: ""; position: absolute; left: 50%; bottom: -10px; width: 14px; height: 14px; background: var(--mv, #fffdf3); border-right: 3px solid var(--ink); border-bottom: 3px solid var(--ink); transform: translateX(-50%) rotate(45deg); }
.tell-bubble .mv-ico { width: 34px; height: 34px; }
.tell-bubble.hidden { visibility: hidden; }
.voice { min-height: 1.5em; margin: 10px 0 0; text-align: center; font-size: 15.5px; color: var(--gold); font-style: italic; }
.voice b { font-style: normal; color: var(--text); }
.intel { display: grid; gap: 4px; margin-top: 4px; }
.tell { margin: 0; text-align: center; font-size: 16.5px; font-weight: 800; }
.habit { margin: 0 auto; max-width: 62ch; text-align: center; font-size: 14.5px; color: var(--soft); padding: 6px 12px; border-radius: 12px; background: #ffffff0d; border: 2px dashed #ffffff22; }
.habit b { color: var(--slime); }
.habit:empty { display: none; }

.moves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.move { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 112px; padding: 10px 6px; border-radius: 18px; border: var(--chunk); background: var(--mv); color: var(--ink); box-shadow: 0 6px 0 var(--ink); transition: transform .12s, filter .12s, opacity .12s; }
.move .mv-ico { width: 50px; height: 50px; }
.move b { font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: .04em; line-height: 1; }
.move small { font-size: 12.5px; font-weight: 700; }
.move kbd { position: absolute; top: 6px; left: 8px; font: 800 12px var(--sans); padding: 1px 5px; border-radius: 5px; border: 2px solid var(--ink); background: #fffdf3aa; }
.move .try { display: none; position: absolute; top: -12px; right: 8px; padding: 1px 8px; border-radius: 999px; border: 2px solid var(--ink); background: var(--slime); color: var(--ink); font: 900 12px var(--sans); font-style: normal; }
.move.suggest { outline: 4px dashed var(--slime); outline-offset: 4px; }
.move.suggest .try { display: block; }
.move:active:not([aria-disabled="true"]) { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.move[aria-disabled="true"] { cursor: default; }
.move.dim { filter: saturate(.3) brightness(.6); }
.move.chosen { transform: translateY(-8px); box-shadow: 0 0 0 4px var(--gold), 0 10px 0 var(--ink); }
.say { min-height: 3em; margin: 12px 0 0; text-align: center; font-size: 15.5px; font-weight: 600; color: var(--soft); }
.say b { font-weight: 900; color: var(--text); }
.history { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 0; padding: 0; }
.history li { padding: 3px 10px; border-radius: 999px; border: 2px solid #ffffff22; background: var(--night-2); font-size: 12.5px; font-weight: 700; }
.history li.win { background: #2e5a2a; } .history li.lose { background: #6a2328; } .history li.tie { background: #6a5520; }

.end { margin-top: 14px; padding: 18px 20px; border-radius: 22px; border: var(--chunk); background: linear-gradient(var(--panel), var(--night-2)); box-shadow: 0 6px 0 var(--ink); text-align: center; }
.end-art { width: 120px; height: 120px; margin: -6px auto 0; }
.end-art svg { width: 100%; height: 100%; }
.kicker { margin: 0; font-size: 12px; letter-spacing: .16em; text-transform: uppercase; font-weight: 900; color: var(--slime); }
.end h3 { margin: 4px 0 6px; font-size: clamp(34px, 6vw, 48px); color: var(--gold); text-shadow: 2px 2px 0 var(--ink); }
.stars { margin: 0 0 4px; font-size: 38px; letter-spacing: 4px; color: #ffffff30; }
.stars .on { color: var(--gold); text-shadow: 0 2px 0 var(--ink); }
#end-line { margin: 0 auto 10px; max-width: 54ch; font-size: 15.5px; }
.end-trophies { list-style: none; margin: 0 auto 10px; padding: 0; display: grid; gap: 6px; max-width: 460px; }
.end-trophies li { padding: 8px 12px; border-radius: 12px; border: var(--chunk); background: var(--gold); color: var(--ink); font-size: 14px; }
.end-daily { margin: 0 auto 10px; padding: 8px 12px; border-radius: 12px; background: var(--slime); color: var(--ink); font-weight: 800; display: inline-block; }
.end .club { justify-content: center; margin: 0 0 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.pop { position: fixed; left: 50%; top: 18%; transform: translateX(-50%); z-index: 50; padding: 10px 18px; border-radius: 16px; border: var(--chunk); background: var(--gold); color: var(--ink); font: 400 26px var(--display); letter-spacing: .03em; box-shadow: 0 5px 0 var(--ink); pointer-events: none; }

/* ---------- monster life (motion only when wanted) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .bob { animation: bob 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
  .pose-roar { animation: roar .45s cubic-bezier(.3, 1.6, .5, 1); transform-origin: 50% 100%; }
  .pose-stomp { animation: stomp .4s cubic-bezier(.5, 0, .7, 1.4); transform-origin: 50% 100%; }
  .pose-sneak { animation: duck .45s ease-out; transform-origin: 50% 100%; }
  .pose-win { animation: hop .45s cubic-bezier(.3, 1.6, .5, 1) 2; transform-origin: 50% 100%; }
  .pose-hit { animation: shake .4s ease-in-out; transform-origin: 50% 100%; }
  .pose-tamed { animation: hop .6s ease-in-out 3; transform-origin: 50% 100%; }
  .tell-bubble.bounce { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
  .clash .count { animation: zoom .2s ease-out; }
  .clash .stamp, .clash .mv { animation: slam .3s cubic-bezier(.3, 1.6, .5, 1); }
  .arena:has(.clash.hit.win) .them .pic, .arena:has(.clash.hit.lose) .you .pic { animation: shake .35s; }
  .grit i.crack { animation: crack .5s ease-out; }
  .mon .art svg, .fighter .art svg, .daily-art svg, .train-art svg { animation: bob 3s ease-in-out infinite; transform-origin: 50% 100%; }
  .twinkle { animation: twinkle 2.4s ease-in-out infinite; }
  .peek { animation: peek 5s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
  .rafter-eyes { animation: glint 6s ease-in-out infinite; }
  .pop { animation: popin .35s cubic-bezier(.3, 1.6, .5, 1); }
}
@keyframes bob { 0%, 100% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-3%) scale(1.01, .99); } }
@keyframes roar { 0% { transform: scale(1); } 40% { transform: scale(1.16, 1.1); } 100% { transform: scale(1); } }
@keyframes stomp { 0% { transform: translateY(-8%); } 60% { transform: translateY(2%) scale(1.06, .94); } 100% { transform: none; } }
@keyframes duck { 0% { transform: scale(1); } 50% { transform: translateX(-6%) scale(1.04, .86); } 100% { transform: none; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-10%); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5%) rotate(-3deg); } 75% { transform: translateX(5%) rotate(3deg); } }
@keyframes pop { 0% { transform: translateX(-50%) scale(.6); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes popin { 0% { transform: translateX(-50%) scale(.5); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes zoom { 0% { transform: scale(2); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes slam { 0% { transform: scale(1.8) rotate(-6deg); opacity: 0; } 100% { transform: scale(1) rotate(-6deg); opacity: 1; } }
@keyframes crack { 0% { background: #fff; transform: scale(1.4); } 100% { background: #ffffff20; transform: none; } }
@keyframes twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes peek { 0%, 70%, 100% { transform: translateY(0); } 80%, 90% { transform: translateY(-5%); } }
@keyframes glint { 0%, 88%, 100% { opacity: 1; } 92%, 96% { opacity: .1; } }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .05; } }

@media (min-width: 700px) and (min-height: 700px) {
  .side .pic { width: min(100%, 280px); }
  .move { min-height: 136px; }
  .move .mv-ico { width: 58px; height: 58px; }
  .move b { font-size: 38px; }
  .clash { min-width: 150px; }
  .clash .mv svg { width: 46px; height: 46px; }
}
@media (max-width: 760px) {
  .circle { grid-template-columns: 1fr; }
  .daily { grid-template-columns: auto 1fr; }
  .daily .btn { grid-column: 1 / -1; }
  .spot { font-size: 12px; padding: 2px 8px; min-width: 48px; }
}
@media (max-width: 520px) {
  .app { padding-left: 12px; padding-right: 12px; }
  .crew-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mon { min-height: 180px; }
  .mon .art { width: 84px; height: 84px; }
  .arena { padding: 48px 4px 8px; grid-template-columns: 1fr minmax(64px, auto) 1fr; }
  .side .pic { width: min(100%, 140px); }
  .side figcaption { padding: 4px 6px; }
  .side figcaption b { font-size: 18px; }
  .clash { min-height: 96px; }
  .clash .vs { font-size: 26px; }
  .clash .mv svg { width: 26px; height: 26px; }
  .tell-bubble { font-size: 20px; padding: 3px 10px 3px 4px; top: -42px; }
  .tell-bubble .mv-ico { width: 28px; height: 28px; }
  .move { min-height: 100px; }
  .move b { font-size: 26px; }
  .move small { font-size: 12px; }
  .duel-top h2 { font-size: 24px; }
  .train-card { grid-template-columns: 80px 1fr; }
  .train-art { width: 80px; height: 80px; }
  .tell { font-size: 15px; }
  .voice { font-size: 14px; margin-top: 6px; }
}
@media (min-width: 700px) and (min-height: 700px) and (max-height: 900px) and (orientation: landscape) {
  .side .pic { width: min(100%, 170px); }
  .arena { padding-top: 44px; }
  .move { min-height: 104px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .side .pic { width: min(100%, 140px); }
  .hero { padding-top: 8px; }
  .hero:has(#first-duel:not([hidden])) h1 { font-size: 44px; }
  .hero:has(#first-duel:not([hidden])) .hero-line { display: none; }
  .move { min-height: 84px; }
}
@media (forced-colors: active) {
  .move, .mon, .btn, .fighter, .spot, .rooms a { border: 2px solid ButtonText; }
  .move.suggest { outline: 3px dashed Highlight; }
  .rooms a[aria-current="true"], .spot.on { outline: 3px solid Highlight; }
  .grit i.on, .trust .dots i.on { background: Highlight; }
}
