:root {
  --night: #12142a;
  --night-2: #1c1f3d;
  --line: #3a4170;
  --text: #f7f1e3;
  --muted: #a9aed0;
  --paper: #fdf6e6;
  --ink: #2a1a12;
  --ink-soft: #6d5442;
  --red: #e0452f;
  --gold: #ffc94d;
  --win: #22b26a;
  --blue: #3d8bff;
  --heat: 0; /* さばいた枚数で上がる(0〜1) */
  --display: "Dela Gothic One", "Hiragino Kaku Gothic StdN", "Hiragino Sans", "Yu Gothic", sans-serif;
  --body: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--night);
  color: var(--text);
  font-family: var(--body);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

/* さばくほど背景が熱くなる */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 60% at 50% -10%, rgb(255 110 50 / calc(var(--heat) * .3)), transparent 70%),
    radial-gradient(90% 50% at 50% 110%, rgb(120 90 255 / .2), transparent 70%),
    var(--night);
}

button, a { font: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  width: min(100%, 480px);
  height: 100dvh;
  margin-inline: auto;
  padding: max(10px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
}

/* ---- 上部 ---- */
.hud {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.logo {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  margin: 0;
  font: 400 clamp(20px, 6vw, 24px)/1 var(--display);
  white-space: nowrap;
}

.logo span { color: var(--gold); }

/* 狭い画面では点数を優先してロゴを隠す */
@media (max-width: 359px) {
  .hud .logo { visibility: hidden; }
}
.logo.big { flex: none; font-size: 44px; }

.score {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin: 0;
}

.score b {
  color: var(--gold);
  font: 400 clamp(20px, 6.2vw, 26px)/1 var(--display);
  font-variant-numeric: tabular-nums;
}

.score span { color: var(--muted); font-size: 12px; font-weight: 800; }
.score.bump b { animation: bump .3s cubic-bezier(.2, 1.8, .4, 1); display: inline-block; }

@keyframes bump {
  40% { transform: scale(1.35); }
}

.best { margin: 0; color: var(--muted); font-size: 11px; font-weight: 800; line-height: 1.35; text-align: right; white-space: nowrap; }
.best b { color: var(--text); font-size: 13px; }

.help {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

/* ---- お題(基準) ---- */
.ref {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 12px 14px 14px;
  border: 2px solid var(--gold);
  border-radius: 18px;
  background: linear-gradient(135deg, #24285a, #1a1d3c);
}

.ref.swap { animation: swap .45s cubic-bezier(.2, 1.4, .4, 1); }

@keyframes swap {
  from { transform: scale(.85); opacity: 0; }
}

.ref p { margin: 0; }

.ref-theme {
  color: var(--gold);
  font: 400 clamp(17px, 5.2vw, 21px)/1.2 var(--display);
  text-align: center;
}

/* お題はいちばん目立たせる */
.theme-title {
  min-width: 0;
  color: var(--gold);
  font: 400 clamp(19px, 5.8vw, 24px)/1.15 var(--display);
  overflow-wrap: anywhere;
}

.level {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font: 400 11px/1.4 var(--display);
}

.ref-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ref-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: #ece2c9;
  object-fit: cover;
}

.ref-q { display: grid; min-width: 0; }

/* 基準の値がこの画面の支点。いちばん大きく */
.ref-value {
  color: #fff;
  font: 400 clamp(26px, 8.4vw, 40px)/1.05 var(--display);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.ref-value::after {
  content: " より";
  color: var(--muted);
  font: 800 15px/1 var(--body);
}

.ref-name {
  display: block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.ref-line { font-size: 16px; font-weight: 800; }

.ref-line b {
  color: var(--gold);
  font: 400 clamp(24px, 7.4vw, 30px)/1.1 var(--display);
  font-variant-numeric: tabular-nums;
}

/* 「低い？それとも高い？」(色はボタンと同じ) */
.ask {
  text-align: center;
  font: 400 clamp(20px, 6vw, 24px)/1.2 var(--display);
}

.ask-down { color: #7fb4ff; }
.ask-up { color: #ff8a5c; }
.ask-or { margin: 0 6px; color: var(--muted); font: 800 13px/1 var(--body); }
.ask-ref { margin-right: 2px; color: var(--text); font: 800 .7em/1 var(--body); }

/* ---- カード ---- */
.table {
  position: relative;
  flex: 1;
  min-height: 0;
  container-type: size; /* カードを置き場の高さに合わせて縮める */
  display: grid;
  place-items: center;
}

.side {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  border-radius: 20px;
  opacity: 0;
  transition: opacity .12s;
  pointer-events: none;
}

.side.left { left: 0; background: linear-gradient(90deg, rgb(61 139 255 / .35), transparent); }
.side.right { right: 0; background: linear-gradient(270deg, rgb(255 110 60 / .35), transparent); }
.side.on { opacity: 1; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 300px, calc(100cqh - 76px));
  max-height: 100%;
  padding: 8px 8px 12px;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 14px 30px rgb(0 0 0 / .45);
  touch-action: none;
  cursor: grab;
  will-change: transform;
}

.card.enter { animation: enter .18s ease-out; }

@keyframes enter {
  from { transform: translateY(30px) scale(.9); opacity: 0; }
}

.shot {
  flex: 1;
  min-height: 0;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 15px;
  background: #ece2c9;
}

.shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.card p { margin: 0; }

.card-name {
  margin-top: 10px !important;
  font-size: clamp(18px, 5.4vw, 22px);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.card-desc {
  min-height: 1.4em;
  margin-top: 2px !important;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-value {
  position: absolute;
  left: 50%;
  top: 40%;
  display: none;
  padding: 6px 16px;
  border-radius: 14px;
  background: rgb(18 20 42 / .9);
  color: #fff;
  font: 400 30px/1.1 var(--display);
  white-space: nowrap;
  transform: translate(-50%, -50%);
}

.card.wrong .card-value { background: var(--red); }

.stamp {
  position: absolute;
  top: 18px;
  padding: 4px 12px;
  border: 4px solid currentColor;
  border-radius: 12px;
  background: rgb(255 255 255 / .92);
  font: 400 22px/1.1 var(--display);
}

.stamp.left { left: 16px; color: var(--blue); transform: rotate(-10deg); }
.stamp.right { right: 16px; color: #ff6a3d; transform: rotate(10deg); }

.card.wrong { animation: shake .4s; box-shadow: 0 0 0 5px var(--red), 0 14px 30px rgb(0 0 0 / .45); }

@keyframes shake {
  20%, 60% { transform: translateX(-10px); }
  40%, 80% { transform: translateX(10px); }
}

.combo {
  position: absolute;
  top: 8px;
  margin: 0;
  color: var(--gold);
  font: 400 22px/1 var(--display);
  text-shadow: 0 2px 10px rgb(0 0 0 / .6);
  pointer-events: none;
  animation: combo .5s ease-out forwards;
}

.combo[hidden] { display: none; }

@keyframes combo {
  from { transform: translateY(10px) scale(.6); opacity: 0; }
  40% { transform: translateY(0) scale(1.15); opacity: 1; }
  to { transform: translateY(-14px); opacity: 0; }
}

/* ---- 残り時間 ---- */
.timer {
  position: relative;
  height: 8px;
  border-radius: 4px;
  background: #0e1024;
}

#timerFill {
  display: block;
  border-radius: 4px;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #ff6a3d, #ffc94d 40%, #2fd081);
  transform-origin: left;
}

/* ---- ボタン ---- */
.choose {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choose button {
  min-height: 64px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  font: 400 clamp(18px, 5.6vw, 22px)/1 var(--display);
  cursor: pointer;
}

.choose .down { background: linear-gradient(180deg, #5aa0ff, #2f6fd6); box-shadow: 0 5px 0 #1f4c96; }
.choose .up { background: linear-gradient(180deg, #ff8a5c, #e0452f); box-shadow: 0 5px 0 #9a2a18; }
.choose button:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.choose button:disabled { opacity: .5; }

.credit {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.credit a { color: inherit; }

/* ---- 始め・終わり ---- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(8 9 18 / .78);
}

.overlay[hidden] { display: none; }

.panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(100%, 380px);
  min-width: 0;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px 18px 18px;
  border: 2px solid var(--gold);
  border-radius: 22px;
  background: var(--night-2);
  text-align: center;
  animation: pop .3s cubic-bezier(.2, 1.5, .4, 1);
}

@keyframes pop {
  from { transform: scale(.75); opacity: 0; }
}

.panel p { margin: 0; }
.intro-rule { font-size: 17px; font-weight: 800; line-height: 1.6; }
.intro-rule b { color: var(--gold); }
.intro-sub, .intro-note { color: var(--muted); font-size: 12px; font-weight: 700; }

.start {
  width: 100%;
  min-height: 62px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #2fd081, #1d9a5c);
  color: #fff;
  font: 400 24px/1 var(--display);
  box-shadow: 0 5px 0 #146b40;
  cursor: pointer;
}

.start:active { transform: translateY(4px); box-shadow: none; }

.over-title { color: var(--muted); font-size: 13px; font-weight: 800; }
.over-score { font-size: 18px; font-weight: 800; }
.over-score b { font: 400 clamp(44px, 14vw, 64px)/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.over-rank { font: 400 22px/1.2 var(--display); }
.over-miss {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgb(224 69 47 / .15);
  color: #ffb3a5;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}
.over-best { color: var(--muted); font-size: 13px; font-weight: 800; }
.over-best.new { color: var(--gold); }

.share {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 50px;
  border-radius: 14px;
  background: #f7f1e3;
  color: #12142a;
  font-weight: 800;
  text-decoration: none;
}

.toast {
  position: fixed;
  top: 40%;
  left: 50%;
  z-index: 6;
  margin: 0;
  padding: 12px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffd66b, #ff9f43);
  color: var(--ink);
  font: 400 22px/1.3 var(--display);
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 8px 26px rgb(255 150 50 / .45);
  transform: translate(-50%, -50%);
  animation: toast 1s ease-out forwards;
  pointer-events: none;
}

.toast[hidden] { display: none; }
.toast small { display: block; margin-top: 4px; font: 800 14px/1.5 var(--body); white-space: normal; }
.toast { max-width: calc(100vw - 32px); }

@keyframes toast {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  15% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; }
  25% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.sheet {
  width: min(calc(100% - 32px), 420px);
  max-height: calc(100dvh - 32px);
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--night-2);
  color: var(--text);
}

.sheet::backdrop { background: rgb(8 9 18 / .72); }
.sheet h2 { margin: 0 0 8px; font: 400 19px/1.3 var(--display); }

.rules {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.sheet-actions {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  margin-top: 14px;
}

.sheet-actions button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

/* ---- ドパガキ仕様: 判定・FEVER・揺れ ---- */
.judge.ok {
  place-content: start center;
  padding-top: 4%;
  gap: 2px;
  animation: judgeOut .75s ease-out forwards;
}

@keyframes judgeOut {
  0%, 55% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-24px); }
}

.judge.ok .judge-mark {
  width: auto;
  height: auto;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
  font: 400 clamp(34px, 11vw, 48px)/1 var(--display);
  letter-spacing: .02em;
  -webkit-text-stroke: 2px #12142a;
  paint-order: stroke fill;
  animation: word .3s cubic-bezier(.2, 2, .4, 1);
}

.judge.perfect .judge-mark { color: #ffe27a; text-shadow: 0 0 18px #ffb800, 0 0 40px #ff7a00; font-size: clamp(34px, 12vw, 54px); }
.judge.great .judge-mark { color: #5cff9d; text-shadow: 0 0 16px #22b26a; }
.judge.good .judge-mark { color: #9fd8ff; text-shadow: 0 0 12px #3d8bff; font-size: clamp(28px, 9vw, 38px); }

@keyframes word {
  from { transform: scale(2.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(.92) rotate(2deg); opacity: 1; }
}

.judge.ok .judge-text { font-size: clamp(14px, 4.2vw, 17px); }

.judge-pts {
  color: var(--gold);
  font: 400 clamp(20px, 6.2vw, 26px)/1 var(--display);
  text-shadow: 0 2px 10px rgb(0 0 0 / .7);
  animation: pts .5s cubic-bezier(.2, 1.6, .4, 1);
}

.judge.ng .judge-pts { display: none; }

@keyframes pts {
  from { transform: translateY(16px) scale(.5); opacity: 0; }
}

.meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -4px;
}

.meter-label {
  min-width: 52px;
  color: var(--muted);
  font: 400 11px/1 var(--display);
  white-space: nowrap;
}

.fever-bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: #0e1024;
}

.fever-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #ff5cc8, #ffc94d);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease-out;
}

body.fever .meter-label { color: #ffe27a; animation: blink .5s steps(2) infinite; }
body.fever .fever-bar span { background: linear-gradient(90deg, #ff5c5c, #ffc94d, #5cff9d, #5cc8ff, #c45cff); }

@keyframes blink {
  50% { opacity: .55; }
}

/* FEVER中は背景が虹色に回る */
body.fever::before {
  background:
    conic-gradient(from var(--spin, 0deg) at 50% 40%, rgb(255 92 92 / .28), rgb(255 201 77 / .28), rgb(92 255 157 / .28), rgb(92 200 255 / .28), rgb(196 92 255 / .28), rgb(255 92 92 / .28)),
    var(--night);
  animation: spin 2.4s linear infinite;
}

@property --spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes spin {
  to { --spin: 360deg; }
}

body.fever .card { box-shadow: 0 0 0 4px #ffe27a, 0 0 34px rgb(255 200 80 / .7), 0 14px 30px rgb(0 0 0 / .45); }

/* FEVERゲージは時間のバーの下に細く */
.timer .fever-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 3px;
  background: transparent;
}

.timer .meter-label {
  position: absolute;
  right: 0;
  bottom: 12px;
  min-width: 0;
}

.card-name[hidden] { display: none; }

.timer.low #timerFill { background: #ff3b2f; animation: blink .24s steps(2) infinite; }

.stage.shake { animation: stageShake .18s; }
.stage.shake-big { animation: stageShake .3s 2; }

@keyframes stageShake {
  25% { transform: translate(-4px, 2px); }
  50% { transform: translate(3px, -3px); }
  75% { transform: translate(-2px, -1px); }
}

.over-stats { color: var(--muted); font-size: 12px; font-weight: 800; }

.over-next {
  padding: 8px 12px;
  border-radius: 12px;
  background: rgb(255 201 77 / .14);
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.over-next[hidden] { display: none; }

#again { animation: pulse 1.1s ease-in-out infinite; }

@keyframes pulse {
  50% { transform: scale(1.04); box-shadow: 0 5px 0 #146b40, 0 0 24px rgb(47 208 129 / .6); }
}

.score b { min-width: 2ch; text-align: right; }

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

/* ---- 正解・不正解 ---- */
.judge {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 6px;
  pointer-events: none;
}

.judge[hidden] { display: none; }

.judge-mark {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  font: 400 76px/1 var(--display);
  color: #fff;
  animation: mark .25s cubic-bezier(.2, 1.8, .4, 1);
}

.judge.ok .judge-mark { background: rgb(34 178 106 / .92); box-shadow: 0 0 40px rgb(34 178 106 / .7); }
.judge.ng .judge-mark { background: rgb(224 69 47 / .95); box-shadow: 0 0 40px rgb(224 69 47 / .7); }

.judge-text {
  padding: 6px 14px;
  border-radius: 12px;
  background: rgb(10 12 30 / .9);
  color: #fff;
  font: 400 clamp(17px, 5vw, 20px)/1.3 var(--display);
  text-align: center;
  white-space: nowrap;
}

@keyframes mark {
  from { transform: scale(.3); opacity: 0; }
}

/* 画面のふちを光らせる(緑=正解、赤=不正解) */
body.flash-ok::after, body.flash-ng::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  animation: flash .45s ease-out forwards;
}

body.flash-ok::after { box-shadow: inset 0 0 0 10px rgb(34 178 106 / .9), inset 0 0 80px rgb(34 178 106 / .5); }
body.flash-ng::after { box-shadow: inset 0 0 0 12px rgb(224 69 47 / .95), inset 0 0 120px rgb(224 69 47 / .6); background: rgb(224 69 47 / .12); animation-duration: 1.2s; }

@keyframes flash {
  to { opacity: 0; }
}

.card.right-answer { box-shadow: 0 0 0 5px var(--win), 0 14px 30px rgb(0 0 0 / .45); }

/* ---- 写真のないカード(映画・ゲームはポスターやパッケージを出せないので文字で見せる) ---- */
.shot { position: relative; }

.poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(150deg, hsl(var(--hue, 220) 70% 42%), hsl(calc(var(--hue, 220) + 40) 70% 22%));
  color: #fff;
  text-align: center;
}

.poster[hidden] { display: none; }
.poster-icon { font-size: 44px; line-height: 1; }

.poster-title {
  font: 400 clamp(22px, 7vw, 30px)/1.25 var(--display);
  overflow-wrap: anywhere;
  text-shadow: 0 2px 10px rgb(0 0 0 / .35);
}

.poster-year {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgb(0 0 0 / .3);
  font-size: 13px;
  font-weight: 800;
}

.ref-icon {
  display: grid;
  place-items: center;
  font-size: 30px;
  background: linear-gradient(150deg, hsl(var(--hue, 220) 70% 42%), hsl(calc(var(--hue, 220) + 40) 70% 22%));
}

.ref-icon[hidden] { display: none; }

/* ロゴ(映画・ゲーム)は切り取らず、白地に収める */
.shot img.is-logo {
  padding: 14%;
  object-fit: contain;
  background: #fff;
}

.ref-img.is-logo {
  padding: 6px;
  object-fit: contain;
  background: #fff;
}


/* カードにも「何の値か」を貼る */
.card-tag {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 1;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(18 20 42 / .88);
  color: var(--gold);
  font: 400 15px/1.2 var(--display);
  white-space: nowrap;
  transform: translateX(-50%);
  box-shadow: 0 3px 10px rgb(0 0 0 / .35);
}

.toast-lv {
  display: block;
  margin-bottom: 4px;
  font: 800 13px/1.2 var(--body);
  letter-spacing: .04em;
}

/* ---- お題の発表(画面いっぱい) ---- */
.splash {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgb(10 11 26 / .9);
  cursor: pointer;
}

.splash[hidden] { display: none; }

.splash-in {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 16px;
  width: min(100%, 420px);
  padding: 26px 18px 30px;
  overflow: hidden;
  border: 3px solid var(--gold);
  border-radius: 26px;
  background: linear-gradient(160deg, #2a2f66, #171a38);
  text-align: center;
  animation: pop .35s cubic-bezier(.2, 1.6, .4, 1);
}

.splash p { margin: 0; }

.splash-lv {
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font: 400 14px/1.3 var(--display);
}

.splash-title {
  color: var(--gold);
  font: 400 clamp(24px, 7.6vw, 36px)/1.2 var(--display);
  overflow-wrap: anywhere;
  animation: titleIn .45s .1s cubic-bezier(.2, 1.8, .4, 1) both;
}

@keyframes titleIn {
  from { transform: scale(1.8); opacity: 0; }
}

.splash-ref {
  display: grid;
  justify-items: center;
  gap: 8px;
  animation: pop .35s .35s cubic-bezier(.2, 1.6, .4, 1) both;
}

.splash-img {
  width: 84px;
  height: 84px;
  border-radius: 16px;
  object-fit: cover;
  background: #ece2c9;
}

.splash-img.ref-icon { display: grid; font-size: 42px; }
.splash-img.ref-icon[hidden] { display: none; }
.splash-img.is-logo { padding: 8px; object-fit: contain; background: #fff; }

.splash-q { display: grid; justify-items: center; text-align: center; }
.splash-name { font-size: 17px; font-weight: 800; }

.splash-value {
  color: #fff;
  font: 400 clamp(34px, 11vw, 48px)/1.05 var(--display);
  overflow-wrap: anywhere;
}

.splash-value::after {
  content: " より";
  color: var(--muted);
  font: 800 16px/1 var(--body);
}

.splash-ask {
  font: 400 clamp(22px, 7vw, 28px)/1.2 var(--display);
  animation: pop .35s .55s cubic-bezier(.2, 1.6, .4, 1) both;
}

.splash-ask .ask-or { margin: 0 10px; font-size: 15px; }

/* 残り時間(左から右へ減る) */
.splash-time {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 5px;
  background: var(--gold);
  transform-origin: left;
  animation: splashTime var(--splash-ms, 2000ms) linear forwards;
}

@keyframes splashTime {
  to { transform: scaleX(0); }
}

/* ---- 結果 ---- */
.over-title { color: var(--muted); font-size: 13px; font-weight: 800; }

.over-break {
  display: flex;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 6px;
  background: #0e1024;
}

.over-break span { flex: 0 1 0; transition: flex-grow .6s ease-out; }
#barBase { background: #8f97c9; }
#barSpeed { background: linear-gradient(90deg, #ffc94d, #ff7a00); }

.over-legend {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: -6px !important;
  font-size: 13px;
  font-weight: 800;
}

.lg-base { color: #b8bee6; }
.lg-speed { color: var(--gold); }

.over-top {
  font: 400 22px/1.2 var(--display);
}

.over-top b { color: var(--gold); font-size: 34px; font-weight: 400; }
.over-top small { margin-left: 6px; color: var(--muted); font: 700 11px/1 var(--body); }

.over-next.new { background: rgb(255 201 77 / .25); color: #ffe27a; font-size: 16px; }

/* ミスしたカードの事実と豆知識 */
.over-miss { display: grid; gap: 6px; width: 100%; text-align: left; }
.over-miss[hidden] { display: none; }
.miss-head { font-size: 13px; }

.miss-fact {
  color: #f7f1e3;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.6;
  animation: pop .3s ease-out;
}

.miss-fact[hidden], .miss-src[hidden] { display: none; }
.miss-src { color: var(--muted); font-size: 10px; font-weight: 700; }
