@font-face {
  font-family: "DSEG7 Classic";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/npm/dseg@0.46.0/fonts/DSEG7-Classic/DSEG7Classic-Regular.woff2") format("woff2");
}

:root {
  --bg-deep: #05060a;
  --bg-mid: #0c1018;
  --bg-elev: #121826;
  --panel: rgba(18, 24, 36, 0.78);
  --panel-border: rgba(255, 255, 255, 0.07);
  --text: #eef2fa;
  --muted: #8b95ab;
  --accent: #7cb8ff;
  --accent-soft: rgba(124, 184, 255, 0.16);
  --success: #4ade80;
  --danger: #fb7185;
  --warn: #fcd34d;
  --radius: 18px;
  --font-display: "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --font-digit: "DSEG7 Classic", "Orbitron", var(--font-mono);
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 24px 48px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 16px 40px rgba(0, 0, 0, 0.35);
  --lcd-face: #08090c;
  --led: #ff3b45;
  --led-dim: rgba(255, 59, 69, 0.45);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display);
  background:
    radial-gradient(120% 90% at 50% -15%, #1a2234 0%, transparent 50%),
    radial-gradient(80% 55% at 100% 0%, rgba(99, 102, 241, 0.12), transparent 45%),
    linear-gradient(168deg, var(--bg-mid) 0%, var(--bg-deep) 55%, #020308 100%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(0.85rem, 3.2dvh, 1.35rem) clamp(0.5rem, 2vw, 1rem) clamp(0.35rem, 1.2dvh, 0.65rem);
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 55% 42% at 12% 22%, rgba(124, 184, 255, 0.1), transparent 55%),
    radial-gradient(ellipse 48% 38% at 88% 75%, rgba(244, 114, 182, 0.08), transparent 52%),
    radial-gradient(ellipse 65% 45% at 50% 105%, rgba(52, 211, 153, 0.05), transparent 48%);
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 78% 70% at 50% 30%, black 18%, transparent 76%);
  pointer-events: none;
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero {
  text-align: center;
  flex: 0 0 auto;
  padding-top: clamp(0.35rem, 1.8dvh, 0.85rem);
  margin-bottom: clamp(0.35rem, 1.5dvh, 0.7rem);
}

