/* ============================================================
   theme.css — ネオンビジュアル担当（色・光・質感・アニメのみ）
   レイアウト/サイズは base.css が担当。ここでは触らない。
   配色: シアン #00f0ff / マゼンタ #ff2d95 / パープル #7a2bff /
         ゴールド #ffd23f を基調。CSSのみ・完全自己完結。
   ============================================================ */

:root {
  --cyan:    #00f0ff;
  --magenta: #ff2d95;
  --purple:  #7a2bff;
  --gold:    #ffd23f;
  --ink:     #05010f; /* 最暗部 */
  --glass:   rgba(14, 8, 30, 0.55); /* セルのガラス色 */
}

/* ---- 1. 暗いネオン背景 ------------------------------------ */
/* deep purple → black の放射＋線形グラデを重ね、ゆっくり呼吸するグロー */
body {
  color: #eaf6ff;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(122, 43, 255, 0.35) 0%, transparent 55%),
    radial-gradient(90% 70% at 12% 108%, rgba(255, 45, 149, 0.22) 0%, transparent 55%),
    radial-gradient(90% 70% at 88% 108%, rgba(0, 240, 255, 0.20) 0%, transparent 55%),
    linear-gradient(160deg, #150a2e 0%, #0a0518 45%, var(--ink) 100%);
  background-attachment: fixed;
}
/* 背景の上に、ゆっくり色循環する巨大グローを重ねる（#app::before を利用） */
#app::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(40% 40% at 30% 30%, rgba(0, 240, 255, 0.18), transparent 60%),
    radial-gradient(40% 40% at 70% 70%, rgba(255, 45, 149, 0.18), transparent 60%);
  filter: blur(30px);
  animation: bgDrift 22s ease-in-out infinite alternate;
}
@keyframes bgDrift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.05); opacity: 0.8; }
  100% { transform: translate3d( 4%,  3%, 0) scale(1.15); opacity: 1;   }
}

/* ---- 2. ロゴ: ネオン管風グロー ---------------------------- */
.logo {
  font-weight: 900;
  letter-spacing: 3px;
  font-size: clamp(22px, 6vw, 40px);
  color: #eafcff;
  text-shadow:
    0 0 4px  #fff,
    0 0 12px var(--cyan),
    0 0 26px var(--cyan),
    0 0 46px rgba(0, 240, 255, 0.6);
  animation: logoFlicker 6s ease-in-out infinite;
}
/* "5×5" だけマゼンタ→パープルの別色ネオン */
.logo span {
  margin: 0 6px;
  color: #ffe6f3;
  text-shadow:
    0 0 4px  #fff,
    0 0 12px var(--magenta),
    0 0 26px var(--magenta),
    0 0 44px rgba(122, 43, 255, 0.7);
}
@keyframes logoFlicker {
  0%, 100%      { filter: brightness(1);    }
  47%, 52%      { filter: brightness(1);    }
  48%           { filter: brightness(0.72); } /* 一瞬ちらつく管の演出 */
  50%           { filter: brightness(1.25); }
}

/* ---- 3. フレーム: 浮遊するネオン枠 ------------------------ */
.frame {
  padding: clamp(8px, 2vw, 16px);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(20, 12, 42, 0.75), rgba(6, 3, 18, 0.85));
  border: 2px solid transparent;
  /* グラデ枠 + 内外グロー */
  box-shadow:
    0 0 0 2px rgba(0, 240, 255, 0.35),
    0 0 22px rgba(0, 240, 255, 0.35),
    0 0 60px rgba(122, 43, 255, 0.30),
    inset 0 0 30px rgba(122, 43, 255, 0.25),
    0 24px 60px rgba(0, 0, 0, 0.65);
  position: relative;
  z-index: 1;
}
/* 枠の外周をゆっくり色循環させる光輪 */
.frame::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 24px;
  padding: 3px;
  background: linear-gradient(120deg, var(--cyan), var(--magenta), var(--purple), var(--cyan));
  background-size: 300% 300%;
  /* 枠線だけ光らせるマスク */
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  opacity: 0.9;
  animation: frameHue 10s linear infinite;
  pointer-events: none;
}
@keyframes frameHue {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---- 4. セル: 暗いガラス調パネル -------------------------- */
.cell {
  border-radius: 12px;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0) 45%),
    var(--glass);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 0 14px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 240, 255, 0.12);
  backdrop-filter: blur(2px);
  transition: box-shadow 0.25s ease;
}

/* ---- 5. 勝利セル: 強い発光パルス -------------------------- */
.cell--win {
  z-index: 5;
  animation: winPulse 0.9s ease-in-out infinite;
}
@keyframes winPulse {
  0% {
    transform: scale(1) rotate(0deg);
    box-shadow:
      inset 0 0 12px rgba(255, 210, 63, 0.5),
      0 0 10px var(--gold),
      0 0 26px var(--gold);
    background: rgba(255, 210, 63, 0.14);
  }
  50% {
    transform: scale(1.14) rotate(-2.5deg);
    box-shadow:
      inset 0 0 18px rgba(255, 255, 255, 0.7),
      0 0 22px var(--magenta),
      0 0 48px var(--cyan);
    background: rgba(255, 45, 149, 0.20);
  }
  100% {
    transform: scale(1) rotate(2.5deg);
    box-shadow:
      inset 0 0 12px rgba(0, 240, 255, 0.5),
      0 0 12px var(--cyan),
      0 0 30px var(--purple);
    background: rgba(0, 240, 255, 0.14);
  }
}

