/* ============================================================
 * GACHAX style
 * ============================================================ */
:root {
  --bg: #0c0812;
  --ink: #f8f0ff;
  --muted: #b4a5c4;
  --pink: #ff2e88;
  --pink2: #ff8ac0;
  --gold: #ffc531;
  --line: rgba(255, 255, 255, 0.14);
  --font-display: 'Dela Gothic One', 'Hiragino Kaku Gothic StdN', 'Yu Gothic', 'Meiryo', sans-serif;
  --font-body: 'M PLUS Rounded 1c', 'Hiragino Maru Gothic ProN', 'Yu Gothic', 'Meiryo', sans-serif;
  --c1: #fff; --c2: #9aa7b6; --c3: #3d4652;
  --rainbow: linear-gradient(115deg, #ff5e5e, #ffd35e, #5eff8f, #5ec8ff, #b35eff, #ff5edb, #ff5e5e);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%; background: var(--bg); color: var(--ink); font-family: var(--font-body);
  overflow: hidden; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }

#stage { position: fixed; inset: 0; overflow: hidden; }
.screen { position: absolute; inset: 0; }
.overlay { z-index: 10; }
#cards { z-index: 12; }
#cutin { z-index: 20; }
#clear { z-index: 25; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 50; opacity: 0; }
#modal { position: fixed; inset: 0; z-index: 80; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--font-display); font-size: clamp(16px, 4.2vw, 20px);
  padding: 12px 22px; border-radius: 999px; transition: transform 0.08s;
}
.btn:active { transform: translateY(3px) scale(0.98); }
.btn-primary {
  background: linear-gradient(180deg, #ffe066, #ff9d00); color: #3a1600;
  box-shadow: 0 5px 0 #8a3a00, 0 10px 20px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}
.btn-ghost { background: rgba(255, 255, 255, 0.08); border: 2px solid var(--line); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; filter: grayscale(0.6); }
.btn-exit {
  background: linear-gradient(180deg, #ff8ac0, #ff2e88); color: #fff;
  box-shadow: 0 5px 0 #8a0040, 0 0 30px rgba(255, 46, 136, 0.8), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  animation: exitBtn 0.9s ease-in-out infinite alternate; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}
@keyframes exitBtn { to { transform: scale(1.07); box-shadow: 0 5px 0 #8a0040, 0 0 50px rgba(255, 46, 136, 1); } }

/* ---------------- room ---------------- */
#room {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px;
  padding: max(16px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, transparent 72%, rgba(255, 46, 136, 0.05) 72.2%, #120a17 72.4%, #07040a 100%),
    radial-gradient(ellipse at 50% 38%, #3d1a49 0%, #1a0c22 50%, #07040a 100%);
}
.logo { text-align: center; }
.logo-main {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(42px, 11vw, 80px); line-height: 1.05;
  transform: skew(-6deg); letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff 0%, #ffe27a 42%, #ff9d00 55%, #ff5ec4 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 #5a1040) drop-shadow(0 0 18px rgba(255, 46, 136, 0.55));
}
.logo-sub { margin-top: 4px; font-weight: 800; font-size: clamp(13px, 3.6vw, 18px); color: var(--pink2); text-shadow: 0 0 10px rgba(255, 46, 136, 0.7); }

.scene { flex: 1; min-height: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.neon-sign {
  font-family: var(--font-display); font-size: clamp(13px, 3.6vw, 18px); line-height: 1.35; text-align: center;
  color: #ffe0ef; padding: 7px 16px; border: 2px solid var(--pink); border-radius: 10px;
  text-shadow: 0 0 6px var(--pink), 0 0 16px var(--pink);
  box-shadow: 0 0 12px var(--pink), inset 0 0 12px rgba(255, 46, 136, 0.45);
  animation: neon 6s infinite;
}
@keyframes neon { 0%, 17%, 23%, 61%, 65%, 100% { opacity: 1; } 19%, 21%, 63% { opacity: 0.3; } }
.neon-sign.confirm { animation: neonConfirm 0.12s steps(2) infinite; color: #fff; border-color: #fff; box-shadow: 0 0 30px var(--pink), 0 0 60px var(--pink); }
@keyframes neonConfirm { 50% { opacity: 0.2; } }

.scene { position: relative; --door-h: min(34vh, 300px); }
.door-wrap { position: relative; height: var(--door-h); aspect-ratio: 0.58; perspective: 900px; }

/* ---- 壁のポスター（config.promo.posters）: 扉の横の壁に貼ってある小さなチラシ ---- */
.posters { position: absolute; inset: 0; pointer-events: none; }
.poster {
  --gap: calc(var(--door-h) * 0.29 + clamp(26px, 8vw, 110px)); /* 扉の中心からの距離 */
  --rot: -4deg;
  position: absolute; top: calc(50% + 24px - var(--door-h) * 0.2); pointer-events: auto; padding: 0;
  width: clamp(48px, calc(50% - var(--gap) - 4px), 78px); aspect-ratio: 0.72;
  transform: translateY(-50%) rotate(var(--rot));
  transition: transform 0.18s cubic-bezier(0.3, 1.6, 0.5, 1), filter 0.18s;
  filter: brightness(0.82) saturate(0.9); /* 薄暗い部屋に貼ってある感 */
}
/* 見た目は内側（button はサイズコンテナにできないので cqw の基準をこちらに置く） */
.pt-in {
  position: absolute; inset: 0; container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center;
  padding: 12% 6% 10%; border-radius: 3px; line-height: 1.1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}
.poster-left { right: calc(50% + var(--gap)); }
.poster-right { left: calc(50% + var(--gap)); --rot: 3.5deg; }
.poster:hover, .poster:focus-visible { filter: none; transform: translateY(-54%) rotate(0deg) scale(1.15); z-index: 1; }
.poster:active { transform: translateY(-50%) scale(1.05); }
/* 初めて貼られたとき: 手前から壁に「ペタッ」 */
.poster.posting { animation: posterSlap 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; }
@keyframes posterSlap {
  0% { opacity: 0; transform: translateY(-50%) rotate(calc(var(--rot) - 14deg)) scale(2.4); filter: none; }
  60% { opacity: 1; transform: translateY(-50%) rotate(var(--rot)) scale(0.94); filter: brightness(1.3); }
  100% { transform: translateY(-50%) rotate(var(--rot)) scale(1); }
}
.pt-tape { position: absolute; width: 34cqw; height: 11cqw; background: rgba(255, 248, 220, 0.55); top: -4cqw; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
.pt-tape.a { left: -8cqw; transform: rotate(-32deg); }
.pt-tape.b { right: -8cqw; transform: rotate(30deg); }
.pt-kicker { font-family: var(--font-display); font-size: 13cqw; letter-spacing: 0.02em; white-space: nowrap; }
.pt-title { font-family: var(--font-display); font-size: 21cqw; line-height: 1.05; }
.pt-tag { font-family: var(--font-display); font-size: 11cqw; padding: 2cqw 8cqw; border-radius: 99px; white-space: nowrap; }

/* パチンコ屋の新装開店チラシ: 赤地の放射に金文字 */
.poster-steam .pt-in {
  color: #fff3b0; outline: 1px solid #5a0008;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 220, 90, 0.35), transparent 60%),
    repeating-conic-gradient(from 0deg at 50% 45%, #d4001a 0 10deg, #a80012 10deg 20deg);
}
.poster-steam .pt-kicker { color: #fff; background: #1a0004; padding: 1cqw 5cqw; transform: rotate(-3deg); }
.poster-steam .pt-title { color: #ffe14d; -webkit-text-stroke: 2cqw #5a0008; paint-order: stroke fill; text-shadow: 0 2cqw 0 #5a0008; }
.poster-steam .pt-tag { background: #171d25; color: #c7d5e0; border: 1px solid #66c0f4; }

/* ---- ポスターから開く紹介モーダル ---- */
.promo-card { width: min(520px, 100%); align-items: stretch; text-align: center; gap: 8px; }
.promo-img { position: relative; aspect-ratio: 460 / 215; border-radius: 10px; overflow: hidden; background: #000; margin-bottom: 6px; }
.promo-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-img.noimg { display: none; }
.promo-img:has(video) { aspect-ratio: 16 / 9; }
.promo-img video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.promo-card p, .promo-card h2 { text-wrap: balance; word-break: auto-phrase; }
.promo-catch { font-family: var(--font-display); font-size: clamp(17px, 5.5vw, 28px); white-space: nowrap; line-height: 1.2; color: #ffe14d; text-shadow: 0 3px 0 #8a0040, 0 0 16px rgba(255, 46, 136, 0.6); }
.promo-sub { font-weight: 800; color: var(--pink2); }
.promo-card .promo-title { font-size: clamp(17px, 5vw, 22px); line-height: 1.3; margin-top: 6px; }
.promo-release { font-weight: 800; color: #66c0f4; }
.promo-msg { font-weight: 800; font-size: 14px; line-height: 1.7; margin-top: 6px; }
.promo-note { font-size: 12px; line-height: 1.6; color: var(--muted); font-weight: 800; }
.promo-card a.btn { text-decoration: none; text-align: center; margin-top: 6px; }

body.exit-mode #room .door-wrap { cursor: pointer; }
.room-exit { flex-shrink: 0; margin-top: 14px; padding: 8px 22px; font-size: clamp(15px, 4vw, 18px); }
.door-glow {
  position: absolute; inset: -4px; border-radius: 6px 6px 0 0; opacity: 0; transition: opacity 0.6s;
  background: radial-gradient(ellipse at 50% 50%, #fff, #ffd1e6 50%, #ff2e88);
  box-shadow: 0 0 60px #ff8ac0;
}
.door {
  position: absolute; inset: 0; transform-origin: left center;
  background: linear-gradient(90deg, #4e2b19, #7a4a2c 45%, #5b3420);
  border: 6px solid #2c160c; border-bottom: 0; border-radius: 6px 6px 0 0;
  box-shadow: 0 0 0 4px #1b0d06, 0 20px 60px rgba(0, 0, 0, 0.85);
  display: flex; flex-direction: column; gap: 8%; padding: 14% 14%;
  transition: transform 1.6s cubic-bezier(0.6, 0, 0.2, 1);
}
.door-panel { flex: 1; border: 3px solid rgba(0, 0, 0, 0.35); border-radius: 4px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06); }
.knob { position: absolute; right: 10%; top: 50%; width: 9%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff6c0, #c9971c 60%, #6d4c00); }
.lock { position: absolute; right: 5%; top: 56%; font-size: clamp(16px, 3.5vh, 24px); }
/* ドアノブ・鍵は小さいので当たり判定を広げる */
.knob::after, .lock::after { content: ''; position: absolute; inset: -60%; }
body:not(.exit-mode) #room .door-wrap { cursor: pointer; }
.door.knocked { animation: doorKnock 0.42s ease-out; }
@keyframes doorKnock { 0%, 100% { translate: 0 0; } 8%, 50% { translate: 0 -1px; } 15%, 58% { translate: 1px 0; } }
.knob.rattling, .lock.rattling { animation: knobRattle 0.5s linear; }
@keyframes knobRattle {
  0%, 100% { rotate: 0deg; } 10% { rotate: -22deg; } 22% { rotate: 14deg; } 34% { rotate: -18deg; }
  50% { rotate: 10deg; } 64% { rotate: -14deg; } 78% { rotate: 8deg; } 90% { rotate: -4deg; }
}
body.exit-mode #room .door { transform: rotateY(-28deg); }
body.exit-mode #room .door-glow { opacity: 1; }
body.exit-mode #room .neon-sign { animation: none; background: rgba(255, 46, 136, 0.25); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: min(720px, 100%); }
.stat { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 12px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; }
.stat .k { font-size: 11px; color: var(--muted); font-weight: 800; }
.stat .v { font-family: var(--font-display); font-size: clamp(16px, 4.5vw, 24px); line-height: 1.2; }
.stat .v small { font-size: 0.55em; margin-left: 2px; color: var(--muted); }
/* 図鑑の入口: 他の欄と違って「出っ張った」ボタンにする（押すと沈む）。右端に ▶ の丸 */
.stat-link {
  position: relative; font: inherit; color: inherit; cursor: pointer; padding-right: 26px;
  background: linear-gradient(180deg, #146b85, #0b3d55); border: 2px solid #5ee7ff;
  box-shadow: 0 4px 0 #04202f, 0 0 14px rgba(94, 231, 255, 0.35), 0 6px 14px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.15s;
}
.stat-link .k { color: #9ff0ff; }
.stat-link .v { color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.stat-link .v small { color: #9ff0ff; }
.stat-link .chev {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center;
  font-style: normal; font-size: 9px; color: #0b3f5a; background: #fff; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.3);
  animation: chevNudge 1.4s ease-in-out infinite;
}
@keyframes chevNudge { 50% { transform: translate(2px, -50%); } }
.stat-link:hover { filter: brightness(1.12); }
.stat-link:active { transform: translateY(4px); box-shadow: 0 0 0 #04202f, 0 0 14px rgba(94, 231, 255, 0.35), 0 2px 6px rgba(0, 0, 0, 0.45), inset 0 2px 0 rgba(255, 255, 255, 0.18); }
.stat.hot { border-color: rgba(255, 46, 136, 0.6); background: rgba(255, 46, 136, 0.12); }
.stat.hot .v { color: var(--pink2); }

.pulls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(720px, 100%); }
@media (max-width: 560px) { .pulls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pull-btn {
  --b1: #6b7bff; --b2: #3a2fb8; --bs: #1d1663; --bt: #fff;
  position: relative; padding: 12px 6px 10px; border-radius: 16px; color: var(--bt);
  background: linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: 0 6px 0 var(--bs), 0 10px 22px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4);
  transition: transform 0.08s, box-shadow 0.08s; display: flex; flex-direction: column; align-items: center;
}
.pull-btn:hover { filter: brightness(1.1); }
.pull-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--bs), 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.pull-btn[data-theme='green'] { --b1: #4fe0a0; --b2: #11965a; --bs: #074a2b; }
.pull-btn[data-theme='purple'] { --b1: #d08cff; --b2: #7b2fd1; --bs: #3a0f6e; }
.pull-btn[data-theme='gold'] { --b1: #ffe066; --b2: #ff8a00; --bs: #8a3a00; --bt: #3a1600; }
.pull-btn .pl-label { font-family: var(--font-display); font-size: clamp(22px, 6vw, 32px); line-height: 1.1; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.pull-btn .pl-sub { font-size: 11px; font-weight: 800; opacity: 0.92; }
/* 光の筋: ボタンの外へはみ出さないよう、全面に敷いたグラデーションの位置を動かす（封印のお札が飛び散るので overflow は切らない） */
.pull-btn::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.55) 50%, transparent 60%) no-repeat;
  background-size: 300% 100%; animation: shine 3.2s infinite;
}
.pull-btn.featured { animation: featuredPulse 1.2s ease-in-out infinite alternate; }
.pull-btn.featured::after { animation-duration: 1.8s; }
@keyframes shine { 0%, 55% { background-position: 100% 0; } 100% { background-position: 0% 0; } }
@keyframes featuredPulse { to { box-shadow: 0 6px 0 var(--bs), 0 0 28px rgba(255, 197, 49, 0.75), inset 0 2px 0 rgba(255, 255, 255, 0.4); } }

/* ---- 封印（config.pulls[].unlock）: 灰色のボタンにお札が貼ってある ---- */
.pull-btn.sealed { --b1: #5d5866; --b2: #34303b; --bs: #18151c; --bt: #a49dad; cursor: not-allowed; animation: none; }
.pull-btn.sealed::after { display: none; }
.pull-btn.sealed:hover { filter: none; }
.pull-btn.sealed:active { transform: none; box-shadow: 0 6px 0 var(--bs), 0 10px 22px rgba(0, 0, 0, 0.5), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.pull-btn.sealed .pl-label { opacity: 0.55; }
.pull-btn .seal { display: none; position: absolute; left: 90%; top: -10%; height: 120%; aspect-ratio: 0.4; transform: translateX(-50%) rotate(-9deg); pointer-events: none; z-index: 2; }
.pull-btn.sealed .seal, .pull-btn.unsealing .seal { display: block; }
.seal-half {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.06), transparent 30%, transparent 70%, rgba(0, 0, 0, 0.08)), #f1e6c8;
  border: 2px solid #f1e6c8; outline: 2px solid #b3121f; outline-offset: -6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}
.seal-half b { writing-mode: vertical-rl; font-family: var(--font-display); font-weight: 400; font-size: clamp(16px, 4.6vw, 22px); letter-spacing: 0.1em; color: #b3121f; }
/* 斜めに破れる2片 */
.seal-half.a { clip-path: polygon(0 0, 100% 0, 100% 44%, 0 58%); }
.seal-half.b { clip-path: polygon(0 58%, 100% 44%, 100% 100%, 0 100%); }
.pull-btn.seal-deny .seal { animation: sealDeny 0.35s; }
@keyframes sealDeny { 25% { transform: translateX(-56%) rotate(-13deg); } 60% { transform: translateX(-44%) rotate(-5deg); } }
/* 解放のタメ: --amp（JS が上げていく）で揺れ幅、--glow（0→1）で光 */
.pull-btn { --amp: 1; --glow: 0; }
.pull-btn.seal-shake .seal { animation: sealShake 0.08s linear infinite; }
@keyframes sealShake {
  0%, 100% { transform: translateX(-50%) rotate(-9deg); }
  25% { transform: translate(calc(-50% - 1.5px * var(--amp)), calc(-1px * var(--amp))) rotate(calc(-9deg - 2.5deg * var(--amp))); }
  75% { transform: translate(calc(-50% + 1.5px * var(--amp)), calc(1px * var(--amp))) rotate(calc(-9deg + 2.5deg * var(--amp))); }
}
.pull-btn.seal-shake:not(.seal-build) .seal { filter: drop-shadow(0 0 4px rgba(255, 224, 102, 0.7)); }
.pull-btn.seal-build .seal { filter: drop-shadow(0 0 calc(4px + 14px * var(--glow)) #ffe066) drop-shadow(0 0 calc(24px * var(--glow)) #ffb300) brightness(calc(1 + 0.5 * var(--glow))); }
.pull-btn.seal-build { box-shadow: 0 6px 0 var(--bs), 0 0 calc(30px * var(--glow)) rgba(255, 200, 60, calc(0.9 * var(--glow))), inset 0 2px 0 rgba(255, 255, 255, 0.4); }
.pull-btn.seal-build.seal-shake { animation: btnTremble 0.07s linear infinite; }
@keyframes btnTremble { 50% { transform: translateX(calc(0.6px * var(--amp))); } }
.pull-btn.seal-hold .seal { animation: none; transform: translateX(-50%) rotate(-9deg) scale(1.08); filter: drop-shadow(0 0 22px #fff) drop-shadow(0 0 40px #ffe066) brightness(1.8); transition: transform 0.1s; }
.pull-btn.seal-hold { animation: none; }
.pull-btn.unsealing .seal { animation: sealGone 0.9s forwards; }
.pull-btn.unsealing .seal-half.a { animation: sealFlyA 0.9s cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
.pull-btn.unsealing .seal-half.b { animation: sealFlyB 0.9s cubic-bezier(0.2, 0.7, 0.4, 1) forwards; }
@keyframes sealGone { to { opacity: 1; } }
@keyframes sealFlyA { to { transform: translate(-70%, -90%) rotate(-40deg); opacity: 0; } }
@keyframes sealFlyB { to { transform: translate(60%, 110%) rotate(35deg); opacity: 0; } }
.pull-btn.unsealing { animation: unsealGlow 0.9s ease-out; z-index: 1; }
@keyframes unsealGlow { 0% { filter: brightness(2.2); transform: scale(1.12); } 100% { filter: none; transform: none; } }
.unseal-pop {
  position: absolute; left: 50%; top: 0; z-index: 3; pointer-events: none; white-space: nowrap;
  font-family: var(--font-display); font-size: clamp(22px, 6vw, 32px); color: #fff;
  -webkit-text-stroke: 5px #b3121f; paint-order: stroke fill; text-shadow: 0 0 16px #ffe066;
  animation: unsealPop 1.4s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
}
@keyframes unsealPop { 0% { transform: translate(-50%, 0) scale(0.3); opacity: 0; } 20% { transform: translate(-50%, -70%) scale(1.15); opacity: 1; } 75% { transform: translate(-50%, -80%) scale(1); opacity: 1; } 100% { transform: translate(-50%, -110%) scale(1); opacity: 0; } }

.room-nav { display: flex; gap: 8px; }
.room-nav > button, .room-nav #btnMute {
  font-size: 13px; font-weight: 800; padding: 6px 16px; border-radius: 999px; color: #f1e6ff;
  background: rgba(255, 255, 255, 0.1); border: 2px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5); transition: transform 0.08s, box-shadow 0.08s, background 0.15s, border-color 0.15s;
}
.room-nav > button:hover, .room-nav #btnMute:hover { background: rgba(255, 255, 255, 0.18); border-color: #fff; color: #fff; }
.room-nav > button:active, .room-nav #btnMute:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0, 0, 0, 0.5); }

/* 音量: ボタンを押すと上にスライダーが出る */
.vol-wrap { position: relative; }
.vol-wrap.open #btnMute { color: #fff; border-color: rgba(255, 255, 255, 0.45); background: rgba(255, 255, 255, 0.14); }
.vol-pop {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
  background: rgba(24, 12, 36, 0.96); border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55); z-index: 5; white-space: nowrap;
  animation: volPopIn 0.16s ease-out;
}
.vol-pop::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 7px solid transparent; border-top-color: rgba(24, 12, 36, 0.96);
}
.vol-pop.hidden { display: none; }
@keyframes volPopIn { from { opacity: 0; transform: translate(-50%, 6px); } }
.room-nav .vol-pop .vol-icon { padding: 2px 4px; border: 0; background: none; font-size: 18px; }
.vol-val { min-width: 2.2em; text-align: right; font-size: 13px; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
#volRange {
  --p: 70%; -webkit-appearance: none; appearance: none; width: 150px; height: 6px; border-radius: 999px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, #ff4fa3, #ffc531 var(--p), rgba(255, 255, 255, 0.15) var(--p));
}
#volRange::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5); }
#volRange::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 3px rgba(255, 79, 163, 0.5), 0 2px 6px rgba(0, 0, 0, 0.5); }
.vol-pop.silent #volRange { filter: grayscale(1) opacity(0.6); }

/* ---------------- summon ---------------- */
#summon {
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c3) 70%, #000), #000 75%);
  transition: background 0.3s;
}
.summon-rays {
  position: absolute; left: 50%; top: 50%; width: 220vmax; height: 220vmax; margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c2) 22%, transparent) 0 7deg, transparent 7deg 16deg);
  animation: spin 14s linear infinite;
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 32%); mask-image: radial-gradient(circle, #000 8%, transparent 32%);
}
#summon.rainbow .summon-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 94, 219, 0.3) 0 7deg, transparent 7deg 16deg); animation: spin 6s linear infinite, hue 2s linear infinite; }
.orb {
  position: relative; width: min(58vw, 46vh, 260px); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff 0%, var(--c1) 14%, var(--c2) 48%, var(--c3) 92%);
  box-shadow: 0 0 40px var(--c2), 0 0 120px color-mix(in srgb, var(--c2) 70%, transparent), inset -14px -20px 40px rgba(0, 0, 0, 0.35), inset 10px 12px 30px rgba(255, 255, 255, 0.45);
  transition: background 0.25s, box-shadow 0.25s;
  animation: orbFloat 1.4s ease-in-out infinite;
}
.orb.rainbow { background: radial-gradient(circle at 34% 28%, #fff 0%, transparent 30%), conic-gradient(#ff5e5e, #ffd35e, #5eff8f, #5ec8ff, #b35eff, #ff5edb, #ff5e5e); animation: orbFloat 1.4s ease-in-out infinite, hue 1.5s linear infinite; box-shadow: 0 0 60px #ff5edb, 0 0 140px #5ec8ff; }
.orb.drop { animation: orbDrop 0.9s cubic-bezier(0.25, 1.6, 0.45, 1) both; }
.orb.rainbow.drop { animation: orbDrop 0.9s cubic-bezier(0.25, 1.6, 0.45, 1) both, hue 1.5s linear infinite; }
.orb.hit { animation: orbHit 0.22s ease-out; }
.orb.rainbow.hit { animation: orbHit 0.22s ease-out, hue 1.5s linear infinite; }
.orb.gone { transform: scale(2.2); opacity: 0; transition: transform 0.35s ease-out, opacity 0.35s ease-out; animation: none; }
.orb-shine { position: absolute; left: 18%; top: 12%; width: 30%; height: 18%; border-radius: 50%; background: rgba(255, 255, 255, 0.75); filter: blur(4px); transform: rotate(-30deg); }
@keyframes orbFloat { 50% { transform: translateY(-10px) scale(1.02); } }
@keyframes orbDrop { 0% { transform: translateY(-120vh) scale(0.6); } 70% { transform: translateY(0) scale(1.08, 0.9); } 100% { transform: none; } }
@keyframes orbHit { 0% { transform: scale(0.86, 1.1); } 60% { transform: scale(1.12, 0.94); } 100% { transform: none; } }
.cracks { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px #fff); }
.cracks .ck { opacity: 0; transition: opacity 0.1s; }
.orb[data-crack='1'] .ck1, .orb[data-crack='2'] .ck1, .orb[data-crack='3'] .ck1,
.orb[data-crack='2'] .ck2, .orb[data-crack='3'] .ck2, .orb[data-crack='3'] .ck3 { opacity: 1; }
.omen {
  position: absolute; top: 12%; left: 0; right: 0; text-align: center; pointer-events: none;
  font-family: var(--font-display); font-size: clamp(36px, 11vw, 84px); color: #fff; transform: skew(-8deg);
  -webkit-text-stroke: 2px var(--c3); paint-order: stroke fill;
  text-shadow: 0 0 20px var(--c2), 0 0 40px var(--c2), 0 6px 0 var(--c3);
}
.omen.rainbow { background: var(--rainbow); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-stroke: 0; animation: rainbowSlide 1s linear infinite; text-shadow: none; filter: drop-shadow(0 0 12px #ff5edb) drop-shadow(0 5px 0 #3a0a5e); }
.omen.pop { animation: omenPop 0.5s cubic-bezier(0.2, 2, 0.4, 1) both; }
.omen.rainbow.pop { animation: omenPop 0.5s cubic-bezier(0.2, 2, 0.4, 1) both, rainbowSlide 1s linear infinite; }
@keyframes omenPop { 0% { transform: skew(-8deg) scale(2.6); opacity: 0; } 100% { transform: skew(-8deg) scale(1); opacity: 1; } }
@keyframes rainbowSlide { to { background-position: 200% 0; } }
.tap-hint {
  position: absolute; bottom: max(12%, 60px); left: 0; right: 0; text-align: center; pointer-events: none;
  font-family: var(--font-display); font-size: clamp(30px, 8vw, 48px); color: #fff;
  text-shadow: 0 0 16px var(--c2), 0 4px 0 var(--c3); animation: tapPulse 0.45s ease-in-out infinite alternate;
}
.tap-hint.final { color: #fff36b; font-size: clamp(38px, 11vw, 64px); animation-duration: 0.22s; }
@keyframes tapPulse { to { transform: scale(1.15); } }
#summon.broken .summon-rays { animation-duration: 1s; }

/* ---------------- cards ---------------- */
#cards {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(12px, 3vh, 24px);
  padding: 60px 12px max(20px, env(safe-area-inset-bottom));
  background: radial-gradient(ellipse at center, #28102f, #050207 85%);
}
/* 結果画面：ホバーしたカードのフレーバー（director.showFlavor） */
.cards-flavor {
  position: absolute; top: 10px; left: 50%; z-index: 5; width: min(92vw, 620px);
  transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  transition: opacity 0.15s ease, transform 0.18s ease;
  padding: 10px 16px 12px; border-radius: 12px; text-align: center;
  background: rgba(10, 4, 14, 0.9); border: 2px solid var(--c2, #fff);
  box-shadow: 0 0 18px color-mix(in srgb, var(--c2, #fff) 45%, transparent), 0 6px 20px rgba(0, 0, 0, 0.6);
}
.cards-flavor.show { opacity: 1; transform: translate(-50%, 0); }
.cards-flavor .cf-name { font-family: var(--font-display); font-size: 20px; color: var(--c1, #fff); margin-bottom: 4px; }
.cards-flavor .cf-rarity { font-size: 0.75em; color: var(--c2, #fff); margin-right: 0.6em; }
.cards-flavor .cf-desc { font-size: 14px; line-height: 1.55; color: #eee; }
.cards-info { font-weight: 800; color: var(--muted); font-size: 15px; min-height: 1.4em; }
.cards-info b { font-family: var(--font-display); font-weight: 400; font-size: 1.3em; }
.cards-grid { display: grid; gap: clamp(6px, 1.6vw, 14px); justify-content: center; }
.cards-grid.n1 { grid-template-columns: min(56vw, 40vh, 240px); }
.cards-grid.n3 { grid-template-columns: repeat(3, min(29vw, 36vh, 190px)); }
.cards-grid.n5 { grid-template-columns: repeat(5, min(17.6vw, 34vh, 150px)); }
.cards-grid.n10 { grid-template-columns: repeat(5, min(17.6vw, 26vh, 132px)); }
.cards-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; min-height: 52px; }

.card { position: relative; aspect-ratio: 3 / 4; perspective: 900px; cursor: pointer; container-type: inline-size; }
.card.enter { animation: cardIn 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes cardIn { 0% { transform: translateY(60vh) rotate(-30deg) scale(0.4); opacity: 0; } 100% { transform: none; opacity: 1; } }
/* ホバー3Dチルト（--rx/--ry は director.bindTilt が書き込む） */
.card-tilt {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.6s cubic-bezier(0.25, 1.6, 0.45, 1);
}
.card.tilting { z-index: 3; }
.card.tilting .card-tilt { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) scale(var(--tilt-scale, 1.06)); transition: transform 0.09s ease-out; }
.card-glare {
  position: absolute; inset: 0; z-index: 3; pointer-events: none; border-radius: inherit;
  background: radial-gradient(circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25) 25%, transparent 55%);
  mix-blend-mode: overlay; opacity: 0; transition: opacity 0.3s;
}
.card-front .card-glare { background-position: 0 0; background-image: radial-gradient(circle at var(--gxm, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.25) 25%, transparent 55%); }
.card.tilting .card-glare { opacity: var(--glare, 0.55); }
.card-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.5s cubic-bezier(0.3, 1.5, 0.5, 1); }
.card.flipped .card-inner { transform: rotateY(180deg); }
.card.shake .card-inner { animation: cardShake 0.38s linear; }
@keyframes cardShake { 0%, 100% { transform: none; } 20% { transform: translateX(-6%) rotate(-5deg); } 40% { transform: translateX(6%) rotate(5deg); } 60% { transform: translateX(-4%) rotate(-3deg) scale(1.05); } 80% { transform: translateX(4%) rotate(3deg) scale(1.08); } }
.card-face { position: absolute; inset: 0; border-radius: 7cqw; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-back {
  display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 4cqw, transparent 4cqw 8cqw), radial-gradient(circle at 50% 40%, var(--c2), var(--c3) 80%);
  border: 2px solid var(--c1); box-shadow: 0 0 14px var(--c2), inset 0 0 16px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, box-shadow 0.2s;
}
.card-back.rainbow { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 4cqw, transparent 4cqw 8cqw), var(--rainbow); background-size: auto, 300% 300%; animation: rainbowSlide 2s linear infinite; box-shadow: 0 0 22px #ff5edb; }
.card-back[data-rarity='SSR'] { box-shadow: 0 0 22px var(--c2), 0 0 4px #fff; }
.back-mark { font-family: var(--font-display); font-size: 42cqw; color: rgba(255, 255, 255, 0.92); text-shadow: 0 0 12px var(--c2), 0 3px 0 var(--c3); }
.back-logo { position: absolute; bottom: 7%; font-family: var(--font-display); font-size: 11cqw; color: rgba(255, 255, 255, 0.6); }
.card-front {
  transform: rotateY(180deg); display: flex; flex-direction: column;
  background: radial-gradient(circle at 50% 38%, var(--c1), var(--c2) 55%, var(--c3));
  border: 2px solid var(--c1); box-shadow: 0 0 16px color-mix(in srgb, var(--c2) 70%, transparent);
}
.card-front.rainbow, .card.rainbow .card-front { border-color: #fff; }
.card.rainbow .card-front { background: radial-gradient(circle at 50% 38%, rgba(255, 255, 255, 0.95), transparent 60%), var(--rainbow); background-size: auto, 300% 300%; animation: rainbowSlide 3s linear infinite; }
.card[data-rarity='EXIT'] .card-front { background: radial-gradient(circle at 50% 38%, #fff, #ff8ac0 50%, #a0004a); border-color: #ffd700; box-shadow: 0 0 30px #ff2e88, 0 0 6px #ffd700; }
.card[data-rarity='SSR'] .card-front::after,
.card.rainbow .card-front::after,
.card[data-rarity='EXIT'] .card-front::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.7) 45%, transparent 60%);
  background-size: 300% 100%; animation: holo 2.2s linear infinite; mix-blend-mode: overlay;
}
@keyframes holo { from { background-position: 150% 0; } to { background-position: -150% 0; } }
.card-rarity { position: absolute; top: 3%; left: 6%; z-index: 2; font-family: var(--font-display); font-size: 15cqw; color: #fff; -webkit-text-stroke: 0.8cqw var(--c3); paint-order: stroke fill; }
.new-badge { position: absolute; top: 4%; right: 4%; z-index: 2; background: #ff2e2e; color: #fff; font-family: var(--font-display); font-size: 9.5cqw; padding: 0.5cqw 3cqw; border-radius: 99px; transform: rotate(10deg); box-shadow: 0 2px 0 #7a0000; }
.card-art { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; font-size: 46cqw; line-height: 1; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.35)); }
.art-emoji.multi { white-space: nowrap; font-size: calc(1.15em / var(--n, 1)); }
.card-art .art-img, .cutin-art .art-img { max-width: 80%; max-height: 80%; object-fit: contain; }
.card-name { background: rgba(0, 0, 0, 0.55); padding: 3cqw 2cqw 5cqw; text-align: center; font-size: 12cqw; font-weight: 800; white-space: nowrap; overflow: hidden; }

/* ---------------- reel ---------------- */
.reel { display: inline-flex; align-items: center; justify-content: center; line-height: 1; white-space: nowrap; }
.reel-body { display: inline-flex; align-items: center; }
.reel-window {
  position: relative; display: inline-block; height: 1.2em; width: 2.2em; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent);
}
.reel-mini .reel-window { width: 2.1em; -webkit-mask-image: none; mask-image: none; }
.reel-strip { display: flex; flex-direction: column-reverse; will-change: transform; }
.reel-strip.fast { filter: blur(1.4px); }
.reel-item { display: flex; align-items: center; justify-content: flex-end; height: 1.2em; }
.reel-text { white-space: nowrap; }
.reel-final { display: none; white-space: nowrap; }
.reel.done .reel-body { display: none; }
.reel.done .reel-final { display: inline-block; }
.reel.landed .reel-window { width: auto; }
/* 例外ックス: 「ックス」が震えてヒビ → 砕けて飛び散る → 本当の名前（director.oddballBreak） */
.reel-suffix { display: inline-block; }
.reel.odd-crack .reel-suffix { animation: oddCrack 0.75s ease-in both; }
@keyframes oddCrack {
  0% { transform: none; filter: none; }
  20% { transform: translate(0.02em, 0) rotate(-1deg); }
  40% { transform: translate(-0.03em, 0.01em) rotate(1.5deg); filter: brightness(1.2); }
  60% { transform: translate(0.04em, -0.02em) rotate(-2deg); }
  80% { transform: translate(-0.05em, 0.02em) rotate(3deg) scale(1.04); filter: brightness(1.5); }
  100% { transform: translate(0.06em, -0.02em) rotate(-3deg) scale(1.08); filter: brightness(2.2) drop-shadow(0 0 0.15em #fff); }
}
.odd-shard { display: inline-block; animation: oddShard 0.45s cubic-bezier(0.2, 0.6, 0.4, 1) both; }
@keyframes oddShard {
  0% { transform: none; opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.6); opacity: 0; }
}

/* ---------------- cut-in ---------------- */
#cutin {
  display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--c2) 55%, #000), var(--c3) 45%, #000 90%);
}
.cutin-rays {
  position: absolute; left: 50%; top: 40%; width: 250vmax; height: 250vmax; margin: -125vmax 0 0 -125vmax;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--c1) 30%, transparent) 0 6deg, transparent 6deg 15deg);
  animation: spin 20s linear infinite;
}
#cutin.rainbow .cutin-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.28) 0 6deg, transparent 6deg 15deg); }
#cutin.rainbow { background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.4), transparent 50%), var(--rainbow); background-size: auto, 300% 300%; animation: rainbowSlide 4s linear infinite; }
#cutin.exit { background: radial-gradient(circle at 50% 42%, #fff 0%, #ff8ac0 25%, #c4005a 60%, #2a0014 100%); }
#cutin.exit .cutin-rays { background: repeating-conic-gradient(from 0deg, rgba(255, 230, 120, 0.45) 0 5deg, transparent 5deg 12deg); animation-duration: 6s; }
.cutin-content { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 1.2vh; padding: 16px; width: 100%; text-align: center; }
.cutin-label { font-family: var(--font-display); font-size: clamp(30px, 9vw, 64px); line-height: 1; color: #fff; -webkit-text-stroke: 3px var(--c3); paint-order: stroke fill; text-shadow: 0 0 24px var(--c2); opacity: 0; }
.cutin-content:has(.cutin-stamp.show) .cutin-label { display: none; }
.cutin-label.show { animation: stampIn 0.4s cubic-bezier(0.2, 2, 0.4, 1) both; }
#cutin.rainbow .cutin-label { -webkit-text-stroke-color: #3a0a5e; }
.cutin-stars { display: flex; gap: 2px; height: 1.2em; font-size: clamp(22px, 6vw, 40px); }
.star { color: #ffe066; text-shadow: 0 0 10px #ffb800, 0 2px 0 #8a4a00; animation: starPop 0.32s cubic-bezier(0.2, 2.2, 0.4, 1) both; }
@keyframes starPop { from { transform: scale(3) rotate(-90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cutin-art-wrap { position: relative; }
.cutin-art { font-size: min(36vw, 28vh); line-height: 1.1; filter: drop-shadow(0 0 30px var(--c1)) drop-shadow(0 10px 10px rgba(0, 0, 0, 0.4)); }
.cutin-art.slam { animation: slam 0.6s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
@keyframes slam { 0% { transform: scale(4) rotate(-20deg); opacity: 0; filter: blur(10px); } 60% { opacity: 1; filter: none; } 100% { transform: none; } }
#cutin.landed .cutin-art { animation: artBob 1.6s ease-in-out infinite; }
/* 正体隠し（着地で解除）。.cutin-art 自体は slam で filter を使うので子要素に掛ける */
.cutin-art > :not(.variant-canvas) { transition: filter var(--reveal-ms, 0ms) ease-out; }
#cutin.mask-sil .cutin-art > :not(.variant-canvas) { filter: brightness(0); }
#cutin.mask-mosaic .cutin-art > :not(.variant-canvas) { filter: url(#gxMosaic); transition: none; }
@keyframes artBob { 50% { transform: translateY(-8px) rotate(3deg) scale(1.04); } }
.cutin-new { position: absolute; top: 0; right: -16%; font-family: var(--font-display); font-size: clamp(18px, 5vw, 30px); color: #fff; background: #ff2e2e; padding: 2px 12px; border-radius: 99px; transform: rotate(14deg) scale(0); box-shadow: 0 3px 0 #7a0000; }
.cutin-new.show { animation: newPop 0.4s cubic-bezier(0.2, 2.4, 0.4, 1) forwards; }
@keyframes newPop { to { transform: rotate(14deg) scale(1); } }
.cutin-reel { font-family: var(--font-display); font-size: clamp(44px, 13vw, 110px); color: #fff; -webkit-text-stroke: 0.06em var(--c3); paint-order: stroke fill; text-shadow: 0 0 0.2em var(--c2), 0 0.07em 0 var(--c3); max-width: 96vw; }
#cutin.rainbow .cutin-reel { -webkit-text-stroke-color: #3a0a5e; }
.cutin-reel .reel-window { -webkit-text-stroke: inherit; }
.cutin-reel.done .reel-final { animation: namePop 0.55s cubic-bezier(0.2, 2, 0.4, 1) both; }
@keyframes namePop { 0% { transform: scale(2.2); opacity: 0; } 100% { transform: none; opacity: 1; } }
#cutin.exit .cutin-reel { color: #fff; -webkit-text-stroke-color: #8a0040; text-shadow: 0 0 0.25em #ff2e88, 0 0 0.6em #ffd700, 0 0.07em 0 #5a0026; }
.cutin-desc { max-width: 560px; white-space: pre-line; font-weight: 800; font-size: clamp(13px, 3.6vw, 17px); line-height: 1.6; background: rgba(0, 0, 0, 0.5); padding: 10px 16px; border-radius: 12px; opacity: 0; }
.cutin-desc:empty { display: none; }
.cutin-desc.show { animation: fadeUp 0.4s ease-out both; }
@keyframes fadeUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes stampIn { 0% { transform: scale(3); opacity: 0; } 100% { transform: none; opacity: 1; } }
.cutin-tap { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); right: 20px; z-index: 2; font-family: var(--font-display); font-size: 20px; color: #fff; opacity: 0.85; animation: tapPulse 0.6s ease-in-out infinite alternate; }
/* 「脱出確定!!!」は .cutin-content の先頭に並べ、絵・名前を押し下げて重ならないようにする（出る瞬間だけ場所を取る。空の見出しは畳む） */
.cutin-stamp {
  display: none; position: relative; z-index: 3; width: 100%; line-height: 1.05; margin-bottom: 0.12em; text-align: center; pointer-events: none; opacity: 0;
  font-family: var(--font-display); font-size: clamp(40px, min(12vw, 13vh), 130px); color: #fff; transform: rotate(-8deg);
  -webkit-text-stroke: 0.06em #8a0040; paint-order: stroke fill; text-shadow: 0 0 30px #ff2e88, 0 0 60px #ffd700, 0 8px 0 #5a0026;
}
.cutin-stamp.show { display: block; animation: exitStamp 0.7s cubic-bezier(0.2, 2, 0.4, 1) both, exitWobble 0.5s 0.7s ease-in-out infinite alternate; }
@keyframes exitStamp { 0% { transform: rotate(-8deg) scale(5); opacity: 0; } 100% { transform: rotate(-8deg) scale(1); opacity: 1; } }
@keyframes exitWobble { to { transform: rotate(-5deg) scale(1.08); } }

/* ---------------- blackout ---------------- */
#blackout {
  position: fixed; inset: 0; z-index: 60; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.12s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px;
}
#blackout.on { opacity: 1; pointer-events: auto; }
#blackout.beat { animation: beat 0.5s ease-out; }
@keyframes beat { 0% { background: #2a0010; } 100% { background: #000; } }
.bo-sign {
  font-family: var(--font-display); font-size: clamp(20px, 6vw, 40px); line-height: 1.35; text-align: center;
  padding: 10px 24px; border: 3px solid #3a1022; border-radius: 14px; color: #2a1020; opacity: 0.7;
}
.bo-sign.flicker { animation: boFlicker 1.3s steps(1) both; }
@keyframes boFlicker {
  0%, 9%, 21%, 37%, 52%, 66%, 81% { color: #2a1020; border-color: #3a1022; text-shadow: none; box-shadow: none; }
  6%, 15%, 30%, 45%, 59%, 75%, 90%, 100% { color: #ffe0ef; border-color: var(--pink); text-shadow: 0 0 8px var(--pink), 0 0 24px var(--pink); box-shadow: 0 0 24px var(--pink); }
}
.bo-sign.lit { color: #fff; opacity: 1; border-color: #fff; text-shadow: 0 0 10px var(--pink), 0 0 30px var(--pink), 0 0 60px var(--pink); box-shadow: 0 0 40px var(--pink), 0 0 90px var(--pink), inset 0 0 30px var(--pink); transform: scale(1.1); transition: transform 0.6s; }
.bo-sign.dead { color: #1a0a12; border-color: #1a0a12; opacity: 0.4; }
.bo-text { font-family: var(--font-display); font-size: clamp(20px, 6vw, 36px); color: #fff; min-height: 1.3em; }

/* ---------------- skip ---------------- */
.skip {
  position: fixed; top: max(12px, env(safe-area-inset-top)); right: 12px; z-index: 70;
  font-family: var(--font-display); font-size: 15px; padding: 8px 16px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.55); border: 2px solid rgba(255, 255, 255, 0.35); color: #fff;
}

/* ---------------- clear ---------------- */
#clear {
  display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 18px; padding: 24px 16px; text-align: center; overflow: auto;
  background: radial-gradient(ellipse at 50% 35%, #3a0a24, #0b0408 80%);
}
.clear-door-wrap { position: relative; height: min(42vh, 340px); aspect-ratio: 0.58; perspective: 900px; flex-shrink: 0; transition: transform 1.6s ease-in, height 0.6s ease; }
.clear-light { position: absolute; inset: 0; border-radius: 6px 6px 0 0; background: radial-gradient(ellipse, #fff, #ffe3f0 50%, #ff8ac0); box-shadow: 0 0 80px #ff8ac0, 0 0 200px #ff2e88; opacity: 0.2; transition: opacity 1.4s, box-shadow 1.4s; }
#clear.opened .clear-door { transform: rotateY(-108deg); }
#clear.opened .clear-light { opacity: 1; box-shadow: 0 0 120px #fff, 0 0 300px #ff2e88; }
/* 文字が出たら扉を縮める（transform だと場所を取ったままで下のボタンがはみ出すので高さごと） */
#clear.show-texts .clear-door-wrap { height: min(28vh, 250px); }
@media (max-width: 560px) {
  #clear { gap: 12px; }
  #clear.show-texts .clear-door-wrap { height: 20vh; }
  .clear-texts { gap: 10px; }
}
.clear-texts { opacity: 0; transform: translateY(20px); transition: opacity 0.6s, transform 0.6s; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#clear.show-texts .clear-texts { opacity: 1; transform: none; }
.clear-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(44px, 13vw, 96px); line-height: 1; color: #fff; text-shadow: 0 0 20px #ff2e88, 0 0 50px #ffd700, 0 6px 0 #8a0040; transform: rotate(-4deg); }
.clear-sub { font-weight: 800; font-size: clamp(14px, 4vw, 18px); line-height: 1.6; }
.clear-sub b { font-family: var(--font-display); font-weight: 400; font-size: 1.6em; color: var(--pink2); }
.clear-stats { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.clear-stats div { background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.clear-stats dt { font-size: 11px; color: var(--muted); font-weight: 800; }
.clear-stats dd { font-family: var(--font-display); font-size: 20px; }
.clear-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
/* 脱出画面の作者リンク（config.promo.clear）: 主ボタンより一段控えめ */
.clear-promo { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 2px; }
.clear-promo .btn { font-size: clamp(14px, 3.8vw, 16px); padding: 9px 18px; text-decoration: none; }
.btn .ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.4em; flex-shrink: 0; }
.btn-steam-link { background: linear-gradient(180deg, #2a475e, #171d25); color: #c7d5e0; border: 2px solid #66c0f4; box-shadow: 0 4px 0 #0b0f14; }
.btn-x-follow { background: #000; color: #fff; border: 2px solid rgba(255, 255, 255, 0.85); box-shadow: 0 4px 0 #333; }
.btn-share {
  background: #000; color: #fff; border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 5px 0 #333, 0 0 24px rgba(255, 255, 255, 0.25);
}
.share-card .share-preview { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #07040a; border: 1px solid var(--line); display: grid; place-items: center; }
.share-card .share-preview img { width: 100%; height: 100%; display: block; }
.share-card .share-loading { color: var(--muted); font-weight: 800; }
.share-card .share-note b { color: var(--pink2); }
.share-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.x-logo { font-family: system-ui, sans-serif; font-weight: 900; margin-right: 2px; }

/* ---------------- modal ---------------- */
#modal { background: rgba(0, 0, 0, 0.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(640px, 100%); max-height: 90vh; overflow: auto; background: #1a1022; border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 12px; user-select: text; }
.modal-card h2 { font-family: var(--font-display); font-weight: 400; font-size: 24px; }
.modal-note { font-size: 13px; color: var(--muted); font-weight: 800; }
.rate-list { display: flex; flex-direction: column; gap: 10px; }
.rate-row { border-left: 4px solid var(--c2); padding: 6px 10px; background: rgba(255, 255, 255, 0.04); border-radius: 0 10px 10px 0; }
.rate-row header { display: flex; gap: 10px; align-items: baseline; font-weight: 800; font-size: 13px; color: var(--muted); }
.rate-row .rlabel { font-family: var(--font-display); font-weight: 400; font-size: 20px; color: var(--c2); }
.rate-row .pct { margin-left: auto; font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--ink); }
.rate-items { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; font-size: 13px; }
.rate-item { color: var(--muted); opacity: 0.6; }
.rate-item.own { color: var(--ink); opacity: 1; }
.modal-card .btn { align-self: center; }
.rate-row .rate-item { opacity: 1; }

/* ---------------- 図鑑 ---------------- */
.modal-card.zukan { width: min(600px, 100%); max-height: 92vh; overflow: hidden; user-select: none; }
.modal-card.zukan h2 { display: flex; align-items: baseline; gap: 10px; }
.zk-total { font-size: 18px; color: var(--pink2); }
.zk-total small, .zk-count small { font-size: 0.65em; color: var(--muted); }
.zk-list { overflow-y: auto; min-height: 0; flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 2px 4px 8px; }
.zk-sec header { display: flex; gap: 10px; align-items: baseline; font-weight: 800; font-size: 13px; color: var(--muted); border-bottom: 2px solid var(--c2); padding-bottom: 4px; margin-bottom: 8px; }
.zk-sec .rlabel, .zk-title .rlabel { font-family: var(--font-display); font-weight: 400; font-size: 20px; color: var(--c2); }
.zk-count { margin-left: auto; font-family: var(--font-display); font-weight: 400; font-size: 16px; color: var(--ink); }
.zk-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.zk-tile { position: relative; padding: 0; border-radius: 7%; transition: transform 0.12s; }
.zk-tile:hover { transform: translateY(-3px) scale(1.03); }
.zk-tile:active { transform: scale(0.96); }
.zk-tile .card { cursor: pointer; pointer-events: none; }
.zk-tile .card-inner { transition: none; }
.zk-tile .card-name > span { display: inline-block; }
.zk-tile.locked .card { filter: saturate(0.35) brightness(0.55); }
.zk-tile.locked .back-logo { display: none; }
.zk-n { position: absolute; right: 4%; top: 3%; z-index: 3; font-family: var(--font-display); font-size: 12px; color: #fff; -webkit-text-stroke: 3px #000; paint-order: stroke fill; }
.zk-tile { display: flex; flex-direction: column; gap: 5px; }
.zk-vrow { display: flex; justify-content: center; gap: 4px; }
.zk-v { font-style: normal; font-family: var(--font-display); font-size: clamp(10px, 2.6vw, 13px); line-height: 1; flex: 1; max-width: 30px; padding: 4px 0 3px; border-radius: 6px; text-align: center; color: rgba(255, 255, 255, 0.3); background: rgba(0, 0, 0, 0.35); border: 1px dashed rgba(255, 255, 255, 0.3); }
.zk-v.on { border: 1px solid #fff; }
.zk-v.v-foil.on { color: #2a1040; background: var(--holo); background-size: 300% 100%; animation: rainbowSlide 2s linear infinite; box-shadow: 0 0 6px #fff8; }
.zk-v.v-glitch.on { color: #b6ff00; background: #000; border-color: #00ffd5; text-shadow: -1px 0 #ff00c8, 1px 0 #00ffd5; box-shadow: 1px 0 #ff00c8, -1px 0 #00ffd5; }
.zk-v.v-foil.v-glitch.on { color: #000; background: conic-gradient(from var(--fa, 0deg), #ff9ad5, #b6ff00, #8ad8ff, #ff00c8, #ff9ad5); animation: frameSpin 2s linear infinite; text-shadow: 0 0 2px #fff; box-shadow: 0 0 8px #ff00c8; }
.zk-tile.has-variant .card { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.45)); }
.zk-vsum { display: flex; flex-wrap: wrap; gap: 6px 14px; font-weight: 800; font-size: 13px; color: var(--ink); margin-top: -4px; }
.zk-vsum small { color: var(--muted); font-size: 0.85em; }
.zk-vs { font: inherit; color: inherit; padding: 3px 8px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.04); cursor: pointer; transition: background 0.12s, border-color 0.12s; }
.zk-vs:hover { border-color: rgba(255, 255, 255, 0.45); }
.zk-vs.on { border-color: #fff; background: rgba(255, 255, 255, 0.16); box-shadow: 0 0 8px rgba(255, 255, 255, 0.35); }
.zukan .zk-hide { display: none !important; }
.zk-empty { text-align: center; color: var(--muted); font-weight: 800; padding: 40px 0; }

/* 詳細は高さ固定（入手済み/未入手・説明の長さで窓の大きさが変わると ‹ › の位置がずれて送りにくい）。
   余り・不足は説明欄が吸収する（長ければ説明欄の中でスクロール） */
.zk-detail { align-items: center; overflow-y: auto; height: min(720px, 92vh); }
.zk-detail > * { flex-shrink: 0; }
.zk-detail .zk-desc { flex: 1 1 auto; flex-shrink: 1; min-height: 3.4em; overflow-y: auto; }
.zk-nav { display: flex; align-items: center; gap: 8px; align-self: stretch; }
.zk-nav .btn { padding: 6px 14px; font-size: 14px; margin-right: auto; }
.zk-pos { font-weight: 800; font-size: 13px; color: var(--muted); min-width: 4.5em; text-align: center; }
.zk-arrow { width: 36px; height: 36px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); font-size: 24px; line-height: 1; color: var(--ink); }
.zk-stage { width: min(240px, 58vw); padding: 10px 0 4px; }
.zk-stage .card { width: 100%; cursor: default; }
.zk-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; }
.zk-name { font-family: var(--font-display); font-size: 26px; }
.zk-own { font-size: 13px; font-weight: 800; color: var(--muted); }
.zk-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; align-self: stretch; }
.zk-tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); border: 2px solid var(--line); font-size: 13px; }
.zk-tab b { max-width: 100%; text-align: center; line-height: 1.15; word-break: keep-all; font-size: clamp(10px, 3vw, 14px); }
.zk-tab small { font-size: 11px; font-weight: 800; color: var(--muted); }
.zk-tab.none { opacity: 0.4; cursor: not-allowed; filter: grayscale(1); }
.zk-tab.on { border-color: var(--c2); background: color-mix(in srgb, var(--c2) 22%, transparent); opacity: 1; box-shadow: 0 0 12px color-mix(in srgb, var(--c2) 50%, transparent); }
.zk-desc { align-self: stretch; background: rgba(0, 0, 0, 0.3); border-left: 4px solid var(--c2); border-radius: 0 10px 10px 0; padding: 10px 14px; font-size: 14px; line-height: 1.7; font-weight: 500; min-height: 3.4em; }
.zk-hint { font-size: 12px; color: var(--muted); }
.zk-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 560px) {
  .zk-grid { gap: 7px; }
  .zk-n { font-size: 10px; }
  .zk-tab { font-size: 11px; }
  .modal-card.zukan { padding: 14px; }
  .zk-detail { height: min(760px, 92vh); }
  .zk-actions { flex-wrap: nowrap; gap: 8px; }
  .zk-actions .btn { font-size: 15px; padding: 10px 14px; white-space: nowrap; }
}

/* ---------------- misc ---------------- */
.data-error { position: fixed; left: 8px; bottom: 8px; z-index: 90; background: #600; color: #fff; padding: 10px; border-radius: 8px; font-size: 12px; max-width: 90vw; }
.debug { position: fixed; left: 8px; top: 8px; z-index: 90; display: flex; gap: 4px; align-items: center; background: rgba(0, 0, 0, 0.7); padding: 6px; border-radius: 8px; font-size: 11px; }
.debug button { padding: 2px 6px; border: 1px solid #888; border-radius: 4px; font-size: 11px; }
.debug button.on { background: var(--pink); }
.debug-fx { flex-basis: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 3px; margin-top: 4px; padding-top: 6px; border-top: 1px solid #555; max-height: 70vh; overflow-y: auto; }
.debug-fx .fx-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.debug-fx .fx-label { display: flex; flex-direction: column; line-height: 1.2; }
.debug-fx .fx-label small { color: #aaa; font-size: 10px; }
.debug-fx .seg { display: inline-flex; flex-shrink: 0; }
.debug-fx .seg button { border-radius: 0; margin-left: -1px; }
.debug-fx .seg button:first-child { border-radius: 4px 0 0 4px; }
.debug-fx .seg button:last-child { border-radius: 0 4px 4px 0; }
.debug-fx .fx-reset { align-self: flex-start; margin-top: 2px; }
.debug-fx .fx-log { color: #aaa; line-height: 1.5; }
.debug-fx .fx-log .hit { color: #ffd84d; }

@media (max-height: 640px) {
  .scene { --door-h: 24vh; }
  .neon-sign { font-size: 12px; padding: 4px 12px; }
  .pull-btn { padding: 8px 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .pull-btn::after, .neon-sign, .poster.posting, .pull-btn.seal-shake .seal { animation: none; }
}

/* ---------- 専用アニメ絵（js/arts.js） ---------- */
.art-anim { display: block; width: 1.3em; height: 1.3em; position: relative; }
.art-anim .aa-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.aa-blush { fill: #ff4f8b; opacity: 0.2; }
.aa-pop { font-family: var(--font-display); fill: #fff; stroke: #8a0040; stroke-width: 1.6px; paint-order: stroke fill; stroke-linejoin: round; }
.aa-pop-small { fill: #ffe3f0; }
.aa-pop-heart { fill: #ff2e88; stroke: #fff; stroke-width: 1.2px; }
.aa-pop-emoji { stroke: none; }
.aa-mosaic { opacity: 0; }
.aa-censor { font-family: var(--font-display); fill: #ffe066; }
.aa-kanji { font-family: 'Shippori Mincho B1', 'Yu Mincho', 'YuMincho', 'Hiragino Mincho ProN', 'Noto Serif JP', serif; font-weight: 800; stroke: #2a0014; stroke-width: 3px; stroke-linejoin: round; paint-order: stroke fill; }
.aa-fitglow { fill: #fff6a8; opacity: 0; mix-blend-mode: screen; filter: blur(3px); }
/* カットインの「ふわふわ」はアニメ絵の邪魔なので弱める */
#cutin.landed .cutin-art:has(.art-anim) { animation: artBobSoft 2.4s ease-in-out infinite; }
@keyframes artBobSoft { 50% { transform: translateY(-4px) scale(1.02); } }
