:root {
  --space-1: #0a0b2e;
  --space-2: #171350;
  --nebula:  #3a1f86;
  --chrome-hi: #f4f6fc;
  --chrome:    #c2c9dc;
  --chrome-mid:#8b93ad;
  --chrome-lo: #454b68;
  --chrome-edge:#20263f;
  --screen-1: #2b2578;
  --screen-2: #131038;
  --btn-1: #8879ff;
  --btn-2: #4a34d8;
  --btn-3: #2c1aa6;
  --btn-edge: #150a5c;
  --gold: #ffd23f;
  --amber: #ff9a1e;
  --red: #e21430;
  --lcd-bg: #070a24;
  --lcd-txt: #8fb6ff;
  --pill-1: #7e9bff;
  --pill-2: #3149c8;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; min-height: 100%;
  color: #eaf0ff;
  font-family: "Arial Black", "Helvetica Neue", Arial, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 700px at 50% -10%, #4a2a9a 0%, transparent 55%),
    radial-gradient(900px 600px at 15% 30%, #2a1470 0%, transparent 60%),
    radial-gradient(900px 700px at 85% 70%, #451f8a 0%, transparent 60%),
    linear-gradient(180deg, #12103e 0%, #070622 100%);
  background-attachment: fixed;
}
/* 星 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #fff 50%, transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, #fff 50%, transparent),
    radial-gradient(1px 1px at 40% 60%, #cfe 50%, transparent),
    radial-gradient(1.5px 1.5px at 85% 45%, #fff 50%, transparent),
    radial-gradient(1px 1px at 55% 80%, #fff 50%, transparent),
    radial-gradient(1px 1px at 10% 75%, #cfe 50%, transparent),
    radial-gradient(1.5px 1.5px at 90% 85%, #fff 50%, transparent),
    radial-gradient(1px 1px at 30% 15%, #fff 50%, transparent);
  opacity: .8;
}

body {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 14px 26px; position: relative; z-index: 1;
}

/* ---------------- 筐体 ---------------- */
#cabinet {
  width: min(1080px, 100%);
  border-radius: 26px;
  padding: 14px;
  background:
    linear-gradient(150deg, var(--chrome-hi) 0%, var(--chrome) 16%, var(--chrome-mid) 34%,
      var(--chrome-lo) 50%, var(--chrome-mid) 66%, var(--chrome) 84%, var(--chrome-hi) 100%);
  box-shadow:
    0 30px 80px rgba(0,0,0,0.65),
    inset 0 2px 2px rgba(255,255,255,0.7),
    inset 0 -3px 6px rgba(0,0,0,0.45),
    0 0 0 2px rgba(255,255,255,0.2);
  display: flex; flex-direction: column; gap: 12px;
  position: relative;
}

/* ---------------- 上部デッキ（COINS/マーキー/WIN） ---------------- */
#topdeck {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 0;
  position: relative;
  min-height: 96px;
}

.lcd {
  background: linear-gradient(180deg, var(--lcd-bg), #0c123a);
  border-radius: 12px;
  padding: 8px 18px;
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.8), inset 0 0 0 2px rgba(120,150,255,0.15), 0 2px 0 rgba(255,255,255,0.35);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 2px solid #2a3a7a;
}
.coins-lcd { justify-self: start; margin-top: 34px; min-width: 200px; }
.win-lcd { justify-self: end; margin-top: 34px; min-width: 200px; }
.lcd-label { color: #b9c6ff; font-size: 15px; letter-spacing: 4px; text-shadow: 0 1px 0 #000; }
.lcd-value {
  color: var(--lcd-txt); font-size: 30px; letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px rgba(120,180,255,0.9), 0 2px 2px #000;
}

/* マーキー */
.marquee {
  position: relative; justify-self: center;
  padding: 6px 26px 10px; margin-top: -6px;
  display: flex; flex-direction: column; align-items: center;
}
.marquee-reels {
  position: absolute; inset: 2px 40px auto 40px; top: 2px; height: 74px;
  display: flex; gap: 4px; z-index: 0; opacity: .9;
}
.marquee-reels span {
  flex: 1; border-radius: 8px;
  background: linear-gradient(180deg, #eaf3ff 0%, #7fb4ff 30%, #2f6fd0 60%, #7fb4ff 100%);
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.7), inset 0 -3px 6px rgba(0,0,0,0.4);
  border: 1px solid #c03a1a;
}
.marquee-title {
  position: relative; z-index: 2;
  font-size: 46px; font-weight: 900; letter-spacing: 3px; line-height: 1;
  color: var(--gold);
  background: linear-gradient(180deg, #fff3b0 0%, #ffd23f 45%, #ff9a1e 75%, #e07a10 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 2px #b3121f;
  filter: drop-shadow(0 0 10px rgba(255,180,40,0.85)) drop-shadow(0 3px 2px rgba(0,0,0,0.5));
  padding: 0 6px;
}
.marquee-sub {
  position: relative; z-index: 2; margin-top: 2px;
  font-size: 14px; font-weight: 900; letter-spacing: 10px; color: #fff;
  text-shadow: 0 0 8px rgba(120,180,255,0.9), 0 1px 0 #234;
}
/* 赤球レバー */
.lever { position: absolute; right: -30px; top: -14px; width: 40px; height: 96px; cursor: pointer; z-index: 3; }
.lever-stick { position: absolute; left: 50%; bottom: 0; width: 9px; height: 74px; transform: translateX(-50%);
  border-radius: 6px; transform-origin: 50% 100%; transition: transform .16s ease;
  background: linear-gradient(90deg, #6a7290, #eef2fb 40%, #8b93ad 60%, #454b68); }
.lever-ball { position: absolute; left: 50%; top: 0; width: 30px; height: 30px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 34% 30%, #ff8a9e, #e21430 55%, #900a1a);
  box-shadow: 0 3px 8px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.6); transition: transform .16s ease; }
.lever.pull .lever-stick { transform: translateX(-50%) rotate(26deg); }
.lever.pull .lever-ball { transform: translate(-50%, 12px) rotate(26deg); }

.sound-btn {
  position: absolute; right: 8px; top: 4px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.4); background: rgba(10,14,40,0.7); color: #fff; font-size: 15px;
  display: grid; place-items: center;
}
.sound-btn.muted { opacity: .5; }

/* ---------------- スクリーン ---------------- */
#screen {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: stretch;
  background: linear-gradient(180deg, var(--screen-1), var(--screen-2));
  border-radius: 16px; padding: 12px;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.7), inset 0 0 0 3px rgba(120,150,255,0.18), 0 3px 0 rgba(255,255,255,0.35);
  border: 3px solid #1a1e50;
}

.line-col { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 4px 0; }
.line-badge {
  width: 34px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #dbe6ff;
  font-family: Arial, system-ui, sans-serif;
  background: linear-gradient(180deg, #3a4a90 0%, #232c60 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), inset 0 -2px 3px rgba(0,0,0,0.4);
  border: 1px solid #1a2050; opacity: .5; transition: all .15s ease;
}
.line-badge.active { opacity: 1;
  background: linear-gradient(180deg, var(--pill-1) 0%, var(--pill-2) 100%);
  color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.5); }
.line-badge.win {
  background: linear-gradient(180deg, #fff2a0, #ffb01e);
  color: #7a3b00; border-color: #ffe487;
  box-shadow: 0 0 12px rgba(255,190,40,0.9), inset 0 1px 1px rgba(255,255,255,0.6);
  animation: badgePulse .5s ease-in-out infinite;
}
@keyframes badgePulse { 50% { filter: brightness(1.25); } }

.reel-area { position: relative; }
#reelCanvas { display: block; width: 100%; height: auto; border-radius: 10px;
  box-shadow: 0 0 0 3px #10143a, inset 0 0 30px rgba(0,0,0,0.5); }

.freespin-tag {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  padding: 5px 16px; border-radius: 999px; font-size: 14px; font-weight: 900; letter-spacing: 2px;
  color: #2a1600; background: linear-gradient(180deg, #ffe487, #ffb01e);
  box-shadow: 0 0 16px rgba(255,190,40,0.8); opacity: 0; transition: opacity .3s; pointer-events: none;
  font-family: Arial, system-ui, sans-serif;
}
.freespin-tag.show { opacity: 1; }

.message {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0);
  font-size: clamp(28px, 6vw, 56px); font-weight: 900; letter-spacing: 2px; white-space: nowrap;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(255,190,40,0.9), 0 3px 0 #b3121f, 0 4px 8px rgba(0,0,0,0.6);
  pointer-events: none; z-index: 4; -webkit-text-stroke: 1.5px #b3121f;
  transition: transform .35s cubic-bezier(.2,1.5,.4,1);
}
.message.show { transform: translate(-50%, -50%) scale(1); animation: msgShake .12s infinite; }
@keyframes msgShake { 25%{transform:translate(-51%,-50%) scale(1)} 75%{transform:translate(-49%,-50%) scale(1)} }

/* ---------------- 操作デッキ ---------------- */
#controldeck {
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, #2a2f45 0%, #12152a 100%);
  border-radius: 16px; padding: 12px 16px;
  box-shadow: inset 0 2px 4px rgba(255,255,255,0.12), inset 0 -4px 8px rgba(0,0,0,0.5), 0 3px 0 rgba(255,255,255,0.3);
  border: 2px solid #0c0f22;
}
.bet-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ctrl-group { display: flex; flex-direction: row; align-items: center; gap: 6px; }
.ctrl-label { font-size: 20px; font-weight: 900; font-style: italic; letter-spacing: 2px;
  color: #cfd6ee; text-shadow: 0 1px 0 #000, 0 2px 3px rgba(0,0,0,0.5); }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper-val { min-width: 44px; text-align: center; font-size: 24px; font-weight: 900;
  font-variant-numeric: tabular-nums; color: var(--lcd-txt);
  background: var(--lcd-bg); border-radius: 8px; padding: 4px 6px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.8); border: 1px solid #2a3a7a; font-family: Arial, sans-serif; }

