/* レイアウト: 1520×960 の固定ステージを画面サイズに合わせて拡縮。スマホ幅では縦積みに切り替える */
:root {
  color-scheme: dark;
  --bg: #050c1f;
  --panel: rgba(9, 24, 56, .9);
  --panel-hi: rgba(17, 40, 90, .92);
  --edge: #2f72e6;
  --edge-soft: rgba(70, 150, 255, .3);
  --cyan: #46d6ff;
  --cyan-hi: #b4f2ff;
  --blue: #2a78ff;
  --text: #eaf2ff;
  --muted: #8ea6d1;
  --label: #8fc8ff;
  --ghost: #62729a;
  --danger: #ff5a7a;
  --gold: #ffd36b;
  --editor: #08142f;
  --s-kw: #c792ea; --s-fn: #82aaff; --s-st: #c3e88d; --s-nu: #f78c6c; --s-cm: #7088b8;
  --s-pn: #89ddff; --s-pr: #b9d3e6; --s-ty: #ffcb6b; --s-lt: #ff9cac; --s-id: #e2e9f7; --s-tg: #f07178;
  --f-ui: "M PLUS Rounded 1c", "Hiragino Maru Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --f-num: "Rajdhani", "M PLUS Rounded 1c", "Segoe UI", sans-serif;
  --f-code: "JetBrains Mono", "Cascadia Code", Consolas, Menlo, monospace;
  --f-impact: "Dela Gothic One", "M PLUS Rounded 1c", "Hiragino Sans", sans-serif;
}
html, body { height: 100%; }
[hidden] { display: none !important; }
body {
  margin: 0; color: var(--text); font-family: var(--f-ui); overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 700px at 72% 8%, rgba(40, 110, 255, .22), transparent 60%),
    radial-gradient(900px 600px at 8% 92%, rgba(30, 160, 255, .14), transparent 60%),
    linear-gradient(180deg, #071533 0%, var(--bg) 100%);
}
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(80, 150, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(80, 150, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%);
}
button { font-family: inherit; }
button:focus-visible { outline: 3px solid var(--cyan-hi); outline-offset: 2px; }

#viewport { position: fixed; inset: 0; overflow: hidden; }
#stage { position: absolute; left: 50%; top: 50%; width: 1520px; height: 960px; transform: translate(-50%, -50%) scale(var(--s, 1)); }
.layout { position: absolute; inset: 0; padding: 20px 26px 22px; display: grid; grid-template-rows: 126px minmax(0, 1fr) 320px; gap: 16px; }
.layout.shake { animation: shake .55s linear; }
@keyframes shake {
  10% { translate: -11px 7px; } 20% { translate: 10px -8px; } 30% { translate: -9px -5px; } 40% { translate: 8px 6px; }
  50% { translate: -6px 3px; } 60% { translate: 5px -4px; } 75% { translate: -3px 2px; } 100% { translate: 0 0; }
}

/* パネル共通 */
.panel {
  position: relative; border: 1.5px solid var(--edge); border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .08), 0 0 22px rgba(30, 120, 255, .3), 0 0 3px rgba(120, 200, 255, .6);
}
.panel::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: -1.5px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .75;
}

