/* ===========================================================
 *  FROST DERBY  —  styles (standalone; the character art classes are shared with style.css)
 * =========================================================== */
:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #1f2733;
  --muted: #6f7a8b;
  --line: #dde4ec;
  --soft: #eef2f6;
  --accent: #2f6fd6;
  --gold: #e8b23a;
  --radius: 14px;

  --s-freezing: #2f6fd6;
  --s-cold: #5b9be6;
  --s-chilly: #a9cdf2;
  --s-comfy: #6cc28a;
  --s-warm: #f2c46a;
  --s-hot: #f08a4b;
  --s-overheating: #e04b3c;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -200px, #ffffff, var(--bg));
  background-color: var(--bg);
  color: var(--ink); font-size: 14px; min-height: 100vh;
}
h1, h2, h3 { margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
h3 { font-size: 18px; margin-bottom: 8px; }
p { margin: 6px 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; }
.bad { color: var(--s-overheating); }
.good { color: #2f8a52; }
.note { background: #fff7e0; border: 1px solid #f2dfa6; border-radius: 10px; padding: 8px 12px; font-size: 13px; }
.note.bad { background: #fde9e7; border-color: #f3c0ba; }
.note.good { background: #e6f6ec; border-color: #b9e2c7; color: #1f6b3d; }

/* ---------- top bar ---------- */
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo { color: var(--accent); }
.back-link { color: var(--muted); font-weight: 600; text-decoration: none; font-size: 13px; }
.back-link:hover { color: var(--ink); }
.chips { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.chip { background: var(--soft); border-radius: 999px; padding: 4px 10px; font-size: 12px; white-space: nowrap; }

#app { padding: 16px; max-width: 1400px; margin: 0 auto; }

/* ---------- generic ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.btn:hover:not(:disabled) { border-color: #b9c4d2; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary .muted { color: #c7cfdb; }
.btn.big { padding: 12px 18px; font-size: 15px; }
.btn.wide { width: 100%; justify-content: space-between; }
.link { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: 12px; padding: 0; align-self: flex-start; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.tag { display: inline-block; font-size: 10px; font-weight: 700; color: #8a5a00; background: #fff1cf; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.tag.bad { color: #9b2a1f; background: #fde3df; }
.seg-group { display: inline-flex; background: var(--soft); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg { border: 0; background: transparent; padding: 5px 12px; border-radius: 999px; font-weight: 600; color: var(--muted); }
.seg.active { background: var(--panel); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.go { border: 0; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 16px; padding: 14px; width: 100%; }
.go:hover { background: #2c384a; }
.screen-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
input[type=range] { width: 100%; }
select { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); font: inherit; background: var(--panel); }
.row-label { display: flex; justify-content: space-between; font-weight: 600; font-size: 13px; }

.face { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--soft); display: inline-grid; place-items: center; flex: none; }
.face svg { width: 100%; height: 100%; }
.face.xs { width: 22px; height: 22px; margin-left: -6px; border: 2px solid #fff; }
.face.lg { width: 72px; height: 72px; }

.loading { min-height: 50vh; display: grid; place-content: center; text-align: center; color: var(--muted); }
.spinner { font-size: 42px; color: var(--accent); animation: spin 1.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- title ---------- */
.title-screen { position: relative; min-height: calc(100vh - 100px); display: grid; place-items: center; overflow: hidden; border-radius: 20px;
  background: linear-gradient(180deg, #cfe2f5 0%, #eaf2fa 55%, #f8fbfe 100%); }
.title-lineup { position: absolute; inset: auto 0 0 0; display: flex; justify-content: center; gap: 0; opacity: .9; pointer-events: none; }
.title-girl { width: min(16vw, 220px); margin: 0 -1.5vw; }
.title-girl svg { width: 100%; height: auto; display: block; }
.title-card { position: relative; z-index: 2; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 20px;
  padding: 28px 32px; width: min(460px, 92%); margin-bottom: 18vh; box-shadow: 0 20px 50px rgba(30,60,100,.12); }
.title-card h1 { font-size: 44px; letter-spacing: -.04em; background: linear-gradient(90deg, #2f6fd6, #6cb6ef); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--muted); margin-bottom: 18px; }
.title-actions { display: flex; flex-direction: column; gap: 8px; }
.title-actions .btn { justify-content: space-between; }
.hof { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }
.hof h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.hof-row { display: grid; grid-template-columns: auto auto auto 1fr; align-items: center; gap: 8px; }
.rank { font-weight: 800; border-radius: 6px; padding: 0 6px; font-size: 12px; background: var(--soft); }
.rank-SS, .rank-S { background: #fff1cf; color: #8a5a00; }
.rank-A { background: #fde3d6; color: #9b4a1f; }
.rank-B { background: #e1ecfb; color: #2f5fa6; }

/* ---------- modal + toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(20,30,45,.4); display: none; place-items: center; z-index: 50; padding: 16px; }
.modal.show { display: grid; }
.modal-card { background: var(--panel); border-radius: 16px; padding: 20px 22px; width: min(620px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-card ul { padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.story-face { float: right; margin-left: 10px; }
.choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.choices .btn { justify-content: space-between; text-align: left; }
.fx { font-size: 11px; font-weight: 500; opacity: .75; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; border-radius: 12px; padding: 10px 16px;
  max-width: min(520px, 92vw); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- pick ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.pick-card { display: grid; grid-template-columns: 130px 1fr; gap: 12px; text-align: left; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 10px; transition: border-color .12s, transform .1s; }
.pick-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pick-art svg { width: 100%; height: auto; display: block; }
.pick-name { font-weight: 800; font-size: 18px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin: 6px 0; }
.mini-stats i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; }
.mini-stats em { color: #2f8a52; font-style: normal; font-size: 10px; font-weight: 700; margin-left: 2px; }

/* ---------- hub ---------- */
.hub { display: grid; grid-template-columns: 290px 1fr 250px; gap: 14px; align-items: start; }
.hub-art { height: 300px; display: grid; place-items: center; background: linear-gradient(180deg, #e3eef9, #f6f9fc); border-radius: 12px; overflow: hidden; }
.hub-art svg { height: 100%; width: 100%; }
.hub-name { font-weight: 800; font-size: 18px; }
.meter-row { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.meter-row > span:first-child { width: 52px; }
.meter { flex: 1; height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; transition: width .3s; }
.mood { font-weight: 700; }
.mood-awful, .mood-bad { color: #9b4a1f; }
.mood-good, .mood-great { color: #2f8a52; }
.stats { display: flex; flex-direction: column; gap: 5px; }
.stat-row { display: grid; grid-template-columns: 90px 30px 50px 1fr; align-items: center; gap: 6px; font-size: 13px; }
.stat-name { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.stat-name i { width: 8px; height: 8px; border-radius: 50%; }
.stat-val { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }
.stat-val em { font-style: normal; font-size: 10px; color: #2f8a52; margin-left: 2px; }
.stat-bar { height: 6px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.stat-bar span { display: block; height: 100%; border-radius: 999px; }
.grade { font-weight: 800; font-size: 12px; text-align: center; border-radius: 6px; background: var(--soft); }
[class*="g-S"] { color: #b07800; } .g-Ap, .g-A { color: #c0532a; } .g-Bp, .g-B { color: #2f6fd6; } .g-Cp, .g-C { color: #2f8a52; }
.skill-list { display: flex; flex-wrap: wrap; gap: 4px; }
.skill-pill { background: var(--soft); border-radius: 999px; padding: 2px 8px; }
.skill-pill.unique { background: linear-gradient(90deg, #fff1cf, #fde3d6); font-weight: 700; }

.hub-main { display: flex; flex-direction: column; gap: 12px; }
.week-head { flex-direction: row; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.week-dots { display: flex; gap: 3px; flex-wrap: wrap; }
.wd { width: 10px; height: 10px; border-radius: 3px; background: var(--soft); }
.wd.ev { background: #b8d0ee; } .wd.goal { background: var(--s-hot); }
.wd.past { opacity: .35; } .wd.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.week-events { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.event-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.event-card.goal { border-color: var(--s-hot); box-shadow: 0 0 0 1px var(--s-hot) inset; }
.event-card.compact { padding: 8px 10px; }
.ev-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.grade-badge { color: #fff; font-weight: 800; font-size: 11px; border-radius: 6px; padding: 1px 7px; }
.goal-tag { font-size: 10px; font-weight: 800; color: #9b4a1f; background: #fde3d6; border-radius: 999px; padding: 1px 8px; }
.ev-cond { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; align-items: center; }
.temp-led { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 800; background: #10202f; color: #7fe3ff; border-radius: 6px; padding: 1px 7px; letter-spacing: .04em; }
.temp-led.big { font-size: 26px; padding: 4px 12px; }
.fac-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.fac { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; border: 1px solid var(--line); background: linear-gradient(180deg, #fff, #f6f9fc); border-radius: 12px; padding: 10px; text-align: left; transition: transform .08s, border-color .12s; }
.fac:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.fac-icon { font-size: 24px; }
.fac-name { font-weight: 700; }
.fac-lvl { color: var(--gold); font-size: 11px; letter-spacing: 1px; }
.fac-gains { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 11px; font-weight: 600; color: #2f6fd6; }
.fac-cost { font-size: 11px; color: var(--muted); }
.fac-cost.good { color: #2f8a52; }
.fac-friends { position: absolute; top: 8px; right: 8px; display: flex; padding-left: 6px; }
.other-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hub-right { display: flex; flex-direction: column; gap: 12px; }
.log p { margin: 0; padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.cal { display: flex; flex-direction: column; gap: 6px; }
.cal-row { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 8px; }
.cal-row.past { opacity: .5; }
.skill-shop { display: flex; flex-direction: column; gap: 6px; }
.skill-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.skill-row.have { background: var(--soft); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 6px; }
.shop-item { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.shop-item img { width: 40px; height: 40px; object-fit: contain; background: #eef3f8; border-radius: 8px; }
.shop-item.have { background: var(--soft); }
.tier-head { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 12px 0 6px; }
.tier-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- locker ---------- */
.locker { display: grid; grid-template-columns: 300px 1fr 300px; gap: 14px; align-items: start; }
.wardrobe { max-height: calc(100vh - 100px); position: sticky; top: 70px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 4px 9px; font-weight: 600; font-size: 12px; color: var(--muted); }
.tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.size-picker { align-items: center; gap: 2px; padding: 3px 3px 3px 10px; align-self: flex-start; }
.item-list { overflow-y: auto; flex: 1; padding-right: 4px; }
.item { width: 100%; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 6px 8px; margin-bottom: 5px; text-align: left; }
.item:hover { border-color: #b9c4d2; }
.item.locked { background: #f7f8fa; }
.item.locked .thumb img { filter: grayscale(.8); opacity: .6; }
.item-name { font-weight: 600; display: block; }
.item-stats { display: flex; flex-wrap: wrap; gap: 0 8px; font-size: 11px; color: var(--muted); }
.thumb { width: 40px; height: 40px; border-radius: 8px; background: #eef3f8; display: grid; place-items: center; }
.thumb img { max-width: 36px; max-height: 36px; }
.price { font-size: 11px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.worn-badge { background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 7px; }
.locker-stage { display: flex; flex-direction: column; gap: 12px; }
.locker-art { height: min(56vh, 520px); display: grid; place-items: center; background: linear-gradient(180deg, #dbe8f5, #f4f8fc); border-radius: var(--radius); border: 1px solid var(--line); }
.locker-art svg { height: 100%; width: 100%; }
.rivals { display: flex; flex-direction: column; gap: 8px; }
.rival-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.rival { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 6px; text-align: center; }
.rival-art { height: 130px; display: grid; place-items: center; overflow: hidden; }
.rival-art svg { height: 100%; width: 100%; }
.rival-grades { display: flex; justify-content: center; gap: 3px; font-size: 10px; font-weight: 800; }
.locker-right { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 70px; }
.stack-list { display: flex; flex-direction: column; gap: 3px; max-height: 34vh; overflow-y: auto; }
.stack-item { display: flex; align-items: center; gap: 6px; padding: 3px 6px; border-radius: 8px; background: var(--soft); font-size: 12px; }
.stack-item .nm { flex: 1; }
.stack-item button { border: 0; background: transparent; color: var(--muted); padding: 0 3px; }
.stack-item button:hover:not(:disabled) { color: var(--ink); }
.thumb-sm { width: 22px; height: 22px; object-fit: contain; }
.size-btn { font-size: 10px !important; font-weight: 700; border: 1px solid var(--line) !important; border-radius: 6px; padding: 0 5px !important; background: #fff !important; }
.size-btn.up { background: #e1ecfb !important; color: #2f5fa6 !important; }
.empty { color: var(--muted); font-size: 12px; font-style: italic; }
.fc { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.fc-row { display: flex; justify-content: space-between; gap: 8px; }
.fc-sub { color: var(--muted); font-size: 11px; }
.fc-notes { margin: 4px 0 0; padding-left: 16px; font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.zone-chips { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.zchip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); display: inline-flex; align-items: center; gap: 4px; }
.zchip .dot { width: 8px; height: 8px; border-radius: 50%; }

/* ---------- the freezer ---------- */
.contest { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
.freezer { position: relative; overflow: hidden; border-radius: 18px; min-height: 520px; padding: 12px 12px 18px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.0) 0 58px, rgba(255,255,255,.35) 58px 60px),
    linear-gradient(180deg, #b9cfe2 0%, #d7e5f1 60%, #c4d4e2 61%, #e9f0f6 100%);
  border: 3px solid #8ea5ba; box-shadow: inset 0 0 60px rgba(160,200,235,.7); }
.freezer::before { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,.6), transparent 60%),
    radial-gradient(40px 40px at 6% 12%, rgba(255,255,255,.9), transparent), radial-gradient(60px 50px at 94% 8%, rgba(255,255,255,.85), transparent); }
.freezer.deep { background-color: #9db8d0; filter: saturate(.9) hue-rotate(-6deg); }
.freezer.cosmic { background: radial-gradient(circle at 30% 20%, #3a4a7a, #0d1226 70%); border-color: #3a4a7a; color: #e8eefc; }
.freezer.cosmic .lane-name, .freezer.cosmic .lane-status { color: #e8eefc; }
.freezer-head { position: relative; z-index: 3; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(16,32,47,.82); color: #e7f2ff; border-radius: 12px; padding: 8px 12px; }
.freezer-head .led { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 800; font-size: 20px; color: #7fe3ff; text-shadow: 0 0 8px rgba(127,227,255,.6); }
.fan { display: inline-block; font-size: 20px; animation: spin var(--spin, 0s) linear infinite; }
.ev-name { margin-left: auto; }
.clock { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 700; min-width: 64px; text-align: right; }
.cap { width: 100%; height: 5px; background: rgba(255,255,255,.15); border-radius: 999px; overflow: hidden; }
.cap span { display: block; height: 100%; background: #7fe3ff; width: 0; }
.gusts { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.gusts span { position: absolute; left: -20%; height: 2px; width: 90px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent); animation: gust linear infinite; }
@keyframes gust { to { transform: translateX(140vw); } }
.lanes { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 14px; align-items: end; }
.lane { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; transition: opacity .6s, filter .6s; }
.lane.you { background: rgba(255,255,255,.45); box-shadow: 0 0 0 2px var(--accent) inset; }
.lane-art { height: 300px; width: 100%; display: grid; place-items: end center; }
.lane-art svg { height: 100%; width: 100%; }
.lane-name { font-weight: 700; font-size: 13px; display: flex; align-items: center; gap: 4px; }
.you-tag { background: var(--accent); color: #fff; font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 4px; }
.resolve { position: relative; width: 92%; height: 9px; background: rgba(16,32,47,.18); border-radius: 999px; overflow: hidden; display: flex; }
.resolve .rv { display: block; height: 100%; background: linear-gradient(90deg, #4f8fe0, #7fc4f5); }
.resolve .gt { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, #e04b3c, #f08a4b); width: 0; opacity: 0; }
.lane.in-guts .resolve .gt { opacity: 1; }
.lane.in-guts .resolve { box-shadow: 0 0 0 2px rgba(224,75,60,.6); animation: pulse .6s ease-in-out infinite alternate; }
@keyframes pulse { to { box-shadow: 0 0 0 4px rgba(224,75,60,.25); } }
.lane-status { color: var(--muted); min-height: 16px; text-align: center; }
.lane.out { opacity: .45; filter: grayscale(.7); }
.lane-pop { position: absolute; top: 20%; left: 50%; transform: translate(-50%, 10px); white-space: nowrap; font-weight: 800; font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.15); opacity: 0; transition: opacity .2s, transform .2s; z-index: 5; pointer-events: none; }
.lane-pop.show { opacity: 1; transform: translate(-50%, 0); }
.lane-pop.skill { background: linear-gradient(90deg, #fff1cf, #ffe0b8); color: #8a5a00; }
.lane-pop.guts { background: var(--s-overheating); color: #fff; }
.shiver-1 .lane-art { animation: shiver1 .2s linear infinite; }
.shiver-2 .lane-art { animation: shiver2 .12s linear infinite; }
.shiver-3 .lane-art { animation: shiver3 .09s linear infinite; }
@keyframes shiver1 { 0%,100% { transform: translateX(0); } 50% { transform: translateX(1px); } }
@keyframes shiver2 { 0%,100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes shiver3 { 0%,100% { transform: translate(-3px, 0); } 25% { transform: translate(3px, 1px); } 50% { transform: translate(-2px, -1px); } 75% { transform: translate(3px, 0); } }
.bubble { position: absolute; left: 16px; bottom: 16px; z-index: 6; background: #fff; color: var(--ink); border-radius: 14px; padding: 8px 14px; max-width: min(360px, 80%); font-weight: 600; box-shadow: 0 6px 18px rgba(0,0,0,.12); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
.bubble.show { opacity: 1; transform: none; }
.door { position: absolute; inset: 0; z-index: 8; background: repeating-linear-gradient(0deg, #c8d4df 0 18px, #b6c4d1 18px 20px); border-right: 10px solid #8ea5ba;
  display: grid; place-items: center; transition: transform 1.1s cubic-bezier(.7,0,.3,1); }
.door span { font-weight: 800; letter-spacing: .3em; color: #6e8297; border: 3px solid #6e8297; padding: 8px 14px; border-radius: 8px; }
.door.open { transform: translateX(-102%); }
.commentary { max-height: calc(100vh - 100px); position: sticky; top: 70px; }
.speed .seg { padding: 4px 9px; font-size: 12px; }
.feed { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; }
.feed p { margin: 0; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--soft); animation: feedIn .25s ease-out; }
.feed p.big { background: #e1ecfb; font-weight: 600; }
.feed p.out { background: #fde9e7; }
.feed p.skill { background: #fff3d6; }
.feed p.guts { background: #ffe1d6; }
.feed p.win { background: #fff1cf; font-size: 15px; }
@keyframes feedIn { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- results ---------- */
.results { display: grid; grid-template-columns: 1fr 420px; gap: 14px; align-items: start; }
.ceremony { text-align: center; background: linear-gradient(180deg, #fffaf0, #ffffff); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin-top: 10px; }
.pod { display: flex; flex-direction: column; align-items: center; width: 30%; max-width: 220px; }
.pod-art { height: 260px; display: grid; place-items: end center; }
.pod-art svg { height: 100%; width: 100%; }
.pod-1 .pod-art { height: 320px; }
.pod-block { width: 100%; color: #fff; font-weight: 800; font-size: 26px; border-radius: 10px 10px 0 0; display: grid; place-items: center; }
.pod-1 .pod-block { height: 90px; background: linear-gradient(180deg, #f2c46a, #e3a52f); }
.pod-2 .pod-block { height: 64px; background: linear-gradient(180deg, #c9d3de, #a8b6c4); }
.pod-3 .pod-block { height: 46px; background: linear-gradient(180deg, #e7b08c, #cf8a5f); }
.winner-line { font-size: 16px; }
.quote { font-style: italic; color: var(--muted); }
.res-side { display: flex; flex-direction: column; gap: 12px; }
.res-list { display: flex; flex-direction: column; gap: 4px; }
.res-row { display: grid; grid-template-columns: 38px 30px 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px; border-radius: 10px; }
.res-row > .small, .res-row > .muted { grid-column: 3; }
.res-row > .face { grid-row: span 2; }
.res-row > .place { grid-row: span 2; }
.res-row.you { background: #e1ecfb; }
.place { font-weight: 800; font-size: 15px; }
.place.p1 { color: #c48a12; }
.rewards { display: flex; flex-wrap: wrap; gap: 6px; }
.rewards span { background: var(--soft); border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 13px; }

/* ---------- summary ---------- */
.summary-card { display: grid; grid-template-columns: 280px 1fr; gap: 20px; max-width: 900px; margin: 0 auto; }
.summary-art svg { width: 100%; height: auto; }
.big-rank { font-size: 64px; font-weight: 900; line-height: 1; margin: 8px 0; width: max-content; padding: 4px 18px; border-radius: 14px; background: var(--soft); }
.hist { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0; }

/* ---------- exhibition ---------- */
.exh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.char-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 3px 10px 3px 3px; font-weight: 600; }
.char-chip.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.big-temp { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* ---------- character art (shared with Layer Up's style.css) ---------- */
.char-svg { display: block; overflow: visible; }
.char-svg .drip { animation: drip 1.3s ease-in infinite; transform-box: fill-box; }
@keyframes drip { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(28px); opacity: 0; } }
.char-svg .steam { animation: steam 1.4s ease-out infinite; transform-box: fill-box; }
@keyframes steam { 0% { transform: translateY(6px); opacity: 0; } 30% { opacity: .9; } 100% { transform: translateY(-14px); opacity: 0; } }
.char-svg .breath { animation: breath 2.6s ease-out infinite; transform-box: fill-box; transform-origin: 0% 50%; }
@keyframes breath { 0%, 40% { opacity: 0; transform: scale(.4); } 55% { opacity: .9; } 100% { opacity: 0; transform: scale(1.3) translateX(10px); } }
.char-svg .fan { animation: fanw .35s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes fanw { from { transform: rotate(-22deg); } to { transform: rotate(18deg); } }
.char-svg .puddle { animation: puddle 3s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes puddle { 0%,100% { transform: scaleX(1); } 50% { transform: scaleX(1.04); } }
.char-svg .face-jitter { animation: faceJitter .11s linear infinite; transform-box: fill-box; transform-origin: 50% 60%; }
@keyframes faceJitter { 0%,100% { transform: translate(0,0); } 25% { transform: translate(-3px,4px); } 50% { transform: translate(2px,6px); } 75% { transform: translate(3px,2px); } }
.char-svg .is-frozen { filter: saturate(.35) brightness(1.08); }

/* ---------- smaller screens ---------- */
@media (max-width: 1100px) {
  .hub { grid-template-columns: 260px 1fr; }
  .hub-right { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; }
  .locker { grid-template-columns: 260px 1fr; }
  .locker-right { grid-column: 1 / -1; position: static; }
  .contest { grid-template-columns: 1fr; }
  .commentary { position: static; }
  .results { grid-template-columns: 1fr; }
  .exh-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  #app { padding: 10px; }
  .topbar { padding: 8px 12px; gap: 10px; flex-wrap: wrap; }
  .chips { width: 100%; margin-left: 0; }
  .hub, .locker, .exh-grid { grid-template-columns: 1fr; }
  .hub-right { grid-template-columns: 1fr; }
  .hub-art { height: 220px; }
  .wardrobe { position: static; max-height: none; order: 2; }
  .locker-stage { order: 1; }
  .locker-right { order: 3; }
  .locker-art { height: 46vh; }
  .rival-row { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .rival-art { height: 80px; }
  .rival-grades { display: none; }
  .lanes { grid-template-columns: repeat(3, 1fr); }
  .lane-art { height: 190px; }
  .freezer { min-height: 0; }
  .pick-grid { grid-template-columns: 1fr; }
  .pick-card { grid-template-columns: 100px 1fr; }
  .summary-card { grid-template-columns: 1fr; }
  .summary-art { max-width: 200px; margin: 0 auto; }
  .pod-art { height: 170px; } .pod-1 .pod-art { height: 210px; }
  .title-girl { width: 24vw; margin: 0 -4vw; }
  .title-card { margin-bottom: 30vh; padding: 20px; }
  .title-card h1 { font-size: 34px; }
}

/* character art fills its box exactly (percentage heights don't resolve on grid items) */
.hub-art, .locker-art, .rival-art, .lane-art, .pod-art { position: relative; }
.hub-art > svg, .locker-art > svg, .rival-art > svg, .lane-art > svg, .pod-art > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.lane-art > svg, .pod-art > svg { top: auto; bottom: 0; }
.char-svg { pointer-events: none; }
.hub-art, .locker-art, .rival-art, .pod-art, .pick-art, .summary-art, .title-girl { overflow: hidden; }
.pod-art { width: 100%; }