/* 紫の光沢ボタン */
.rbtn, .pbtn {
  cursor: pointer; border: none; color: #fff; font-weight: 900; font-family: Arial, system-ui, sans-serif;
  background: linear-gradient(180deg, var(--btn-1) 0%, var(--btn-2) 48%, var(--btn-3) 100%);
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.55), inset 0 -3px 6px rgba(0,0,0,0.45),
    0 4px 0 var(--btn-edge), 0 6px 10px rgba(0,0,0,0.5);
  transition: transform .06s ease, filter .15s ease;
}
.rbtn:active:not(:disabled), .pbtn:active:not(:disabled) { transform: translateY(3px); box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), 0 1px 0 var(--btn-edge); }
.rbtn:hover:not(:disabled), .pbtn:hover:not(:disabled) { filter: brightness(1.1); }
.rbtn:disabled, .pbtn:disabled { opacity: .45; cursor: not-allowed; }

.rbtn { width: 46px; height: 46px; border-radius: 12px; font-size: 26px; line-height: 1; }

.totalbet { display: flex; flex-direction: row; align-items: baseline; gap: 5px; margin: 0; }
.totalbet span { font-size: 11px; letter-spacing: 2px; color: #9fb0e0; font-family: Arial, sans-serif; }
.totalbet b { font-size: 20px; color: var(--gold); font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255,190,40,0.7); font-family: Arial, sans-serif; }

