* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; background: #0b0616; overflow: hidden; touch-action: manipulation;
  overscroll-behavior: none; -webkit-touch-callout: none;
  font-family: "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif; color: #fff; }
/* キーボード操作時のフォーカスを明示する */
:focus-visible { outline: 3px solid #00e0ff; outline-offset: 2px; border-radius: 6px; }
#app { position: relative; height: 100%; height: 100dvh; max-width: 480px; margin: 0 auto;
  background: #0b0616; }

/* ===== ステージ(動画)エリア: 全画面 ===== */
#stage { position: absolute; inset: 0; overflow: hidden; }
#stage video, #stage img.poster {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: filter .3s, opacity .3s; }
.dimmed { filter: brightness(.45) saturate(.6); }
#stage.shake { animation: stageShake .5s ease-out; }
@keyframes stageShake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px) rotate(-.6deg); }
  40% { transform: translateX(8px) rotate(.5deg); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(4px); }
}
/* SAKUYAのレベル成長エフェクト。明るい動画背景にも埋もれないよう、
   外周・中心光・星粒・リング・放射光を独立レイヤーで重ねる。 */
#aura { position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: 0;
  overflow: hidden; transition: opacity .18s; isolation: isolate; }
#aura::before, #aura::after, #aura .fxLayer { position: absolute; pointer-events: none;
  will-change: transform, opacity, filter; }
#aura::before, #aura::after { content: ''; inset: -18%; opacity: 0; }
#aura .fxLayer { display: block; opacity: 0; mix-blend-mode: screen; }
#aura .fxCore { inset: 11% 4% 17%; border-radius: 50%; }
#aura .fxStars { inset: -12%; }
#aura .fxRing { inset: 49% 4% 10%; border-radius: 50%; }
#aura .fxRays { inset: -25%; }
#aura .fxBurst { inset: 8% -12% 10%; border-radius: 50%; }
#stage.level-fx-active #aura { opacity: 1; }

/* Lv2: 一目で分かる桜色の外周＋光のスイープ */
#stage.level-fx-active[data-sakuya-level="2"] #aura {
  background: radial-gradient(ellipse at 50% 55%, transparent 32%, rgba(255,40,156,.1) 57%, rgba(255,36,146,.42) 100%);
  box-shadow: inset 0 0 28px 7px rgba(255,107,193,.96), inset 0 0 108px 28px rgba(255,32,144,.5); }
#stage.level-fx-active[data-sakuya-level="2"] #aura::before {
  opacity: .7; background: linear-gradient(112deg, transparent 35%, rgba(255,255,255,.08) 43%,
    rgba(255,112,205,.68) 49%, rgba(255,255,255,.12) 55%, transparent 65%);
  animation: fxSweep 2.8s ease-in-out infinite; }
#stage.level-fx-active[data-sakuya-level="2"] #aura .fxCore {
  opacity: .62; background: radial-gradient(ellipse, rgba(255,218,239,.55),
    rgba(255,51,163,.25) 38%, transparent 70%); }

/* Lv3: 外周に中心の鼓動光を追加 */
#stage.level-fx-active[data-sakuya-level="3"] #aura {
  background: radial-gradient(ellipse at 50% 54%, rgba(255,91,188,.18) 0, transparent 36%, rgba(255,38,148,.5) 100%);
  box-shadow: inset 0 0 34px 9px rgba(255,142,216,.98), inset 0 0 120px 32px rgba(255,28,143,.56);
  animation: fxAuraPulse 1.35s ease-in-out infinite alternate; }
#stage.level-fx-active[data-sakuya-level="3"] #aura .fxCore {
  opacity: .8; background: radial-gradient(ellipse, rgba(255,255,255,.55) 0,
    rgba(255,55,166,.36) 28%, rgba(255,40,151,.1) 53%, transparent 72%);
  animation: fxCorePulse 1.35s ease-in-out infinite; }

/* Lv4: 左右からピンクとシアンの双光 */
#stage.level-fx-active[data-sakuya-level="4"] #aura {
  background: linear-gradient(90deg, rgba(255,24,145,.5), transparent 32% 68%, rgba(0,224,255,.5));
  box-shadow: inset 0 0 38px 10px rgba(189,96,255,.98), inset 0 0 126px 34px rgba(105,65,255,.5); }
