:root {
  --cp-bg: #070913;
  --cp-cyan: #00f0ff;
  --cp-amber: #ffb800;
  --cp-text: #eef6ff;
  --cp-border: rgba(0, 240, 255, 0.35);

  /* 実機風アーケード筐体カラー */
  --cab-frame: #1c2838;
  --cab-steel: #37475a;
  --cab-blue: #0a1f6e;
  --marquee-lime: #c6ff00;
  --led-bg: #0b0e0b;
  --led-red: #ff2a2a;
  --led-amber: #ffc107;
  --led-green: #39ff14;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; }
body {
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
  background-color: var(--cp-bg);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.14), transparent 55%),
    linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 36px 36px, 36px 36px;
  color: var(--cp-text);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* 共通ネオン看板HUD */
.arcade-hud {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  padding: 8px 18px;
  background: rgba(7, 9, 19, 0.95);
  border-bottom: 2px solid var(--cp-cyan);
  box-shadow: 0 4px 18px rgba(0, 240, 255, 0.2);
  flex-shrink: 0;
}
.arcade-brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 900; letter-spacing: 0.06em;
  color: var(--cp-cyan); text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}
.arcade-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  border: 1px solid var(--cp-amber); color: var(--cp-amber); text-shadow: none;
}
.hud-stats { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hud-pill {
  background: rgba(0, 240, 255, 0.08); border: 1px solid var(--cp-border);
  padding: 4px 10px; border-radius: 6px; font-size: 13px; font-weight: bold;
}
.hud-pill strong { color: var(--cp-amber); font-size: 15px; margin-left: 5px; }
.cp-btn {
  background: rgba(0, 240, 255, 0.12); color: var(--cp-cyan);
  border: 1px solid var(--cp-cyan); padding: 6px 12px; border-radius: 6px;
  font-weight: 800; font-size: 12px; cursor: pointer;
}
.cp-btn:hover { background: var(--cp-cyan); color: #050814; }

/* メイン筐体コンテナ */
.stage-main {
  flex: 1;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: 10px 12px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cabinet {
  background: linear-gradient(180deg, #243447 0%, #111924 100%);
  border: 5px solid #4a5d75;
  border-radius: 20px;
  padding: 12px 14px 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.8), inset 0 2px 10px rgba(255, 255, 255, 0.14);
  transition: box-shadow 0.25s, border-color 0.25s;
}
.cabinet.win-flash {
  border-color: #ffeb3b;
  box-shadow: 0 0 36px rgba(255, 235, 59, 0.75);
}
.cabinet.fever {
  border-color: #ff3d00;
  box-shadow: 0 0 48px rgba(255, 61, 0, 0.9), inset 0 0 28px rgba(255, 213, 79, 0.35);
}

/* 上部マーキー（実機の黄緑ロゴ風） */
.marquee {
  background: linear-gradient(180deg, #0c247a 0%, #061347 100%);
  border: 3px solid #607d8b;
  border-radius: 12px;
  padding: 6px 12px;
  text-align: center;
  margin-bottom: 10px;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.6);
}
.marquee-title {
  font-size: clamp(28px, 6vw, 40px);
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 1.05;
  background: linear-gradient(180deg, #e7ff52 0%, #9ccc65 55%, #ffd54f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 0 #1b2a00) drop-shadow(0 0 10px rgba(198, 255, 0, 0.45));
}
.marquee-sub {
  font-size: 11px; font-weight: 800; color: #dbeafe; margin-top: 2px; letter-spacing: 0.04em;
}

/* 主役：円形ルーレット盤 */
.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1 / 1;
  margin: 0 auto 12px;
  border-radius: 14px;
  background: radial-gradient(circle at center, #0e2a8c 0%, #050f3d 100%);
  border: 4px solid #37474f;
  box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}
.roulette-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ポケットスタイル（SVG要素） */
.pocket-wedge {
  stroke: #111827;
  stroke-width: 2.5;
  transition: fill 0.06s, filter 0.06s;
}
.pocket-wedge.alt-white { fill: #e8edf5; }
.pocket-wedge.alt-red { fill: #c62828; }
.pocket-wedge.is-phoenix { fill: #ff6f00; }
.pocket-wedge.is-miss { fill: #334155; }

.pocket-text {
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}
.pocket-text.dark { fill: #b71c1c; }
.pocket-text.light { fill: #ffffff; }
.pocket-text.miss { fill: #94a3b8; font-size: 13px; }
.pocket-text.phoenix { fill: #fff8e1; font-size: 12px; }

/* 回転中の点灯＆残像テール */
.pocket-wedge.lit {
  fill: #ffeb3b !important;
  filter: drop-shadow(0 0 14px #ffeb3b);
}
.pocket-wedge.is-phoenix.lit {
  fill: #ff1744 !important;
  filter: drop-shadow(0 0 18px #ff5252);
}
.pocket-wedge.tail-1 { fill: #ff9800 !important; opacity: 0.92; }
.pocket-wedge.tail-2 { fill: #f57c00 !important; opacity: 0.75; }

.pocket-text.lit { fill: #7f0000 !important; }
.pocket-text.is-phoenix.lit { fill: #ffffff !important; }

/* 内周丸ランプ */
.inner-lamp {
  fill: #1b3a1b;
  stroke: #0f172a;
  stroke-width: 2;
  transition: fill 0.06s;
}
.inner-lamp.lit {
  fill: #76ff03;
  filter: drop-shadow(0 0 10px #76ff03);
}
.inner-lamp.tail-1 { fill: #64dd17; opacity: 0.75; }
.inner-lamp.tail-2 { fill: #33691e; opacity: 0.6; }

/* フェニックス発光（ボーナス時） */
.cabinet.fever .phoenix-svg,
.cabinet.fever .phoenix-custom {
  animation: phoenixPulse 0.45s infinite alternate;
}
@keyframes phoenixPulse {
  from { filter: drop-shadow(0 0 8px #ff3d00); transform: scale(1); }
  to { filter: drop-shadow(0 0 24px #ffeb3b); transform: scale(1.04); }
}

/* assets/phoenix.png 差し替え画像 */
.phoenix-custom {
  position: absolute;
  top: 50%; left: 50%;
  width: 44%; height: 44%;
  transform: translate(-50%, -56%);
  object-fit: contain;
  pointer-events: none;
}

/* 中央7セグLED（実機胸元風） */
.center-led-box {
  position: absolute;
  left: 50%;
  bottom: 24%;
  transform: translateX(-50%);
  background: var(--led-bg);
  border: 2px solid #78909c;
  border-radius: 6px;
  padding: 4px 10px;
  text-align: center;
  min-width: 118px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}
.center-led-label {
  font-size: 10px; font-weight: 900; color: #ffeb3b;
  white-space: nowrap; letter-spacing: 0.04em;
}
.center-led-num {
  font-family: "Courier New", monospace;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: var(--led-red);
  text-shadow: 0 0 10px rgba(255, 42, 42, 0.85);
  line-height: 1.1;
}
.bonus-dots { display: flex; justify-content: center; gap: 6px; margin-top: 3px; }
.b-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #2b1d1d; border: 1px solid #6d4c41;
}
.b-dot.on { background: #ff3d00; border-color: #ffeb3b; box-shadow: 0 0 8px #ff6d00; }

/* 右下CREDIT 7セグ表示 */
.corner-credit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--led-bg);
  border: 2px solid #607d8b;
  border-radius: 6px;
  padding: 3px 8px;
  text-align: right;
  line-height: 1.1;
}
.corner-lbl { display: block; font-size: 9px; font-weight: 900; color: #94a3b8; }
.corner-val {
  font-family: "Courier New", monospace;
  font-size: 18px; font-weight: 900;
  color: var(--led-red);
  text-shadow: 0 0 8px rgba(255, 42, 42, 0.8);
}

/* 下部ベット＆操作パネル */
.control-deck {
  background: linear-gradient(180deg, #1b2533 0%, #0f1620 100%);
  border: 2px solid #455a64;
  border-radius: 12px;
  padding: 10px;
}
.sub-led-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px;
}
.sub-led {
  background: var(--led-bg); border: 2px solid #37474f; border-radius: 6px;
  padding: 4px 10px; display: flex; justify-content: space-between; align-items: center;
}
.sub-led span { font-size: 11px; color: #94a3b8; font-weight: 800; }
.sub-led strong {
  font-family: "Courier New", monospace; font-size: 20px; font-weight: 900;
  color: var(--led-amber); text-shadow: 0 0 8px rgba(255, 193, 7, 0.65);
}

.bet-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 10px;
}
.slot-btn {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
  border: 2px solid #64748b; border-bottom: 5px solid #334155;
  border-radius: 10px; padding: 8px 2px; min-height: 70px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #0f172a; font-weight: 900; transition: transform 0.06s;
  -webkit-tap-highlight-color: transparent;
}
.slot-btn:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 2px; }
.slot-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.slot-btn.has-bet {
  background: linear-gradient(180deg, #fff59d 0%, #fbc02d 100%);
  border-color: #d50000; border-bottom-color: #8e0000;
}
.slot-num { font-size: 20px; line-height: 1; }
.slot-mult { font-size: 11px; color: #b71c1c; margin-top: 2px; }
.slot-bet {
  margin-top: 4px; font-size: 12px; background: #111; color: var(--led-green);
  padding: 1px 8px; border-radius: 4px; font-family: "Courier New", monospace;
}

.action-row { display: flex; gap: 8px; align-items: center; }
.retro-btn {
  min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 2px solid #64748b; border-bottom: 5px solid #334155;
  font-weight: 900; font-size: 13px; cursor: pointer;
  background: #e2e8f0; color: #0f172a;
}
.retro-btn:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 2px; }
.retro-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.retro-btn.start {
  flex: 1; font-size: 18px; letter-spacing: 0.08em;
  background: linear-gradient(180deg, #ff5252 0%, #c62828 100%);
  color: #fff; border-color: #ff8a80; border-bottom-color: #7f0000;
  box-shadow: 0 0 14px rgba(255, 82, 82, 0.4);
}

/* スマホ最適化 */
@media (max-width: 480px) {
  .arcade-hud { padding: 8px 12px; }
  .stage-main { padding: 8px 8px 16px; }
  .cabinet { padding: 10px; border-width: 4px; }
  .center-led-box { bottom: 22%; min-width: 100px; padding: 3px 8px; }
  .slot-btn { min-height: 64px; }
  .retro-btn { font-size: 12px; padding: 8px 10px; }
  .retro-btn.start { font-size: 16px; }
}