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

:root {
  color-scheme: dark;
  --gold: #f8c84f;
  --led: #ffcf3a;
  --ink: #fff8df;
  --cyan: #35d3ff;
  --purple: #b478ff;
  --red: #ff324a;
  /* 演出フォント（最大3系統に統一） */
  --f-title: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-num: "Orbitron", "Impact", "Arial Black", sans-serif;
  --f-sub: "Noto Sans JP", "Hiragino Sans", sans-serif;
}

/* ===== 演出用の共通テキスト効果 ===== */
/* 金色グラデ＋黒フチ＋発光（決定文字・タイトル用） */
.tx-gold {
  font-family: var(--f-title);
  font-weight: 800;
  background: linear-gradient(180deg, #fff7d6 0%, #ffe487 26%, #f8bf3e 52%, #b9781d 78%, #ffe08a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: clamp(2px, 0.9vw, 4px) rgba(18, 8, 0, 0.92);
  paint-order: stroke fill;
  filter:
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.9))
    drop-shadow(0 0 16px rgba(180, 90, 255, 0.55))
    drop-shadow(0 0 6px rgba(255, 60, 70, 0.4));
}
/* 白金色＋細金フチ（サブ見出し・「3G以内に」用） */
.tx-plat {
  font-family: var(--f-title);
  font-weight: 700;
  background: linear-gradient(180deg, #ffffff 0%, #f4ecd0 45%, #d8c48a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px rgba(120, 90, 30, 0.8);
  paint-order: stroke fill;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 10px rgba(200, 150, 255, 0.4));
}
/* くすんだ灰金（失敗用） */
.tx-ash {
  font-family: var(--f-title);
  font-weight: 800;
  background: linear-gradient(180deg, #e7e2d0 0%, #bdb49a 45%, #7d7660 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: clamp(2px, 0.8vw, 3px) rgba(10, 8, 14, 0.9);
  paint-order: stroke fill;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 12px rgba(120, 80, 160, 0.4));
}

html, body {
  height: 100%;
  background: #050308;
  font-family: "Impact", "Arial Black", "Hiragino Sans", sans-serif;
  color: var(--ink);
  overflow: hidden;
}

.stage {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

/* ===== 筐体（縦型・背景画像） ===== */
.machine {
  position: relative;
  width: min(99vw, calc(99vh * 853 / 1844));
  aspect-ratio: 853 / 1844;
  background: url("./assets/god_bg.png") center/cover no-repeat;
  overflow: hidden;
  box-shadow: 0 0 60px rgba(248, 200, 79, 0.25), 0 16px 50px rgba(0, 0, 0, 0.85);
  user-select: none;
}

/* キャラを沈めてリールを主役に（左右＋上下のヴィネット） */
.machine::before {
  content: "";
  position: absolute;
  inset: 0 0 28% 0;
  background:
    linear-gradient(90deg, rgba(4, 2, 8, 0.68) 0%, rgba(4, 2, 8, 0.12) 30%, rgba(4, 2, 8, 0.12) 70%, rgba(4, 2, 8, 0.68) 100%),
    linear-gradient(180deg, rgba(4, 2, 8, 0.28) 0%, rgba(4, 2, 8, 0) 22%, rgba(4, 2, 8, 0) 55%, rgba(4, 2, 8, 0.55) 100%);
  z-index: 2;
  pointer-events: none;
}

/* ===== 演出用ベール ===== */
.veil {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 18;
}
.red-veil    { background: radial-gradient(circle at 50% 45%, rgba(255, 30, 60, 0.32), rgba(120, 0, 10, 0.14) 60%, transparent 78%); }
.black-veil  { background: #04020a; z-index: 24; }
.gold-veil   { background: radial-gradient(circle at 50% 42%, rgba(255, 220, 110, 0.55), rgba(180, 120, 20, 0.2) 55%, transparent 80%); z-index: 25; }
.stairs-veil {
  background:
    radial-gradient(ellipse 60% 90% at 50% 100%, rgba(255, 210, 90, 0.55), transparent 70%),
    linear-gradient(180deg, transparent 30%, rgba(255, 190, 70, 0.28) 100%);
  z-index: 25;
  transform: translateY(24%) scale(1.05);
}

/* LAST の赤紫フラッシュ（背景を赤紫に変える） */
.machine.last .red-veil {
  background: radial-gradient(circle at 50% 45%, rgba(200, 40, 190, 0.4), rgba(90, 0, 70, 0.24) 55%, rgba(140, 0, 20, 0.12) 74%, transparent 84%);
  animation: lastPulse 0.9s ease-in-out infinite;
}
@keyframes lastPulse {
  0%, 100% { opacity: 0.2; }
  50%      { opacity: 0.95; }
}
/* LASTの回転中は枠点滅をさらに速く強く */
.machine.last-spin .reel { animation: lastReelBlink 0.32s steps(1) infinite; }
@keyframes lastReelBlink {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 60, 200, 0.85), 0 0 22px rgba(220, 40, 190, 0.7); }
  50%      { box-shadow: 0 0 0 2px rgba(255, 220, 120, 0.9), 0 0 26px rgba(255, 180, 60, 0.75); }
}

