:root {
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-2: #efede6;
  --ink: #1c1c1e;
  --muted: #6b6a66;
  --line: #e2dfd6;
  --accent: #5b5bd6;
  --accent-soft: rgba(91, 91, 214, .10);
  --done: #2f9e6b;
  --doing: #d98a1c;
  --todo: #c4c1b7;
  --fire: #e8663d;
  --water: #2f8fd6;
  --grass: #4a9e3a;
  --star: #e3a21a;
  --good: #2f9e6b;
  --perfect: #1f7a52;
  --danger: #d6453d;
  --m-harvey: #e0559b;
  --m-yihao: #d63a3a;
  --m-binqi: #8048d6;
  --m-all: #8a877e;
  --c-tft: #c2557a;
  --c-audio: #b07a2a;
  --c-joy: #5b5bd6;
  --c-btn: #2a9a8b;
  --c-fsr: #8a5bd6;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131315;
    --surface: #1c1c20;
    --surface-2: #25252a;
    --ink: #ececef;
    --muted: #9b9aa2;
    --line: #2f2f36;
    --accent: #8f8ff2;
    --accent-soft: rgba(143, 143, 242, .14);
    --todo: #45454d;
    --m-harvey: #f27ab5;
    --m-yihao: #f26b6b;
    --m-binqi: #a97ff2;
    --m-all: #9b9aa2;
    --c-tft: #e07a9c;
    --c-audio: #d9a24f;
    --c-joy: #8f8ff2;
    --c-btn: #4cc2b1;
    --c-fsr: #b08ff2;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131315;
  --surface: #1c1c20;
  --surface-2: #25252a;
  --ink: #ececef;
  --muted: #9b9aa2;
  --line: #2f2f36;
  --accent: #8f8ff2;
  --accent-soft: rgba(143, 143, 242, .14);
  --todo: #45454d;
  --m-harvey: #f27ab5;
  --m-yihao: #f26b6b;
  --m-binqi: #a97ff2;
  --m-all: #9b9aa2;
  --c-tft: #e07a9c;
  --c-audio: #d9a24f;
  --c-joy: #8f8ff2;
  --c-btn: #4cc2b1;
  --c-fsr: #b08ff2;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Noto Sans SC", "Segoe UI", Roboto, sans-serif;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
code, pre, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.hero { padding: 40px 0 24px; display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-end; justify-content: space-between; }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero h1 { font-size: 40px; line-height: 1.1; margin: 6px 0 6px; letter-spacing: -0.02em; }
.hero p { margin: 0; color: var(--muted); }
.countdown { display: flex; gap: 8px; align-items: flex-end; }
.countdown .unit { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 58px; text-align: center; box-shadow: var(--shadow); }
.countdown .num { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.countdown .lbl { font-size: 11px; color: var(--muted); }
.countdown-cap { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: right; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav .wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-top: 8px; padding-bottom: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--bg); }
.who { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 3px 11px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--c, var(--m-all)); flex: none; }

/* ---------- layout ---------- */
main { padding: 28px 0 80px; }
.panel[hidden] { display: none; }
h2 { font-size: 20px; margin: 36px 0 12px; letter-spacing: -0.01em; }
h2:first-child { margin-top: 0; }
h2 small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.spacer { flex: 1; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 6px 14px; border-radius: 8px; cursor: pointer; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--muted); }
.meter { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; display: flex; }
.meter > i { display: block; height: 100%; }