#stage.level-fx-active[data-sakuya-level="4"] #aura::before {
  opacity: .88; background: linear-gradient(102deg, transparent 20%, rgba(255,48,161,.55) 34%,
    transparent 46% 54%, rgba(0,229,255,.55) 66%, transparent 80%);
  animation: fxDualLight 1.8s ease-in-out infinite alternate; }
#stage.level-fx-active[data-sakuya-level="4"] #aura .fxCore {
  opacity: .72; background: radial-gradient(ellipse, rgba(255,255,255,.48), rgba(185,72,255,.25) 35%, transparent 68%); }

/* Lv5: 大粒の星を画面全体に追加 */
#stage.level-fx-active[data-sakuya-level="5"] #aura {
  background: radial-gradient(ellipse at 50% 52%, rgba(255,224,102,.15), transparent 42%, rgba(255,37,148,.44) 100%);
  box-shadow: inset 0 0 42px 11px rgba(255,221,105,.96), inset 0 0 132px 36px rgba(255,43,157,.56); }
#stage.level-fx-active[data-sakuya-level="5"] #aura .fxCore {
  opacity: .76; background: radial-gradient(ellipse, rgba(255,244,181,.5), rgba(255,57,167,.22) 40%, transparent 70%); }
#stage.level-fx-active[data-sakuya-level="5"] #aura .fxStars,
#stage.level-fx-active[data-sakuya-level="8"] #aura .fxStars,
#stage.level-fx-active[data-sakuya-level="9"] #aura .fxStars {
  opacity: 1;
  background-image: radial-gradient(circle, #fff 0 4px, transparent 5px),
    radial-gradient(circle, #ffe066 0 3px, transparent 4.5px),
    radial-gradient(circle, #ff63b9 0 4px, transparent 5.5px),
    radial-gradient(circle, #6feaff 0 2.5px, transparent 4px);
  background-size: 92px 118px, 71px 96px, 127px 109px, 58px 83px;
  background-position: 10px 8px, 38px 61px, 74px 20px, 21px 44px;
  filter: drop-shadow(0 0 7px #fff);
  animation: fxStarsRise 3.2s linear infinite; }

/* Lv6: 太い光柱が上昇 */
#stage.level-fx-active[data-sakuya-level="6"] #aura {
  background: linear-gradient(90deg, rgba(255,33,151,.38), transparent 38% 62%, rgba(0,218,255,.38));
  box-shadow: inset 0 0 48px 12px rgba(135,122,255,.98), inset 0 0 140px 38px rgba(75,58,255,.58); }
#stage.level-fx-active[data-sakuya-level="6"] #aura::before {
  opacity: .86;
  background: repeating-linear-gradient(90deg, transparent 0 31px, rgba(255,255,255,.12) 34px,
    rgba(76,221,255,.72) 40px, rgba(255,74,177,.48) 47px, transparent 57px);
  filter: blur(1px) drop-shadow(0 0 9px rgba(83,220,255,.9));
  animation: fxEnergyRise 1.7s ease-in-out infinite; }
#stage.level-fx-active[data-sakuya-level="6"] #aura .fxCore {
  opacity: .82; background: radial-gradient(ellipse, rgba(207,250,255,.58), rgba(105,68,255,.28) 42%, transparent 72%); }

/* Lv7: キャラクターを囲む太い二重リング */
#stage.level-fx-active[data-sakuya-level="7"] #aura {
  background: radial-gradient(ellipse at 50% 52%, rgba(161,95,255,.2), transparent 39%, rgba(59,47,255,.48) 100%);
  box-shadow: inset 0 0 54px 14px rgba(77,228,255,.98), inset 0 0 148px 42px rgba(151,46,255,.65); }
#stage.level-fx-active[data-sakuya-level="7"] #aura .fxCore {
  opacity: .88; background: radial-gradient(ellipse, rgba(255,255,255,.62), rgba(164,60,255,.3) 38%, transparent 70%); }