/* 暗転 */
.machine.blackout .black-veil { opacity: 0.96; transition: opacity 0.4s ease; }

/* 成功：金色発光＋階段せり上がり */
.machine.stairs-glow .stairs-veil {
  opacity: 1;
  animation: stairsRise 2.6s ease-out forwards;
}
@keyframes stairsRise {
  0%   { opacity: 0; transform: translateY(30%) scale(1.02); }
  30%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(-8%) scale(1.35); }
}
.machine.success .gold-veil { opacity: 1; animation: goldFlash 2s ease-out; }
@keyframes goldFlash {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0.6; }
}

/* 復活：紫雷＋金光の爆発 */
.machine.revive .gold-veil {
  opacity: 1;
  background: radial-gradient(circle at 50% 45%, rgba(200, 130, 255, 0.6), rgba(255, 210, 90, 0.35) 45%, transparent 78%);
  animation: reviveBurst 1.4s ease-out;
}
@keyframes reviveBurst {
  0%   { opacity: 0; transform: scale(1.5); }
  30%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0.7; transform: scale(1.05); }
}

/* 黄777 停止時の強い金色フラッシュ */
.machine.gold777-stop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, rgba(255, 235, 150, 0.95), rgba(255, 200, 70, 0.5) 45%, rgba(120, 70, 0, 0.15) 75%, transparent 90%);
  animation: gold777Flash 0.3s ease-out;
  pointer-events: none;
  z-index: 20;
}
@keyframes gold777Flash {
  0%   { opacity: 0; }
  35%  { opacity: 1; }
  100% { opacity: 0.85; }
}

/* ヒット時の一瞬フラッシュ */
.machine.hit::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 220, 120, 0.4), transparent 60%);
  animation: hitFlash 0.6s ease-out;
  pointer-events: none;
  z-index: 16;
}
@keyframes hitFlash {
  0%, 100% { opacity: 0; }
  35%      { opacity: 1; }
}

/* 緊張状態（あと1つ）：紫の脈動 */
.machine.tense::before {
  background:
    linear-gradient(90deg, rgba(90, 20, 140, 0.5) 0%, rgba(5, 3, 10, 0) 26%, rgba(5, 3, 10, 0) 74%, rgba(90, 20, 140, 0.5) 100%),
    linear-gradient(180deg, rgba(5, 3, 10, 0) 60%, rgba(40, 6, 60, 0.4) 100%);
  animation: tensePulse 1.1s ease-in-out infinite;
}
@keyframes tensePulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.5); }
}

/* ===== 焼き込み文字の目隠し（重複情報を整理） ===== */
.mask {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}
/* リール下・左右にはみ出す「CHANCE」「0003G」を隠す */
.mask-l {
  left: 0; top: 69.6%; width: 34%; height: 3.4%;
  background: linear-gradient(90deg, rgba(6, 3, 12, 0.97) 65%, rgba(6, 3, 12, 0) 100%);
}
.mask-r {
  right: 0; top: 69.6%; width: 34%; height: 3.4%;
  background: linear-gradient(270deg, rgba(6, 3, 12, 0.97) 65%, rgba(6, 3, 12, 0) 100%);
}
/* 最下部の CREDIT / PAY / 演出モード / オートプレイ を沈める（KIKUSORAは残す） */
.foot-dim {
  left: 0; right: 0; bottom: 0; height: 15%;
  background:
    linear-gradient(90deg, rgba(4, 2, 8, 0.82) 0%, rgba(4, 2, 8, 0.82) 30%, rgba(4, 2, 8, 0) 42%, rgba(4, 2, 8, 0) 58%, rgba(4, 2, 8, 0.82) 70%, rgba(4, 2, 8, 0.82) 100%);
}

