:root {
  --bg-deep: #020614;
  --bg-mid: #041230;
  --bg-panel: rgba(5, 19, 49, 0.86);
  --bg-screen: #02091b;

  --intel-navy: #00285a;
  --intel-blue: #0068b5;
  --intel-bright: #0071c5;
  --ultra-cyan: #00c7fd;
  --ultra-violet: #6366f1;

  --blue-900: #0a1c46;
  --blue-700: #0054a6;
  --blue-500: #0071c5;
  --blue-400: #00c7fd;
  --cyan-300: #67e8f9;
  --cyan-400: #00f0ff;
  --ice-white: #edfaff;

  --gold-jackpot: #fde047;
  --silver-rank: #e2e8f0;
  --bronze-rank: #7dd3fc;
  --coral-miss: #fb7185;

  --font-display: 'Intel One Display', 'IntelOne Display', 'Intel One Mono', monospace;
  --font-mono: 'Intel One Mono', 'IntelOneMono', monospace;
  --font-ui: 'Intel One Text', 'IntelOne Text', 'Intel Clear', 'Intel One Mono', system-ui, -apple-system, sans-serif;

  --glow-cyan: 0 0 12px rgba(0, 199, 253, 0.75), 0 0 28px rgba(0, 113, 197, 0.6);
  --glow-strong: 0 0 16px rgba(0, 240, 255, 0.95), 0 0 42px rgba(0, 199, 253, 0.78), 0 0 80px rgba(0, 113, 197, 0.6);
}

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

html,
body {
  min-height: 100%;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: radial-gradient(circle at 50% 15%, #002e6d 0%, #030e27 52%, #01040e 100%);
  color: var(--ice-white);
  font-family: var(--font-ui);
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ===== Ambient Background Layers ===== */
#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.bg-grid {
  position: fixed;
  inset: -40% -20% -20% -20%;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: perspective(600px) rotateX(58deg) translateY(18%);
  mask-image: radial-gradient(ellipse at 50% 60%, rgba(0, 0, 0, 0.8) 15%, transparent 72%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 60%, rgba(0, 0, 0, 0.8) 15%, transparent 72%);
  animation: gridScroll 14s linear infinite;
}

@keyframes gridScroll {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 0 56px;
  }
}

.bg-circuit-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0, 199, 253, 0.22) 0 1.5px, transparent 2px),
    radial-gradient(circle at 88% 24%, rgba(0, 199, 253, 0.22) 0 1.5px, transparent 2px),
    linear-gradient(125deg, transparent 47%, rgba(0, 199, 253, 0.08) 49%, rgba(99, 102, 241, 0.08) 51%, transparent 53%);
  background-size: 90px 90px, 110px 110px, 100% 100%;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(0, 199, 253, 0.2), transparent 40%),
    radial-gradient(circle at 82% 20%, rgba(0, 113, 197, 0.28), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(99, 102, 241, 0.16), transparent 46%);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

body.state-running .bg-glow {
  filter: brightness(1.2);
}

body.state-tension .bg-glow {
  animation: tensionGlow 0.45s ease-in-out infinite alternate;
}

@keyframes tensionGlow {
  from {
    opacity: 0.85;
    filter: brightness(1.1);
  }
  to {
    opacity: 1;
    filter: brightness(1.55);
  }
}

body.state-jackpot .bg-glow {
  background:
    radial-gradient(circle at 50% 45%, rgba(0, 240, 255, 0.36), transparent 55%),
    radial-gradient(circle at 25% 30%, rgba(253, 224, 71, 0.22), transparent 45%),
    radial-gradient(circle at 75% 30%, rgba(56, 189, 248, 0.3), transparent 45%);
  animation: jackpotAura 0.7s ease-in-out infinite alternate;
}

@keyframes jackpotAura {
  from {
    transform: scale(1);
    opacity: 0.9;
  }
  to {
    transform: scale(1.06);
    opacity: 1;
  }
}

/* ===== Top Bar ===== */
.top-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 7px 16px 7px 10px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(0, 48, 112, 0.82), rgba(4, 18, 48, 0.88));
  border: 1px solid rgba(0, 199, 253, 0.45);
  box-shadow: 0 0 22px rgba(0, 199, 253, 0.18), inset 0 0 12px rgba(0, 113, 197, 0.25);
  backdrop-filter: blur(8px);
}

.chip-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #00c7fd 0%, #0071c5 60%, #1e3a8a 100%);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 12px rgba(0, 199, 253, 0.75);
}

.chip-mark-core {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #e0f7ff;
}