/* ---------- architecture ---------- */
.arch { display: grid; grid-template-columns: 1fr 70px 1fr 70px 1fr; align-items: center; }
.board { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; min-height: 100%; }
.board h4 { margin: 0 0 2px; font-size: 14px; }
.board .sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.board.central { border-color: var(--accent); background: var(--accent-soft); }
.comps { display: flex; flex-wrap: wrap; gap: 6px; }
.comp { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 4px 9px; font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: opacity .2s, border-color .2s; }
.comp .if { font-size: 11px; color: var(--muted); }
.comp:hover, .comp.sel { border-color: var(--ink); }
.comp.dim { opacity: .3; }
.link { position: relative; height: 2px; background: repeating-linear-gradient(90deg, var(--muted) 0 6px, transparent 6px 11px); margin: 0 6px; }
.link::after { content: "802.15.4"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.packet { position: absolute; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: fly 1.8s linear infinite; }
.packet.back { background: var(--done); animation-direction: reverse; animation-delay: .9s; }
@keyframes fly { from { left: 0; } to { left: calc(100% - 10px); } }
.detail { margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; min-height: 48px; }
.detail b { margin-right: 6px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; }

@media (max-width: 760px) {
  .arch { grid-template-columns: 1fr; }
  .link { height: 44px; width: 2px; margin: 6px auto; background: repeating-linear-gradient(180deg, var(--muted) 0 6px, transparent 6px 11px); }
  .link::after { top: 50%; left: 10px; transform: translateY(-50%); }
  .packet { left: -4px !important; animation-name: flyv; }
  @keyframes flyv { from { top: 0; } to { top: calc(100% - 10px); } }
  .hero h1 { font-size: 32px; }
}

/* ---------- team ---------- */
.team { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.member { cursor: pointer; text-align: left; transition: border-color .2s, transform .2s; }
.member:hover { border-color: var(--c); transform: translateY(-1px); }
.member.sel { border-color: var(--c); box-shadow: 0 0 0 1px var(--c); }
.member h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.member .role { font-size: 12px; color: var(--c); margin: 2px 0 6px; }
.member p { margin: 0; font-size: 13px; color: var(--muted); }
.member .count { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* ---------- gantt ---------- */
.scroll { overflow-x: auto; }
table.gantt { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 13px; }
.gantt th, .gantt td { border-bottom: 1px solid var(--line); padding: 7px 4px; text-align: center; }
.gantt th { font-weight: 500; color: var(--muted); font-size: 12px; }
.gantt th.task, .gantt td.task { text-align: left; width: 32%; padding-left: 8px; }
.gantt td.owner { width: 10%; color: var(--muted); font-size: 12px; text-align: left; white-space: nowrap; }
.gantt .now { background: var(--accent-soft); }
.gantt th.now { color: var(--accent); font-weight: 700; }
.gantt tr.grp td { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding-top: 14px; background: transparent; }
.gantt tr.t { cursor: pointer; }
.gantt tr.t:hover td { background: var(--surface-2); }
.gantt tr.t.sel td { background: var(--accent-soft); }
.bar { height: 14px; border-radius: 4px; }
.bar.done { background: var(--done); }
.bar.doing { background: var(--doing); background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.25) 0 6px, transparent 6px 12px); background-size: 17px 17px; animation: stripe 1s linear infinite; }
.bar.todo { background: var(--todo); }
@keyframes stripe { to { background-position: 17px 0; } }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 12px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; background: var(--c); }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.toolbar label { font-size: 13px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }

/* ---------- parts ---------- */
.parts { list-style: none; margin: 0; padding: 0; }
.parts li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.parts li:last-child { border-bottom: 0; }
.parts .nm { font-weight: 600; font-size: 14px; }
.parts .md { font-size: 12px; color: var(--muted); grid-column: 1; }
.st { font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; align-self: start; background: var(--surface-2); color: var(--muted); }
.st.have, .st.arrived { background: color-mix(in srgb, var(--done) 15%, transparent); color: var(--done); }
.st.ordered { background: var(--accent-soft); color: var(--accent); }
.st.buy, .st.choosing { background: color-mix(in srgb, var(--doing) 16%, transparent); color: var(--doing); }