/* ---- 6. シンボル絵文字: 軽いドロップシャドウ -------------- */
.sym {
  filter:
    drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6))
    drop-shadow(0 0 6px rgba(0, 240, 255, 0.25));
}
.cell--win .sym {
  filter:
    drop-shadow(0 0 8px rgba(255, 210, 63, 0.9))
    drop-shadow(0 0 16px rgba(255, 45, 149, 0.6));
}

/* ---- 7. メーター: LED風発光数字 --------------------------- */
.meter-label { color: #9ad9ff; text-shadow: 0 0 6px rgba(0, 240, 255, 0.5); }
.meter-val {
  color: #eafcff;
  text-shadow:
    0 0 4px  #fff,
    0 0 12px var(--cyan),
    0 0 22px rgba(0, 240, 255, 0.6);
}
/* WIN メーターはゴールド発光（獲得時の meter--win で強調） */
.meter--win .meter-label { color: #ffe9a8; text-shadow: 0 0 6px rgba(255, 210, 63, 0.6); }
.meter--win .meter-val {
  color: #fff4d0;
  text-shadow:
    0 0 5px  #fff,
    0 0 14px var(--gold),
    0 0 28px rgba(255, 210, 63, 0.8);
  animation: goldPulse 1.1s ease-in-out infinite;
}
@keyframes goldPulse {
  0%, 100% { filter: brightness(1);    }
  50%      { filter: brightness(1.35); }
}

/* ---- 8. SPINボタン: シアン→マゼンタの主役 ----------------- */
.spin-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 50%, var(--magenta) 100%);
  background-size: 200% 200%;
  box-shadow:
    0 0 18px rgba(0, 240, 255, 0.55),
    0 0 40px rgba(255, 45, 149, 0.45),
    inset 0 2px 6px rgba(255, 255, 255, 0.35),
    inset 0 -3px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.12s ease, box-shadow 0.2s ease, filter 0.2s ease;
  animation: spinBreathe 2.4s ease-in-out infinite, spinShift 6s linear infinite;
}
.spin-btn__label {
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 16px rgba(0, 240, 255, 0.7);
}
@keyframes spinBreathe {
  0%, 100% { box-shadow: 0 0 18px rgba(0,240,255,0.55), 0 0 40px rgba(255,45,149,0.45),
                         inset 0 2px 6px rgba(255,255,255,0.35), inset 0 -3px 8px rgba(0,0,0,0.3); }
  50%      { box-shadow: 0 0 28px rgba(0,240,255,0.85), 0 0 66px rgba(255,45,149,0.7),
                         inset 0 2px 6px rgba(255,255,255,0.45), inset 0 -3px 8px rgba(0,0,0,0.3); }
}
@keyframes spinShift {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.spin-btn:hover  { transform: translateY(-2px) scale(1.03); filter: brightness(1.1); }
.spin-btn:active { transform: translateY(1px) scale(0.97); filter: brightness(0.95); }
.spin-btn:disabled {
  background: linear-gradient(135deg, #3a3550, #23202f);
  color: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
  filter: grayscale(0.7);
  animation: none;
}
.spin-btn:disabled .spin-btn__label { text-shadow: none; }

/* ---- 9. 小ボタン: chip / mute ----------------------------- */
.chip {
  color: #eafcff;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,0.18), rgba(20,12,42,0.9));
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.4),
    0 0 12px rgba(0, 240, 255, 0.35),
    inset 0 1px 2px rgba(255, 255, 255, 0.25);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.7);
  transition: transform 0.12s ease, box-shadow 0.2s ease, color 0.2s ease;
}
.chip:hover {
  transform: translateY(-1px) scale(1.08);
  color: #fff;
  box-shadow: 0 0 0 1px var(--magenta), 0 0 18px rgba(255, 45, 149, 0.6),
              inset 0 1px 2px rgba(255,255,255,0.3);
}
.chip:active { transform: scale(0.92); }

.mute-btn {
  border-radius: 50%;
  padding: 6px 8px;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
  transition: transform 0.12s ease, filter 0.2s ease;
}
.mute-btn:hover  { transform: scale(1.15); filter: drop-shadow(0 0 12px rgba(255, 45, 149, 0.8)); }
.mute-btn:active { transform: scale(0.9); }

/* ---- 10. メッセージ トースト ------------------------------ */
/* base.css の transform: translateX(-50%) を壊さないよう opacity のみ制御 */
.message {
  color: #eafcff;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(10, 5, 24, 0.82);
  border: 1px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.4), inset 0 0 12px rgba(122, 43, 255, 0.3);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;                       /* 初期は非表示 */
  transition: opacity 0.35s ease;   /* main.js がテキスト/クラスで出し入れ */
}
/* 中身が入ったら表示（空 :empty のときは隠す） */
.message:not(:empty) { opacity: 1; }

/* ---- 11/12. モーション配慮 -------------------------------- */
/* 過度な動きを抑える。目が疲れないように強アニメを停止 */
@media (prefers-reduced-motion: reduce) {
  #app::before,
  .logo,
  .frame::before,
  .cell--win,
  .meter--win .meter-val,
  .spin-btn {
    animation: none !important;
  }
  .cell--win { transform: none; box-shadow: 0 0 16px var(--gold), inset 0 0 14px rgba(255,210,63,0.5); }
  * { transition-duration: 0.001s !important; }
}