.brand-divider {
  color: var(--ultra-cyan);
  margin: 0 4px;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background: rgba(8, 26, 66, 0.72);
  color: var(--cyan-300);
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: transform 0.16s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.icon-btn:hover {
  border-color: var(--cyan-400);
  background: rgba(14, 44, 108, 0.85);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
}

.icon-btn:active {
  transform: translateY(1px);
}

/* ===== Shared Screen Shell ===== */
.screen {
  position: relative;
  z-index: 5;
  min-height: calc(100vh - 76px);
  width: 100%;
  padding: 10px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: screenIn 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== Shared Neon Panel Card ===== */
.menu-card,
.panel-card {
  width: min(560px, 100%);
  padding: 34px 36px;
  border-radius: 26px;
  background: linear-gradient(155deg, rgba(11, 35, 88, 0.88) 0%, rgba(5, 17, 45, 0.92) 100%);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  box-shadow:
    0 26px 65px rgba(0, 0, 0, 0.65),
    0 0 38px rgba(37, 99, 235, 0.32),
    inset 0 0 26px rgba(0, 240, 255, 0.12);
  backdrop-filter: blur(12px);
}

/* ===== Main Menu Screen ===== */
.menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 26px 34px 28px;
}

/* ===== Intel Core Ultra 4 Silicon Emblem ===== */
.ultra-emblem {
  position: relative;
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  margin-bottom: 2px;
}

.ultra-emblem-ring {
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  background: conic-gradient(
    from 0deg,
    rgba(0, 199, 253, 0.9),
    rgba(0, 113, 197, 0.25),
    rgba(99, 102, 241, 0.85),
    rgba(0, 240, 255, 0.95),
    rgba(0, 113, 197, 0.25),
    rgba(0, 199, 253, 0.9)
  );
  padding: 2px;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: dieRingSpin 7s linear infinite;
  filter: drop-shadow(0 0 12px rgba(0, 199, 253, 0.65));
}

@keyframes dieRingSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.ultra-die {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 16px;
  background: linear-gradient(145deg, #0071c5 0%, #00357a 48%, #071333 100%);
  border: 1.5px solid rgba(125, 211, 252, 0.85);
  box-shadow:
    inset 0 2px 14px rgba(255, 255, 255, 0.3),
    0 10px 26px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(0, 199, 253, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.ultra-die::after {
  content: '';
  position: absolute;
  inset: -40%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  animation: siliconSheen 3.6s ease-in-out infinite;
}

@keyframes siliconSheen {
  0% { transform: translateX(-120%) rotate(10deg); }
  45%, 100% { transform: translateX(120%) rotate(10deg); }
}

.ultra-die-intel {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(224, 247, 255, 0.92);
  text-transform: lowercase;
  line-height: 1;
}

.ultra-die-core {
  font-family: var(--font-display);
  font-size: 0.54rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--cyan-300);
  margin-top: 3px;
}

.ultra-die-series {
  font-family: var(--font-display);
  font-size: 2.05rem;
  font-weight: 900;
  line-height: 1;
  margin-top: 2px;
  color: #ffffff;
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.9), 0 0 28px rgba(0, 113, 197, 0.9);
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.08;
  background: linear-gradient(180deg, #ffffff 0%, #bae6fd 45%, #00c7fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(0, 199, 253, 0.52));
}

.hero-kicker {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ultra-cyan);
  text-shadow: 0 0 12px rgba(0, 199, 253, 0.55);
}

.hero-subtitle {
  font-size: 0.94rem;
  color: rgba(186, 230, 253, 0.84);
  max-width: 450px;
  line-height: 1.48;
}

.menu-clock-preview {
  width: 100%;
  padding: 12px 20px;
  margin: 2px 0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 50%, #052052 0%, #020a1c 82%);
  border: 1px solid rgba(0, 199, 253, 0.4);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.85), 0 0 22px rgba(0, 199, 253, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.preview-tag {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: rgba(103, 232, 249, 0.72);
}

.preview-digits {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #e6fbff;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.7),
    0 0 24px rgba(0, 240, 255, 0.85),
    0 0 46px rgba(37, 99, 235, 0.7);
  animation: previewGlow 2.4s ease-in-out infinite alternate;
}

@keyframes previewGlow {
  from {
    opacity: 0.86;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6), 0 0 22px rgba(0, 240, 255, 0.7);
  }
  to {
    opacity: 1;
    text-shadow: 0 0 14px #ffffff, 0 0 32px rgba(0, 240, 255, 0.95), 0 0 58px rgba(37, 99, 235, 0.8);
  }
}

.menu-buttons {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 6px;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 24px;
  border-radius: 15px;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, filter 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.menu-btn:hover {
  transform: translateY(-2px);
}

.menu-btn:active {
  transform: translateY(1px);
}

.menu-btn-icon {
  font-size: 0.95rem;
}

.menu-btn-primary {
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 55%, #1d4ed8 100%);
  border: 1.5px solid #7dd3fc;
  color: #ffffff;
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.35),
    0 8px 24px rgba(37, 99, 235, 0.45),
    0 0 24px rgba(0, 240, 255, 0.45);
}

.menu-btn-primary:hover {
  filter: brightness(1.1);
  box-shadow:
    inset 0 2px 12px rgba(255, 255, 255, 0.45),
    0 10px 28px rgba(37, 99, 235, 0.55),
    0 0 34px rgba(0, 240, 255, 0.7);
}

.menu-btn-secondary {
  background: rgba(14, 42, 102, 0.72);
  border: 1.5px solid rgba(56, 189, 248, 0.5);
  color: #e0f7ff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.menu-btn-secondary:hover {
  background: rgba(20, 58, 138, 0.86);
  border-color: var(--cyan-400);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.35);
}

.menu-btn-ghost {
  background: rgba(7, 22, 54, 0.6);
  border: 1.5px solid rgba(148, 163, 184, 0.35);
  color: #bae6fd;
}

.menu-btn-ghost:hover {
  border-color: rgba(56, 189, 248, 0.7);
  color: #ffffff;
}

.menu-btn-danger {
  background: rgba(159, 18, 57, 0.22);
  border: 1.5px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

.menu-btn-danger:hover {
  background: rgba(190, 18, 60, 0.34);
  border-color: #fb7185;
  color: #ffffff;
  box-shadow: 0 0 20px rgba(251, 113, 133, 0.32);
}

.menu-footer-stats {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
  color: rgba(186, 230, 253, 0.75);
}

.menu-footer-stats strong {
  font-family: var(--font-display);
  color: var(--cyan-300);
}

.dot-sep {
  opacity: 0.45;
}

/* ===== Name Entry & Quit Cards ===== */
.name-card,
.quit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.panel-eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--cyan-400);
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.6vw, 2.15rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #ffffff;
  text-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
}