#stage.level-fx-active[data-sakuya-level="7"] #aura .fxRing,
#stage.level-fx-active[data-sakuya-level="8"] #aura .fxRing,
#stage.level-fx-active[data-sakuya-level="9"] #aura .fxRing {
  opacity: .96; border: 7px solid rgba(255,81,183,.9);
  box-shadow: 0 0 12px 3px rgba(255,255,255,.9), 0 0 28px 8px rgba(0,224,255,.82),
    inset 0 0 18px 5px rgba(255,55,173,.72);
  animation: fxRingPulse 1.35s ease-in-out infinite; }
#stage.level-fx-active[data-sakuya-level="7"] #aura::after {
  opacity: .74; background: radial-gradient(ellipse at 50% 73%, transparent 0 21%, rgba(0,231,255,.8) 22%,
    rgba(255,80,183,.86) 24%, transparent 27%);
  animation: fxOuterRing 1.35s ease-out infinite; }

/* Lv8: 星・リング・プリズムの高速合成 */
#stage.level-fx-active[data-sakuya-level="8"] #aura {
  background: linear-gradient(135deg, rgba(255,24,148,.48), transparent 40%, rgba(0,224,255,.5));
  box-shadow: inset 0 0 58px 15px rgba(225,118,255,.99), inset 0 0 155px 44px rgba(113,47,255,.7);
  animation: fxAuraPulse .72s ease-in-out infinite alternate; }
#stage.level-fx-active[data-sakuya-level="8"] #aura .fxCore {
  opacity: .94; background: conic-gradient(from 0deg, rgba(255,69,176,.42), rgba(85,228,255,.5),
    rgba(255,226,105,.38), rgba(195,82,255,.48), rgba(255,69,176,.42));
  filter: blur(10px); animation: fxPrismTurn 4s linear infinite; }
#stage.level-fx-active[data-sakuya-level="8"] #aura .fxRing { animation-duration: .92s; }

/* Lv9: 金色の覚醒放射光を最大強度で合成 */
#stage.level-fx-active[data-sakuya-level="9"] #aura {
  background: radial-gradient(ellipse at 50% 50%, rgba(255,255,221,.25) 0, rgba(255,206,55,.14) 35%,
    rgba(255,45,157,.46) 70%, rgba(255,194,43,.64) 100%);
  box-shadow: inset 0 0 62px 17px rgba(255,235,123,1), inset 0 0 168px 48px rgba(255,86,41,.74);
  animation: fxAuraPulse .58s ease-in-out infinite alternate; }
#stage.level-fx-active[data-sakuya-level="9"] #aura .fxCore {
  opacity: 1; background: radial-gradient(ellipse, rgba(255,255,255,.78), rgba(255,220,74,.42) 34%,
    rgba(255,48,156,.19) 54%, transparent 72%);
  animation: fxCorePulse .8s ease-in-out infinite; }
#stage.level-fx-active[data-sakuya-level="9"] #aura .fxRays {
  opacity: .52; background: repeating-conic-gradient(from 0deg at 50% 52%, rgba(255,239,128,.9) 0 3deg,
    transparent 4deg 13deg, rgba(255,47,158,.76) 14deg 17deg, transparent 18deg 29deg);
  filter: drop-shadow(0 0 8px rgba(255,220,76,.85));
  animation: fxPrismTurn 8s linear infinite; }
#stage.level-fx-active[data-sakuya-level="9"] #aura .fxRing {
  border-color: rgba(255,225,81,.98); animation-duration: .7s;
  box-shadow: 0 0 14px 4px #fff, 0 0 34px 12px rgba(255,211,61,.95),
    inset 0 0 22px 7px rgba(255,51,158,.85); }

/* プレイヤーターン開始時の解放バースト。各レベルの常設演出に重ねる。 */
#stage.level-fx-enter #aura .fxBurst {
  animation: fxEnterBurst .95s cubic-bezier(.1,.65,.25,1) both;
  background: radial-gradient(ellipse, transparent 0 27%, rgba(255,255,255,.96) 29%,
    rgba(255,75,180,.9) 31%, rgba(71,226,255,.72) 34%, transparent 41%); }