.eyebrow {
  margin: 0 0 0.15rem;
  font-size: clamp(0.58rem, 1.4dvh, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  font-size: clamp(0.95rem, 2.4dvh + 0.9vw, 1.45rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 0 0 0.2rem;
  line-height: 1.2;
  text-wrap: balance;
  background: linear-gradient(185deg, #ffffff 0%, #b8c5e8 55%, #7a8fb8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0 auto;
  max-width: 32rem;
  font-size: clamp(0.68rem, 1.6dvh + 0.5vw, 0.82rem);
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.panel {
  border-radius: var(--radius);
  padding: clamp(0.55rem, 1.6dvh, 0.95rem) clamp(0.65rem, 2vw, 1rem);
  box-shadow: var(--shadow-soft);
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.glass {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.hidden {
  display: none !important;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}

.field > span:first-child {
  font-size: clamp(0.72rem, 1.6dvh, 0.82rem);
  font-weight: 700;
  color: var(--muted);
}

input[type="text"] {
  width: 100%;
  padding: clamp(0.45rem, 1.4dvh, 0.65rem) 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 8, 14, 0.72);
  color: var(--text);
  font-size: clamp(1.1rem, 2.8dvh + 1.5vw, 1.65rem);
  font-weight: 700;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]::placeholder {
  color: rgba(139, 149, 171, 0.55);
  font-weight: 600;
}

input[type="text"]:focus {
  border-color: rgba(124, 184, 255, 0.45);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.panel.setup {
  justify-content: flex-start;
}

/* —— 限时点按调节 —— */
.time-field {
  margin-bottom: 0.35rem;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.time-stepper {
  display: flex;
  flex-direction: column;
  gap: clamp(0.45rem, 1.4dvh, 0.65rem);
  margin-top: 0.15rem;
  padding: clamp(0.5rem, 1.4dvh, 0.75rem);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, rgba(14, 18, 28, 0.95) 0%, rgba(8, 10, 16, 0.92) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.time-stepper-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.25rem, 1vw, 0.45rem);
  padding: clamp(0.2rem, 0.8dvh, 0.35rem) 0;
}

.time-digit {
  min-width: 2.4ch;
  text-align: center;
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5.5dvh + 1.2vw, 2.85rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 0 24px rgba(124, 184, 255, 0.35);
}

.time-sep {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 4dvh, 2.1rem);
  font-weight: 800;
  color: rgba(255, 255, 255, 0.28);
  line-height: 1;
  transform: translateY(-0.06em);
}

.time-stepper-units {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.35rem, 1.2vw, 0.65rem);
}

.time-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.time-unit-label {
  font-size: clamp(0.68rem, 1.5dvh, 0.78rem);
  font-weight: 700;
  color: var(--muted);
}

.time-unit-controls {
  display: flex;
  gap: 0.4rem;
  width: 100%;
  justify-content: center;
}

.step-btn {
  flex: 1;
  max-width: 5.5rem;
  min-height: clamp(2.75rem, 7dvh, 3.35rem);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(28, 36, 52, 0.95) 0%, rgba(16, 20, 30, 0.98) 100%);
  color: var(--text);
  font-size: clamp(1.35rem, 3.2dvh, 1.65rem);
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  user-select: none;
}

.step-btn:active,
.step-btn.is-pressed {
  transform: scale(0.96);
  border-color: rgba(124, 184, 255, 0.35);
  background: linear-gradient(180deg, rgba(36, 48, 72, 0.98) 0%, rgba(20, 26, 38, 0.98) 100%);
}

.step-btn--plus {
  color: #b8d4ff;
  border-color: rgba(124, 184, 255, 0.22);
}

.time-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.preset-chip {
  min-height: 2.1rem;
  padding: 0.35rem 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 10, 16, 0.65);
  color: var(--muted);
  font-size: clamp(0.62rem, 1.4dvh, 0.72rem);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.preset-chip.is-active,
.preset-chip:active {
  color: var(--text);
  border-color: rgba(124, 184, 255, 0.4);
  background: rgba(124, 184, 255, 0.12);
}

.time-hint {
  margin: 0.35rem 0 0;
  text-align: center;
  font-size: clamp(0.68rem, 1.5dvh, 0.8rem);
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: none;
  border-radius: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, filter 0.12s, opacity 0.15s, box-shadow 0.2s;
  flex-shrink: 0;
}

.btn-xl {
  min-height: clamp(44px, 6.5dvh, 52px);
  font-size: clamp(0.92rem, 2dvh + 0.6vw, 1.12rem);
  padding: clamp(0.45rem, 1.2dvh, 0.65rem) 0.85rem;
  border-radius: 14px;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn:active:not(:disabled) {
  transform: scale(0.987);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: linear-gradient(165deg, #5b8cff 0%, #3d6ee8 50%, #2c4db8 100%);
  color: #fff;
  box-shadow: var(--shadow-lift);
}

.btn.success {
  background: linear-gradient(165deg, #4ade80 0%, #16a34a 100%);
  color: #041208;
  box-shadow: 0 10px 26px rgba(22, 163, 74, 0.28);
}

.btn.danger {
  background: linear-gradient(165deg, #fb7185 0%, #e11d48 100%);
  color: #1a0508;
  box-shadow: 0 10px 26px rgba(225, 29, 72, 0.25);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn.pause {
  background: linear-gradient(165deg, #94a3b8 0%, #64748b 100%);
  color: #0f172a;
  box-shadow: 0 10px 22px rgba(100, 116, 139, 0.22);
}

.panel.game.is-paused .bomb-readout__lcd {
  opacity: 0.72;
  filter: saturate(0.65);
}

.panel.game.is-paused .bomb-digit {
  animation: none !important;
}

.panel.game.is-paused .status-line {
  color: var(--accent);
  font-weight: 700;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: clamp(0.35rem, 1dvh, 0.5rem);
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 0.25rem;
}

/* —— 加时统计 —— */
.extend-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.4rem, 1.2vw, 0.65rem);
  width: 100%;
  flex-shrink: 0;
  padding: clamp(0.45rem, 1.2dvh, 0.65rem);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.extend-stats--bump {
  animation: stats-bump 0.35s ease;
}

@keyframes stats-bump {
  0% {
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.08);
  }
  40% {
    transform: scale(1.02);
    border-color: rgba(251, 191, 36, 0.45);
  }
  100% {
    transform: scale(1);
    border-color: rgba(255, 255, 255, 0.08);
  }
}

.extend-stats__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: clamp(0.35rem, 1dvh, 0.5rem);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.extend-stats__cell--accent .extend-stats__value {
  color: #fcd34d;
  text-shadow: 0 0 20px rgba(252, 211, 77, 0.25);
}

.extend-stats__label {
  font-size: clamp(0.62rem, 1.4dvh, 0.72rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

.extend-stats__value {
  font-family: var(--font-mono);
  font-size: clamp(1.35rem, 3.5dvh + 1vw, 1.85rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

/* —— 游戏内按钮区 —— */
.actions--game {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1.1dvh, 0.55rem);
  width: 100%;
}

.panel.game .actions {
  margin-top: 0;
  padding-top: clamp(0.25rem, 0.8dvh, 0.45rem);
}

.actions__row--dual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(0.4rem, 1.1dvh, 0.55rem);
}

.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: clamp(46px, 6.8dvh, 54px);
  padding: 0.55rem 0.85rem;
  border-radius: 14px;
  font-size: clamp(0.88rem, 1.9dvh + 0.5vw, 1.05rem);
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.12) inset,
    0 8px 20px rgba(0, 0, 0, 0.28);
  transition:
    transform 0.12s ease,
    filter 0.12s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.btn-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75em;
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 700;
  opacity: 0.92;
}

.btn-action__text {
  letter-spacing: 0.04em;
}

.btn-win {
  background: linear-gradient(165deg, #5ee9a8 0%, #22c55e 45%, #15803d 100%);
  color: #052e16;
  border-color: rgba(134, 239, 172, 0.35);
  min-height: clamp(50px, 7.5dvh, 58px);
  font-size: clamp(0.95rem, 2.1dvh + 0.55vw, 1.12rem);
}

.btn-pause {
  background: linear-gradient(165deg, #64748b 0%, #475569 55%, #334155 100%);
  color: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.25);
}

.btn-giveup {
  background: linear-gradient(165deg, #fb7185 0%, #e11d48 55%, #9f1239 100%);
  color: #fff5f5;
  border-color: rgba(254, 202, 202, 0.2);
}

.btn-addtime {
  background: linear-gradient(165deg, rgba(251, 191, 36, 0.22) 0%, rgba(180, 83, 9, 0.35) 100%);
  color: #fef3c7;
  border-color: rgba(251, 191, 36, 0.35);
}

.btn-addtime .btn-action__icon {
  color: #fcd34d;
  font-size: 1em;
  letter-spacing: 0.02em;
}

.btn-action:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 12px 28px rgba(0, 0, 0, 0.35);
}

.btn-action:active:not(:disabled) {
  transform: scale(0.985);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 4px 12px rgba(0, 0, 0, 0.25);
}

.panel.game.is-paused .btn-pause {
  background: linear-gradient(165deg, #7cb8ff 0%, #3b82f6 55%, #1d4ed8 100%);
  color: #eff6ff;
  border-color: rgba(147, 197, 253, 0.35);
}

.setup-footer,
.result-footer {
  display: flex;
  flex-direction: column;
  gap: clamp(0.4rem, 1dvh, 0.55rem);
  margin-top: auto;
  flex-shrink: 0;
}

.setup-footer .btn-xl,
.result-footer .btn-xl {
  margin-top: 0;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-height: 42px;
  font-size: clamp(0.82rem, 1.8dvh, 0.92rem);
  position: relative;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: rgba(124, 184, 255, 0.35);
  background: rgba(124, 184, 255, 0.08);
}

.btn-ghost--danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.25);
}

.btn-ghost--danger:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
}

.history-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 0.35em;
  margin-left: 0.35em;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.78em;
  font-weight: 700;
  background: rgba(124, 184, 255, 0.2);
  color: var(--accent);
}

.history-badge.hidden {
  display: none;
}

body.history-open {
  overflow: hidden;
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.5rem, 2vw, 1rem);
}

.history-modal.hidden {
  display: none !important;
}

.history-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 10, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.history-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  max-height: min(88dvh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  background: linear-gradient(165deg, #1a2234 0%, #0e121c 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.history-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.history-modal__head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.history-modal__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.history-modal__close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.history-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
}

.history-storage {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.history-storage__file {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.history-storage__file code {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 0.92em;
}

.history-storage__status {
  margin: 0 0 0.55rem;
  font-size: 0.75rem;
  line-height: 1.45;
  font-weight: 600;
}

.history-storage__status--ok {
  color: #86efac;
}

.history-storage__status--warn {
  color: #fcd34d;
}

.history-storage__status--file {
  color: var(--accent);
}

.history-storage__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.btn-ghost--sm {
  min-height: 34px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.history-file-label {
  cursor: pointer;
  margin: 0;
}

.history-tip {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

.history-tip code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: rgba(124, 184, 255, 0.85);
}

#btnClearHistory:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.history-view.hidden {
  display: none !important;
}

.history-summary__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.history-summary__item {
  text-align: center;
  padding: 0.5rem 0.35rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
}

.history-summary__item--win .history-summary__n {
  color: var(--success);
}

.history-summary__item--lose .history-summary__n {
  color: var(--danger);
}

.history-summary__n {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.history-summary__l {
  font-size: 0.68rem;
  color: var(--muted);
  font-weight: 600;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.history-item {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  text-align: left;
}

.history-item:hover {
  background: rgba(124, 184, 255, 0.08);
  border-color: rgba(124, 184, 255, 0.22);
  transform: translateY(-1px);
}

.history-item--win {
  border-left: 3px solid var(--success);
}

.history-item--lose {
  border-left: 3px solid var(--danger);
}

.history-item__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.history-item__name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  word-break: break-word;
}

.history-item__badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2em 0.55em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
}

.history-item--win .history-item__badge {
  color: var(--success);
  background: rgba(74, 222, 128, 0.12);
}

.history-item--lose .history-item__badge {
  color: var(--danger);
  background: rgba(251, 113, 133, 0.12);
}

.history-item__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.history-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 1.5rem 0;
}

.history-empty.hidden {
  display: none;
}

#btnClearHistory {
  width: 100%;
  margin-top: 0.75rem;
}

.history-back {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.5rem;
  border: none;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.history-back:hover {
  text-decoration: underline;
}

.history-detail__hero {
  text-align: center;
  padding: 1rem 0.75rem;
  border-radius: 14px;
  margin-bottom: 0.85rem;
}

.history-detail__hero--win {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
}

.history-detail__hero--lose {
  background: rgba(251, 113, 133, 0.1);
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.history-detail__outcome {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.history-detail__hero--win .history-detail__outcome {
  color: var(--success);
}

.history-detail__hero--lose .history-detail__outcome {
  color: var(--danger);
}

.history-detail__name {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  word-break: break-word;
}

.history-detail__dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.history-detail__dl > div {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.history-detail__dl dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
}

.history-detail__dl dd {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

/* —— 游戏中：整块在面板内垂直居中 —— */
.panel.game {
  justify-content: center;
  align-items: center;
  gap: clamp(0.35rem, 1.4dvh, 0.65rem);
}

.target-name {
  text-align: center;
  width: 100%;
  max-width: 100%;
  font-size: clamp(2.35rem, 9.5dvh + 4vw, 5.75rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 0;
  word-break: break-word;
  max-height: min(34dvh, 11.5rem);
  min-height: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.timer-stage {
  flex: 0 1 auto;
  min-height: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.1rem 0;
}

/* —— 横向「炸弹」数码管 —— */
.bomb-readout {
  width: 100%;
  max-width: min(100%, 640px);
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 20px 50px rgba(0, 0, 0, 0.55);
}

.bomb-readout__hazard {
  height: 12px;
  background: repeating-linear-gradient(
    -45deg,
    #fbbf24 0 10px,
    #0a0a0a 10px 20px
  );
  opacity: 0.92;
}

.bomb-readout__bezel {
  padding: clamp(0.45rem, 1.4dvh, 0.75rem) clamp(0.55rem, 1.8vw, 0.85rem);
  background:
    linear-gradient(145deg, rgba(55, 60, 72, 0.95) 0%, rgba(22, 24, 32, 0.98) 40%, rgba(12, 14, 20, 1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
}

.bomb-readout__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.bomb-readout__label {
  font-family: "Orbitron", var(--font-mono);
  font-size: clamp(0.55rem, 1.25dvh, 0.68rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.38);
}

.bomb-readout__status-lights {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow:
    0 0 10px rgba(34, 197, 94, 0.75),
    16px 0 0 #eab308,
    16px 0 10px rgba(234, 179, 8, 0.45),
    32px 0 0 #ef4444,
    32px 0 10px rgba(239, 68, 68, 0.45);
  margin-right: 32px;
}

.bomb-readout__lcd {
  position: relative;
  background: linear-gradient(180deg, #12141a 0%, var(--lcd-face) 28%, #050508 100%);
  border-radius: 10px;
  padding: clamp(0.45rem, 1.5dvh, 0.85rem) clamp(0.5rem, 2vw, 1rem);
  border: 1px solid rgba(0, 0, 0, 0.65);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.04),
    inset 0 -8px 24px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 59, 69, 0.06);
  overflow: hidden;
}

.bomb-readout__scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(255, 255, 255, 0.02) 2px,
    rgba(255, 255, 255, 0.02) 3px
  );
  pointer-events: none;
  opacity: 0.5;
  mix-blend-mode: overlay;
}

.bomb-readout__digits-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.06em 0.12em;
}

.bomb-digit {
  display: inline-block;
  font-family: var(--font-digit);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  color: var(--led);
  text-shadow:
    0 0 8px rgba(255, 59, 69, 0.95),
    0 0 22px rgba(255, 40, 50, 0.55),
    0 0 48px rgba(255, 30, 40, 0.25);
  line-height: 1;
}

.bomb-digit--main {
  font-size: clamp(2rem, 8.5dvh + 3vw, 4.6rem);
  letter-spacing: 0.06em;
}

.bomb-digit--ms {
  font-size: clamp(1.1rem, 4.2dvh + 1.4vw, 2.35rem);
  letter-spacing: 0.08em;
  color: #ff6b6f;
  text-shadow:
    0 0 6px rgba(255, 80, 90, 0.9),
    0 0 18px rgba(255, 50, 60, 0.45);
}

.bomb-digit--dot {
  font-size: clamp(1.4rem, 5.5dvh + 2vw, 3rem);
  color: var(--led-dim);
  text-shadow: 0 0 12px rgba(255, 59, 69, 0.35);
  transform: translateY(-0.08em);
}

.bomb-readout__sub {
  position: relative;
  z-index: 1;
  margin-top: 0.35rem;
  text-align: center;
  font-family: "Orbitron", var(--font-mono);
  font-size: clamp(0.5rem, 1.15dvh, 0.62rem);
  letter-spacing: 0.35em;
  color: rgba(255, 255, 255, 0.22);
}

.status-line {
  text-align: center;
  font-size: clamp(0.72rem, 1.7dvh + 0.4vw, 0.88rem);
  color: var(--muted);
  margin: 0;
  font-weight: 600;
  flex-shrink: 0;
}

.panel.game .status-line {
  margin-bottom: clamp(0.15rem, 0.6dvh, 0.35rem);
}

/* —— 最后 10 秒 —— */
body.tense {
  animation: body-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes body-pulse {
  from {
    filter: saturate(1);
  }
  to {
    filter: saturate(1.18) brightness(1.03);
  }
}

.game.tense-mode .timer-stage {
  animation: shake 0.32s ease-in-out infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  25% {
    transform: translate(-2px, 1px) rotate(-0.35deg);
  }
  50% {
    transform: translate(2px, -1px) rotate(0.35deg);
  }
  75% {
    transform: translate(-1px, -1px) rotate(-0.2deg);
  }
}

.game.tense-mode .bomb-readout__lcd {
  animation: lcd-pulse 0.45s ease-in-out infinite alternate;
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.05),
    inset 0 -8px 24px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 59, 69, 0.25),
    0 0 32px rgba(255, 40, 50, 0.22);
}

@keyframes lcd-pulse {
  from {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.05),
      inset 0 -8px 24px rgba(0, 0, 0, 0.65),
      0 0 0 1px rgba(255, 59, 69, 0.2),
      0 0 24px rgba(255, 40, 50, 0.15);
  }
  to {
    box-shadow:
      inset 0 2px 4px rgba(255, 255, 255, 0.05),
      inset 0 -8px 24px rgba(0, 0, 0, 0.65),
      0 0 0 1px rgba(255, 59, 69, 0.45),
      0 0 48px rgba(255, 30, 40, 0.35);
  }
}

.game.tense-mode .bomb-digit--main {
  color: #ff9a9e;
  text-shadow:
    0 0 10px rgba(255, 120, 120, 1),
    0 0 28px rgba(255, 60, 70, 0.65),
    0 0 56px rgba(255, 30, 40, 0.35);
  animation: digit-tick 0.45s ease-in-out infinite;
}

.game.tense-mode .bomb-digit--ms {
  color: #fecaca;
  animation: ms-flicker 0.22s steps(2, end) infinite;
}

@keyframes ms-flicker {
  50% {
    opacity: 0.58;
  }
}

@keyframes digit-tick {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.game.tense-mode .bomb-digit--dot {
  color: rgba(255, 180, 180, 0.85);
}

.game.tense-mode .bomb-readout__hazard {
  animation: hazard-blink 0.5s steps(2) infinite;
}

@keyframes hazard-blink {
  50% {
    opacity: 0.65;
  }
}

.game.tense-mode .target-name {
  color: var(--warn);
  text-shadow:
    0 0 24px rgba(252, 211, 77, 0.35),
    0 2px 20px rgba(0, 0, 0, 0.5);
}

.game.tense-mode .status-line {
  color: #fca5a5;
  font-weight: 700;
}

.game.tense-mode .btn.secondary {
  border-color: rgba(251, 113, 133, 0.45);
}

/* 结果 */
.panel.result {
  justify-content: center;
}

.result {
  text-align: center;
}

.result-icon {
  font-size: clamp(2rem, 8dvh, 3.25rem);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.result-title {
  margin: 0 0 0.35rem;
  font-size: clamp(1.15rem, 3.5dvh + 1vw, 1.65rem);
  font-weight: 800;
}

.result-detail {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: clamp(0.75rem, 1.8dvh + 0.45vw, 0.92rem);
  line-height: 1.45;
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.result.win .result-title {
  color: var(--success);
}

.result.lose .result-title {
  color: var(--danger);
}