.panel-title-sm {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.panel-subtitle {
  font-size: 0.95rem;
  color: rgba(186, 230, 253, 0.78);
  line-height: 1.5;
}

.name-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}

.input-wrapper {
  width: 100%;
}

.input-wrapper.shake {
  animation: stageShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.neon-input {
  width: 100%;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(2, 11, 31, 0.92);
  border: 2px solid rgba(56, 189, 248, 0.5);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  outline: none;
  user-select: text;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.neon-input::placeholder {
  color: rgba(148, 197, 255, 0.42);
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.neon-input:focus {
  border-color: var(--cyan-400);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.4), inset 0 0 12px rgba(0, 240, 255, 0.15);
}

.input-error {
  font-size: 0.86rem;
  font-weight: 600;
  color: #fda4af;
}

.panel-actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  width: 100%;
  margin-top: 6px;
}

.center-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.center-actions .menu-btn {
  max-width: 300px;
}

/* ===== Game Stage ===== */
.stage {
  width: 100%;
  max-width: 980px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.stage.shake {
  animation: stageShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes stageShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-7px, 0, 0); }
  40%, 60% { transform: translate3d(7px, 0, 0); }
}

/* ===== Title Block & Pills ===== */
.title-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.game-pills-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.target-pill,
.player-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.34), rgba(0, 240, 255, 0.22));
  border: 1px solid rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.22);
}

.player-pill {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.24), rgba(56, 189, 248, 0.16));
  border-color: rgba(125, 211, 252, 0.55);
}

.target-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--cyan-300);
}

.target-value,
.player-name-value {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

.main-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.9rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #ffffff 0%, #bae6fd 48%, #38bdf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(0, 240, 255, 0.45));
}

.subtitle {
  font-size: 0.98rem;
  color: rgba(186, 230, 253, 0.82);
  font-weight: 500;
}

.inline-kbd {
  display: inline-block;
  padding: 2px 9px;
  margin: 0 3px;
  border-radius: 6px;
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.45);
  border: 1px solid rgba(0, 240, 255, 0.65);
  box-shadow: 0 2px 0 rgba(0, 240, 255, 0.35), 0 0 10px rgba(0, 240, 255, 0.25);
}

/* ===== Arcade Night Market Cabinet ===== */
.cabinet-wrapper {
  position: relative;
  width: min(780px, 100%);
  display: flex;
  justify-content: center;
  align-items: center;
}