@keyframes fxSweep { 0%,15% { transform: translateX(-65%); } 70%,100% { transform: translateX(65%); } }
@keyframes fxAuraPulse { from { opacity: .72; filter: brightness(.92); } to { opacity: 1; filter: brightness(1.28); } }
@keyframes fxCorePulse { 0%,100% { transform: scale(.88); opacity: .58; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes fxDualLight { from { transform: translateX(-5%) skewX(-5deg); } to { transform: translateX(5%) skewX(5deg); } }
@keyframes fxStarsRise { from { transform: translate3d(0,12%,0); } to { transform: translate3d(0,-12%,0); } }
@keyframes fxEnergyRise { 0% { transform: translateY(24%); opacity: .42; } 55% { opacity: 1; } 100% { transform: translateY(-24%); opacity: .42; } }
@keyframes fxRingPulse { 0%,100% { transform: scale(.92); opacity: .65; } 50% { transform: scale(1.04); opacity: 1; } }
@keyframes fxOuterRing { 0% { transform: scale(.76); opacity: .22; } 45% { opacity: .92; } 100% { transform: scale(1.2); opacity: .18; } }
@keyframes fxPrismTurn { to { transform: rotate(360deg); } }
@keyframes fxEnterBurst { 0% { transform: scale(.5); opacity: 0; filter: brightness(2); }
  28% { opacity: 1; } 100% { transform: scale(1.45); opacity: 0; filter: brightness(1); } }

#turnBanner { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%);
  padding: 6px 18px; border-radius: 999px; font-weight: 800; font-size: 15px;
  background: rgba(255,45,150,.85); box-shadow: 0 0 14px rgba(255,45,150,.8);
  letter-spacing: .1em; white-space: nowrap; pointer-events: none; }
#turnBanner.cpu { background: rgba(0,170,255,.85); box-shadow: 0 0 14px rgba(0,170,255,.8); }
#scores { position: absolute; top: calc(44px + env(safe-area-inset-top, 0px)); left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 12px; font-size: 13px;
  pointer-events: none; }
.scoreBox { background: rgba(0,0,0,.5); border-radius: 10px; padding: 5px 10px; min-width: 108px; }
.scoreBox .name { font-size: 10px; opacity: .8; }
.scoreBox .val { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.scoreBox .levelTag { font-size: 10px; letter-spacing: .08em; min-height: 13px; color: #ffe066; }
#p1Box { border: 1px solid #ff2d96; } #cpuBox { border: 1px solid #00aaff; text-align: right; }
#judge { position: absolute; bottom: 21%; left: 50%; transform: translateX(-50%);
  font-size: 30px; font-weight: 900; letter-spacing: .06em; opacity: 0;
  text-shadow: 0 0 12px currentColor; pointer-events: none; }
#judge.pop { animation: judgePop .45s ease-out; }
@keyframes judgePop { 0% {opacity:0; transform:translateX(-50%) scale(.6);}
  25% {opacity:1; transform:translateX(-50%) scale(1.15);} 70% {opacity:1;}
  100% {opacity:0; transform:translateX(-50%) scale(1);} }
#combo { position: absolute; bottom: 27%; left: 50%; transform: translateX(-50%);
  font-size: 16px; font-weight: 800; color: #ffe066; text-shadow: 0 0 10px rgba(255,224,102,.8);
  pointer-events: none; }

/* ===== ノーツレーン(動画に重ねる全画面オーバーレイ、画面自体がタップパッド) ===== */
#laneWrap { position: absolute; inset: 0; z-index: 3; }
canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#hud { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#missFlash { position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,32,56,0) 35%, rgba(255,32,56,.5) 100%); }
#missFlash.on { animation: missFlash .5s ease-out; }
@keyframes missFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
#judge.miss { font-size: 46px; }
#countdown { position: absolute; top: 38%; left: 50%; transform: translate(-50%,-50%);
  font-size: 96px; font-weight: 900; color: #fff; opacity: 0; pointer-events: none;
  text-shadow: 0 0 26px rgba(255,45,150,.95), 0 0 60px rgba(0,224,255,.6); }
#countdown.pop { animation: countPop .42s ease-out forwards; }
@keyframes countPop {
  0% { opacity: 0; transform: translate(-50%,-50%) scale(1.7); }
  30% { opacity: 1; }
  100% { opacity: .92; transform: translate(-50%,-50%) scale(1); }
}

