:root {
  color-scheme: dark;
  --bg-1: #1a002b;
  --bg-2: #00131f;
  --panel: rgba(20, 4, 36, 0.78);
  --panel-border: rgba(255, 0, 200, 0.35);
  --text: #fff6ff;
  --muted: #ffd6fb;
  --glow: rgba(255, 0, 200, 0.5);
  --button-gradient-start: #ff2fd8;
  --button-gradient-mid: #00e5ff;
  --button-gradient-end: #fff23d;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  overflow-x: hidden;
  background: linear-gradient(160deg, var(--bg-1), var(--bg-2));
}

body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background: conic-gradient(
    from 0deg,
    #ff2fd8,
    #00e5ff,
    #fff23d,
    #3dff8f,
    #ff2fd8
  );
  filter: blur(80px) saturate(1.6);
  opacity: 0.55;
  animation: rainbow-spin 18s linear infinite, rainbow-pulse 6s ease-in-out infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  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: 36px 36px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
  pointer-events: none;
}

@keyframes rainbow-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes rainbow-pulse {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.7;
  }
}

.app {
  width: min(960px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 40px;
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #ffe6fb;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.78rem;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 11vw, 5.5rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
  color: #fff;
  -webkit-text-stroke: 2px rgba(0, 0, 0, 0.5);
  text-shadow:
    0 0 8px #ff2fd8,
    0 0 20px #00e5ff,
    0 0 36px #fff23d,
    0 4px 0 rgba(0, 0, 0, 0.4);
  animation: title-glow 3s ease-in-out infinite;
}

@keyframes title-glow {
  0%,
  100% {
    text-shadow:
      0 0 8px #ff2fd8,
      0 0 20px #00e5ff,
      0 0 36px #fff23d,
      0 4px 0 rgba(0, 0, 0, 0.4);
  }
  50% {
    text-shadow:
      0 0 16px #00e5ff,
      0 0 30px #fff23d,
      0 0 48px #ff2fd8,
      0 4px 0 rgba(0, 0, 0, 0.4);
  }
}

.lede {
  max-width: 42rem;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 0, 200, 0.6);
}

/* --- ジャックポット常時表示 ---------------------------------------------- */

.jackpot-display {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  padding: 14px 18px;
  border-radius: 22px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 40%),
    linear-gradient(135deg, rgba(60, 30, 0, 0.85), rgba(20, 4, 36, 0.9));
  border: 2px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 2px rgba(255, 215, 0, 0.5),
    0 0 30px rgba(255, 215, 0, 0.45),
    0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.jackpot-display::before {
  content: "";
  position: absolute;
  inset: -40%;
  z-index: 0;
  background: conic-gradient(
    from 0deg,
    #ffd700,
    #ff2fd8,
    #00e5ff,
    #fff23d,
    #ffd700
  );
  filter: blur(30px);
  opacity: 0.45;
  animation: jackpot-display-spin 6s linear infinite;
}

@keyframes jackpot-display-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.jackpot-display__label {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: #ffe08a;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.jackpot-display__value {
  position: relative;
  z-index: 1;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #ffd700, #fff23d, #ff2fd8, #ffd700);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.55);
  animation: jackpot-value-shine 3.2s linear infinite;
  transition: transform 160ms ease;
}

@keyframes jackpot-value-shine {
  to {
    background-position: -200% center;
  }
}

.jackpot-display__value.is-pulse {
  animation: jackpot-value-shine 3.2s linear infinite, jackpot-value-pulse 420ms ease-out;
}

@keyframes jackpot-value-pulse {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
  }
  40% {
    transform: scale(1.14);
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.9));
  }
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
  }
}

.hud {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat,
.machine,
.result {
  backdrop-filter: blur(20px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 0, 200, 0.15);
}

.stat {
  padding: 16px 18px;
  border-radius: 20px;
}

.stat__label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat__value {
  font-size: 1.5rem;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.6);
}

.machine {
  position: relative;
  padding: 22px;
  border-radius: 30px;
  overflow: hidden;
  transition: transform 120ms ease;
}