.shockwave-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  overflow: visible;
}

.shockwave-ring {
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 36px;
  border: 3px solid var(--cyan-400);
  box-shadow: 0 0 28px var(--cyan-400), inset 0 0 20px var(--cyan-400);
  opacity: 0.9;
  animation: shockwaveExpand 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shockwave-ring.jackpot {
  border-color: var(--gold-jackpot);
  box-shadow: 0 0 38px var(--gold-jackpot), 0 0 60px var(--cyan-400);
  animation-duration: 1.05s;
}

@keyframes shockwaveExpand {
  0% {
    transform: scale(0.88);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.65);
    opacity: 0;
  }
}

.cabinet {
  position: relative;
  width: 100%;
  padding: 26px;
  border-radius: 26px;
  background: linear-gradient(145deg, #072252 0%, #03102b 50%, #061c47 100%);
  border: 2px solid rgba(0, 199, 253, 0.65);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.68),
    0 0 40px rgba(0, 113, 197, 0.5),
    inset 0 0 26px rgba(0, 199, 253, 0.22);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}

/* Silicon Precision Corner Brackets */
.corner-bracket {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  border-color: var(--cyan-400);
  border-style: solid;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.8));
}

.corner-bracket.tl {
  top: -5px;
  left: -5px;
  border-width: 3px 0 0 3px;
  border-top-left-radius: 10px;
}

.corner-bracket.tr {
  top: -5px;
  right: -5px;
  border-width: 3px 3px 0 0;
  border-top-right-radius: 10px;
}

.corner-bracket.bl {
  bottom: -5px;
  left: -5px;
  border-width: 0 0 3px 3px;
  border-bottom-left-radius: 10px;
}

.corner-bracket.br {
  bottom: -5px;
  right: -5px;
  border-width: 0 3px 3px 0;
  border-bottom-right-radius: 10px;
}

.screen-die-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(125, 211, 252, 0.58);
}

body.state-running .cabinet {
  border-color: var(--cyan-400);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.7),
    0 0 48px rgba(0, 240, 255, 0.45),
    inset 0 0 30px rgba(0, 240, 255, 0.28);
}

body.state-tension .cabinet {
  animation: cabinetPulse 0.42s ease-in-out infinite alternate;
}

@keyframes cabinetPulse {
  from {
    transform: scale(1);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7), 0 0 45px rgba(0, 240, 255, 0.55);
  }
  to {
    transform: scale(1.014);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 75px rgba(0, 240, 255, 0.85);
  }
}

body.state-jackpot .cabinet {
  border-color: var(--gold-jackpot);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.7),
    0 0 65px rgba(0, 240, 255, 0.85),
    0 0 110px rgba(253, 224, 71, 0.55),
    inset 0 0 40px rgba(0, 240, 255, 0.45);
}

/* ===== Chasing Marquee LED Bulbs ===== */
.marquee-bulbs {
  position: absolute;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.marquee-bulbs.top {
  top: 8px;
  left: 28px;
  right: 28px;
}

.marquee-bulbs.bottom {
  bottom: 8px;
  left: 28px;
  right: 28px;
}

.marquee-bulbs.left {
  left: 8px;
  top: 32px;
  bottom: 32px;
  flex-direction: column;
}

.marquee-bulbs.right {
  right: 8px;
  top: 32px;
  bottom: 32px;
  flex-direction: column;
}

.bulb {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #0d2b63;
  border: 1px solid rgba(103, 232, 249, 0.3);
  transition: background 0.12s ease, box-shadow 0.12s ease, transform 0.12s ease;
}

.bulb.lit {
  background: #e0faff;
  border-color: #ffffff;
  box-shadow: 0 0 8px #ffffff, 0 0 16px var(--cyan-400), 0 0 24px var(--blue-500);
  transform: scale(1.18);
}

.bulb.lit-gold {
  background: #fef9c3;
  border-color: #ffffff;
  box-shadow: 0 0 10px #ffffff, 0 0 20px var(--gold-jackpot), 0 0 30px var(--cyan-400);
  transform: scale(1.26);
}

.bulb.lit-miss {
  background: #ffe4e6;
  border-color: #fda4af;
  box-shadow: 0 0 10px var(--coral-miss), 0 0 20px rgba(251, 113, 133, 0.7);
}

/* ===== Inner Timer Screen ===== */
.timer-screen {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 20px 28px 22px;
  background: radial-gradient(circle at 50% 42%, #061b47 0%, #020a1c 78%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 2px,
    transparent 4px
  );
  z-index: 3;
}

.screen-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 4;
}

.state-chip {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--cyan-300);
  transition: all 0.2s ease;
}