/* ---------- pins ---------- */
.pins { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.pin { border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 8px 7px; cursor: pointer; background: var(--surface); text-align: left; min-height: 74px; position: relative; transition: transform .15s; }
.pin:hover { transform: translateY(-1px); border-color: var(--muted); }
.pin .p { font-weight: 700; font-size: 15px; }
.pin .u { font-size: 11px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.pin.used { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.pin.used .u { color: var(--ink); }
.pin.busy { background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); }
.pin.free { border-style: dashed; }
.pin.sel { box-shadow: 0 0 0 2px var(--ink); }
.pin .warn { position: absolute; top: 6px; right: 7px; font-size: 11px; color: var(--doing); }
.pin.power { cursor: default; background: var(--surface-2); }
.pin-summary { display: flex; flex-wrap: wrap; gap: 18px; font-size: 13px; margin: 4px 0 12px; }
.pin-summary b { font-size: 18px; margin-right: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.switch input { appearance: none; width: 34px; height: 20px; border-radius: 999px; background: var(--todo); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { left: 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; padding: 2px; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
ul.notes { margin: 12px 0 0; padding-left: 18px; font-size: 13px; color: var(--muted); }

/* ---------- updates ---------- */
.update { border-left: 3px solid var(--c, var(--accent)); padding: 2px 0 2px 14px; margin-bottom: 22px; }
.update .meta { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.update h3 { margin: 3px 0 4px; font-size: 16px; }
.update p { margin: 0; white-space: pre-line; }
.search { flex: 1; min-width: 180px; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; }
.empty { color: var(--muted); font-size: 14px; padding: 12px 0; }
.composer { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.composer label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.composer input, .composer select, .composer textarea { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 9px; font-size: 14px; color: var(--ink); }
.composer .full { grid-column: 1 / -1; }
pre.snippet { background: var(--surface-2); border-radius: 10px; padding: 12px; overflow-x: auto; margin: 12px 0 8px; white-space: pre-wrap; word-break: break-all; }

/* ---------- battle ---------- */
.arena { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: 14px; align-items: stretch; }
@media (max-width: 760px) {
  .arena { grid-template-columns: 1fr 1fr; gap: 10px; }
  .arena .mid { grid-column: 1 / -1; order: 3; }
  .fighter { padding: 10px 6px; }
  .roster { gap: 3px; }
  .mini { padding: 3px 1px 2px; }
  .mname { font-size: 10px; }
  .pad { gap: 4px; }
  .pad button { font-size: 12px; padding: 8px 0; }
}
.fighter { --el: var(--accent); background: var(--surface-2); border-radius: 12px; padding: 14px; text-align: center; position: relative; border: 2px solid transparent; transition: border-color .2s; min-width: 0; }
.fighter.turn { border-color: var(--el); }
.fighter.fire, .mini.fire { --el: var(--fire); }
.fighter.water, .mini.water { --el: var(--water); }
.fighter.grass, .mini.grass { --el: var(--grass); }
.fighter .name { font-weight: 700; overflow-wrap: anywhere; }
.fighter .pname { font-weight: 500; color: var(--el); }
.fighter .role-lbl { font-size: 12px; color: var(--muted); min-height: 18px; }
.stage { height: 112px; display: flex; align-items: center; justify-content: center; }
.sprite { width: 96px; height: 96px; display: block; image-rendering: pixelated; }
.hidden-pet { width: 80px; height: 80px; border-radius: 16px; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800; color: var(--muted); background: var(--surface); }
.fighter.hit .sprite { animation: shake .35s; }
.fighter.ko .stage { opacity: .5; }
.roster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 8px; }
.mini { background: var(--surface); border: 1.5px solid var(--line); border-radius: 8px; padding: 4px 3px 3px; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; }
.mini.active { border-color: var(--el); }
.mini.fainted { opacity: .4; filter: grayscale(1); }
.msprite { width: 28px; height: 28px; display: block; image-rendering: pixelated; }
.mname { font-size: 11px; line-height: 1.2; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mhp { width: 100%; height: 5px; border-radius: 999px; background: var(--surface-2); overflow: hidden; display: block; }
.mhp > i { display: block; height: 100%; background: var(--el); transition: width .4s ease; }
.mnum { font-size: 10px; color: var(--muted); line-height: 1.2; font-variant-numeric: tabular-nums; }
.eff { font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 999px; white-space: nowrap; }
.eff.strong { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.eff.weak { color: var(--muted); background: var(--surface); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.hp { height: 12px; border-radius: 999px; background: var(--surface); overflow: hidden; border: 1px solid var(--line); }
.hp > i { display: block; height: 100%; background: var(--el); transition: width .4s ease; }
.hpnum { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.badges { min-height: 22px; margin-top: 6px; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 10px; }
.pad button.wide { grid-column: 1 / -1; padding-top: 6px; padding-bottom: 6px; }
.mini.pickable { cursor: pointer; border-style: dashed; border-color: var(--accent); }
.mini.pickable:hover { background: var(--accent-soft); }
.pad button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 2px; font-size: 13px; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none; line-height: 1.2; }
.pad button kbd { display: block; font-size: 10px; color: var(--muted); font-family: inherit; }
.pad button:disabled { opacity: .35; cursor: not-allowed; }
.pad button.held { background: var(--el); color: #fff; border-color: var(--el); }
.pop { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); font-weight: 800; font-size: 22px; pointer-events: none; animation: pop 1s ease-out forwards; color: var(--danger); text-shadow: 0 1px 0 var(--surface); }
.pop.heal { color: var(--done); }
.pop small { display: block; font-size: 12px; font-weight: 700; white-space: nowrap; }
@keyframes pop { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -40px); } }
.mid { display: flex; flex-direction: column; gap: 12px; }
.prompt { background: var(--surface-2); border-radius: 12px; padding: 12px; text-align: center; font-size: 14px; min-height: 66px; display: flex; align-items: center; justify-content: center; }
.gauge { position: relative; height: 22px; border-radius: 8px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.gauge .zone { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--good) 35%, transparent); }
.gauge .zone i { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--perfect) 70%, transparent); }
.gauge .cursor { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--ink); border-radius: 2px; }
.gauge-lbl { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; margin-bottom: 4px; }
.gauge-lbl span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge .cursor.locked { background: var(--accent); }
/* attack trial: moving band + level pointer */
.trial-gauge { height: 30px; overflow: visible; margin-top: 8px; }
.trial-gauge .band { position: absolute; top: 0; bottom: 0; border-radius: 6px; background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px solid color-mix(in srgb, var(--accent) 70%, transparent); box-sizing: border-box; }
.trial-gauge.readying .band { border-style: dashed; }
.trial-gauge .band.in { background: color-mix(in srgb, var(--good) 40%, transparent); border-color: var(--good); }
.trial-gauge .ptr { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.trial-gauge .ptr::before { content: ""; position: absolute; top: -5px; left: -4px; border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0; }
.trial-track { --ready: 23%; position: relative; height: 4px; margin-top: 7px; border-radius: 999px; overflow: hidden; background: linear-gradient(to right, var(--line) 0 var(--ready), var(--surface-2) var(--ready)); }
.trial-track i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--accent); }
.tier { min-height: 30px; margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 8px; font-size: 12px; color: var(--muted); text-align: center; }
.tier b { font-size: 15px; padding: 2px 12px; border-radius: 999px; letter-spacing: 1px; }
.tier.t0 b { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.tier.t1 b { background: var(--doing); color: #fff; animation: tier-pop .45s ease-out; }
.tier.t2 b { color: #fff; background: linear-gradient(90deg, var(--fire), var(--star), var(--fire)); background-size: 200% 100%; box-shadow: 0 0 14px color-mix(in srgb, var(--fire) 55%, transparent); animation: tier-pop .5s ease-out, shimmer 1.4s linear infinite; }
.tier-tag { font-size: 12px; font-weight: 700; padding: 0 7px; border-radius: 999px; white-space: nowrap; }
.tier-tag.t0 { background: var(--surface); border: 1px solid var(--line); }
.tier-tag.t1 { background: var(--doing); color: #fff; }
.tier-tag.t2 { background: var(--fire); color: #fff; }
@keyframes tier-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.18); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
.fighter.flare1 { animation: flare1 .8s ease-out; }
.fighter.flare2 { animation: flare2 1.1s ease-out; }
.fighter.flare2 .sprite { animation: rise 1.1s ease-out; }
@keyframes flare1 { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--doing) 70%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
@keyframes flare2 { 0%, 40% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--fire) 80%, transparent), 0 0 24px 4px color-mix(in srgb, var(--star) 70%, transparent); } 100% { box-shadow: 0 0 0 22px transparent, 0 0 0 0 transparent; } }
@keyframes rise { 0% { transform: scale(1); } 30% { transform: scale(1.18) translateY(-6px); } 100% { transform: scale(1); } }
/* chained blocks */
.hits { min-height: 24px; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.hit-chip { font-size: 12px; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.hit-chip.now { border-color: var(--accent); color: var(--accent); }
.hit-chip.good { border-color: var(--good); color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.hit-chip.perfect { border-color: var(--perfect); color: #fff; background: var(--perfect); font-weight: 700; }
.hit-chip.miss { border-color: var(--danger); color: var(--danger); }
.hit-sum { font-size: 12px; font-weight: 700; }
.pop.blk { top: 18%; font-size: 16px; color: var(--good); }
.pop.blk.perfect { color: var(--perfect); }
.pop.blk.miss { color: var(--muted); }
.log { list-style: none; margin: 0; padding: 0; font-size: 13px; max-height: 150px; overflow-y: auto; }
.log li { padding: 3px 0; border-bottom: 1px dashed var(--line); color: var(--muted); }
.log li:first-child { color: var(--ink); }
.params { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; }
.params label { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.params label span { display: flex; justify-content: space-between; }
.params label b { font-variant-numeric: tabular-nums; }
.params .pgroup { grid-column: 1 / -1; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 2px; margin-top: 4px; }
#param-c { white-space: pre; word-break: normal; }
.params .cname { font-size: 11px; color: var(--muted); }
.params input[type=range] { width: 100%; accent-color: var(--accent); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 8px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: all .25s; pointer-events: none; z-index: 20; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

footer { color: var(--muted); font-size: 12px; padding: 24px 0 40px; border-top: 1px solid var(--line); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- reviews ---------------- */
.rv-summary { display: grid; grid-template-columns: auto 1fr; gap: 14px 28px; align-items: center; }
.rv-score { text-align: center; }
.rv-score .big { font-size: 40px; font-weight: 700; line-height: 1.1; }
.rv-bars { display: grid; gap: 4px; font-size: 12px; }
.rv-bar { display: grid; grid-template-columns: 30px 1fr 24px; gap: 8px; align-items: center; }
.rv-bar .track { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rv-bar .track div { height: 100%; background: var(--star); }
.rv-pets { grid-column: 1 / -1; display: grid; gap: 6px; }
.stars { color: var(--line); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.stars .on { color: var(--star); }
.stars.lg { font-size: 18px; }
.pet-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px; color: #fff; background: var(--c); }
.rv-picker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.rv-stars button { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 2px; cursor: pointer; color: var(--line); }
.rv-stars button.on { color: var(--star); }
.rv-stars button:hover { transform: scale(1.1); }
.btn.disabled { opacity: .45; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
a.btn.primary { color: #fff; }
.review { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; background: var(--line); }
.review .body { min-width: 0; flex: 1; }
.review .meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.review p { margin: 6px 0; white-space: pre-line; overflow-wrap: anywhere; }
.review .reply { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) {
  .rv-summary { grid-template-columns: 1fr; }
}