.machine::before {
  content: "";
  position: absolute;
  inset: 1rem;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.machine__frame {
  border-radius: 24px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(145deg, rgba(20, 3, 30, 0.95), rgba(10, 4, 26, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -16px 30px rgba(0, 0, 0, 0.3);
}

.reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.reel {
  position: relative;
  height: 264px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 0 0 1px rgba(0, 0, 0, 0.25),
    0 18px 36px rgba(0, 0, 0, 0.3);
}

/* 上段・下段を暗くし、中段（当たりラインの主役）を目立たせるビネット。
   スクロールする .reel__strip とは独立した固定オーバーレイなので、
   どのシンボルが通過してもレイアウトの手直しが要らない。 */
.reel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    to bottom,
    rgba(6, 0, 12, 0.62) 0%,
    rgba(6, 0, 12, 0.62) 31%,
    transparent 34%,
    transparent 66%,
    rgba(6, 0, 12, 0.62) 69%,
    rgba(6, 0, 12, 0.62) 100%
  );
  pointer-events: none;
}

/* 中段の当たりライン枠 */
.reel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% / 3);
  height: calc(100% / 3);
  z-index: 3;
  border-top: 2px solid rgba(255, 255, 255, 0.55);
  border-bottom: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 22px var(--glow) inset;
  pointer-events: none;
  transition: box-shadow 200ms ease, border-color 200ms ease;
}

.reel__strip {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  will-change: transform;
}

.reel__cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reel__cell img {
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  object-fit: contain;
  transform: scale(var(--reel-scale, 1));
  filter:
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3))
    drop-shadow(0 0 16px var(--reel-glow, var(--glow)));
}

.reel__cell.is-win-highlight {
  z-index: 4;
}

.reel__cell.is-win-highlight img {
  filter:
    drop-shadow(0 6px 12px rgba(0, 0, 0, 0.3))
    drop-shadow(0 0 30px var(--reel-glow, var(--glow)))
    drop-shadow(0 0 46px var(--reel-glow, var(--glow)));
  animation: win-cell-pulse 700ms ease-in-out infinite;
}

@keyframes win-cell-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.telop {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  pointer-events: none;
  font-size: clamp(2rem, 9vw, 3.4rem);
  font-weight: 900;
  color: #fff23d;
  letter-spacing: 0.08em;
  text-shadow:
    0 0 12px #ff2f5d,
    0 0 26px #ff2f5d,
    0 4px 0 rgba(0, 0, 0, 0.5);
  animation: telop-pop 480ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.telop[hidden] {
  display: none;
}

@keyframes telop-pop {
  0% {
    opacity: 0;
    transform: scale(0.4) rotate(-6deg);
  }
  60% {
    opacity: 1;
    transform: scale(1.15) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.win-badge {
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translate(-50%, 100%);
  z-index: 6;
  margin: 0;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(20, 3, 30, 0.88);
  border: 1px solid var(--panel-border);
  color: var(--text);
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
  box-shadow: 0 0 20px var(--glow);
  animation: win-badge-in 320ms ease-out;
}

.win-badge[hidden] {
  display: none;
}

@keyframes win-badge-in {
  0% {
    opacity: 0;
    transform: translate(-50%, 100%) scale(0.7);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 100%) scale(1);
  }
}

/* JP専用テロップ: 通常のリーチテロップより金色・派手にする */
.telop--jp {
  z-index: 8;
  color: #ffd700;
  font-size: clamp(2.4rem, 11vw, 4.2rem);
  text-shadow:
    0 0 14px #ffd700,
    0 0 30px #ff2fd8,
    0 0 48px #00e5ff,
    0 4px 0 rgba(0, 0, 0, 0.5);
  animation: jp-telop-pop 620ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes jp-telop-pop {
  0% {
    opacity: 0;
    transform: scale(0.3) rotate(-8deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.25) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

.jackpot-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  margin: 0;
  padding: 12px 26px;
  border-radius: 999px;
  background: rgba(20, 3, 30, 0.9);
  border: 2px solid #ffd700;
  color: #ffd700;
  font-weight: 900;
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  animation: jackpot-badge-in 360ms ease-out;
}

.jackpot-badge[hidden] {
  display: none;
}

@keyframes jackpot-badge-in {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* スピン中: 振動、背景の回転を加速 */
.machine--spinning {
  animation: machine-shake 220ms ease-in-out infinite;
}

body:has(.machine--spinning)::before {
  animation-duration: 4s, 2s;
}

/* リーチ演出: 背景の脈動を速く・赤〜金系にし、リール枠を強く発光させる */
.machine--reach {
  animation: machine-shake 180ms ease-in-out infinite;
}

.machine--reach .reel::after {
  border-color: #ff2f5d;
  box-shadow: 0 0 34px #ff2f5d inset, 0 0 24px #fff23d;
  animation: reach-frame-pulse 480ms ease-in-out infinite;
}

@keyframes reach-frame-pulse {
  0%,
  100% {
    box-shadow: 0 0 34px #ff2f5d inset, 0 0 24px #fff23d;
  }
  50% {
    box-shadow: 0 0 54px #fff23d inset, 0 0 40px #ff2f5d;
  }
}

body:has(.machine--reach)::before {
  animation-duration: 1.6s, 0.9s;
  background: conic-gradient(from 0deg, #ff2f5d, #fff23d, #ff8f3d, #ff2f5d);
  opacity: 0.7;
}

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

/* 小当たり: 控えめな演出 */
.machine--pair .reel {
  animation: pair-glow 900ms ease-in-out 2;
}

@keyframes pair-glow {
  0%,
  100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.2),
      0 0 0 1px rgba(0, 0, 0, 0.25),
      0 18px 36px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.3),
      0 0 0 2px rgba(255, 242, 61, 0.6),
      0 0 30px rgba(255, 242, 61, 0.5);
  }
}

/* 大当たり: 画面フラッシュ・シェイク・虹色発光 */
.machine--jackpot {
  animation: jackpot-shake 420ms ease-in-out 3;
}

.machine--jackpot .reel {
  animation: jackpot-rainbow 900ms linear infinite;
}

@keyframes jackpot-shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-6px, 3px) rotate(-1deg);
  }
  40% {
    transform: translate(6px, -3px) rotate(1deg);
  }
  60% {
    transform: translate(-5px, -2px) rotate(-1deg);
  }
  80% {
    transform: translate(5px, 2px) rotate(1deg);
  }
}