.main-btns { display: flex; align-items: stretch; justify-content: center; gap: 10px; }
.main-btns .pbtn { flex: 1 1 0; }
.pbtn { border-radius: 14px; padding: 0 22px; height: 58px; font-size: 22px; letter-spacing: 1px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pbtn small { font-size: 12px; letter-spacing: 1px; opacity: .9; }
.pbtn.spin { font-size: 26px; padding: 0 34px;
  background: linear-gradient(180deg, #9d8bff 0%, #5a3fe0 48%, #3a1ec0 100%); }
.pbtn.spin::after { content: ""; }
.pbtn.auto.active { background: linear-gradient(180deg, #ff9a5a, #e04a1a); box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), 0 4px 0 #7a2408, 0 6px 10px rgba(0,0,0,0.5); }

.free-mode #screen { box-shadow: inset 0 0 50px rgba(120,60,255,0.5), inset 0 0 0 3px rgba(180,140,255,0.4), 0 3px 0 rgba(255,255,255,0.35); }
.free-mode #cabinet { box-shadow: 0 30px 80px rgba(0,0,0,0.65), inset 0 2px 2px rgba(255,255,255,0.7), 0 0 40px rgba(150,90,255,0.5), 0 0 0 2px rgba(200,160,255,0.4); }

.disclaimer { text-align: center; color: #6a72a0; font-size: 10px; margin: 2px 0 0;
  font-family: Arial, system-ui, sans-serif; letter-spacing: .5px; }
#hint { color: #7f88c0; font-size: 12px; letter-spacing: .5px; text-align: center;
  font-family: Arial, system-ui, sans-serif; }

/* =========================================================================
 * 華麗アップグレード（royal 紫金・金雕・宝石・電飾）— ここまでの基本を上書き
 * ========================================================================= */
:root {
  --gold-1: #fff3c0; --gold-2: #ffd23f; --gold-3: #e0a010; --gold-4: #7a4e08;
  --royal-1: #3a1a8c; --royal-2: #1a0e52;
}

/* 背景の特効キャンバス */
#fxCanvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
body { background:
    radial-gradient(1200px 800px at 50% -12%, #5a2ec0 0%, transparent 55%),
    radial-gradient(900px 600px at 12% 26%, #2a1478 0%, transparent 60%),
    radial-gradient(1000px 800px at 88% 72%, #4a1f9a 0%, transparent 60%),
    linear-gradient(180deg, #170f4a 0%, #05041c 100%); }
body::before { opacity: .5; }        /* 星は fx.js が主役 */
#cabinet, #hint { position: relative; z-index: 2; }

/* ---- 金雕クローム筐体 ---- */
#cabinet {
  background:
    linear-gradient(150deg, var(--chrome-hi) 0%, var(--chrome) 14%, var(--chrome-mid) 32%,
      var(--chrome-lo) 50%, var(--chrome-mid) 68%, var(--chrome) 86%, var(--chrome-hi) 100%);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.7),
    inset 0 2px 2px rgba(255,255,255,0.75), inset 0 -3px 6px rgba(0,0,0,0.5),
    0 0 0 3px var(--gold-3), 0 0 0 7px #5a3c06, 0 0 0 9px rgba(255,210,90,0.25),
    0 0 46px rgba(255,190,50,0.32);
  overflow: hidden;
}
/* 金の帯（上下）＋隅の宝石 */
#cabinet::before {
  content: ""; position: absolute; inset: 12px; border-radius: 18px; pointer-events: none; z-index: 0;
  box-shadow: inset 0 0 0 2px rgba(255,225,140,0.5);
  background:
    radial-gradient(circle at 14px 14px, #fff6cf 2px, #ffd23f 4px, transparent 6px),
    radial-gradient(circle at calc(100% - 14px) 14px, #fff6cf 2px, #ffd23f 4px, transparent 6px),
    radial-gradient(circle at 14px calc(100% - 14px), #fff6cf 2px, #ffd23f 4px, transparent 6px),
    radial-gradient(circle at calc(100% - 14px) calc(100% - 14px), #fff6cf 2px, #ffd23f 4px, transparent 6px);
}
/* クロームのきらめき（斜めに走る光） */
#cabinet::after {
  content: ""; position: absolute; top: 0; left: -30%; width: 30%; height: 100%; z-index: 1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  animation: shimmer 6s ease-in-out infinite;
}
@keyframes shimmer { 0%,100% { left: -30%; } 55%,100% { left: 130%; } }
#topdeck, #screen, #controldeck, .disclaimer { position: relative; z-index: 2; }

/* ---- LCD を金縁に ---- */
.lcd { border: 2px solid var(--gold-3);
  box-shadow: inset 0 3px 10px rgba(0,0,0,0.85), inset 0 0 0 2px rgba(255,210,90,0.25),
    0 0 0 1px #5a3c06, 0 2px 0 rgba(255,255,255,0.3), 0 0 16px rgba(255,190,50,0.25); }
.lcd-value { text-shadow: 0 0 14px rgba(140,190,255,0.95), 0 2px 2px #000; }

/* ---- マーキー（王冠・宝石・強い後光） ---- */
.marquee-crown { position: relative; z-index: 2; font-size: 20px; color: var(--gold-2);
  text-shadow: 0 0 12px rgba(255,200,60,0.9); margin-bottom: -4px; animation: gemPulse 2.2s ease-in-out infinite; }
@keyframes gemPulse { 50% { transform: scale(1.16); filter: brightness(1.3); } }
.marquee { padding: 12px 36px 14px; }

/* ③ 金属看板の底板（クローム＋金トリム・立体） */
.sign {
  position: relative; z-index: 2; display: flex; gap: 9px;
  padding: 9px 13px; border-radius: 14px;
  background: linear-gradient(160deg, #eef1fb 0%, #bcc4d8 22%, #4a5068 50%, #bcc4d8 78%, #eef1fb 100%);
  box-shadow:
    inset 0 2px 2px rgba(255,255,255,0.8), inset 0 -4px 8px rgba(0,0,0,0.5),
    0 0 0 2px var(--gold-3), 0 0 0 4px #5a3c06, 0 6px 14px rgba(0,0,0,0.55), 0 0 24px rgba(255,190,50,0.4);
}

/* 各文字の長方框（参考図の青いリールドラム風） */
.sign-box {
  position: relative; width: 52px; height: 70px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #eaf5ff 0%, #8fc0ff 26%, #3a78d8 60%, #1e4aa8 100%);
  border: 1.5px solid #b33a18;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.85), inset 0 -7px 10px rgba(0,0,0,0.42),
    inset 0 0 0 2px rgba(255,255,255,0.22), 0 2px 4px rgba(0,0,0,0.4);
}
.sign-box::before {   /* ドラム上部の光沢 */
  content: ""; position: absolute; left: 4px; right: 4px; top: 4px; height: 34%;
  border-radius: 7px 7px 12px 12px; background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(255,255,255,0)); pointer-events: none;
}
.sign-box b {
  position: relative; font: 900 54px/1 "Arial Black", system-ui, sans-serif;
  color: transparent; -webkit-text-fill-color: transparent;
  background: linear-gradient(180deg, #fff3b0 0%, #ffd23f 45%, #ff9a1e 78%, #e07a10 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 2.5px #b3121f;
  filter: drop-shadow(0 0 9px rgba(255,190,50,0.95)) drop-shadow(0 2px 1px rgba(0,0,0,0.55));
}
/* ② 文字面に敷き詰めた発光電球ドット（密＆明るく） */
.sign-box b::after {
  content: attr(data-l); position: absolute; inset: 0;
  -webkit-text-stroke: 0; color: transparent; -webkit-text-fill-color: transparent;
  background: radial-gradient(circle at 50% 45%, #fff 0 1.5px, rgba(255,246,205,0.55) 1.9px, transparent 2.4px) 0 0 / 5.4px 5.4px;
  -webkit-background-clip: text; background-clip: text;
  mix-blend-mode: screen; opacity: 1;
  animation: bulbTwinkle 1.1s steps(2, jump-none) infinite; pointer-events: none;
}
@keyframes bulbTwinkle { 50% { opacity: .58; background-position: 2.7px 2.7px; } }

/* SLOT 看板を囲む電飾 */
.bulb-frame.bulb-sign { inset: -5px -6px; }
.bulb-frame.bulb-sign .bulb { width: 6px; height: 6px; animation-duration: 1s; }

/* ---- 頂欄：アバター｜SLOT｜性別トグル（縦） → CREDIT/WIN ---- */
#topdeck { display: flex; flex-direction: column; align-items: stretch; gap: 8px; min-height: 0; padding: 8px 10px 0; }
.top-main { display: flex; align-items: center; gap: 10px; }
.player { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 0 0 auto; z-index: 3; }
.marquee { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; }
.top-right { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; z-index: 3; }
/* 性別トグルを縦並びに */
.gender-toggle { flex-direction: column; align-items: stretch; gap: 3px; padding: 3px; border-radius: 14px; }
.age-badge { margin-right: 0; text-align: center; }
.g-pill { text-align: center; }
.sound-btn { position: static; }
.lcd-row { display: flex; gap: 8px; }
.lcd-row .lcd { flex: 1 1 0; min-width: 0; margin-top: 0; }
.coins-lcd { align-items: flex-start; }
.win-lcd { align-items: flex-end; }
.avatar {
  width: 80px; height: 80px; border-radius: 16px; overflow: hidden;
  background: radial-gradient(circle at 50% 12%, #3d2c62, #110826);
  border: 3px solid var(--gold-2);
  box-shadow: 0 0 0 1px #7a4e08, 0 0 20px rgba(255,196,56,0.8),
    inset 0 0 18px rgba(0,0,0,0.55), 0 3px 7px rgba(0,0,0,0.5);
  animation: avatarGlow 2.2s ease-in-out infinite;
}
@keyframes avatarGlow {
  50% { box-shadow: 0 0 0 1px #7a4e08, 0 0 34px rgba(255,212,92,1),
    inset 0 0 18px rgba(0,0,0,0.55), 0 3px 7px rgba(0,0,0,0.5); }
}
.avatar svg { width: 100%; height: auto; display: block; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.nod { animation: avNod .5s ease; }
.avatar.cheer { animation: avCheer .5s ease; }
.avatar.cheer-big { animation: avCheer .5s ease infinite; }
@keyframes avNod { 40% { transform: translateY(3px); } }
@keyframes avCheer { 0%,100% { transform: translateY(0) scale(1); } 45% { transform: translateY(-6px) scale(1.07); } }

.gender-row .chara-name { white-space: nowrap; }
.gender-toggle { display: flex; align-items: center; padding: 3px; border-radius: 999px;
  background: #17111f; border: 1px solid rgba(255,210,90,0.3); box-shadow: inset 0 1px 3px rgba(0,0,0,0.6); }
.age-badge { font: 900 12px/1 Arial, sans-serif; color: #2a1600; letter-spacing: .5px;
  padding: 5px 8px; margin-right: 5px; border-radius: 999px;
  background: linear-gradient(180deg, #ffe487, #ff9a1e); box-shadow: 0 0 8px rgba(255,180,40,0.6); }
.g-pill { border: none; cursor: pointer; background: transparent; color: #c7b8e6; white-space: nowrap;
  font: 800 13px/1 Arial, system-ui, sans-serif; padding: 6px 12px; border-radius: 999px; letter-spacing: 1px; transition: all .18s; }
.g-pill:hover { color: #fff; }
.g-pill[data-g="male"].active { background: linear-gradient(180deg, #ffb15a, #e8641a); color: #fff; box-shadow: 0 0 10px rgba(255,140,40,0.6); }
.g-pill[data-g="female"].active { background: linear-gradient(180deg, #ff8ad0, #e0338f); color: #fff; box-shadow: 0 0 10px rgba(255,80,170,0.6); }
.chara-name { font: 800 12px/1 Arial, system-ui, sans-serif; letter-spacing: 1px; color: var(--gold-2);
  text-shadow: 0 0 8px rgba(255,190,50,0.6); padding-left: 4px; }

/* ---- スクリーンを深い royal に＋金縁 ---- */
#screen { background: linear-gradient(180deg, #33208a 0%, #150e46 100%);
  border: 3px solid var(--gold-3);
  box-shadow: inset 0 0 46px rgba(0,0,0,0.72), inset 0 0 0 2px rgba(255,210,90,0.35),
    0 0 0 1px #5a3c06, 0 3px 0 rgba(255,255,255,0.3), 0 0 26px rgba(120,60,220,0.4); }

/* ---- リール窓：金雕フレーム＋隅の宝石＋電飾 ---- */
.reel-area { padding: 8px; border-radius: 14px;
  background: linear-gradient(150deg, var(--gold-1), var(--gold-2) 25%, var(--gold-4) 55%, var(--gold-2) 82%, var(--gold-1));
  box-shadow: 0 0 0 2px #5a3c06, inset 0 0 0 2px rgba(255,255,255,0.55), 0 0 22px rgba(255,190,50,0.45); }
.reel-area::after {
  content: ""; position: absolute; inset: 2px; border-radius: 12px; pointer-events: none; z-index: 3;
  background:
    radial-gradient(circle at 9px 9px, #b6f 0, #7a2ad0 3px, transparent 6px),
    radial-gradient(circle at calc(100% - 9px) 9px, #6ef 0, #2f7fd0 3px, transparent 6px),
    radial-gradient(circle at 9px calc(100% - 9px), #6ef 0, #2f7fd0 3px, transparent 6px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), #b6f 0, #7a2ad0 3px, transparent 6px);
}
#reelCanvas { border-radius: 8px; box-shadow: 0 0 0 2px #2a1a04, inset 0 0 30px rgba(0,0,0,0.5); }

/* 電飾（チェイスライト） */
.bulb-frame { position: absolute; inset: -3px; pointer-events: none; z-index: 6; }
.bulb { position: absolute; width: 8px; height: 8px; border-radius: 50%; transform: translate(-50%, -50%);
  background: radial-gradient(circle at 40% 35%, #fff, #ffd23f 45%, #c8860a);
  animation: bulbChase 1.15s linear infinite; }
@keyframes bulbChase {
  0%, 100% { opacity: .3; box-shadow: 0 0 3px rgba(255,200,60,0.4); }
  50% { opacity: 1; box-shadow: 0 0 10px 3px rgba(255,215,90,0.95); }
}

/* ---- 宝石ライン番号 ---- */
.line-badge { border: 1px solid #10164a;
  background: linear-gradient(180deg, #4a5cc0 0%, #232c76 48%, #141a56 100%);
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.45), inset 0 -2px 3px rgba(0,0,0,0.5); }
.line-badge.active { background: linear-gradient(180deg, #9fc0ff 0%, #4a63e0 45%, #2233b0 100%);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.7), 0 0 8px rgba(90,120,255,0.6); }
.line-badge.win { background: linear-gradient(180deg, #fff2a0, #ff9a1e); color: #7a3b00; border-color: #fff0b0;
  box-shadow: 0 0 14px rgba(255,190,40,0.95), inset 0 1px 2px rgba(255,255,255,0.7); }

/* ---- 金縁プレミアムボタン ---- */
.rbtn, .pbtn { box-shadow:
    inset 0 2px 2px rgba(255,255,255,0.55), inset 0 -3px 6px rgba(0,0,0,0.45),
    0 0 0 2px var(--gold-3), 0 4px 0 var(--btn-edge), 0 6px 12px rgba(0,0,0,0.55); }
.rbtn:active:not(:disabled), .pbtn:active:not(:disabled) {
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.5), 0 0 0 2px var(--gold-3), 0 1px 0 var(--btn-edge); }
.stepper-val { border: 2px solid var(--gold-3); box-shadow: inset 0 2px 6px rgba(0,0,0,0.85), 0 0 8px rgba(255,190,50,0.3); }
.totalbet b { text-shadow: 0 0 12px rgba(255,200,60,0.9); }

/* 発光する SPIN（角丸・行内で伸縮） */
.pbtn.spin { border-radius: 16px; height: 56px; padding: 0 14px; position: relative; flex: 1.25 1 0;
  background: radial-gradient(circle at 40% 25%, #b6a4ff, #6a3fe8 48%, #3a1ec0 100%);
  box-shadow: inset 0 3px 3px rgba(255,255,255,0.6), inset 0 -4px 8px rgba(0,0,0,0.5),
    0 0 0 3px var(--gold-2), 0 0 0 5px #7a4e08, 0 4px 0 #150a5c, 0 0 22px rgba(150,90,255,0.7);
  animation: spinGlow 1.8s ease-in-out infinite; }
@keyframes spinGlow { 50% { box-shadow: inset 0 3px 3px rgba(255,255,255,0.6), inset 0 -4px 8px rgba(0,0,0,0.5),
  0 0 0 3px var(--gold-1), 0 0 0 5px #7a4e08, 0 4px 0 #150a5c, 0 0 34px rgba(180,120,255,0.95); } }
.pbtn.spin:active:not(:disabled) { transform: translateY(3px); }

/* ---- BIG WIN に回る光芒 ---- */
.message.show::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 460px; height: 460px;
  transform: translate(-50%, -50%); z-index: -1; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255,210,90,0.28) 0 10deg, transparent 10deg 20deg);
  animation: rayspin 8s linear infinite; -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%);
          mask: radial-gradient(circle, #000 30%, transparent 70%);
}
@keyframes rayspin { to { transform: translate(-50%, -50%) rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  #cabinet::after, .bulb, .pbtn.spin, .marquee-crown, .message.show::before { animation: none !important; }
}

/* ---------------- レスポンシブ ---------------- */
@media (max-width: 720px) {
  body { padding: 10px 6px; }
  #cabinet { border-radius: 18px; padding: 10px; gap: 8px; }

  /* 上部：頂欄（アバター｜SLOT｜縦トグル）→ CREDIT/WIN */
  #topdeck { padding: 6px 6px 0; gap: 7px; }
  .top-main { gap: 6px; }
  .avatar { width: 62px; height: 62px; border-radius: 13px; border-width: 3px; }
  .chara-name { font-size: 10px; }
  .gender-toggle { padding: 2px; border-radius: 11px; }
  .age-badge { font-size: 9px; padding: 3px 6px; }
  .g-pill { font-size: 11px; padding: 4px 8px; letter-spacing: 0; }
  .top-right { gap: 5px; }
  .sound-btn { width: 30px; height: 30px; font-size: 14px; }
  .coins-lcd, .win-lcd { min-width: 0; padding: 5px 10px; }
  .lcd-label { font-size: 11px; letter-spacing: 2px; }
  .lcd-value { font-size: 22px; }
  .marquee { padding: 4px 6px 6px; }
  .sign { gap: 3px; padding: 4px 5px; border-radius: 9px; }
  .sign-box { width: 28px; height: 38px; border-radius: 6px; }
  .sign-box b { font-size: 28px; -webkit-text-stroke: 1.4px #b3121f; }

  /* リール窓を縦いっぱいに（ライン番号の高さに合わせて上下を埋める） */
  .line-col { justify-content: space-around; }
  .lever { display: none; }   /* モバイルはレバー非表示（SPINボタンで操作） */

  .line-badge { width: 24px; height: 20px; font-size: 10px; border-radius: 5px; }
  #screen { padding: 7px; gap: 4px; }

  /* 操作：BET・TOTAL BET・LINES を1行に、下段に MAX/SPIN/AUTO */
  #controldeck { gap: 9px; padding: 9px 7px; }
  .bet-line { gap: 3px; }
  .ctrl-group { gap: 3px; }
  .ctrl-label { font-size: 12px; letter-spacing: 0; }
  .rbtn { width: 30px; height: 30px; font-size: 17px; border-radius: 7px; }
  .stepper-val { min-width: 22px; font-size: 15px; padding: 3px 3px; }
  .totalbet { flex-direction: column; align-items: center; gap: 0; }
  .totalbet span { font-size: 8px; letter-spacing: 0; }
  .totalbet b { font-size: 15px; }
  .main-btns { gap: 8px; }
  .pbtn { height: 46px; padding: 0 8px; font-size: 15px; border-radius: 10px; }
  .pbtn.spin { font-size: 17px; padding: 0 10px; height: 46px; border-radius: 12px; }
  #hint { display: none; }
}
