/* ---------- PC の中から覗かれている開幕状態（fx.insidePc）。□＝モニター、外側＝PC の内部 ---------- */
.pcview { position: absolute; inset: 0; z-index: 1; background: #05070d; overflow: hidden; transition: background 1.2s ease .3s; }
.pcview-code { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .92; transition: opacity 1s ease; }
.pcview-monitor {
  position: absolute; left: 50%; top: 44%;
  width: min(92vw, 78svh * 1.406); aspect-ratio: 1440 / 1024;
  transform: translate(-50%, -50%);
  background: #0b1020; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(143,211,255,.45), 0 0 36px rgba(143,211,255,.22), 0 30px 90px rgba(0,0,0,.65);
  transition: left 1.5s cubic-bezier(.2,.7,.15,1), top 1.5s cubic-bezier(.2,.7,.15,1), width 1.5s cubic-bezier(.2,.7,.15,1), height 1.5s cubic-bezier(.2,.7,.15,1), transform 1.5s cubic-bezier(.2,.7,.15,1), border-radius 1s ease, box-shadow .8s ease;
}
.pcview-monitor.is-full { left: 0; top: 0; width: 100%; height: 100% !important; transform: none; border-radius: 0; box-shadow: none; }
.pcview-glare {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; transition: opacity 1s ease;
  background:
    repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    linear-gradient(115deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,.03) 28%, transparent 50%);
}
.pcview-monitor.is-full .pcview-glare { opacity: 0; }