@keyframes jackpot-rainbow {
  0% {
    box-shadow: 0 0 0 3px #ff2fd8, 0 0 40px #ff2fd8;
  }
  33% {
    box-shadow: 0 0 0 3px #00e5ff, 0 0 40px #00e5ff;
  }
  66% {
    box-shadow: 0 0 0 3px #fff23d, 0 0 40px #fff23d;
  }
  100% {
    box-shadow: 0 0 0 3px #ff2fd8, 0 0 40px #ff2fd8;
  }
}

.machine--jackpot::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  background: white;
  opacity: 0;
  pointer-events: none;
  animation: jackpot-flash 420ms ease-out 3;
}

@keyframes jackpot-flash {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

/* JP発動: 通常の大当たり(.machine--jackpot)よりさらに格上の全画面演出 */
.machine--jp-trigger {
  animation: jp-trigger-shake 380ms ease-in-out 4;
}

.machine--jp-trigger .reel {
  animation: jp-trigger-rainbow 500ms linear infinite;
}

@keyframes jp-trigger-shake {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  20% {
    transform: translate(-10px, 5px) rotate(-2deg);
  }
  40% {
    transform: translate(10px, -5px) rotate(2deg);
  }
  60% {
    transform: translate(-9px, -4px) rotate(-2deg);
  }
  80% {
    transform: translate(9px, 4px) rotate(2deg);
  }
}

@keyframes jp-trigger-rainbow {
  0% {
    box-shadow: 0 0 0 4px #ffd700, 0 0 50px #ffd700;
  }
  33% {
    box-shadow: 0 0 0 4px #ff2fd8, 0 0 50px #ff2fd8;
  }
  66% {
    box-shadow: 0 0 0 4px #00e5ff, 0 0 50px #00e5ff;
  }
  100% {
    box-shadow: 0 0 0 4px #ffd700, 0 0 50px #ffd700;
  }
}

.machine--jp-trigger::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 7;
  background: radial-gradient(circle, #fff8d6, #ffd700 45%, #ff2fd8 100%);
  opacity: 0;
  pointer-events: none;
  animation: jp-trigger-flash 380ms ease-out 4;
}

@keyframes jp-trigger-flash {
  0% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
  }
}

.bet-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
}