body.state-running .state-chip {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--cyan-400);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.5);
}

body.state-jackpot .state-chip {
  background: rgba(253, 224, 71, 0.22);
  border-color: var(--gold-jackpot);
  color: #fef08a;
  box-shadow: 0 0 18px rgba(253, 224, 71, 0.6);
}

.blind-badge {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.28);
  border: 1px solid rgba(129, 140, 248, 0.6);
  color: #c7d2fe;
}

/* ===== Giant Digital Readout ===== */
.digits-container {
  position: relative;
  display: grid;
  place-items: center;
  padding: 6px 0;
  z-index: 4;
  transition: opacity 0.35s ease, filter 0.35s ease;
}

.digits-container.blind-hidden {
  opacity: 0.05;
  filter: blur(10px);
}

.digits-ghost,
.digits-live {
  grid-area: 1 / 1;
  font-family: var(--font-mono);
  font-size: clamp(3.1rem, 10.5vw, 6.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.04em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.digits-ghost {
  color: rgba(56, 189, 248, 0.08);
  pointer-events: none;
}

.digits-live {
  color: #e6fbff;
  text-shadow:
    0 0 12px rgba(255, 255, 255, 0.75),
    0 0 28px rgba(0, 240, 255, 0.85),
    0 0 58px rgba(37, 99, 235, 0.75);
  transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.18s ease;
}

.digits-live.pop {
  animation: digitPop 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes digitPop {
  0% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

body.state-jackpot .digits-live {
  color: #ffffff;
  text-shadow:
    0 0 18px #ffffff,
    0 0 36px var(--gold-jackpot),
    0 0 70px var(--cyan-400),
    0 0 110px var(--blue-500);
  animation: jackpotDigits 0.65s ease-in-out infinite alternate;
}

@keyframes jackpotDigits {
  from { transform: scale(1); }
  to { transform: scale(1.055); }
}

body.state-close .digits-live {
  color: #e0f7ff;
  text-shadow:
    0 0 14px #ffffff,
    0 0 36px var(--cyan-400),
    0 0 70px #38bdf8;
}

body.state-miss .digits-live {
  color: #ffdbe3;
  text-shadow:
    0 0 12px rgba(251, 113, 133, 0.9),
    0 0 34px rgba(225, 29, 72, 0.55);
}

.blind-curtain {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(6, 22, 56, 0.82), rgba(2, 10, 28, 0.92));
  animation: fadeIn 0.35s ease;
}

.blind-text {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.5rem);
  letter-spacing: 0.22em;
  color: var(--cyan-300);
  text-shadow: var(--glow-cyan);
  animation: blindPulse 1.1s ease-in-out infinite alternate;
}

@keyframes blindPulse {
  from { opacity: 0.55; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.03); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== Progress / Tension Meter ===== */
.meter-track {
  position: relative;
  width: 100%;
  height: 12px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(12, 31, 74, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  overflow: visible;
  z-index: 4;
  transition: opacity 0.3s ease;
}

.meter-track.blind-hidden {
  opacity: 0;
}

.meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d4ed8 0%, #0ea5e9 55%, #00f0ff 100%);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.8);
  position: relative;
  transition: background 0.2s ease;
}

.meter-fill::after {
  content: '';
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 16px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 0 12px #ffffff, 0 0 22px var(--cyan-400);
  opacity: 0;
  transition: opacity 0.15s ease;
}

body.state-running .meter-fill::after {
  opacity: 1;
}

.meter-fill.overshoot {
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 65%, #fb7185 100%);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.8);
}

.meter-target-marker {
  position: absolute;
  left: 80%;
  top: -6px;
  bottom: -6px;
  width: 4px;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 0 10px #ffffff, 0 0 18px var(--cyan-400);
  transform: translateX(-50%);
}

.meter-target-marker::before {
  content: 'TARGET';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.56rem;
  letter-spacing: 0.14em;
  color: var(--cyan-300);
  white-space: nowrap;
}

/* ===== Result Feedback Banner ===== */
.result-banner {
  z-index: 4;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}

.result-title {
  font-family: var(--font-display);
  font-size: clamp(0.98rem, 2.2vw, 1.38rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cyan-300);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.45);
}

.result-delta {
  font-size: 0.92rem;
  font-weight: 600;
  color: rgba(186, 230, 253, 0.78);
}

body.state-jackpot .result-title {
  color: #fef08a;
  font-size: clamp(1.15rem, 2.8vw, 1.75rem);
  text-shadow: 0 0 14px var(--gold-jackpot), 0 0 28px var(--cyan-400);
}

body.state-close .result-title {
  color: #ffffff;
  text-shadow: var(--glow-cyan);
}

body.state-miss .result-title {
  color: #fda4af;
  text-shadow: 0 0 14px rgba(251, 113, 133, 0.6);
}

/* ===== Tactile 3D Arcade Button ===== */
.controls-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.arcade-btn {
  position: relative;
  border: none;
  padding: 0;
  background: transparent;
  cursor: pointer;
  outline: none;
  border-radius: 20px;
}

.arcade-btn::before {
  content: '';
  position: absolute;
  inset: 6px -4px -8px -4px;
  border-radius: 22px;
  background: linear-gradient(180deg, #0b2459, #061538);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.65), 0 0 26px rgba(37, 99, 235, 0.4);
  z-index: 0;
}

.arcade-btn-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-width: 280px;
  padding: 16px 38px;
  border-radius: 18px;
  background: linear-gradient(180deg, #38bdf8 0%, #2563eb 52%, #1d4ed8 100%);
  border: 2px solid #7dd3fc;
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.45),
    0 6px 0 #102a6b,
    0 0 28px rgba(0, 240, 255, 0.5);
  transform: translateY(0);
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.2s ease, border-color 0.2s ease;
}

.arcade-btn:hover .arcade-btn-top {
  filter: brightness(1.08);
  box-shadow:
    inset 0 2px 12px rgba(255, 255, 255, 0.55),
    0 6px 0 #102a6b,
    0 0 38px rgba(0, 240, 255, 0.72);
}

.arcade-btn:active .arcade-btn-top,
.arcade-btn.pressed .arcade-btn-top {
  transform: translateY(6px);
  box-shadow:
    inset 0 2px 8px rgba(255, 255, 255, 0.35),
    0 0 0 #102a6b,
    0 0 20px rgba(0, 240, 255, 0.85);
}

body.state-running .arcade-btn-top {
  background: linear-gradient(180deg, #00f0ff 0%, #0284c7 55%, #0369a1 100%);
  border-color: #ffffff;
  box-shadow:
    inset 0 2px 12px rgba(255, 255, 255, 0.6),
    0 6px 0 #082f49,
    0 0 42px rgba(0, 240, 255, 0.85);
}

.arcade-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.btn-action-label {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(2, 8, 23, 0.5);
}

.btn-key-hint {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.38);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #e0f7ff;
}

/* ===== Post-Game Results & Embedded Leaderboard ===== */
.results-layout {
  width: min(1020px, 100%);
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 22px;
  align-items: stretch;
}

.score-summary-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

.score-summary-card.tier-jackpot {
  border-color: var(--gold-jackpot);
  box-shadow:
    0 24px 65px rgba(0, 0, 0, 0.7),
    0 0 48px rgba(0, 240, 255, 0.5),
    0 0 70px rgba(253, 224, 71, 0.28);
}

.results-player-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #bae6fd;
  word-break: break-word;
}

.results-score-time {
  font-family: var(--font-mono);
  font-size: clamp(2.4rem, 5vw, 3.55rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.03em;
  white-space: nowrap;
  color: #ffffff;
  text-shadow:
    0 0 14px rgba(255, 255, 255, 0.75),
    0 0 32px rgba(0, 240, 255, 0.85),
    0 0 60px rgba(37, 99, 235, 0.65);
  margin: 6px 0 2px;
}

.score-summary-card.tier-jackpot .results-score-time {
  color: #fef9c3;
  text-shadow:
    0 0 18px #ffffff,
    0 0 38px var(--gold-jackpot),
    0 0 72px var(--cyan-400);
}

.score-summary-card.tier-miss .results-score-time {
  color: #ffe4e6;
  text-shadow: 0 0 16px rgba(251, 113, 133, 0.85);
}

.results-score-verdict {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--cyan-300);
}

.score-summary-card.tier-jackpot .results-score-verdict {
  color: #fef08a;
}

.score-summary-card.tier-miss .results-score-verdict {
  color: #fda4af;
}

.results-score-delta {
  font-size: 0.94rem;
  color: rgba(186, 230, 253, 0.82);
}

.results-rank-pill {
  margin: 10px 0 8px;
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(2, 11, 31, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.results-rank-pill span {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: rgba(186, 230, 253, 0.75);
}

.results-rank-pill strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cyan-400);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.65);
}