/* 上段: タイトルとHUD */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 28px; min-width: 0; }
.brand { display: grid; gap: 12px; min-width: 0; }
.banner { display: flex; align-items: center; }
.badge {
  position: relative; z-index: 1; height: 54px; padding: 0 18px; display: grid; place-items: center;
  background: linear-gradient(180deg, #a8e7ff, #4fb8ff); color: #072a6b; font: 800 26px/1 var(--f-num); letter-spacing: .06em;
  border: 2px solid #d6f4ff; border-radius: 10px 4px 4px 10px; box-shadow: 0 0 14px rgba(80, 190, 255, .7);
}
.banner h1 {
  margin: 0 0 0 -6px; height: 54px; padding: 0 58px 0 28px; display: flex; align-items: center;
  font: 800 33px/1 var(--f-ui); letter-spacing: .03em; color: #fff; text-shadow: 0 2px 0 rgba(0, 20, 80, .5);
  background: linear-gradient(90deg, #1d5bdc, #2f7dff 70%, #2a6cf0); clip-path: polygon(0 0, 100% 0, calc(100% - 26px) 100%, 0 100%);
}
.slashes { width: 40px; height: 54px; margin-left: -18px; background: linear-gradient(115deg, transparent 38%, #2f7dff 38% 52%, transparent 52% 64%, #2f7dff 64% 74%, transparent 74%); opacity: .9; }
.desc { margin: 0; font: 700 17px/1.7 var(--f-ui); color: #dce8ff; text-wrap: pretty; }
.hud { flex: none; display: flex; align-items: stretch; width: 660px; height: 96px; padding: 0 16px 0 10px; }
.hud .cell { display: grid; align-content: center; gap: 4px; padding: 0 22px; min-width: 132px; }
.lbl { font: 700 15px/1 var(--f-num); letter-spacing: .14em; color: var(--label); }
.hud .val { font: 700 46px/1 var(--f-num); font-variant-numeric: tabular-nums; color: #fff; text-shadow: 0 0 12px rgba(100, 190, 255, .5); }
.hud .val { transform-origin: 0 50%; }
.hud .sep { width: 1px; margin: 16px 0; background: linear-gradient(transparent, rgba(110, 170, 255, .55), transparent); }
.exp { flex: 1; display: grid; align-content: center; gap: 10px; padding: 0 6px 0 22px; }
.exp-row { display: flex; justify-content: space-between; align-items: baseline; font: 700 20px/1 var(--f-num); color: #cfe3ff; font-variant-numeric: tabular-nums; }
.lv { color: var(--label); } .lv b { font-size: 26px; color: #fff; margin-left: 2px; }
.bar {
  position: relative; height: 18px; overflow: hidden; border-radius: 99px; border: 1.5px solid #2a5fc4;
  background: repeating-linear-gradient(-45deg, rgba(60, 120, 220, .2) 0 6px, rgba(60, 120, 220, .06) 6px 12px), #0a1a3c;
}
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; transition: width .2s ease;
  background: linear-gradient(90deg, #2b8cff, var(--cyan) 70%, var(--cyan-hi)); box-shadow: 0 0 12px rgba(70, 214, 255, .85);
}
.mute {
  align-self: center; flex: none; width: 42px; height: 42px; margin-left: 8px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--edge-soft); background: rgba(4, 12, 32, .6); color: var(--cyan); display: grid; place-items: center;
}
.mute svg { width: 22px; height: 22px; }
.mute .off, .mute[aria-pressed="false"] .on { display: none; }
.mute[aria-pressed="false"] .off { display: block; }

/* 中段: 統計とエディタ */
.mid { display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 22px; min-height: 0; }
.side { align-self: start; display: grid; padding: 10px 18px 16px; }
.stat { padding: 11px 0 10px; border-bottom: 1px solid rgba(90, 150, 255, .22); }
.stat .lbl { font-family: var(--f-ui); font-size: 13px; letter-spacing: .08em; }
.stat .val { margin-top: 7px; font: 700 32px/1 var(--f-num); font-variant-numeric: tabular-nums; }
.stat .val small { margin-left: 4px; font: 700 13px/1 var(--f-ui); color: var(--muted); }
.stat.time .val { font-size: 50px; }
.stat.time.warn .val { color: var(--danger); animation: pulse .8s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .55; } }
.streak {
  margin-top: 14px; display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 4px 6px; padding: 9px 10px; border-radius: 10px;
  background: rgba(255, 120, 60, .08); border: 1px solid rgba(255, 140, 80, .35); color: #ffd7b8;
  font: 800 13px/1.2 var(--f-ui); opacity: .38; transition: opacity .2s, box-shadow .2s;
}
.streak.on { opacity: 1; box-shadow: 0 0 14px rgba(255, 120, 60, .4); }
.streak svg { width: 18px; height: 18px; flex: none; }
.streak b { grid-column: 1 / -1; justify-self: end; font: 700 24px/1 var(--f-num); color: #fff; font-variant-numeric: tabular-nums; }
.streak b::after { content: "文字"; margin-left: 3px; font: 700 12px/1 var(--f-ui); color: #ffd7b8; }

.editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.editor.shake { animation: eshake .28s; }
@keyframes eshake { 25% { translate: -7px 0; } 50% { translate: 6px 0; } 75% { translate: -3px 0; } }
.tabbar {
  flex: none; height: 46px; display: flex; align-items: flex-end; gap: 12px; padding: 0 18px;
  background: rgba(4, 12, 32, .65); border-bottom: 1px solid var(--edge-soft); border-radius: 13px 13px 0 0;
}
.tab {
  height: 38px; margin-bottom: -1px; display: flex; align-items: center; gap: 10px; padding: 0 14px 0 12px;
  background: var(--editor); border: 1px solid var(--edge-soft); border-bottom-color: var(--editor); border-radius: 9px 9px 0 0;
  font: 600 16px/1 var(--f-code); color: #dfe9ff;
}
.ficon { width: 22px; height: 22px; border-radius: 4px; display: grid; place-items: center; font: 800 10px/1 var(--f-code); }
.ficon.js { background: #f7df1e; color: #222; }
.ficon.ts { background: #3178c6; color: #fff; }
.ficon.py { background: linear-gradient(135deg, #3776ab 52%, #ffd43b 52%); color: #fff; }
.ficon.go { background: #00add8; color: #fff; }
.ficon.rs { background: #dea584; color: #2b1606; }
.ficon.java { background: #e76f00; color: #fff; }
.ficon.cs { background: #68217a; color: #fff; }
.ficon.php { width: 28px; background: #777bb4; color: #fff; }
.ficon.rb { background: #cc342d; color: #fff; }
.ficon.sql { width: 28px; background: #336791; color: #fff; }
.tab .x { margin-left: 6px; color: #6c7fa8; font-size: 17px; }
.tabinfo { margin-left: auto; align-self: center; font: 700 15px/1 var(--f-num); letter-spacing: .08em; color: var(--muted); font-variant-numeric: tabular-nums; }
.codewrap { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--editor); border-radius: 0 0 13px 13px; }
.progline { position: absolute; left: 0; top: 0; z-index: 2; height: 2px; width: 0; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 8px var(--cyan); transition: width .15s; }
.code { padding: 16px 0 70px; font: 400 21px/34px var(--f-code); }
.code, .g-next pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
.code.enter { animation: codeIn .4s ease-out; }
@keyframes codeIn { from { opacity: 0; transform: translateY(18px); } }
.ln { display: flex; white-space: pre; }
.ln .no { flex: none; width: 66px; padding-right: 24px; text-align: right; color: #34466e; user-select: none; }
.ln .src { flex: none; padding-right: 40px; }
.ln.active { background: linear-gradient(90deg, rgba(64, 140, 255, .18), rgba(64, 140, 255, .05) 60%, transparent 90%); }
.ln.active .no { color: #a8cbff; }
.c { position: relative; color: var(--ghost); }
.c.cur { color: #f4f8ff; background: rgba(70, 214, 255, .16); border-radius: 3px; box-shadow: 0 2px 0 var(--cyan); }
.c.cur::before {
  content: ""; position: absolute; left: -2px; top: 5px; bottom: 5px; width: 3px; border-radius: 2px;
  background: var(--cyan); box-shadow: 0 0 10px var(--cyan), 0 0 22px rgba(70, 214, 255, .6); animation: caret 1.05s steps(1) infinite;
}
.typing .c.cur::before { animation: none; }
@keyframes caret { 50% { opacity: 0; } }
.c.ac:not(.ok) { opacity: .45; }
.c.pair { text-shadow: 0 0 8px rgba(70, 214, 255, .7); }
.c.nl { opacity: 0; }
.c.nl.cur { opacity: 1; color: var(--cyan); }
.c.ok { color: var(--s-id); }
.c.ok.kw, .c.ok.dc { color: var(--s-kw); }
.c.ok.fn, .c.ok.bi { color: var(--s-fn); }
.c.ok.st { color: var(--s-st); }
.c.ok.nu { color: var(--s-nu); }
.c.ok.cm { color: var(--s-cm); font-style: italic; }
.c.ok.pn { color: var(--s-pn); }
.c.ok.pr { color: var(--s-pr); }
.c.ok.ty { color: var(--s-ty); }
.c.ok.lt { color: var(--s-lt); }
.c.ok.tg { color: var(--s-tg); }
.c.err.ok { text-decoration: underline 2px rgba(255, 90, 122, .9); text-underline-offset: 6px; }
.c.bad { animation: bad .34s ease-out; }
.c.just { animation: just .45s ease-out; }
.c.auto { animation: autoGlow 1.4s ease-out; }
@keyframes bad { 0% { background: rgba(255, 90, 122, .9); color: #fff; } 100% { background: rgba(255, 90, 122, 0); } }
@keyframes just { 0% { color: #fff; text-shadow: 0 0 10px var(--cyan-hi), 0 0 18px var(--cyan); } 100% { text-shadow: 0 0 0 transparent; } }
@keyframes autoGlow {
  0% { color: #fff; background: rgba(70, 214, 255, .4); text-shadow: 0 0 6px #fff, 0 0 16px var(--cyan), 0 0 30px var(--blue); }
  100% { background: rgba(70, 214, 255, 0); text-shadow: 0 0 0 transparent; }
}
/* IT用語モード: コード表示の代わりに用語カードを出す */
body:not(.it-mode) [data-game="it"], .it-mode [data-game="code"] { display: none; }
.termview { display: none; position: relative; flex: 1; min-height: 0; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px 24px; background: var(--editor); border-radius: 0 0 13px 13px; text-align: center; }
.it-mode .codewrap { display: none; }
.it-mode .termview { display: flex; }
.termview.enter { animation: codeIn .35s ease-out; }
.termview.bad .tv-word { animation: wordBad .35s; }
@keyframes wordBad { 0% { color: #ffb3c3; } 25% { translate: -7px 0; } 50% { translate: 6px 0; } 75% { translate: -3px 0; } 100% { translate: 0 0; } }
.tv-cat { padding: 6px 14px; border-radius: 999px; border: 1px solid var(--edge-soft); background: rgba(70, 214, 255, .08); color: var(--cyan-hi); font: 800 14px/1 var(--f-ui); letter-spacing: .08em; }
.tv-word { font: 400 76px/1.1 var(--f-impact); color: #fff; text-shadow: 0 0 22px rgba(70, 190, 255, .45), 0 5px 0 #0b3a9c; text-wrap: balance; }
.tv-roma { font: 600 40px/1.2 var(--f-code); letter-spacing: .06em; font-variant-ligatures: none; }
.tv-roma .t { color: var(--cyan-hi); text-shadow: 0 0 10px rgba(70, 214, 255, .6); }
.tv-roma .cur { color: #fff; background: rgba(70, 214, 255, .2); border-radius: 4px; box-shadow: 0 3px 0 var(--cyan); }
.tv-roma .r { color: var(--ghost); }
.tv-desc { margin: 4px 0 0; font: 700 18px/1.5 var(--f-ui); color: #b7c7e6; }
/* 次の用語（カードの下部に表示） */
.tv-next { position: absolute; right: 22px; top: 18px; display: flex; align-items: baseline; gap: 12px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--edge-soft); background: rgba(10, 30, 70, .7); white-space: nowrap; }
.tv-next b { font: 800 22px/1 var(--f-ui); color: #dfe9ff; }
.tv-pop { position: absolute; left: 26px; top: 22px; opacity: 0; pointer-events: none; font: 400 30px/1 var(--f-impact); color: var(--cyan-hi); text-shadow: 0 0 12px var(--cyan); white-space: nowrap; }
.tv-pop small { margin-left: 8px; font: 700 22px/1 var(--f-num); color: var(--gold); }
.tv-pop.perfect { color: var(--gold); text-shadow: 0 0 14px rgba(255, 200, 80, .8); }
.tv-pop.show { animation: tvPop .9s ease-out both; }
@keyframes tvPop { 0% { opacity: 0; translate: 0 10px; } 20% { opacity: 1; translate: 0 0; } 75% { opacity: 1; } 100% { opacity: 0; translate: 0 -24px; } }
.ficon.it { background: linear-gradient(135deg, #46d6ff, #2a78ff); color: #031a4a; }
.stamp {
  position: absolute; left: 50%; top: 50%; z-index: 5; pointer-events: none; opacity: 0; text-align: center; white-space: nowrap;
  font: 400 76px/1 var(--f-impact); color: #fff; text-shadow: 0 0 20px var(--cyan), 0 5px 0 #0c3a9c;
}
.stamp small { display: block; margin-top: 6px; font: 700 30px/1 var(--f-num); color: var(--gold); text-shadow: 0 0 10px rgba(255, 200, 80, .7); }
.stamp.perfect { color: var(--gold); text-shadow: 0 0 22px rgba(255, 200, 80, .85), 0 5px 0 #8a4b00; }
.stamp.show { animation: stamp 1.15s ease-out both; }
@keyframes stamp {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-8deg) scale(2.3); }
  16% { opacity: 1; transform: translate(-50%, -50%) rotate(-8deg) scale(.94); }
  26% { transform: translate(-50%, -50%) rotate(-8deg) scale(1); }
  74% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -62%) rotate(-8deg) scale(1); }
}
.toast {
  position: absolute; left: 50%; top: 60px; z-index: 6; translate: -50% 0; padding: 9px 18px; border-radius: 999px; pointer-events: none;
  background: rgba(8, 24, 60, .94); border: 1px solid var(--cyan); color: var(--cyan-hi); font: 800 15px/1 var(--f-ui);
  opacity: 0; transition: opacity .25s, translate .25s; white-space: nowrap;
}
.toast.show { opacity: 1; translate: -50% 8px; }
.tapbtn {
  display: none; position: absolute; right: 12px; bottom: 12px; z-index: 4; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  border: 1.5px solid var(--cyan); background: rgba(10, 40, 100, .92); color: #fff; font: 800 15px/1 var(--f-ui);
}

/* 下段: ネコ・キーボード・必殺ゲージ */
.bottom { display: grid; grid-template-columns: 272px minmax(0, 1fr) 262px; gap: 18px; min-height: 0; }
.catzone { position: relative; }
.cat { position: absolute; left: -24px; bottom: -20px; width: 312px; height: auto; overflow: visible; }
.bubble {
  position: absolute; left: 0; top: -44px; z-index: 3; width: 214px; padding: 13px 14px; border-radius: 22px;
  background: #fff; color: #0d2350; font: 800 18px/1.35 var(--f-ui); text-align: center; text-wrap: balance;
  transform: rotate(-6deg); box-shadow: 0 6px 0 rgba(0, 20, 60, .35), 0 0 18px rgba(120, 200, 255, .5);
}
.bubble::after { content: ""; position: absolute; left: 98px; bottom: -15px; border: 11px solid transparent; border-top: 17px solid #fff; border-bottom: 0; transform: skewX(-16deg); }
.bubble.pop { animation: bpop .32s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bpop { from { scale: .7; } }
.kb { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; min-width: 0; }
.kb-row { flex: 1; display: flex; gap: 7px; min-height: 0; }
.key {
  position: relative; flex: var(--u, 1) 1 0; min-width: 0; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(180deg, #142a57, #0d1d40); border: 1.5px solid #27467f;
  box-shadow: 0 3px 0 #081430, inset 0 1px 0 rgba(150, 200, 255, .12);
  font: 600 20px/1 var(--f-code); color: #c9d8f5; transition: background .12s, box-shadow .12s, border-color .12s, transform .06s;
}
.key .s { position: absolute; left: 7px; top: 5px; font-size: 12px; color: #7f95c4; }
.key.mod { font: 700 15px/1 var(--f-ui); color: #9fb3dc; }
.key.next { border-color: #3d86ff; color: #e6f0ff; box-shadow: 0 0 9px rgba(60, 140, 255, .65), 0 3px 0 #081430; }
.key.target-shift { border-color: #6fd0ff; color: #fff; box-shadow: 0 0 14px rgba(70, 214, 255, .65), 0 3px 0 #081430; }
.key.target {
  background: linear-gradient(180deg, #2a8cff, #1757d6); border-color: #9be6ff; color: #fff;
  box-shadow: 0 0 0 2px rgba(70, 214, 255, .5), 0 0 20px rgba(70, 214, 255, .9), inset 0 0 12px rgba(180, 240, 255, .5);
}
.key.target .s { color: #dff6ff; }
.key.down { transform: translateY(3px); }
.key.down.okk { background: linear-gradient(180deg, var(--cyan), #1d8dff); color: #04204f; }
.key.down.ngk { background: linear-gradient(180deg, #ff6a88, #c2244a); border-color: #ffb3c3; color: #fff; }
.key.enter-top { border-bottom-left-radius: 0; border-bottom-right-radius: 0; border-bottom-color: transparent; z-index: 1; }
.key.enter-bot { margin-top: -9px; border-top: 0; border-top-left-radius: 0; border-top-right-radius: 0; }
.gauge { display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; min-width: 0; }
.g-title { font: 800 17px/1.35 var(--f-ui); color: #fff; text-align: center; text-wrap: balance; }
.g-title b { margin: 0 2px; font: 700 28px/1 var(--f-num); color: var(--cyan); }
.g-title .fire { font: 800 20px/1.35 var(--f-ui); color: var(--gold); text-shadow: 0 0 12px rgba(255, 200, 80, .8); }
.g-next { flex: 1; min-height: 0; overflow: hidden; padding: 10px 12px; border-radius: 10px; background: rgba(4, 12, 32, .7); border: 1px solid var(--edge-soft); }
.g-next-head { display: flex; gap: 8px; margin-bottom: 8px; font: 700 12px/1 var(--f-num); letter-spacing: .14em; color: var(--muted); }
.g-next-head span { font: 600 12px/1 var(--f-code); letter-spacing: 0; color: #cfe0ff; }
.g-next pre { margin: 0; overflow: hidden; font: 400 12.5px/1.6 var(--f-code); color: #8ea4cf; white-space: pre; }
.g-bar { height: 14px; }
.g-count { text-align: center; font: 700 21px/1 var(--f-num); color: #cfe0ff; font-variant-numeric: tabular-nums; }
.g-count b { font-size: 27px; color: #fff; }
.gauge.disabled .g-bar, .gauge.disabled .g-count { opacity: .3; }
.gauge.hot { border-color: #8fe6ff; animation: hot .7s ease-in-out infinite alternate; }
@keyframes hot { to { box-shadow: inset 0 0 0 1px rgba(120, 190, 255, .2), 0 0 34px rgba(70, 214, 255, .75), 0 0 4px #fff; } }

/* 左下のネコ（動画をキャンバスに描き、端をぼかして背景になじませる） */
.cat { aspect-ratio: 560 / 504; }
.cat-video { display: none; }
.cat-canvas { position: absolute; inset: 0; width: 100%; height: 100%; transition: filter .2s; }
.cat.oops .cat-canvas { filter: drop-shadow(0 0 10px rgba(255, 90, 122, .8)); }
.cat.power .cat-canvas { filter: brightness(1.12) saturate(1.2) drop-shadow(0 0 12px var(--cyan)); }
.cat-fx { position: absolute; inset: -10%; width: 120%; height: 120%; overflow: visible; pointer-events: none; }
.cat-fx .spark, .cat-fx .sweat, .cat-fx .oops-mark { opacity: 0; }
.cat-fx .oops-mark { font-family: var(--f-impact); }
.cat.happy .spark { opacity: 1; animation: twinkle .4s steps(2) infinite; }
@keyframes twinkle { 50% { opacity: .3; } }
.cat.oops .sweat, .cat.oops .oops-mark { opacity: 1; }

/* 必殺技演出 */
.special { position: absolute; inset: 0; z-index: 40; pointer-events: none; visibility: hidden; --bx: 1050px; --by: 385px; }
.special.on { visibility: visible; }
.special.out { opacity: 0; transition: opacity .45s ease; }
.sp-dim { position: absolute; inset: 0; background: radial-gradient(720px 520px at var(--bx) var(--by), rgba(40, 140, 255, .3), rgba(2, 8, 26, .32) 72%); }
.sp-speed {
  position: absolute; inset: 0;
  background: repeating-conic-gradient(from 0deg at var(--bx) var(--by), rgba(170, 235, 255, 0) 0deg 3.2deg, rgba(170, 235, 255, .3) 3.2deg 3.7deg, rgba(170, 235, 255, 0) 3.7deg 7deg);
  -webkit-mask-image: radial-gradient(circle at var(--bx) var(--by), transparent 140px, #000 330px, #000 500px, transparent 820px);
  mask-image: radial-gradient(circle at var(--bx) var(--by), transparent 140px, #000 330px, #000 500px, transparent 820px);
}
.special.on .sp-speed { animation: speed .12s steps(2) infinite; }
@keyframes speed { 50% { opacity: .5; } }
/* 必殺技の猫（動画をキャンバスに描く）。肉球の位置が --bx / --by に来るよう配置する */
.sp-video { display: none; }
.sp-cat { position: absolute; left: calc(var(--bx) - 244px); top: calc(var(--by) - 288px); width: 720px; height: auto; }
.special.on .sp-cat { animation: spCatIn .3s ease-out both; }
@keyframes spCatIn { from { opacity: 0; scale: 1.08; } }
.sp-paw { position: absolute; left: var(--bx); top: var(--by); width: 1px; height: 1px; }
/* 肉球から左へのびるビーム */
.sp-beam {
  position: absolute; left: 0; top: var(--by); width: var(--bx); height: 72px; translate: 0 -50%; opacity: 0; transform-origin: 100% 50%;
  background: linear-gradient(180deg, rgba(70, 214, 255, 0), rgba(70, 214, 255, .35) 22%, rgba(170, 240, 255, .9) 40%, #fff 50%, rgba(170, 240, 255, .9) 60%, rgba(70, 214, 255, .35) 78%, rgba(70, 214, 255, 0));
  filter: drop-shadow(0 0 18px var(--cyan)) drop-shadow(0 0 40px rgba(42, 120, 255, .8));
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%); mask-image: linear-gradient(90deg, transparent, #000 6%);
}
.sp-beam i { position: absolute; inset: 38% 0; filter: blur(3px); background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, .6) 50px, rgba(255, 255, 255, 0) 100px, rgba(255, 255, 255, 0) 190px); animation: beamFlow .22s linear infinite; }
.sp-beam.on { opacity: 1; animation: beamIn .18s ease-out both, beamWobble .09s steps(2) .18s infinite; }
@keyframes beamIn { from { scale: 0 .3; } to { scale: 1 1; } }
@keyframes beamWobble { 50% { scale: 1 .82; } }
@keyframes beamFlow { from { background-position: 0 0; } to { background-position: -190px 0; } }
.sp-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle at var(--bx) var(--by), #fff, rgba(160, 235, 255, .85) 30%, rgba(60, 160, 255, .4) 70%); }
.special.on .sp-flash { animation: flash .6s ease-out both; }
@keyframes flash { 0% { opacity: 0; } 8% { opacity: 1; } 100% { opacity: 0; } }

/* 背景をゆっくり流れるコード記号 */
.ambient { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ambient span { position: absolute; bottom: -60px; color: rgba(90, 160, 255, .13); font: 600 var(--fs, 22px)/1 var(--f-code); white-space: nowrap; animation: rise var(--dur, 20s) linear var(--delay, 0s) infinite; }
@keyframes rise { from { translate: 0 0; rotate: 0deg; } to { translate: var(--dx, 0px) -1100px; rotate: var(--rot, 20deg); } }
/* ミスしたときの赤いフラッシュ */
.vignette { position: absolute; inset: 0; z-index: 35; pointer-events: none; opacity: 0; box-shadow: inset 0 0 140px 30px rgba(255, 50, 90, .55); }
.vignette.on { animation: vig .35s ease-out; }
@keyframes vig { from { opacity: 1; } to { opacity: 0; } }
/* コンボの節目で出る文字 */
.combo-pop {
  position: absolute; right: 70px; top: 150px; z-index: 36; pointer-events: none; opacity: 0; white-space: nowrap;
  font: 400 64px/1 var(--f-impact); color: var(--gold); text-shadow: 0 0 18px rgba(255, 200, 80, .8), 0 5px 0 #8a4b00;
}
.combo-pop small { display: block; margin-top: 4px; text-align: right; font: 700 20px/1 var(--f-ui); color: #fff; text-shadow: 0 0 10px var(--cyan); }
.combo-pop.show { animation: comboPop 1.2s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes comboPop { 0% { opacity: 0; scale: .4; rotate: -12deg; } 18% { opacity: 1; scale: 1.08; rotate: -6deg; } 30% { scale: 1; } 75% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -40px; rotate: -6deg; } }
/* コード完成時に走る光 */
.codewrap::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; translate: -110% 0; background: linear-gradient(100deg, transparent 30%, rgba(160, 235, 255, .35) 48%, rgba(255, 255, 255, .5) 50%, rgba(160, 235, 255, .35) 52%, transparent 70%); }
.codewrap.sweep::after { animation: sweep .75s ease-out; }
@keyframes sweep { from { translate: -110% 0; } to { translate: 110% 0; } }
/* レベルアップでゲージが光る */
.bar.flash { animation: barFlash .7s ease-out; }
@keyframes barFlash { 0% { box-shadow: 0 0 0 2px #fff, 0 0 26px var(--gold); border-color: #fff; } 100% { box-shadow: none; } }
/* タイトルのネコがふわふわ浮く */
.logo svg { animation: float 2.8s ease-in-out infinite; }
@keyframes float { 50% { translate: 0 -6px; } }

.bigmsg {
  position: absolute; left: 50%; top: 42%; z-index: 50; translate: -50% -50%; pointer-events: none; opacity: 0; white-space: nowrap;
  font: 400 124px/1 var(--f-impact); color: #fff; text-shadow: 0 0 24px var(--cyan), 0 8px 0 #0b3a9c;
}
/* レベルアップはタイピング画面に重ならないよう、右上のHUDの下に小さく出す */
.bigmsg.lv { left: auto; right: 34px; top: 120px; translate: 0 0; transform-origin: 100% 50%; font-size: 34px; color: var(--gold); text-shadow: 0 0 14px rgba(255, 200, 80, .8), 0 3px 0 #8a4b00; }
.bigmsg.show { animation: big 1.3s ease-out both; }
.bigmsg.tu.show { animation-duration: 1.7s; }
@keyframes big { 0% { opacity: 0; scale: 2.4; } 15% { opacity: 1; scale: .95; } 25% { scale: 1; } 80% { opacity: 1; } 100% { opacity: 0; scale: 1.05; } }

/* オーバーレイ（タイトル・カウント・ポーズ・結果） */
.ov { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(10, 30, 80, .5), rgba(2, 6, 20, .84)); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.ov.clear { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.card { width: 780px; max-width: 100%; padding: 32px 44px 28px; display: grid; gap: 20px; justify-items: center; text-align: center; }
.card.small { width: 560px; }
.logo { display: flex; align-items: center; gap: 18px; }
.logo svg { width: 118px; height: auto; overflow: visible; }
.logo-sub { font: 700 16px/1 var(--f-num); letter-spacing: .42em; color: var(--cyan); text-align: left; }
.logo-title { position: relative; }
/* タイトル右下に重ねるβ版ラベル */
.beta-tag { position: absolute; right: -22px; bottom: -22px; padding: 7px 16px; border-radius: 999px; background: #ffb547; color: #2a1600; font: 700 22px/1 var(--f-ui); letter-spacing: .06em; text-shadow: none; transform: rotate(-6deg); box-shadow: 0 0 12px rgba(255, 181, 71, .55); }
.logo-title { margin-top: 8px; font: 400 60px/1.05 var(--f-impact); color: #fff; text-shadow: 0 0 18px rgba(70, 190, 255, .6), 0 5px 0 #0b3a9c; }
.opts { width: 100%; display: grid; gap: 14px; }
.opt { display: grid; grid-template-columns: 132px 1fr; align-items: center; gap: 16px; }
.opt-lbl { text-align: right; font: 800 16px/1.2 var(--f-ui); color: var(--muted); }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button {
  padding: 10px 18px; border-radius: 999px; cursor: pointer; border: 1.5px solid #2c5bb8; background: #0b1b40; color: #b9cdf2;
  font: 700 17px/1 var(--f-ui); transition: background .15s, box-shadow .15s, color .15s;
}
.seg button:hover { border-color: #5a94ff; color: #fff; }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, #2f8bff, #1a5ee0); border-color: #a5e9ff; color: #fff; box-shadow: 0 0 14px rgba(70, 190, 255, .6); }
/* 言語ボタンのロゴ（高さをそろえ、横長のPHPは幅に合わせる） */
.lang-logo { display: block; height: 22px; width: auto; flex: none; }
.lang-logo.js { border-radius: 4px; }
.seg.langs button { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; font-size: 15px; }
.seg-note { width: 100%; font: 700 12px/1 var(--f-ui); color: var(--muted); text-align: left; padding-left: 4px; }
.row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.btn {
  padding: 15px 44px; border-radius: 14px; cursor: pointer; border: 2px solid var(--cyan-hi);
  background: linear-gradient(180deg, var(--cyan), var(--blue)); color: #031a4a; font: 800 24px/1 var(--f-ui);
  box-shadow: 0 0 22px rgba(70, 214, 255, .7), 0 5px 0 #0b3a9c; transition: transform .1s, box-shadow .1s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 0 18px rgba(70, 214, 255, .7), 0 1px 0 #0b3a9c; }
.btn.ghost { padding: 13px 24px; background: rgba(8, 20, 50, .6); color: #cfe3ff; border-color: #3d6fd0; box-shadow: none; font-size: 18px; }
.hint { max-width: 640px; font: 700 14px/1.9 var(--f-ui); color: var(--muted); text-wrap: balance; }
kbd { padding: 1px 7px; border-radius: 5px; border: 1px solid #3a5ea8; background: #0b1b40; color: #dfeaff; font: 600 13px/1 var(--f-code); }
.best { min-height: 1em; font: 800 16px/1 var(--f-ui); color: var(--gold); }
.best b { font: 700 22px/1 var(--f-num); margin-left: 4px; }
.ov-title { font: 400 54px/1 var(--f-impact); color: #fff; letter-spacing: .06em; text-shadow: 0 0 18px rgba(70, 190, 255, .6), 0 5px 0 #0b3a9c; }
.count { font: 400 230px/1 var(--f-impact); color: #fff; text-shadow: 0 0 34px var(--cyan), 0 12px 0 #0b3a9c; }
.count.go { animation: cpop .6s ease-out both; }
@keyframes cpop { 0% { scale: 2; opacity: 0; } 25% { scale: .92; opacity: 1; } 40% { scale: 1; } 100% { scale: 1; opacity: .9; } }
.res-head { display: flex; align-items: center; gap: 34px; }
.rank {
  width: 148px; height: 148px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 3px solid currentColor;
  font: 400 104px/1 var(--f-impact); color: var(--cyan); text-shadow: 0 0 22px currentColor; box-shadow: 0 0 26px currentColor, inset 0 0 22px currentColor;
  animation: rankIn .6s cubic-bezier(.2, 1.6, .4, 1) .2s both;
}
.rank.S { color: var(--gold); } .rank.A { color: #ff8fd0; } .rank.B { color: var(--cyan); } .rank.C { color: #8fe3a8; } .rank.D { color: #9fb3dc; }
@keyframes rankIn { from { scale: 2.6; opacity: 0; } }
.res-score { display: grid; gap: 6px; justify-items: start; }
.res-score .big { font: 700 72px/1 var(--f-num); color: #fff; font-variant-numeric: tabular-nums; text-shadow: 0 0 16px rgba(100, 190, 255, .55); }
.res-score .sub { font: 700 15px/1 var(--f-ui); color: var(--muted); }
.newrec { padding: 5px 12px; border-radius: 999px; background: var(--gold); color: #3a2400; font: 800 14px/1 var(--f-ui); animation: pulse .6s ease-in-out infinite alternate; }
.res-grid { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.res-item { padding: 13px 10px; border-radius: 12px; background: rgba(4, 12, 32, .6); border: 1px solid var(--edge-soft); }
.res-item .lbl { font-family: var(--f-ui); font-size: 13px; letter-spacing: .06em; }
.res-item .val { margin-top: 8px; font: 700 34px/1 var(--f-num); font-variant-numeric: tabular-nums; }
.res-item .val small { margin-left: 3px; font: 700 13px/1 var(--f-ui); color: var(--muted); }
.plist { width: 100%; max-height: 300px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; padding: 2px; }
.plist button {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 11px 14px; border-radius: 10px; cursor: pointer;
  border: 1.5px solid #2c5bb8; background: #0b1b40; color: #cfdcf5; font: 600 15px/1 var(--f-code); text-align: left;
}
.plist button:hover { border-color: #5a94ff; color: #fff; }
.plist button[aria-pressed="true"] { background: linear-gradient(180deg, #2f8bff, #1a5ee0); border-color: #a5e9ff; color: #fff; box-shadow: 0 0 14px rgba(70, 190, 255, .6); }
.plist .pf { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .pl { flex: none; color: var(--gold); font: 700 13px/1 var(--f-ui); letter-spacing: .05em; }
.weak { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 14px; font: 700 15px/1.4 var(--f-ui); color: #dfe9ff; }
.weak .lbl { font-family: var(--f-ui); font-size: 13px; letter-spacing: .06em; }
.weak .wk { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-num); font-size: 18px; }
.weak kbd { font-size: 15px; padding: 3px 9px; border-color: rgba(255, 90, 122, .7); }
.ov-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.soon { padding: 6px 12px; border-radius: 999px; border: 1px dashed var(--gold); color: var(--gold); font: 800 13px/1 var(--f-ui); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.rk-filters { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 14px; }
.rk-select select { padding: 9px 14px; border-radius: 999px; border: 1.5px solid #2c5bb8; background: #0b1b40; color: #dfe9ff; font: 700 15px/1 var(--f-ui); }
.rk-wrap { width: 100%; overflow-x: auto; }
.rk-table { width: 100%; border-collapse: collapse; font: 700 16px/1 var(--f-ui); font-variant-numeric: tabular-nums; }
.rk-table th { padding: 8px 10px; font-size: 12px; letter-spacing: .08em; color: var(--label); text-align: left; border-bottom: 1px solid var(--edge-soft); }
.rk-table td { padding: 9px 10px; border-bottom: 1px solid rgba(90, 150, 255, .12); text-align: left; color: #dfe9ff; }
.rk-table td.num { font-family: var(--f-num); font-size: 19px; }
.rk-table th:nth-child(n+3), .rk-table td:nth-child(n+3) { text-align: right; }
.rk-table .pos { width: 64px; font: 700 20px/1 var(--f-num); color: var(--muted); }
.rk-table tr.top1 .pos { color: var(--gold); } .rk-table tr.top2 .pos { color: #dfe7f5; } .rk-table tr.top3 .pos { color: #e8a36a; }
.rk-table tr.top1 td { background: rgba(255, 211, 107, .08); }
.rk-me { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; border: 1.5px solid var(--cyan); background: rgba(70, 214, 255, .08); font: 800 15px/1.3 var(--f-ui); }
.rk-me b { font: 700 24px/1 var(--f-num); color: #fff; }
.vs { display: flex; align-items: center; justify-content: center; gap: 34px; }
.vs-side { display: grid; justify-items: center; gap: 6px; font: 800 17px/1.2 var(--f-ui); }
.vs-side span { font: 700 13px/1.2 var(--f-ui); color: var(--muted); }
.vs-icon { width: 96px; height: 96px; border-radius: 50%; border: 3px solid var(--cyan); box-shadow: 0 0 18px rgba(70, 214, 255, .6); }
.vs-icon.me { object-fit: cover; object-position: 42% 22%; background: #0a1a3e; }
.vs-icon.foe { display: grid; place-items: center; border-color: #3d5a96; box-shadow: none; background: #0b1b40; color: #5f77a8; font: 400 44px/1 var(--f-impact); }
.vs-icon.foe.searching { border-color: var(--gold); border-top-color: transparent; animation: ring 1s linear infinite; }
.vs-mark { font: 400 56px/1 var(--f-impact); color: var(--gold); text-shadow: 0 0 18px rgba(255, 200, 80, .8), 0 5px 0 #8a4b00; }
.ol-grid { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ol-card { display: grid; gap: 12px; align-content: start; justify-items: center; padding: 18px 16px; border-radius: 12px; background: rgba(4, 12, 32, .6); border: 1px solid var(--edge-soft); }
.ol-card h3 { margin: 0; font: 800 19px/1.2 var(--f-ui); color: #fff; }
.ol-card p { margin: 0; font: 700 13px/1.6 var(--f-ui); color: var(--muted); text-wrap: pretty; }
.ol-card .btn { font-size: 18px; padding: 12px 22px; }
.ol-room { display: flex; gap: 8px; width: 100%; }
.ol-room input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; border: 1.5px solid #2c5bb8; background: #0b1b40; color: #dfe9ff; font: 700 15px/1 var(--f-code); }
.ol-room .btn { padding: 10px 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ol-status { min-height: 1.5em; margin: 0; font: 800 15px/1.5 var(--f-ui); color: var(--cyan-hi); text-align: center; }
.res-comment { display: flex; align-items: center; gap: 14px; text-align: left; font: 800 17px/1.5 var(--f-ui); color: #fff; }
.res-comment svg { width: 64px; flex: none; overflow: visible; }

#fx { position: fixed; inset: 0; z-index: 80; width: 100%; height: 100%; pointer-events: none; }
#mobileInput { position: fixed; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; resize: none; font-size: 16px; pointer-events: none; }

/* スマホ幅: 縦積みレイアウト（キーボード表示は省略） */
@media (max-width: 859px) {
  body { overflow: auto; }
  #viewport { position: static; overflow: visible; }
  #stage { position: relative; left: auto; top: auto; width: auto; height: auto; transform: none; }
  .layout { position: relative; display: flex; flex-direction: column; gap: 12px; padding-inline: 16px; padding-block: 14px 28px; }
  .top { flex-direction: column; align-items: stretch; gap: 12px; }
  .badge { height: 38px; padding: 0 12px; font-size: 17px; }
  .banner h1 { height: 38px; padding: 0 34px 0 18px; font-size: 19px; }
  .slashes { height: 38px; }
  .desc { font-size: 13px; line-height: 1.6; }
  .hud { width: auto; height: 74px; padding: 0 6px; }
  .hud .cell { min-width: 0; padding: 0 10px; }
  .hud .val { font-size: 30px; }
  .exp { padding-left: 10px; }
  .exp-row { font-size: 15px; } .lv b { font-size: 19px; }
  .mute { width: 36px; height: 36px; }
  .mid { display: flex; flex-direction: column; gap: 12px; }
  .side { align-self: stretch; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 10px; padding: 6px 12px 10px; }
  .stat { padding: 6px 0; border: 0; }
  .stat .val, .stat.time .val { font-size: 24px; margin-top: 4px; }
  .streak { grid-column: 1 / -1; margin-top: 4px; grid-template-columns: 18px 1fr auto; }
  .streak b { grid-column: auto; }
  .editor { height: 54vh; min-height: 300px; }
  .codewrap { overflow: auto; }
  .code { padding-top: 10px; font-size: 14px; line-height: 24px; }
  .ln .no { width: 40px; padding-right: 12px; }
  .tapbtn { display: block; }
  .termview { min-height: 340px; gap: 10px; padding-top: 64px; }
  .tv-next b { font-size: 16px; }
  .tv-word { font-size: 40px; } .tv-roma { font-size: 24px; } .tv-desc { font-size: 14px; }
  .stamp { font-size: 42px; } .stamp small { font-size: 20px; }
  .bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .kb { display: none; }
  .catzone { min-height: 250px; }
  .cat { left: 50%; bottom: 0; width: 230px; height: auto; translate: -50% 0; }
  .bubble { top: 0; left: 0; right: 0; width: auto; padding: 10px; font-size: 14px; }
  .bubble::after { left: 46%; }
  .gauge { padding: 12px; }
  .special { position: fixed; --bx: 52vw; --by: 34vh; }
  .sp-cat { width: 360px; left: calc(var(--bx) - 122px); top: calc(var(--by) - 144px); }
  .sp-beam { height: 54px; }
  .bigmsg { position: fixed; font-size: 52px; }
  .combo-pop { position: fixed; right: 16px; top: 30vh; font-size: 40px; }
  .vignette { position: fixed; } .bigmsg.lv { top: 12px; right: 16px; font-size: 22px; }
  .ov { position: fixed; padding: 16px; overflow: auto; place-items: start center; }
  .card { width: auto; padding: 22px 16px; gap: 16px; }
  .logo { flex-direction: column; } .logo svg { width: 84px; } .logo-sub { text-align: center; letter-spacing: .25em; } .logo-title { font-size: 28px; } .beta-tag { right: -34px; bottom: -13px; padding: 4px 10px; font-size: 14px; }
  .opt { grid-template-columns: 1fr; gap: 8px; } .opt-lbl { text-align: left; }
  .seg button { padding: 9px 14px; font-size: 15px; }
  .btn { font-size: 20px; padding: 13px 30px; }
  .res-head { gap: 18px; } .rank { width: 96px; height: 96px; font-size: 64px; } .res-score .big { font-size: 46px; }
  .res-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ol-grid { grid-template-columns: 1fr; }
  .vs { gap: 14px; } .vs-icon { width: 72px; height: 72px; } .vs-mark { font-size: 36px; }
  .count { font-size: 140px; }
}
@media (prefers-reduced-motion: reduce) {
  .ambient span, .logo svg, .cat-ring, .cat-frame { animation: none; }
  .vignette.on { animation-duration: .15s; }
  .layout.shake, .editor.shake { animation: none; }
  .special.on .sp-speed, .sp-beam.on, .sp-beam i { animation: none; }
  .special.on .sp-flash { animation-duration: .25s; }
  .special.on .sp-cat { animation: none; }
}