/* ===== 上部 HUD：TOTAL POINT / 残りG ===== */
.hud-top {
  position: absolute;
  left: 5%;
  top: 28.2%;
  width: 90%;
  height: 4.9%;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 3%;
  z-index: 6;
}
.hud-top .total,
.hud-top .remain {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0.4% 4%;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(8, 4, 16, 0.82), rgba(20, 8, 32, 0.82));
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(180, 130, 60, 0.4);
}
.hud-top small {
  font-family: var(--f-sub);
  font-size: clamp(7px, 1.9vw, 13px);
  letter-spacing: 2px;
  color: var(--cyan);
  opacity: 0.85;
}
.hud-top .total strong {
  font-family: var(--f-num);
  font-size: clamp(15px, 4.6vw, 32px);
  color: var(--led);
  text-shadow: 0 0 10px rgba(255, 200, 60, 0.9), 0 0 3px rgba(180, 60, 255, 0.5);
  line-height: 1;
}
.hud-top .remain {
  align-items: center;
  flex-direction: row;
  gap: 4px;
  min-width: 30%;
  justify-content: center;
}
.hud-top .remain small { font-family: var(--f-sub); color: var(--ink); opacity: 0.8; }
.hud-top .remain strong {
  font-family: var(--f-num);
  font-weight: 800;
  font-size: clamp(22px, 8vw, 54px);
  color: #fff;
  text-shadow: 0 0 14px rgba(160, 120, 255, 0.7), 0 0 6px rgba(255, 60, 70, 0.4), 0 2px 4px #000;
  line-height: 1;
}
.hud-top .remain em {
  font-family: var(--f-num);
  font-style: normal;
  font-size: clamp(10px, 3vw, 20px);
  color: var(--gold);
}
.hud-top .remain.is-last strong {
  color: var(--red);
  font-size: clamp(18px, 6.4vw, 42px);
  text-shadow: 0 0 18px rgba(255, 50, 70, 1);
  animation: lastBlink 0.6s steps(1) infinite;
}
@keyframes lastBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ===== 運命のシンボル バー（集める対象を大きく明快に） ===== */
.fate-bar {
  position: absolute;
  left: 5%;
  top: 33.6%;
  width: 90%;
  height: 7.2%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2%;
  padding: 1% 3%;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 4, 20, 0.78), rgba(28, 8, 42, 0.78));
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(190, 140, 70, 0.5);
  z-index: 6;
}
.fate-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 3%;
  height: 30%;
}
.fate-head small {
  font-family: var(--f-sub);
  font-weight: 700;
  font-size: clamp(8px, 2.3vw, 15px);
  letter-spacing: 3px;
  color: var(--purple);
  text-shadow: 0 0 8px rgba(180, 120, 255, 0.7);
}
.fate-head strong {
  font-family: var(--f-num);
  font-weight: 800;
  font-size: clamp(14px, 4.4vw, 28px);
  color: var(--gold);
  text-shadow: 0 0 12px rgba(255, 200, 60, 0.9), 0 0 4px rgba(180, 60, 255, 0.5);
  line-height: 1;
}
.fate-head strong.done {
  color: #fff;
  text-shadow: 0 0 16px rgba(200, 130, 255, 1), 0 0 30px rgba(255, 200, 60, 0.8);
  animation: goldPulse 1s ease-in-out infinite;
}
.fate-bar .slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3%;
  align-items: stretch;
  flex: 1;
}
.slot {
  position: relative;
  border-radius: 8px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 74%;
  background-color: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(120, 90, 40, 0.6);
  filter: brightness(0.4) grayscale(0.45);
  transition: filter 0.5s ease, box-shadow 0.5s ease, transform 0.4s ease;
}
.slot i {
  position: absolute;
  left: 0; right: 0; bottom: 2%;
  font-size: clamp(7px, 2vw, 12px);
  font-style: normal;
  text-align: center;
  color: var(--ink);
  opacity: 0.6;
  letter-spacing: 1px;
}
.slot.on {
  filter: none;
  box-shadow: inset 0 0 0 1px rgba(255, 210, 90, 1), 0 0 20px rgba(255, 200, 80, 0.95);
  transform: scale(1.05);
  background-color: rgba(45, 22, 4, 0.55);
  animation: slotGlow 1.4s ease-in-out infinite;
}
.slot.on i { opacity: 1; color: var(--gold); text-shadow: 0 0 8px rgba(255, 200, 60, 0.9); }
@keyframes slotGlow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 210, 90, 1), 0 0 14px rgba(255, 200, 80, 0.7); }
  50%      { box-shadow: inset 0 0 0 1px rgba(255, 220, 120, 1), 0 0 26px rgba(255, 210, 100, 1); }
}