.results-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.next-hint {
  font-size: 0.78rem;
  color: rgba(186, 230, 253, 0.68);
  line-height: 1.45;
}

/* ===== Leaderboard Cards & Tables ===== */
.leaderboard-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.leaderboard-full-card {
  width: min(780px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.leaderboard-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.lb-target-tag {
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.14);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: var(--cyan-300);
}

.lb-summary-pills {
  display: flex;
  gap: 10px;
}

.lb-mini-stat {
  padding: 7px 14px;
  border-radius: 12px;
  background: rgba(2, 11, 31, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  display: flex;
  align-items: center;
  gap: 9px;
}

.lb-mini-stat span {
  font-family: var(--font-display);
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  color: rgba(186, 230, 253, 0.72);
}

.lb-mini-stat strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: #ffffff;
}

.gold-text {
  color: #fef08a !important;
  text-shadow: 0 0 12px rgba(253, 224, 71, 0.55);
}

.leaderboard-table-wrap {
  width: 100%;
  max-height: 360px;
  overflow-y: auto;
  border-radius: 16px;
  background: rgba(2, 11, 31, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.3);
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.45) transparent;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.leaderboard-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px;
  background: rgba(8, 26, 66, 0.96);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(125, 211, 252, 0.85);
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
}

.leaderboard-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
  font-size: 0.95rem;
  color: #e0f7ff;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tbody tr.is-current-run {
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.2), rgba(37, 99, 235, 0.22));
  box-shadow: inset 3px 0 0 var(--cyan-400);
}