/* 生きている絵：画像＋（描かれている矩形に合わせた）効果レイヤー */
.living { position: absolute; inset: 0; overflow: hidden; }
.living-inner { position: absolute; inset: 0; transform-origin: 50% 40%; }
.living-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; opacity: 0; transition: opacity .9s ease; }
.living-img.is-loaded { opacity: 1; }
.living-fx { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; }
.fx-lamp {
  position: absolute; left: 11%; top: 44%; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; mix-blend-mode: screen;
  background: radial-gradient(circle, rgba(255,200,130,.55) 0%, rgba(255,170,80,.16) 40%, transparent 68%);
  animation: lamp 3.8s ease-in-out infinite;
}
@keyframes lamp { 0%,100% { opacity: .45; transform: translate(-50%,-50%) scale(.96); } 50% { opacity: 1; transform: translate(-50%,-50%) scale(1.1); } }
.fx-snow { position: absolute; left: 57%; top: 0; width: 43%; height: 66%; opacity: .9; }
.fx-steam { position: absolute; left: 86%; top: 60%; width: 7%; height: 26%; transform: translate(-50%, -100%); }
.fx-steam i {
  position: absolute; left: 50%; bottom: 0; width: 70%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.5), rgba(255,255,255,.1) 55%, transparent 72%);
  will-change: transform, opacity; opacity: 0; animation: steam 3.4s linear infinite;
}
.fx-steam i:nth-child(2) { animation-delay: .9s; width: 55%; }
.fx-steam i:nth-child(3) { animation-delay: 1.7s; width: 80%; }
.fx-steam i:nth-child(4) { animation-delay: 2.6s; width: 50%; }
@keyframes steam {
  0%   { transform: translate(-50%, 0) scale(.5); opacity: 0; }
  15%  { opacity: .75; }
  100% { transform: translate(-20%, -230%) scale(1.7) rotate(12deg); opacity: 0; }
}
/* 髪だけ揺れる：同じ絵を頭の周り（顔を除く）だけマスクして乱流フィルタ */
.living-hair {
  position: absolute; inset: 0; display: none; pointer-events: none;
  background-size: 100% 100%; background-repeat: no-repeat;
  -webkit-mask-image: radial-gradient(ellipse 24% 20% at 50% 11%, #000 45%, transparent 100%), radial-gradient(ellipse 8% 19% at 31% 40%, #000 40%, transparent 100%), radial-gradient(ellipse 8% 19% at 69% 42%, #000 40%, transparent 100%);
          mask-image: radial-gradient(ellipse 24% 20% at 50% 11%, #000 45%, transparent 100%), radial-gradient(ellipse 8% 19% at 31% 40%, #000 40%, transparent 100%), radial-gradient(ellipse 8% 19% at 69% 42%, #000 40%, transparent 100%);
}
html.hair-wind .living-hair { display: block; filter: url(#hairWind); animation: hair-sway 5.5s ease-in-out infinite; }
@keyframes hair-sway { 0%,100% { translate: 0 0; } 50% { translate: 2px 1px; } }

/* 雪の景色になったあと：上 30% を空へ溶かして夜明けが見えるように。全画面の雪を絵の上へ */
.pcview-monitor.is-scene .living-img {
  -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 30%);
          mask-image: linear-gradient(180deg, transparent 4%, #000 30%); }
html.pc-revealed .layer-snow { z-index: 2; }
html.pc-inside .layer-snow { opacity: 0; }
html.pc-reveal .pcview { background: transparent; }
html.pc-reveal .pcview-code { opacity: 0; }
html.pc-reveal .layer-snow, html.pc-revealed .layer-snow { opacity: 1; transition: opacity 1s ease .8s; }

/* 開幕のコピー配置：スマホは□の下、横長画面は左の列に */
html.pc-inside .hero-copy { position: absolute; left: 0; right: 0; bottom: calc(3svh + 58px); /* ヘッダー分ずれてヘッドホンが画面下で切れていた（2026-09-28） */ z-index: 3; padding: 0 var(--gutter); }
html.pc-inside .eyebrow { display: inline-block; padding: 7px 14px; border: 1px solid rgba(143,211,255,.6); border-radius: 999px; color: #d9f0ff; background: rgba(5,7,13,.55); font-size: 13px; }
html.pc-reveal .hero-copy { opacity: 0; transition: opacity .5s ease; }
html.pc-revealed .hero-copy { animation: copy-in .9s ease .1s both; }
@keyframes copy-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (min-aspect-ratio: 5/4) {
  .pcview-monitor { left: 62%; top: 50%; width: min(66vw, 82svh * 1.406); }
  html.pc-inside .hero-copy { left: 4vw; right: auto; width: 30vw; bottom: auto; top: 50%; transform: translateY(-50%); text-align: left; padding: 0; }
  html.pc-inside .copy-main { font-size: clamp(26px, 2.6vw, 40px); }
  html.pc-inside .headphone { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pcview, .pcview-monitor, .pcview-code { transition: none; }
  .fx-lamp, .fx-steam i, html.hair-wind .living-hair { animation: none; }
  html.hair-wind .living-hair { display: none; }
}

/* 動画版（画像→動画ループ）。動画があるときは CSS の湯気・ランプ・雪は消す（動画に入っている） */
.living-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; opacity: 0; transition: opacity .9s ease; }
.living-video.is-loaded { opacity: 1; }
html.has-video .fx-lamp, html.has-video .fx-steam, html.has-video .fx-snow { display: none; }
.pcview-monitor.is-scene .living-video {
  -webkit-mask-image: linear-gradient(180deg, transparent 4%, #000 30%);
          mask-image: linear-gradient(180deg, transparent 4%, #000 30%); }

/* 2026-09-27 CEO：□の中で右端のマグの湯気が切れないように。動画（16:9）のときは □ も 16:9 にして動画を丸ごと見せる（PC・スマホとも） */
html.has-video .pcview-monitor:not(.is-full) { aspect-ratio: 16 / 9; width: min(92vw, 78svh * 1.778); } /* :not(.is-full)＝広がった後は幅 100% のルールを邪魔しない（2026-09-27 修正） */
html.has-video .living-video, html.has-video .living-img { object-position: 50% 50%; }
@media (min-aspect-ratio: 5/4) {
  html.has-video .pcview-monitor:not(.is-full) { width: min(66vw, 82svh * 1.778); }
}

/* 2026-09-27 CEO：押した後は「引き」か「女の子のアップ」の 2 パターン（fx.afterMode・?after=wide|zoom）。zoom＝顔を中心に 1.35 倍 */
.pcview-monitor.is-full .living-video, .pcview-monitor.is-full .living-img { transition: opacity .9s ease, transform 1.6s cubic-bezier(.2,.7,.15,1); }
html.after-zoom .pcview-monitor.is-full .living-video, html.after-zoom .pcview-monitor.is-full .living-img { transform: scale(1.35); transform-origin: var(--hero-zoom-origin, 44% 34%); } /* 中心はキャストごと（pcview.js が --hero-zoom-origin を入れる。2026-09-28） */
@media (max-aspect-ratio: 3/4) {
  html.after-zoom .pcview-monitor.is-full .living-video, html.after-zoom .pcview-monitor.is-full .living-img { transform: scale(1.15); transform-origin: var(--hero-zoom-origin-m, 46% 34%); }
}

/* 2026-09-27 CEO：スマホ（縦長）では wide も cover で顔のアップになってしまう → wide は動画を横いっぱいに収める（上に寄せ、下は夜の濃紺）。zoom はそのまま寄る */
@media (max-aspect-ratio: 3/4) {
  .pcview-monitor.is-full { background: #0b1020; }
  html:not(.after-zoom) .pcview-monitor.is-full .living-video,
  html:not(.after-zoom) .pcview-monitor.is-full .living-img { object-fit: contain; object-position: 50% 22%; }
  html:not(.after-zoom) .pcview-monitor.is-scene .living-video,
  html:not(.after-zoom) .pcview-monitor.is-scene .living-img { -webkit-mask-image: none; mask-image: none; }
}

/* 2026-09-28 CEO：スマホで男の子版が拡大されすぎて顔がはみ出す（横長の動画を縦長の全画面に cover すると横幅の 1/4 しか見えない）
   → heroCast.mobileBand のキャストは、押した後は画面上部の帯（横幅の約半分が見える高さ）に収め、下は同じ絵をぼかして敷く */
@media (max-aspect-ratio: 3/4) {
  html.hero-band .pcview-monitor.is-full::before {
    content: ""; position: absolute; inset: -40px; z-index: 0;
    background: var(--hero-poster) 50% 90% / cover no-repeat; /* 顔ではなく服のあたりをぼかして敷く */
    filter: blur(22px) brightness(.85) saturate(1.1);
  }
  html.hero-band .pcview-monitor.is-full .living {
    bottom: auto; height: min(100%, 120vw);
    -webkit-mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
            mask-image: linear-gradient(180deg, #000 72%, transparent 100%);
  }
  html.hero-band .pcview-monitor.is-full .living-video,
  html.hero-band .pcview-monitor.is-full .living-img { object-fit: cover; object-position: var(--hero-band-pos, 50% 35%); transform: none; }
  html.hero-band .pcview-monitor.is-scene .living-video,
  html.hero-band .pcview-monitor.is-scene .living-img { -webkit-mask-image: none; mask-image: none; }
}