/* ===== 中央リール（主役・大きめ） ===== */
.reels {
  position: absolute;
  left: 5%;
  top: 41.4%;
  width: 90%;
  height: 29.4%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 4.5%;
  z-index: 4;
}
.reel {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: linear-gradient(180deg, #150a26 0%, #1f0f36 50%, #0e0718 100%);
  box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.9), inset 0 0 0 2px rgba(180, 130, 50, 0.7), 0 0 14px rgba(255, 200, 70, 0.25);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3%;
  padding: 2% 0;
}
/* 中央ライン */
.reels::before {
  content: "";
  position: absolute;
  left: -2%; right: -2%;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(255, 60, 90, 0.9), rgba(255, 220, 90, 0.95), rgba(60, 210, 255, 0.9), transparent);
  z-index: 6;
  pointer-events: none;
}
/* LAST 時：リール枠を点滅 */
.machine.last .reel {
  animation: reelFrameBlink 0.6s ease-in-out infinite;
}
@keyframes reelFrameBlink {
  0%, 100% { box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.9), inset 0 0 0 2px rgba(255, 60, 70, 0.9), 0 0 14px rgba(255, 60, 70, 0.5); }
  50%      { box-shadow: inset 0 0 26px rgba(0, 0, 0, 0.9), inset 0 0 0 2px rgba(255, 200, 70, 0.5), 0 0 8px rgba(255, 200, 70, 0.2); }
}

.symbol {
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.symbol-god    { background-image: url("./assets/sym/gold7.png"); }
.symbol-seven  { background-image: url("./assets/sym/red7.png"); }
.symbol-zeus   { background-image: url("./assets/sym/blue7.png"); }
.symbol-crown  { background-image: url("./assets/sym/crest.png"); }
.symbol-gem    { background-image: url("./assets/sym/chance.png"); }
.symbol-cherry { background-image: url("./assets/sym/crest2.png"); }
.symbol-orb    { background-image: url("./assets/sym/blue7.png"); }

/* リール回転中 */
.machine.spinning .reel { animation: reelShake 0.12s linear infinite; }
@keyframes reelShake {
  from { filter: brightness(1); }
  to   { filter: brightness(1.18); }
}

/* ===== 継続決定 勝利ムービー ===== */
.win-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
  opacity: 0;
  visibility: hidden;
  z-index: 32;
  pointer-events: none;
}
.machine.video-play .win-video {
  opacity: 1;
  visibility: visible;
}

/* ===== 獲得時に飛ぶシンボル ===== */
.fly-symbol {
  position: absolute;
  left: 0; top: 0;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0;
  z-index: 22;
  pointer-events: none;
}

/* ===== トースト（メッセージ） ===== */
.toast {
  position: absolute;
  left: 8%;
  top: 71.5%;
  width: 84%;
  text-align: center;
  font-size: clamp(13px, 4.2vw, 28px);
  color: var(--ink);
  text-shadow: 0 0 12px rgba(120, 210, 255, 0.7), 0 2px 5px #000;
  opacity: 0;
  z-index: 8;
  pointer-events: none;
}
.toast.strong {
  color: #fff;
  text-shadow: 0 0 16px rgba(200, 130, 255, 1), 0 0 30px rgba(255, 200, 60, 0.7), 0 2px 5px #000;
}
.toast.show { animation: toastPop 1.5s ease-out; }
@keyframes toastPop {
  0%   { opacity: 0; transform: translateY(8px) scale(0.9); }
  18%  { opacity: 1; transform: translateY(0) scale(1.05); }
  75%  { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.98); }
}