.leaderboard-table tbody tr.is-current-run td {
  color: #ffffff;
  font-weight: 700;
}

.rank-badge {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 26px;
  padding: 0 8px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(14, 42, 102, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--cyan-300);
}

.rank-badge.rank-1 {
  background: rgba(253, 224, 71, 0.22);
  border-color: var(--gold-jackpot);
  color: #fef08a;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.45);
}

.rank-badge.rank-2 {
  background: rgba(226, 232, 240, 0.2);
  border-color: #e2e8f0;
  color: #ffffff;
}

.rank-badge.rank-3 {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--cyan-400);
  color: #bae6fd;
}

.lb-player-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.you-tag {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.24);
  border: 1px solid var(--cyan-400);
  color: #ffffff;
}

.lb-time-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.lb-diff-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  background: rgba(14, 42, 102, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
}

.lb-diff-pill.jackpot {
  background: rgba(253, 224, 71, 0.2);
  border-color: var(--gold-jackpot);
  color: #fef08a;
  box-shadow: 0 0 10px rgba(253, 224, 71, 0.35);
}

.lb-diff-pill.close {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--cyan-400);
  color: #ffffff;
}

.lb-empty-row td {
  text-align: center;
  padding: 34px 16px;
  color: rgba(186, 230, 253, 0.6);
  font-size: 0.95rem;
}

/* ===== Settings Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 8, 23, 0.76);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
}

.settings-modal {
  width: min(460px, 100%);
  border-radius: 22px;
  background: linear-gradient(160deg, #0b2254 0%, #05112d 100%);
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 36px rgba(0, 240, 255, 0.22);
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: #ffffff;
}

.close-btn {
  background: none;
  border: none;
  color: var(--cyan-300);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.close-btn:hover {
  color: #ffffff;
}

.modal-body {
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.setting-group label {
  font-size: 0.88rem;
  font-weight: 600;
  color: #bae6fd;
}

.setting-hint {
  font-size: 0.76rem;
  color: rgba(186, 230, 253, 0.65);
  margin-top: 2px;
}

.setting-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.setting-group input[type='number'],
.setting-group select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(2, 11, 31, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 0.94rem;
  outline: none;
}

.setting-group input[type='number'] {
  max-width: 120px;
  font-family: var(--font-display);
  font-weight: 700;
}

.setting-group input:focus,
.setting-group select:focus {
  border-color: var(--cyan-400);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.35);
}

.preset-pills {
  display: flex;
  gap: 6px;
}

.preset-btn {
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 42, 102, 0.6);
  color: var(--cyan-300);
  font-family: var(--font-display);
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover,
.preset-btn.active {
  background: rgba(0, 240, 255, 0.22);
  border-color: var(--cyan-400);
  color: #ffffff;
}

.toggle-group {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(15, 36, 84, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #bae6fd;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: rgba(0, 240, 255, 0.3);
  border-color: var(--cyan-400);
}

.switch input:checked + .slider::before {
  transform: translateX(22px);
  background: #ffffff;
  box-shadow: 0 0 10px var(--cyan-400);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-top: 1px solid rgba(56, 189, 248, 0.2);
}

.primary-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid var(--cyan-400);
  background: linear-gradient(180deg, #0ea5e9, #2563eb);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.primary-btn:hover {
  filter: brightness(1.1);
}

.danger-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(251, 113, 133, 0.45);
  background: rgba(225, 29, 72, 0.16);
  color: #fda4af;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.danger-btn:hover {
  background: rgba(225, 29, 72, 0.3);
  color: #ffffff;
}

.secondary-btn {
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.5);
  background: rgba(14, 42, 102, 0.75);
  color: #e0f7ff;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.secondary-btn:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: var(--cyan-400);
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.32);
}

.ghost-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.72);
  color: #bae6fd;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.ghost-btn:hover {
  border-color: var(--blue-400);
  color: #ffffff;
}

.warning-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid rgba(251, 191, 36, 0.65);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.34), rgba(217, 119, 6, 0.42));
  color: #fef3c7;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.warning-btn:hover {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.5), rgba(217, 119, 6, 0.6));
  color: #ffffff;
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.38);
}

.danger-solid-btn {
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid #fda4af;
  background: linear-gradient(180deg, #f43f5e, #be123c);
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(244, 63, 94, 0.45);
  transition: all 0.18s ease;
}

.danger-solid-btn:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.7);
}

.danger-solid-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: none;
}

.modal-footer-wrap {
  flex-wrap: wrap;
  gap: 10px;
}

.modal-footer-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ===== Leaderboard Host Action Bar ===== */
.leaderboard-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.lb-host-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 13px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.tool-btn svg {
  width: 16px;
  height: 16px;
}