.bet-select__button {
  min-width: 76px;
  padding: 10px 14px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.bet-select__button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.bet-select__button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.bet-select__button--active {
  background: linear-gradient(
    135deg,
    var(--button-gradient-start),
    var(--button-gradient-mid) 55%,
    var(--button-gradient-end)
  );
  color: #1a002b;
  box-shadow: 0 0 16px var(--glow);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.button--small {
  min-width: 0;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.button--revive {
  background: linear-gradient(135deg, #ff2f5d, #fff23d);
  color: #1a002b;
  font-weight: 900;
}

.button {
  min-width: 140px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    opacity 160ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.button--primary {
  background: linear-gradient(
    135deg,
    var(--button-gradient-start),
    var(--button-gradient-mid) 55%,
    var(--button-gradient-end)
  );
  color: #1a002b;
  font-weight: 900;
  box-shadow:
    0 10px 24px rgba(255, 47, 216, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.mute-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.mute-toggle:hover {
  transform: translateY(-1px);
}

.mute-toggle--active {
  box-shadow: 0 0 14px rgba(255, 47, 216, 0.5);
  color: #ff2fd8;
}

.volume-slider {
  flex: 1;
  max-width: 220px;
  height: 6px;
  border-radius: 999px;
  appearance: none;
  background: linear-gradient(
    90deg,
    var(--button-gradient-start),
    var(--button-gradient-mid),
    var(--button-gradient-end)
  );
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff6ff;
  border: 2px solid var(--button-gradient-mid);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff6ff;
  border: 2px solid var(--button-gradient-mid);
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.6);
  cursor: pointer;
}

.audio-controls__value {
  min-width: 3.2em;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.result {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: 22px;
}

.result__title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 900;
}

.result__body {
  margin: 0;
  color: var(--muted);
}

.result__title {
  transition: transform 200ms ease;
}

.machine--jackpot ~ .result .result__title {
  animation: result-bounce 600ms ease-in-out 1;
  color: #fff23d;
  text-shadow: 0 0 12px #ff2fd8, 0 0 24px #00e5ff;
}

.machine--pair ~ .result .result__title {
  color: #fff23d;
}

@keyframes result-bounce {
  0% {
    transform: scale(0.6);
  }
  50% {
    transform: scale(1.3);
  }
  70% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}

.panel {
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: 22px;
  backdrop-filter: blur(20px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4), 0 0 30px rgba(255, 0, 200, 0.15);
}

.panel summary {
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
  list-style: none;
}

.panel summary::-webkit-details-marker {
  display: none;
}

.panel summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 8px;
  font-size: 0.7em;
  transition: transform 160ms ease;
}

.panel[open] summary::before {
  transform: rotate(90deg);
}

.panel__actions {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

/* --- 配当表 ------------------------------------------------------------ */

.paytable {
  margin-top: 14px;
  display: grid;
  gap: 20px;
}

.paytable__symbols {
  display: grid;
  gap: 8px;
}

.paytable__row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.paytable__image {
  width: 44px;
  height: 44px;
  object-fit: contain;
  transform: scale(var(--reel-scale, 1));
}

.paytable__label {
  font-weight: 700;
  color: var(--text);
}

.paytable__multiplier {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.paytable__jackpot-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  text-align: center;
  font-weight: 800;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.paytable__lines {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.line-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.line-diagram__grid {
  width: 64px;
  height: 64px;
}

.line-diagram__cell {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.25);
  stroke-width: 0.6;
}

.line-diagram__line {
  fill: none;
  stroke: var(--button-gradient-start);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-diagram__caption {
  font-size: 0.78rem;
  color: var(--muted);
}

/* --- 統計・履歴 --------------------------------------------------------- */

.stats-panel {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
}

.stats-panel__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.stats-panel__label {
  color: var(--muted);
  font-size: 0.86rem;
}

.stats-panel__value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.history {
  margin-top: 18px;
}

.history__title {
  margin: 0 0 8px;
  font-size: 0.95rem;
  color: var(--muted);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.history-list__item {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.86rem;
}

.history-list__item--win {
  background: rgba(255, 242, 61, 0.12);
  border: 1px solid rgba(255, 242, 61, 0.3);
}

.history-list__item--jackpot {
  background: rgba(255, 215, 0, 0.16);
  border: 1px solid rgba(255, 215, 0, 0.5);
  font-weight: 800;
  color: #ffd700;
}

.history-list__empty {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

@media (max-width: 720px) {
  .app {
    width: min(100vw - 20px, 960px);
    padding-top: 18px;
  }

  .hud {
    grid-template-columns: 1fr;
  }

  .jackpot-display {
    padding: 10px 14px;
  }

  .jackpot-badge {
    max-width: calc(100vw - 48px);
    white-space: normal;
    text-align: center;
  }

  .reels {
    gap: 8px;
  }

  .reel {
    height: 198px;
  }

  .reel__cell img {
    width: calc(100% - 16px);
    height: calc(100% - 16px);
  }

  .button {
    width: 100%;
  }

  .bet-select__button {
    flex: 1 1 calc(50% - 8px);
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }

  .paytable__row {
    grid-template-columns: 36px 1fr;
    row-gap: 2px;
  }

  .paytable__image {
    width: 36px;
    height: 36px;
  }

  .paytable__multiplier {
    grid-column: 2 / 3;
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  body::before {
    opacity: 0.3;
  }

  .machine--jackpot::after {
    display: none;
  }

  .machine--jp-trigger::after {
    display: none;
  }

  .jackpot-display::before {
    opacity: 0.25;
  }

  .jackpot-display__value {
    animation: none;
  }
}