/* ===== 右上：音量 ===== */
.topright {
  position: absolute;
  right: 3.5%;
  top: 1.5%;
  z-index: 9;
}
#soundButton {
  width: clamp(28px, 9vw, 48px);
  height: clamp(28px, 9vw, 48px);
  background: rgba(10, 5, 18, 0.55);
  border: 1px solid rgba(180, 130, 60, 0.5);
  border-radius: 50%;
  color: var(--ink);
  font-size: clamp(13px, 4vw, 22px);
  cursor: pointer;
  z-index: 9;
}

/* ===== START ボタン（背景に焼き込まれた赤ボタンの上に透明オーバーレイ） ===== */
.start {
  position: absolute;
  left: 31%;
  top: 70.4%;
  width: 32%;
  height: 16%;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: transparent;
  font-size: 0;
  cursor: pointer;
  z-index: 7;
  box-shadow: 0 0 0 0 rgba(255, 90, 90, 0);
  animation: startSlow 2.2s ease-in-out infinite;
}
.start:active { transform: scale(0.96); }
@keyframes startSlow {
  0%, 100% { box-shadow: 0 0 12px 2px rgba(255, 80, 80, 0.15); }
  50%      { box-shadow: 0 0 26px 6px rgba(255, 90, 90, 0.4); }
}
/* 回転中 */
.machine.spinning .start { animation: startPulse 0.5s ease-in-out infinite alternate; }
@keyframes startPulse {
  from { box-shadow: 0 0 0 0 rgba(255, 60, 60, 0); }
  to   { box-shadow: 0 0 30px 8px rgba(255, 90, 90, 0.6); }
}
/* LAST：高速点滅 */
.machine.last .start { animation: startFast 0.4s steps(1) infinite; }
@keyframes startFast {
  0%, 100% { box-shadow: 0 0 30px 10px rgba(255, 50, 60, 0.8); }
  50%      { box-shadow: 0 0 6px 1px rgba(255, 50, 60, 0.1); }
}
/* 成功：金色に光る */
.machine.success .start { animation: startGold 1.2s ease-in-out infinite; }
@keyframes startGold {
  0%, 100% { box-shadow: 0 0 20px 4px rgba(255, 210, 90, 0.5); }
  50%      { box-shadow: 0 0 40px 12px rgba(255, 220, 110, 0.9); }
}

/* ===== 開始カットイン（3G以内に 運命の3シンボルを揃えろ！） ===== */
.judge-cut {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5%;
  background: linear-gradient(180deg, rgba(20, 6, 40, 0.86), rgba(60, 10, 90, 0.76), rgba(10, 4, 24, 0.9));
  opacity: 0;
  visibility: hidden;
  z-index: 28;
  pointer-events: none;
  text-align: center;
}
.judge-cut small {
  font-size: clamp(12px, 3.6vw, 26px);
  letter-spacing: 8px;
  padding-left: 8px;
}
.judge-cut strong.cut-main {
  font-size: clamp(30px, 9.6vw, 66px);
  line-height: 1.14;
  padding: 0 5%;
  letter-spacing: 1px;
}
.judge-cut strong.cut-main .em {
  font-weight: 800;
  background: linear-gradient(180deg, #ffe9c0 0%, #ff9a4a 45%, #ff3d55 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: clamp(2px, 0.9vw, 4px) rgba(18, 8, 0, 0.92);
  paint-order: stroke fill;
  filter: drop-shadow(0 0 14px rgba(255, 80, 90, 0.7));
}
.judge-cut .cut-symbols {
  display: flex;
  gap: 5%;
  margin-top: 2%;
}
.judge-cut .cut-symbols span {
  width: clamp(48px, 18vw, 110px);
  height: clamp(48px, 18vw, 110px);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 14px rgba(255, 200, 80, 0.8));
  animation: cutSymFloat 1.4s ease-in-out infinite alternate;
}
.judge-cut .cut-symbols span:nth-child(2) { animation-delay: 0.15s; }
.judge-cut .cut-symbols span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cutSymFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-8%); }
}
.judge-cut .cut-names {
  font-family: var(--f-sub);
  font-weight: 500;
  font-size: clamp(9px, 2.4vw, 15px);
  letter-spacing: 2px;
  color: rgba(245, 225, 170, 0.9);
  text-shadow: 0 1px 2px #000, 0 0 8px rgba(255, 200, 60, 0.4);
}
.judge-cut.show { animation: judgeCut 1.6s ease-out; }
@keyframes judgeCut {
  0%   { opacity: 0; visibility: visible; transform: scale(1.3) skewX(-6deg); }
  14%  { opacity: 1; transform: scale(1) skewX(0deg); }
  82%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; visibility: hidden; transform: scale(0.94); }
}