.tool-btn:hover {
  transform: translateY(-1px);
}

.tool-btn-cyan {
  background: rgba(14, 42, 102, 0.76);
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  color: #e0f7ff;
}

.tool-btn-cyan:hover {
  background: rgba(14, 165, 233, 0.28);
  border-color: var(--cyan-400);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

.tool-btn-danger {
  background: rgba(159, 18, 57, 0.22);
  border: 1.5px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
}

.tool-btn-danger:hover {
  background: rgba(190, 18, 60, 0.36);
  border-color: #fb7185;
  color: #ffffff;
  box-shadow: 0 0 18px rgba(251, 113, 133, 0.32);
}

.lb-back-btn {
  width: auto;
  min-width: 230px;
}

/* ===== Double-Confirmation Reset Modal ===== */
#confirm-reset-backdrop {
  z-index: 65;
}

.confirm-modal {
  width: min(430px, 100%);
  padding: 28px 26px 24px;
  border-radius: 22px;
  background: linear-gradient(160deg, #0b2254 0%, #05112d 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.8), 0 0 38px rgba(251, 191, 36, 0.18);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.confirm-modal.step-2 {
  border-color: #fb7185;
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.85), 0 0 46px rgba(244, 63, 94, 0.36);
}

.confirm-step-badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fde68a;
}

.confirm-modal.step-2 .confirm-step-badge {
  background: rgba(244, 63, 94, 0.24);
  border-color: #fb7185;
  color: #ffe4e6;
}

.confirm-icon {
  font-size: 2.3rem;
  line-height: 1;
  filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.5));
}

.confirm-modal.step-2 .confirm-icon {
  filter: drop-shadow(0 0 16px rgba(244, 63, 94, 0.7));
}

.confirm-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.confirm-message {
  font-size: 0.94rem;
  line-height: 1.5;
  color: rgba(186, 230, 253, 0.85);
}

.confirm-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.full-width-btn {
  width: 100%;
}

.confirm-row {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
}

/* ===== Toast Notification Banner ===== */
.toast-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  padding: 12px 22px;
  border-radius: 999px;
  background: rgba(8, 28, 72, 0.95);
  border: 1.5px solid var(--cyan-400);
  color: #ffffff;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(0, 240, 255, 0.35);
  backdrop-filter: blur(10px);
  animation: toastIn 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast-banner.toast-danger {
  border-color: #fb7185;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.65), 0 0 24px rgba(244, 63, 94, 0.35);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translate(-50%, 14px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 860px) {
  .results-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .top-bar {
    padding: 12px 16px;
  }

  .brand-text {
    font-size: 0.64rem;
    letter-spacing: 0.1em;
  }

  .screen-die-label {
    display: none;
  }

  .menu-card,
  .panel-card {
    padding: 24px 20px;
  }

  .cabinet {
    padding: 20px;
  }

  .timer-screen {
    padding: 16px 16px 18px;
  }

  .panel-actions,
  .confirm-row {
    grid-template-columns: 1fr;
  }

  .leaderboard-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .lb-host-tools {
    justify-content: center;
  }

  .lb-back-btn {
    width: 100%;
  }

  .arcade-btn-top {
    min-width: 230px;
    padding: 14px 28px;
  }
}