/* ===== オーバーレイ(メニュー各種) ===== */
.overlay { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start; gap: 12px; text-align: center;
  background: rgba(8,4,18,.9); backdrop-filter: blur(4px); overflow-y: auto;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 18px
           calc(18px + env(safe-area-inset-bottom, 0px)); }
/* 安全な中央寄せ: 収まる時は中央、あふれる時は上からスクロール
   (justify-content:centerだと上端がスクロール不能領域に切れるため使わない) */
.overlay > :first-child { margin-top: auto; }
.overlay > :last-child { margin-bottom: auto; }
.overlay h1 { font-size: 24px; line-height: 1.4; flex-shrink: 0;
  background: linear-gradient(90deg,#ff2d96,#ffe066,#00e0ff);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.overlay h2 { font-size: 18px; letter-spacing: .1em; flex-shrink: 0; }
.overlay p { font-size: 12px; opacity: .85; line-height: 1.7; }
.selLabel { font-size: 11px; letter-spacing: .2em; opacity: .7; margin-top: 2px; }
.selRow { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.selBtn { padding: 9px 14px; font-size: 13px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.25);
  border-radius: 12px; cursor: pointer; letter-spacing: .05em; min-height: 44px; }
.selBtn.sel { border-color: #ffe066; background: rgba(255,224,102,.18);
  box-shadow: 0 0 12px rgba(255,224,102,.5); }
.selBtn.lock { opacity: .35; pointer-events: none; }
.btn { padding: 13px 40px; font-size: 17px; font-weight: 800; color: #fff;
  background: linear-gradient(90deg,#ff2d96,#b84dff); border: none; border-radius: 999px;
  box-shadow: 0 0 18px rgba(255,45,150,.6); cursor: pointer; margin-top: 4px; }
.btn:active { transform: scale(.96); }
.btnSub { padding: 9px 22px; font-size: 13px; font-weight: 800; color: #fff;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; cursor: pointer; min-height: 44px; }
.statusLine { font-size: 13px; font-weight: 800; color: #ffe066; }
.creditLine { font-size: 10px !important; opacity: .6 !important; line-height: 1.8; }
.legalLink { color: #5ad1ff; font-weight: 700; text-decoration: underline;
  display: inline-block; padding: 6px 4px; }
#vsInfo { font-size: 13px; font-weight: 800; color: #ffe066; min-height: 18px; }

/* ステージカード */
.stageCard { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 340px;
  background: rgba(255,255,255,.07); border: 2px solid rgba(255,255,255,.2);
  border-radius: 14px; padding: 8px 12px; cursor: pointer; text-align: left; color: #fff; }
.stageCard img { width: 46px; height: 46px; object-fit: cover; border-radius: 10px; }
.stageCard .sc-main { flex: 1; }
.stageCard .sc-title { font-size: 14px; font-weight: 800; }
.stageCard .sc-sub { font-size: 11px; opacity: .8; }
.stageCard .sc-state { font-size: 18px; }
.stageCard.cleared { border-color: #8dff70; }
.stageCard.locked { opacity: .4; pointer-events: none; }

/* ===== 設定画面 ===== */
.settingBox { width: 100%; max-width: 340px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18); border-radius: 14px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px; }
.settingHead { font-size: 12px; font-weight: 800; letter-spacing: .15em; opacity: .8;
  text-align: left; }
.settingRow { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; }
.settingRow label { font-weight: 700; white-space: nowrap; }
.settingRow input[type="range"] { flex: 1; min-width: 120px; accent-color: #ff2d96; height: 28px; }
.settingRow input[type="checkbox"] { width: 22px; height: 22px; accent-color: #ff2d96; }
.settingNote { font-size: 11px; opacity: .7; line-height: 1.6; text-align: left; }
.btnSub.danger { border-color: rgba(255,32,56,.7); color: #ff9aa8; }

/* キャリブレーション */
#calibratePad { width: 200px; height: 200px; border-radius: 50%; cursor: pointer;
  border: 4px solid #ff2d96; display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900; letter-spacing: .1em; color: #ff2d96;
  background: rgba(255,45,150,.12); user-select: none; -webkit-user-select: none; }
#calibratePad.beat { animation: calibBeat .18s ease-out; }
@keyframes calibBeat { 0% { box-shadow: 0 0 0 0 rgba(255,45,150,.9); transform: scale(1.06); }
  100% { box-shadow: 0 0 0 26px rgba(255,45,150,0); transform: scale(1); } }

/* 一時停止ボタン(バトル中のみ表示。HUDはpointer-events:noneなので個別に有効化) */
#pauseBtn { position: absolute; top: calc(10px + env(safe-area-inset-top, 0px)); left: 10px;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.5); color: #fff; font-size: 18px; cursor: pointer;
  pointer-events: auto; z-index: 6; }

/* ローディング */
#loadingList { display: flex; flex-direction: column; gap: 8px; min-width: 220px; }
.loadRow { font-size: 14px; font-weight: 700; text-align: left; }
.loadRow .loadIcon { display: inline-block; width: 22px; }

/* 通知トースト */
#toast { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  z-index: 30; background: rgba(8,4,18,.92); border: 1px solid rgba(255,224,102,.6);
  color: #ffe066; font-size: 13px; font-weight: 700; border-radius: 999px;
  padding: 10px 20px; opacity: 0; pointer-events: none; transition: opacity .3s;
  max-width: 86%; text-align: center; }
#toast.on { opacity: 1; }

#resultOverlay { display: none; }
#resultTitle { font-size: 38px; font-weight: 900; }
.reward { color: #ffe066; font-weight: 900; font-size: 18px; line-height: 1.6; }
.hidden { display: none !important; }

/* ===== クロゼッタ: タイトル・ラッキー属性 ===== */
.titleSub { font-size: 13px; letter-spacing: .3em; -webkit-text-fill-color: #ffd9ec;
  color: #ffd9ec; font-weight: 700; }
.luckyLine { font-size: 12px; font-weight: 800; color: #ffe066;
  border: 1px dashed rgba(255,224,102,.6); border-radius: 999px; padding: 6px 16px; }
#songTheme { position: absolute; top: calc(76px + env(safe-area-inset-top, 0px));
  left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 800;
  color: #ffd9ec; background: rgba(0,0,0,.45); border-radius: 999px; padding: 3px 12px;
  pointer-events: none; white-space: nowrap; }

/* ===== カードUI(プレースホルダー画: 絵文字+属性色) =====
   属性色は各カードの --attrColor で与える */
.gameCard { position: relative; width: 158px; height: 220px; border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 32%, rgba(255,255,255,.34), transparent 62%),
    linear-gradient(160deg, var(--attrColor, #888) 0%, #241a38 120%);
  border: 3px solid rgba(255,255,255,.55); overflow: hidden; color: #fff;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 8px; flex-shrink: 0; user-select: none; -webkit-user-select: none; }
.gameCard.rar-R  { border-color: #bfe6ff; box-shadow: 0 0 10px rgba(120,200,255,.7); }
.gameCard.rar-SR { border-color: #ffe066; box-shadow: 0 0 14px rgba(255,224,102,.85); }
.cardTop { display: flex; justify-content: space-between; width: 100%;
  font-size: 11px; font-weight: 900; }
.cardRar { background: rgba(0,0,0,.5); border-radius: 6px; padding: 1px 7px; }
.rar-R .cardRar { color: #bfe6ff; } .rar-SR .cardRar { color: #ffe066; }
.cardStyle { background: rgba(0,0,0,.5); border-radius: 6px; padding: 1px 7px;
  font-variant-numeric: tabular-nums; }
.cardEmoji { font-size: 64px; line-height: 1.35; filter: drop-shadow(0 3px 6px rgba(0,0,0,.45)); }
.cardName { font-size: 13px; font-weight: 900; line-height: 1.3;
  text-shadow: 0 1px 3px rgba(0,0,0,.7); }
.cardAttrChip { margin-top: auto; font-size: 11px; font-weight: 800;
  background: rgba(0,0,0,.5); border: 1px solid var(--attrColor, #888);
  border-radius: 999px; padding: 2px 10px; }
.cardCount { position: absolute; right: 6px; bottom: 6px; font-size: 12px; font-weight: 900;
  background: rgba(0,0,0,.65); border-radius: 8px; padding: 1px 7px; }
.cardShineTag { position: absolute; left: 6px; bottom: 6px; font-size: 10px; font-weight: 900;
  border-radius: 8px; padding: 1px 7px; background: rgba(255,255,255,.22); }
.shine-2 .cardShineTag { background: linear-gradient(90deg,#ff9ad5,#ffe066,#7de8ff);
  color: #241a38; }

/* 小型カード(コーデ/一覧用) */
.gameCard.mini { width: 96px; height: 134px; border-width: 2px; border-radius: 10px; padding: 5px; }
.gameCard.mini .cardEmoji { font-size: 34px; }
.gameCard.mini .cardName { font-size: 9.5px; }
.gameCard.mini .cardTop { font-size: 8.5px; }
.gameCard.mini .cardAttrChip { font-size: 8px; padding: 1px 6px; }
.gameCard.mini .cardCount { font-size: 10px; }
.gameCard.mini .cardShineTag { font-size: 8px; }
.gameCard.mini.equipped { outline: 3px solid #ffe066; outline-offset: 1px;
  box-shadow: 0 0 16px rgba(255,224,102,.9); }
.gameCard.mini.equipped::after { content: '装備中'; position: absolute; top: 4px; left: 50%;
  transform: translateX(-50%); font-size: 9px; font-weight: 900; color: #241a38;
  background: #ffe066; border-radius: 6px; padding: 0 6px; }

/* ===== 輝度進化(重ね): ノーマル→キラ→ホロ。CSSのリアルタイム加工で表現 ===== */
.cardFx { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.shine-1 .cardFx {   /* キラ: 流れる光沢スイープ+星のきらめき */
  opacity: 1;
  background:
    radial-gradient(circle at 22% 26%, rgba(255,255,255,.9) 0 2px, transparent 4px),
    radial-gradient(circle at 74% 58%, rgba(255,255,255,.85) 0 1.6px, transparent 3.4px),
    radial-gradient(circle at 42% 78%, rgba(255,255,255,.8) 0 1.4px, transparent 3px),
    linear-gradient(115deg, transparent 32%, rgba(255,255,255,.5) 47%, transparent 62%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 240% 100%;
  animation: kiraSweep 2.4s ease-in-out infinite; mix-blend-mode: screen; }
.shine-2 .cardFx {   /* ホロ: 虹色の光沢が流れる(ホログラム風) */
  opacity: .85;
  background:
    linear-gradient(115deg, transparent 25%, rgba(255,255,255,.55) 48%, transparent 68%),
    linear-gradient(65deg,
      rgba(255,90,160,.5) 0%, rgba(255,214,90,.5) 20%, rgba(120,255,160,.5) 40%,
      rgba(90,200,255,.5) 60%, rgba(190,120,255,.5) 80%, rgba(255,90,160,.5) 100%);
  background-size: 260% 100%, 300% 100%;
  animation: holoFlow 3.2s linear infinite; mix-blend-mode: screen; }
@keyframes kiraSweep { 0%,100% { background-position: 0 0, 0 0, 0 0, -120% 0; }
  55% { background-position: 0 0, 0 0, 0 0, 120% 0; } }
@keyframes holoFlow { from { background-position: -130% 0, 0 0; }
  to { background-position: 130% 0, 300% 0; } }

/* ===== 獲得演出(1枚めくり) ===== */
.gainHint { font-size: 12px; opacity: .8; }
#gainCardWrap { perspective: 900px; }
#gainFlipper { position: relative; width: 158px; height: 220px; cursor: pointer;
  transform-style: preserve-3d; transition: transform .65s cubic-bezier(.2,.7,.25,1); }
#gainFlipper.flipped { transform: rotateY(180deg); }
#gainFlipper .gameCard { position: absolute; inset: 0; backface-visibility: hidden;
  -webkit-backface-visibility: hidden; }
#gainFlipper .cardFront { transform: rotateY(180deg); }
.cardBack { background:
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,.16), transparent 60%),
    repeating-linear-gradient(45deg, #b84dff 0 14px, #ff2d96 14px 28px);
  justify-content: center; gap: 6px; animation: backGlow 1.4s ease-in-out infinite alternate; }
.cardBackMark { font-size: 54px; filter: drop-shadow(0 3px 6px rgba(0,0,0,.5)); }
.cardBackText { font-size: 13px; font-weight: 900; letter-spacing: .28em; }
@keyframes backGlow { from { box-shadow: 0 0 10px rgba(255,45,150,.5); }
  to { box-shadow: 0 0 26px rgba(184,77,255,.9); } }
#cardGainInfo { font-size: 15px; font-weight: 800; line-height: 1.8; min-height: 48px; }
.gainNew { color: #ffe066; font-size: 19px; }
.gainShineUp { color: #7de8ff; }

/* ===== コーデ画面 ===== */
#opPanel { width: 100%; max-width: 360px; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.2); border-radius: 14px; padding: 10px 12px;
  display: flex; flex-direction: column; gap: 5px; }
.opTotal { font-size: 16px; font-weight: 900; color: #ffe066; }
.opTotal b { font-size: 22px; }
.opNote { font-size: 10px; opacity: .7; font-weight: 700; margin-left: 6px; }
.opBreak { font-size: 11px; opacity: .85; }
.opThemes { font-size: 10px; opacity: .95; display: flex; flex-wrap: wrap; gap: 4px;
  justify-content: center; line-height: 1.9; }
.themeChip { border: 1px solid var(--attrColor, #888); border-radius: 999px;
  padding: 1px 8px; white-space: nowrap; }
#coordeList { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 6px; }
.coordeSlotHead { font-size: 12px; font-weight: 800; text-align: left; opacity: .95;
  border-bottom: 1px solid rgba(255,255,255,.18); padding: 6px 2px 4px; }
.coordeSlotHead b { color: #ffe066; }
.noEquip { opacity: .55; }
.coordeRow { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px;
  -webkit-overflow-scrolling: touch; }
.coordeEmpty { font-size: 11px; opacity: .55; padding: 12px 4px; }

/* ===== 図鑑(60マスグリッド) ===== */
#zukanGrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  width: 100%; max-width: 360px; }
.zukanCell { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.06); border: 2px solid rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
  color: #fff; padding: 0; }
.zukanCell.got { background:
    radial-gradient(ellipse at 50% 34%, rgba(255,255,255,.3), transparent 65%),
    linear-gradient(160deg, var(--attrColor, #888) 0%, #241a38 130%); }
.zukanCell.got.rar-R  { border-color: #bfe6ff; }
.zukanCell.got.rar-SR { border-color: #ffe066; box-shadow: 0 0 8px rgba(255,224,102,.7); }
.zEmoji { font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); }
.zCount { position: absolute; right: 2px; bottom: 2px; font-size: 9px; font-weight: 900;
  background: rgba(0,0,0,.65); border-radius: 6px; padding: 0 4px; }
.zUnknown { font-size: 18px; font-weight: 900; opacity: .4; }
#zukanDetail { width: 100%; max-width: 360px; min-height: 64px; font-size: 12px;
  line-height: 1.8; background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 8px 12px; }

/* ===== 横画面の案内(縦画面専用) ===== */
#rotateHint { display: none; position: fixed; inset: 0; z-index: 50;
  background: rgba(8,4,18,.96); color: #fff; font-size: 18px; font-weight: 800;
  align-items: center; justify-content: center; text-align: center; padding: 24px; }
@media (orientation: landscape) and (max-height: 520px) {
  #rotateHint { display: flex; }
}

/* ===== 視差・点滅を抑える設定の尊重 ===== */
@media (prefers-reduced-motion: reduce) {
  #stage.shake, #aura, #aura::before, #aura::after, #aura .fxLayer, #missFlash.on, #calibratePad.beat,
  .cardFx, .cardBack {
    animation: none !important; }
  #judge.pop, #countdown.pop { animation: none !important; opacity: 1; }
  #stage video, #stage img.poster { transition: none; }
  #gainFlipper { transition-duration: .01s; }
}