/* ===== 結果カットイン（継続決定 / 終了 / 逆転継続） ===== */
.result-cut {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3%;
  background: radial-gradient(circle at 50% 45%, rgba(30, 10, 50, 0.5), rgba(2, 1, 6, 0.94));
  opacity: 0;
  visibility: hidden;
  z-index: 30;
  pointer-events: none;
  text-align: center;
}
.result-cut.show {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}
.result-symbols {
  display: flex;
  gap: 4%;
  justify-content: center;
}
.result-symbols span {
  width: clamp(52px, 20vw, 120px);
  height: clamp(52px, 20vw, 120px);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 0 18px rgba(255, 210, 90, 0.9));
}
.result-cut.symbols .result-symbols span { animation: resultSymPop 0.8s ease-out backwards; }
.result-symbols span:nth-child(2) { animation-delay: 0.15s; }
.result-symbols span:nth-child(3) { animation-delay: 0.3s; }
@keyframes resultSymPop {
  0%   { opacity: 0; transform: scale(0.3) rotate(-12deg); }
  60%  { opacity: 1; transform: scale(1.15) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}
.result-symbols .symbol-gem.big {
  width: clamp(90px, 34vw, 200px);
  height: clamp(90px, 34vw, 200px);
  background-image: url("./assets/sym/chance.png");
  filter: drop-shadow(0 0 30px rgba(200, 130, 255, 1));
  animation: reviveSymPop 0.9s ease-out;
}
@keyframes reviveSymPop {
  0%   { opacity: 0; transform: scale(0.2); }
  55%  { opacity: 1; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}
/* 上段リード（運命接続 完了 / 天啓発動 / 神域閉門） */
.result-lead {
  font-family: var(--f-title);
  font-weight: 700;
  font-size: clamp(16px, 5vw, 34px);
  letter-spacing: clamp(3px, 1.4vw, 9px);
  line-height: 1.1;
  padding-left: clamp(3px, 1.4vw, 9px);
}
/* 下段の主役文字（継続決定 / 逆転継続 / 挑戦終了） */
#resultTitle {
  font-family: var(--f-title);
  font-weight: 800;
  font-size: clamp(40px, 14vw, 104px);
  line-height: 1.02;
  letter-spacing: 2px;
}
#resultSub {
  font-family: var(--f-sub);
  font-weight: 500;
  font-size: clamp(11px, 3.4vw, 22px);
  letter-spacing: 4px;
  color: rgba(210, 200, 230, 0.85);
  text-shadow: 0 1px 3px #000;
}
@keyframes goldPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* ── 成功（継続決定）：金＋赤＋紫、背面に翼プレート ── */
.result-cut.win { background: radial-gradient(circle at 50% 46%, rgba(60, 22, 90, 0.55), rgba(2, 1, 6, 0.95)); }
.result-cut.win .result-lead {
  background: linear-gradient(180deg, #ffffff, #ecd9a4);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px rgba(120, 90, 30, 0.8); paint-order: stroke fill;
  filter: drop-shadow(0 0 12px rgba(200, 150, 255, 0.6));
}
.result-cut.win #resultTitle {
  position: relative;
  background: linear-gradient(180deg, #fff7d6 0%, #ffe487 26%, #f8bf3e 52%, #b9781d 78%, #ffe08a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: clamp(2px, 1vw, 5px) rgba(18, 8, 0, 0.92); paint-order: stroke fill;
  filter: drop-shadow(0 2px 3px #000) drop-shadow(0 0 24px rgba(180, 90, 255, 0.7)) drop-shadow(0 0 12px rgba(255, 60, 70, 0.5));
  animation: goldPulse 1.2s ease-in-out infinite;
}
/* 背面の金属＋翼プレート */
.result-cut.win #resultTitle::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 168%; height: 240%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(ellipse 60% 42% at 50% 50%, rgba(255, 210, 120, 0.32), transparent 70%),
    conic-gradient(from 90deg at 50% 50%, transparent 0deg, rgba(255, 200, 90, 0.14) 30deg, transparent 60deg, transparent 300deg, rgba(255, 200, 90, 0.14) 330deg, transparent 360deg);
  z-index: -1;
  pointer-events: none;
  filter: blur(2px);
}

/* ── 復活（逆転継続）：紫＋白金＋金、下段は赤い内側発光 ── */
.result-cut.revive { background: radial-gradient(circle at 50% 46%, rgba(120, 60, 200, 0.45), rgba(2, 1, 6, 0.95)); }
.result-cut.revive .result-lead {
  background: linear-gradient(180deg, #ffffff, #e4d3ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1.5px rgba(60, 20, 90, 0.85); paint-order: stroke fill;
  filter: drop-shadow(0 0 16px rgba(180, 90, 255, 0.9));
  animation: revLeadIn 0.5s ease-out backwards;
}
.result-cut.revive #resultTitle {
  background: linear-gradient(180deg, #fff2c4 0%, #ffcf5e 45%, #ff7a3c 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: clamp(2px, 1vw, 5px) rgba(30, 4, 0, 0.92); paint-order: stroke fill;
  filter: drop-shadow(0 2px 3px #000) drop-shadow(0 0 22px rgba(255, 70, 60, 0.7)) drop-shadow(0 0 14px rgba(180, 90, 255, 0.6));
  animation: revTitleIn 0.6s ease-out 0.2s backwards;
}
@keyframes revLeadIn { 0% { opacity: 0; transform: translateY(-10px) scale(0.9); } 100% { opacity: 1; transform: none; } }
@keyframes revTitleIn { 0% { opacity: 0; transform: scale(1.4); } 60% { opacity: 1; transform: scale(0.96); } 100% { opacity: 1; transform: scale(1); } }

/* ── 失敗（神域閉門）：灰金＋暗紫＋黒、徐々に沈む ── */
.result-cut.fail { background: radial-gradient(circle at 50% 46%, rgba(30, 14, 44, 0.6), rgba(1, 1, 3, 0.97)); }
.result-cut.fail .result-lead {
  background: linear-gradient(180deg, #d7d0bd, #8a8168);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1.5px rgba(8, 6, 12, 0.9); paint-order: stroke fill;
  filter: drop-shadow(0 0 10px rgba(120, 80, 160, 0.5));
}
.result-cut.fail #resultTitle {
  background: linear-gradient(180deg, #e7e2d0 0%, #b3aa90 45%, #756e59 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: clamp(2px, 0.9vw, 4px) rgba(6, 4, 10, 0.92); paint-order: stroke fill;
  filter: drop-shadow(0 2px 4px #000) drop-shadow(0 0 12px rgba(120, 80, 160, 0.45));
  animation: failFade 2.2s ease-out both;
}
.result-cut.fail #resultSub { color: rgba(170, 160, 185, 0.7); }
@keyframes failFade {
  0%   { opacity: 0; transform: translateY(8px); filter: brightness(1.3) drop-shadow(0 0 18px rgba(150, 100, 200, 0.6)); }
  30%  { opacity: 1; }
  100% { opacity: 0.82; transform: none; filter: brightness(0.8) drop-shadow(0 0 6px rgba(80, 50, 110, 0.3)); }
}

/* 使わない要素は非表示（背景画像を活かす） */
#pauseButton, #coinBalance { display: none; }

/* ===== ゲート（読み込み/開始/エラー） ===== */
.gate-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 4, 12, 0.82);
  backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}
.gate-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}
.gate-inner {
  width: min(88%, 420px);
  padding: 26px 22px;
  text-align: center;
  border-radius: 16px;
  background: rgba(18, 12, 28, 0.72);
  border: 1px solid rgba(212, 175, 90, 0.35);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.gate-msg {
  font-family: "Shippori Mincho B1", serif;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.6;
  color: #f4ecd6;
  letter-spacing: 0.02em;
}
.gate-start {
  margin-top: 20px;
  display: inline-block;
  padding: 14px 30px;
  font-family: "Orbitron", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: 0.06em;
  color: #1a1206;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, #ffe9a8, #d4af5a 70%, #b8923f);
  box-shadow: 0 6px 18px rgba(180, 140, 60, 0.5);
}
.gate-start:disabled {
  filter: grayscale(0.4) brightness(0.85);
  cursor: default;
}
.gate-return {
  margin-top: 14px;
  display: inline-block;
  font-size: 13px;
  color: #cbb98f;
  text-decoration: underline;
  opacity: 0.9;
}
