/* ============================================================
 * 特殊バージョン（フォイル / グリッチ）
 *  絵と地のエフェクトは js/holo.js の WebGL シェーダー。ここは枠・文字・画面揺らし。
 * ============================================================ */
@property --fa { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
:root {
  --holo: linear-gradient(105deg, #fff 0%, #ffc6ec 14%, #b8f3ff 28%, #fff7b0 42%, #dcc2ff 56%, #b8ffd9 70%, #ffc6ec 84%, #fff 100%);
  --gc: #00f0ff; --gm: #ff00c8;
  --mono: 'Consolas', 'Courier New', monospace;
}
#vfx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 45; }

/* --- カード --- */
.variant-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.card.has-shader .card-art > .art-emoji, .card.has-shader .card-art > .art-img { visibility: hidden; }

/* --- 奥行き / 飛び出し ---
 *  カード面（.card-face）: シェーダーが「奥に沈んだ層」を傾きと逆向きにずらして描く（視差）
 *  .card-pop: 面の兄弟。表面と同じ向きで translateZ して本物の 3D で手前に浮かぶ（枠 < 絵 < バッジ）
 *  傾きは director.tiltSpring がバネで --rx/--ry/--tx/--ty を書く */
.card.variant { perspective: 560px; --dz-frame: 2.5cqw; --dz-art: 24cqw; --dz-badge: 34cqw; }
.card-art-spacer { flex: 1; min-height: 0; }
.card-pop { position: absolute; inset: 0; transform: rotateY(180deg); transform-style: preserve-3d; pointer-events: none; border-radius: 7cqw; }
.card-pop > * { position: absolute; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.card-pop .pop-frame, .card-pop .pop-badge { inset: 0; border-radius: inherit; }
.card-pop .pop-frame { transform: translateZ(var(--dz-frame)); }
.card-pop .pop-art { transform: translateZ(var(--dz-art)); }
.card-pop .pop-badge { transform: translateZ(var(--dz-badge)); }
.card-pop .card-art { position: absolute; inset: 0; }
.card-pop .card-art .variant-canvas { inset: auto; left: 50%; top: 50%; width: 1.9em; height: 1.9em; transform: translate(-50%, -50%); z-index: 0; }
.card.has-shader .card-pop .card-art { filter: none; }
/* 浮いたバッジの影は面に落ちる感じに濃いめ */
.card-pop .variant-badge { box-shadow: 0 1.6cqw 3cqw rgba(0, 0, 0, 0.5); }
/* カードの下に落ちる影（傾きと逆にずれる） */
.card-shadow {
  position: absolute; inset: 8% 6% 0; border-radius: 9cqw; pointer-events: none; opacity: 0;
  background: rgba(20, 0, 40, 0.75); filter: blur(5cqw);
  transform: translate(calc(var(--tx, 0) * -9cqw), calc(7cqw + var(--ty, 0) * -9cqw)) scale(0.94);
  transition: opacity 0.4s, scale 0.35s;
}
.card.variant.flipped .card-shadow { opacity: 1; }
.card.variant.flipped.tilting .card-shadow { scale: 1.06; opacity: 0.85; }
.card.v-foil .card-shadow { background: rgba(90, 40, 160, 0.75); }
.card.v-glitch .card-shadow { background: linear-gradient(90deg, rgba(255, 0, 200, 0.6), rgba(0, 240, 255, 0.6)); }
/* バネ駆動中は CSS のトランジションを切って、持ち上げ（scale）だけふわっと */
.card.spring .card-tilt, .card.spring.tilting .card-tilt {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: scale 0.4s cubic-bezier(0.3, 1.7, 0.5, 1);
}
.card.spring.tilting .card-tilt { scale: 1.1; }
.card.spring.tilting { z-index: 5; }
.card.spring { touch-action: none; } /* スマホで指でなぞって傾けられるように（スクロールに取られない） */
.card.spring .card-glare { opacity: calc(0.18 + 0.3 * max(var(--tx, 0), -1 * var(--tx, 0), var(--ty, 0), -1 * var(--ty, 0))); }
@media (prefers-reduced-motion: reduce) { .card.variant { --dz-art: 12cqw; --dz-badge: 16cqw; } }
.card.variant .card-name { position: relative; z-index: 2; }
.variant-frame {
  position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit; padding: 2.4cqw;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
}
.variant-badge {
  position: absolute; z-index: 4; left: 5%; top: 21%; font-family: var(--font-display); font-size: 8cqw; line-height: 1.2;
  padding: 0.6cqw 2.6cqw; border-radius: 1.6cqw; transform: rotate(-7deg); white-space: nowrap;
}

/* FOIL */
.card.v-foil .card-front { border-color: #fff; box-shadow: 0 0 18px rgba(255, 255, 255, 0.85), 0 0 34px rgba(190, 160, 255, 0.7); }
.card.v-foil .variant-frame { background: conic-gradient(from var(--fa), #ff9ad5, #ffe98a, #9dffb0, #8ad8ff, #c79bff, #ff9ad5); animation: frameSpin 2.6s linear infinite; }
@keyframes frameSpin { to { --fa: 360deg; } }
.card.v-foil .variant-badge { color: #2a1040; background: var(--holo); background-size: 300% 100%; animation: rainbowSlide 2s linear infinite; box-shadow: 0 0 2.4cqw #fff, 0 0.8cqw 0 #6b3a8a; }
.card.v-foil .reel-final {
  background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: rainbowSlide 2.4s linear infinite; filter: drop-shadow(0 0 1.5cqw rgba(255, 255, 255, 0.7));
}
.card.v-foil .card-rarity {
  background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 0; animation: rainbowSlide 2.4s linear infinite; filter: drop-shadow(0 0.6cqw 0 var(--c3)) drop-shadow(0 0 1.5cqw #fff);
}
.card-back.hint-foil::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 220, 250, 0.9) 47%, rgba(190, 245, 255, 0.95) 50%, rgba(255, 250, 200, 0.9) 53%, transparent 62%);
  background-size: 300% 100%; animation: holo 2.8s ease-in-out infinite;
}

/* GLITCH */
.card.v-glitch .card-front { box-shadow: -3px 0 14px var(--gm), 3px 0 14px var(--gc); }
.card.v-glitch .variant-frame { background: repeating-linear-gradient(0deg, var(--gc) 0 3cqw, #000 3cqw 4cqw, var(--gm) 4cqw 7cqw, #fff 7cqw 7.6cqw); animation: frameGlitch 0.9s steps(1) infinite; }
@keyframes frameGlitch {
  0% { background-position: 0 0; transform: none; }
  20% { background-position: 0 9cqw; }
  41% { transform: translateX(1.6cqw); }
  44% { transform: none; background-position: 0 -4cqw; }
  70% { filter: hue-rotate(90deg); }
  74% { filter: none; }
  88% { transform: translate(-1cqw, 0.6cqw) skewX(4deg); }
  91% { transform: none; }
}
.card.v-glitch .variant-badge { color: #b6ff00; background: #000; font-family: var(--mono); font-weight: 800; letter-spacing: 0.08em; border: 0.5cqw solid var(--gc); animation: txtGlitch 1.6s steps(1) infinite; }
.card.v-glitch .card-name, .card.v-glitch .card-rarity { animation: txtGlitch 1.9s steps(1) infinite; }
@keyframes txtGlitch {
  0% { text-shadow: -0.07em 0 var(--gm), 0.07em 0 var(--gc); transform: none; clip-path: none; }
  6% { text-shadow: 0.18em 0 var(--gm), -0.18em 0 var(--gc); transform: translateX(0.25em) skewX(-14deg); }
  9% { transform: none; text-shadow: -0.07em 0 var(--gm), 0.07em 0 var(--gc); }
  37% { clip-path: inset(0 0 52% 0); transform: translateX(-0.3em); }
  39% { clip-path: inset(48% 0 0 0); transform: translateX(0.25em); }
  41% { clip-path: none; transform: none; }
  73% { filter: invert(1); }
  75% { filter: none; }
  90% { transform: translateY(-0.1em) scaleX(1.15); text-shadow: 0.12em 0 var(--gc), -0.12em 0 var(--gm); }
  92% { transform: none; }
}
.card-back.hint-glitch .back-mark { animation: markGlitch 2.2s steps(1) infinite; }
@keyframes markGlitch {
  0%, 100% { transform: none; }
  62% { transform: translateX(-12%) skewX(20deg); text-shadow: 6px 0 var(--gm), -6px 0 var(--gc); }
  64% { transform: translateX(9%); clip-path: inset(0 0 50% 0); }
  66% { transform: none; clip-path: none; }
  86% { transform: scaleY(0.25); filter: invert(1); }
  87% { transform: none; filter: none; }
}
.card-back.hint-glitch::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 255, 240, 0.35) 0 2px, transparent 2px 5px); animation: scanFlick 2.2s steps(1) infinite;
}
@keyframes scanFlick { 0%, 100% { opacity: 0; } 62% { opacity: 1; transform: translateX(6%); } 67% { opacity: 0; transform: none; } 86% { opacity: 0.8; } 88% { opacity: 0; } }

/* FOIL × GLITCH */
.card.v-foil.v-glitch .variant-frame { animation: frameSpin 1.3s linear infinite, frameGlitch 0.7s steps(1) infinite; }
.card.v-foil.v-glitch .variant-badge { color: #2a1040; background: var(--holo); background-size: 300% 100%; border: 0; font-family: var(--font-display); animation: txtGlitch 1.3s steps(1) infinite, rainbowSlide 1s linear infinite; }
.card.v-foil.v-glitch .card-front { box-shadow: -4px 0 18px var(--gm), 4px 0 18px var(--gc), 0 0 30px #fff; }
.card.v-foil.v-glitch .reel-final { animation: rainbowSlide 1.2s linear infinite, txtGlitch 1.5s steps(1) infinite; }

/* --- カットイン --- */
.cutin-vfx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.cutin-art { position: relative; }
.cutin-art .variant-canvas { inset: auto; left: 50%; top: 50%; width: 1.9em; height: 1.9em; transform: translate(-50%, -50%); }
.cutin-art.has-shader > .art-emoji, .cutin-art.has-shader > .art-img { visibility: hidden; }
.cutin-variant { height: 0; overflow: visible; font-family: var(--font-display); font-size: clamp(20px, 5.4vw, 38px); line-height: 1; opacity: 0; position: relative; z-index: 3; white-space: nowrap; }
.cutin-variant.show { animation: stampIn 0.45s cubic-bezier(0.2, 2.2, 0.4, 1) both; }
#cutin.v-foil .cutin-variant { color: transparent; background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 0 10px #fff) drop-shadow(0 3px 0 #6b3a8a); }
#cutin.v-foil .cutin-variant.show { animation: stampIn 0.45s cubic-bezier(0.2, 2.2, 0.4, 1) both, rainbowSlide 1.6s linear infinite; }
#cutin.v-glitch .cutin-variant { color: #b6ff00; font-family: var(--mono); font-weight: 800; text-shadow: -3px 0 var(--gm), 3px 0 var(--gc); }
#cutin.v-glitch .cutin-variant.show { animation: stampIn 0.45s both, txtGlitch 1.4s steps(1) infinite 0.45s; }
#cutin.v-foil.v-glitch .cutin-variant { font-family: var(--font-display); color: transparent; }
#cutin.v-foil.v-glitch .cutin-variant.show { animation: stampIn 0.45s both, rainbowSlide 0.9s linear infinite, txtGlitch 1.2s steps(1) infinite 0.45s; }
#cutin.v-foil .cutin-reel .reel-final { color: transparent; background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: rainbowSlide 2s linear infinite; }
#cutin.v-glitch .cutin-reel .reel-final { animation: txtGlitch 1.7s steps(1) infinite; }
#cutin.v-foil.v-glitch .cutin-reel .reel-final { animation: rainbowSlide 1s linear infinite, txtGlitch 1.4s steps(1) infinite; }
#cutin.v-glitch .cutin-desc { font-family: var(--mono); text-shadow: -1px 0 var(--gm), 1px 0 var(--gc); }

/* --- 画面中央の「FOIL!!」 --- */
#variantPop { position: fixed; inset: 0; z-index: 66; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1vh; opacity: 0; }
#variantPop.show { animation: vpLife 1.5s ease-out forwards; }
#variantPop.show.combo { animation: vpLife 2.6s ease-out forwards; }
@keyframes vpLife { 0% { opacity: 0; } 6% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
.vp-main { position: relative; font-family: var(--font-display); font-size: clamp(50px, 15vw, 160px); line-height: 1; white-space: nowrap; color: #fff; }
.vp-sub { font-family: var(--font-display); font-size: clamp(16px, 4.4vw, 30px); color: #fff; text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 3px 0 #000; }
#variantPop.show .vp-main { animation: vpSlam 0.55s cubic-bezier(0.2, 2, 0.4, 1) both; }
#variantPop.show .vp-sub { animation: fadeUp 0.4s ease-out 0.25s both; }
@keyframes vpSlam { 0% { transform: scale(3.2) rotate(-8deg); opacity: 0; filter: blur(12px); } 100% { transform: rotate(-4deg); opacity: 1; filter: none; } }
#variantPop.v-foil .vp-main {
  color: transparent; background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 0.02em rgba(255, 255, 255, 0.9);
  filter: drop-shadow(0 0 0.12em #fff) drop-shadow(0 0 0.3em #c79bff) drop-shadow(0 0.06em 0 #4a1e6a);
}
#variantPop.show.v-foil .vp-main { animation: vpSlam 0.55s cubic-bezier(0.2, 2, 0.4, 1) both, rainbowSlide 1.2s linear infinite; }
#variantPop.v-glitch .vp-main { font-family: var(--mono); font-weight: 900; color: #b6ff00; text-shadow: -0.04em 0 var(--gm), 0.04em 0 var(--gc); }
#variantPop.v-glitch .vp-main::before, #variantPop.v-glitch .vp-main::after { content: attr(data-text); position: absolute; inset: 0; text-shadow: none; -webkit-text-stroke: 0; }
#variantPop.v-glitch .vp-main::before { color: var(--gc); animation: sliceA 0.5s steps(1) infinite; }
#variantPop.v-glitch .vp-main::after { color: var(--gm); animation: sliceB 0.42s steps(1) infinite; }
@keyframes sliceA { 0% { clip-path: inset(10% 0 70% 0); transform: translateX(-0.08em); } 25% { clip-path: inset(55% 0 20% 0); transform: translateX(0.12em); } 50% { clip-path: inset(30% 0 50% 0); transform: translateX(-0.04em); } 75% { clip-path: inset(80% 0 5% 0); transform: translateX(0.07em); } }
@keyframes sliceB { 0% { clip-path: inset(65% 0 10% 0); transform: translateX(0.1em); } 33% { clip-path: inset(5% 0 80% 0); transform: translateX(-0.12em); } 66% { clip-path: inset(40% 0 35% 0); transform: translateX(0.05em); } }
#variantPop.show.v-glitch .vp-main { animation: vpSlam 0.35s steps(4) both, txtGlitch 0.9s steps(1) infinite 0.35s; }
#variantPop.v-foil.v-glitch .vp-main { font-family: var(--font-display); color: transparent; text-shadow: none; }
#variantPop.show.v-foil.v-glitch .vp-main { animation: vpSlam 0.4s steps(5) both, rainbowSlide 0.8s linear infinite, txtGlitch 0.8s steps(1) infinite 0.4s; }
#variantPop.v-glitch .vp-sub { font-family: var(--mono); color: #b6ff00; }

/* --- 画面ごとバグる --- */
body.glitching #stage { animation: stageGlitch 0.52s steps(1) infinite; }
@keyframes stageGlitch {
  0% { transform: translateX(-2.5%) skewX(5deg); filter: hue-rotate(120deg) saturate(2.5); }
  12% { transform: translate(3%, 1%); filter: contrast(1.8) brightness(1.3); clip-path: inset(0 0 8% 0); }
  24% { transform: none; filter: invert(1); clip-path: none; }
  30% { filter: none; transform: scaleY(1.04) translateX(-1%); }
  48% { transform: translateX(1.5%) skewX(-8deg); filter: hue-rotate(-90deg); clip-path: inset(6% 0 0 0); }
  62% { transform: none; filter: none; clip-path: none; }
  78% { transform: translateY(-1.5%) scaleX(1.03); filter: saturate(4) hue-rotate(200deg); }
  90% { transform: none; filter: none; }
}

/* --- 結果 / 提供割合 --- */
.vlabel { font-family: var(--font-display); font-weight: 400; }
.vlabel.v-foil { background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: rainbowSlide 2s linear infinite; }
.vlabel.v-glitch { color: #b6ff00; text-shadow: -2px 0 var(--gm), 2px 0 var(--gc); }
.vlabel.v-foil.v-glitch { color: transparent; text-shadow: none; }

/* --- デバッグ: 見本ギャラリー --- */
.debug { flex-wrap: wrap; max-width: calc(100vw - 16px); }
.debug .sep { width: 1px; height: 16px; background: #666; margin: 0 4px; }
.modal-card.gallery { width: min(880px, 100%); }
.gallery-ctl { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gallery-ctl select { font: inherit; padding: 6px; border-radius: 8px; background: #2a1d35; color: #fff; border: 1px solid var(--line); max-width: 100%; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 8px 4px; }
.gallery-cell { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.gallery-cell .card { width: 100%; cursor: default; }
.gallery-cell .cap { font-size: 12px; font-weight: 800; color: var(--muted); }
.gallery-cell .btn { padding: 6px 10px; font-size: 12px; }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

@media (prefers-reduced-motion: reduce) {
  body.glitching #stage { animation: none; }
}


/* ---------------- 特殊版セックスで脱出（#clear.vexit .v-foil / .v-glitch / .v-combo） ---------------- */
.clear-vfx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; mix-blend-mode: screen; }
#clear.vexit > :not(.clear-vfx) { position: relative; z-index: 1; }
#clear.v-foil { background: radial-gradient(ellipse at 50% 35%, #3b2366, #140a2a 55%, #05030c 90%); }
#clear.v-glitch { background: repeating-linear-gradient(0deg, rgba(0, 240, 255, 0.05) 0 2px, transparent 2px 4px), radial-gradient(ellipse at 50% 35%, #0d2a2c, #05070a 80%); }
#clear.v-foil.v-glitch { background: repeating-linear-gradient(0deg, rgba(255, 0, 200, 0.05) 0 2px, transparent 2px 4px), radial-gradient(ellipse at 50% 35%, #3b2366, #0a1420 60%, #040308 90%); }

/* 扉の向こうの光 */
#clear.v-foil .clear-light { background: conic-gradient(from var(--fa, 0deg), #fff, #ffc6ec, #b8f3ff, #fff7b0, #dcc2ff, #b8ffd9, #fff); animation: frameSpin 3s linear infinite; }
#clear.v-foil.opened .clear-light { box-shadow: 0 0 120px #fff, 0 0 240px #c79bff, 0 0 360px #8ad8ff; }
#clear.v-glitch .clear-light { background: repeating-linear-gradient(0deg, #fff 0 6px, #b8fff9 6px 9px, #fff 9px 15px, #ffc2f3 15px 17px); animation: lightGlitch 0.8s steps(1) infinite; }
#clear.v-glitch.opened .clear-light { box-shadow: -14px 0 120px var(--gm), 14px 0 120px var(--gc), 0 0 260px #b6ff00; }
#clear.v-foil.v-glitch .clear-light { background: conic-gradient(from var(--fa, 0deg), #fff, #ffc6ec, #b8f3ff, #b6ff00, #dcc2ff, #00f0ff, #fff); animation: frameSpin 1.6s linear infinite, lightGlitch 0.8s steps(1) infinite; }
@keyframes lightGlitch {
  0%, 100% { filter: none; transform: none; }
  13% { filter: hue-rotate(90deg) saturate(3); transform: translateX(4px); }
  16% { filter: none; transform: none; }
  58% { filter: invert(0.15) contrast(1.6); transform: translateX(-6px) skewX(4deg); }
  62% { filter: none; transform: none; }
}

/* 扉のバッジ（ステッカー） */
.clear-vbadge {
  position: absolute; top: -6%; right: -34%; z-index: 3; display: flex; flex-direction: column; align-items: center; line-height: 1;
  padding: 0.35em 0.7em 0.4em; border-radius: 12px; font-family: var(--font-display); font-size: clamp(18px, 4.6vw, 30px);
  transform: rotate(12deg) scale(0); opacity: 0; pointer-events: none;
}
.clear-vbadge small { font-family: var(--font-display); font-size: 0.5em; margin-top: 0.25em; opacity: 0.85; }
#clear.vbadge-on .clear-vbadge { animation: vbadgeSlap 0.42s cubic-bezier(0.2, 2.2, 0.4, 1) both; }
@keyframes vbadgeSlap { 0% { transform: rotate(-20deg) scale(3); opacity: 0; } 100% { transform: rotate(12deg) scale(1); opacity: 1; } }
#clear.v-foil .clear-vbadge { color: #2a1040; background: var(--holo); background-size: 300% 100%; box-shadow: 0 0 18px #fff, 0 4px 0 #6b3a8a; }
#clear.v-foil.vbadge-on .clear-vbadge { animation: vbadgeSlap 0.42s cubic-bezier(0.2, 2.2, 0.4, 1) both, rainbowSlide 2s linear infinite; }
#clear.v-glitch .clear-vbadge { color: #b6ff00; background: #000; border: 3px solid var(--gc); font-family: var(--mono); font-weight: 900; box-shadow: -4px 0 0 var(--gm), 4px 0 0 var(--gc); }
#clear.v-glitch.vbadge-on .clear-vbadge { animation: vbadgeSlap 0.42s steps(5) both, txtGlitch 1.6s steps(1) infinite 0.5s; }
#clear.v-foil.v-glitch .clear-vbadge { color: #2a1040; background: var(--holo); background-size: 300% 100%; border: 0; font-family: var(--font-display); }
#clear.v-foil.v-glitch.vbadge-on .clear-vbadge { animation: vbadgeSlap 0.42s cubic-bezier(0.2, 2.2, 0.4, 1) both, rainbowSlide 1s linear infinite, txtGlitch 1.3s steps(1) infinite 0.5s; }

/* 見出し */
#clear.v-foil .clear-title {
  color: transparent; background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text;
  text-shadow: none; filter: drop-shadow(0 0 14px #fff) drop-shadow(0 6px 0 #5a2a8a); animation: rainbowSlide 1.8s linear infinite;
}
#clear.v-glitch .clear-title { position: relative; color: #fff; text-shadow: -0.05em 0 var(--gm), 0.05em 0 var(--gc), 0 6px 0 #003a3f; }
#clear.v-glitch .clear-title::before, #clear.v-glitch .clear-title::after { content: attr(data-text); position: absolute; inset: 0; text-shadow: none; }
#clear.v-glitch .clear-title::before { color: var(--gc); animation: sliceA 0.6s steps(1) infinite; }
#clear.v-glitch .clear-title::after { color: var(--gm); animation: sliceB 0.5s steps(1) infinite; }
#clear.v-foil.v-glitch .clear-title { color: transparent; filter: drop-shadow(-3px 0 var(--gm)) drop-shadow(3px 0 var(--gc)) drop-shadow(0 0 16px #fff); }
#clear.v-foil.v-glitch .clear-title::before, #clear.v-foil.v-glitch .clear-title::after { -webkit-text-fill-color: currentColor; }

/* 「○○版セックス」と自慢の一言 */
.clear-vname { font-family: var(--font-display); font-weight: 400; font-size: 1.25em; padding: 0 0.1em; }
#clear.v-foil .clear-vname { color: transparent; background: var(--holo); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; animation: rainbowSlide 2s linear infinite; filter: drop-shadow(0 0 6px #fff8); }
#clear.v-glitch .clear-vname { color: #b6ff00; text-shadow: -2px 0 var(--gm), 2px 0 var(--gc); animation: txtGlitch 2.2s steps(1) infinite; display: inline-block; }
.clear-brag { font-weight: 900; font-size: clamp(13px, 3.6vw, 16px); padding: 6px 16px; border-radius: 999px; }
#clear.v-foil .clear-brag { color: #2a1040; background: var(--holo); background-size: 300% 100%; animation: rainbowSlide 3s linear infinite; box-shadow: 0 0 16px #fff8; }
#clear.v-glitch .clear-brag { color: #b6ff00; background: #000; border: 2px solid var(--gc); font-family: var(--mono); box-shadow: -3px 0 0 var(--gm), 3px 0 0 var(--gc); }
#clear.v-foil.v-glitch .clear-brag { color: #2a1040; background: var(--holo); background-size: 300% 100%; border: 0; font-family: inherit; animation: rainbowSlide 1.4s linear infinite; box-shadow: -3px 0 0 var(--gm), 3px 0 0 var(--gc), 0 0 16px #fff8; }

/* ときどき画面ごとバグる（director startClearVariantFx） */
#clear.vglitch-burst .clear-door-wrap, #clear.vglitch-burst .clear-texts { animation: clearBurst 0.36s steps(1); }
@keyframes clearBurst {
  0% { translate: -8px 0; filter: hue-rotate(120deg) saturate(2.5); clip-path: inset(0 0 12% 0); }
  25% { translate: 10px 2px; filter: contrast(1.8) brightness(1.3); clip-path: inset(20% 0 0 0); }
  50% { translate: -4px -2px; filter: invert(0.85) hue-rotate(180deg); clip-path: none; }
  75% { translate: 6px 0; filter: none; }
  100% { translate: 0 0; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  #clear.vglitch-burst .clear-door-wrap, #clear.vglitch-burst .clear-texts { animation: none; }
}
/* 特殊版は自慢の一言が増えるぶん、スマホでは扉と記録を少し詰めて1画面に収める */
@media (max-width: 560px) {
  #clear.vexit.show-texts .clear-door-wrap { height: 16vh; }
  #clear.vexit .clear-title { font-size: clamp(38px, 11vw, 96px); }
  #clear.vexit .clear-stats { gap: 6px; flex-wrap: nowrap; }
  #clear.vexit .clear-stats div { padding: 6px 8px; }
  #clear.vexit .clear-stats dd { font-size: 16px; white-space: nowrap; }
  #clear.vexit .clear-vbadge { right: -42%; }
}
/* 合体版: 透明文字に text-shadow が透けてにじむので、ずれ色は drop-shadow で */
#clear.v-foil.v-glitch .clear-title { text-shadow: none; filter: drop-shadow(-3px 0 var(--gm)) drop-shadow(3px 0 var(--gc)) drop-shadow(0 5px 0 #3a1a5a); }
#clear.v-foil.v-glitch .clear-vname { color: transparent; text-shadow: none; filter: drop-shadow(-2px 0 var(--gm)) drop-shadow(2px 0 var(--gc)); animation: rainbowSlide 1.4s linear infinite, txtGlitch 2.2s steps(1) infinite; }
