:root {
  --paper: #f6f6f8;
  --ink: #05070d;
  --navy: #04086a;
  --slate: #6b7591;
  --muted: #b4bccf;
  --pink: #ff3ea5;
  --cyan: #00b9c2;
  --line: #c9cee0;
  --panel-glow: rgba(255, 62, 165, .10);
  --decode-blur: 8px;
  --decode-lift: 4vh;
  --decode-wash-opacity: .84;
  --binary-rain-opacity: .46;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", monospace;
  --font-pixel: "VT323", "DotGothic16", monospace;

  /* iMac G3 cabinet — Bondi Blue (translucent teal). Sampled from original 1998 photo.
     Swap palettes by replacing the four values below:
       Strawberry:  cabinet #DB3D63  hi #F4A7B8  sh #6F1A30  edge #A0294B
       Blueberry:   cabinet #3B6BB5  hi #9FB8E2  sh #1F3870  edge #2E5092
       Grape:       cabinet #8C4FB5  hi #C9A5E2  sh #4F2570  edge #6C3892
       Lime:        cabinet #9CC74A  hi #D7EBA0  sh #5F8420  edge #79A132
       Tangerine:   cabinet #EE8A2E  hi #F8C58A  sh #A4520F  edge #C76E1F
       Cream front-bezel variant: cabinet #E8ECEA  hi #F6F8F6  sh #8A9695  edge #B6BFBC
   */
  --pc-cabinet: #F2FAFF;
  --pc-cabinet-edge: #BFD6E0;
  --pc-cabinet-highlight: #FAFDFF;
  --pc-cabinet-shadow: #86A8B5;

  /* Desktop PC monitor physical bezel dimensions */
  --crt-bezel-top: 36px;
  --crt-bezel-right: 36px;
  --crt-bezel-bottom: 84px;
  --crt-bezel-left: 36px;
  --crt-bezel-radius: 14px;

  /* === NEK ブランドウォーターマーク — ここを編集して位置/サイズ/濃度を調整 ===
     位置: right/left/top/bottom の 4 変数で配置コーナーを自由に切替。
           使わない側は auto のまま残す（例: 右下 → right + bottom を px 指定、left/top は auto）。
           値は px だけでなく % や vw/vh も使える。                                  */
  --brand-mark-right: 40px;      /* 右からの距離（左下に置くなら auto に） */
  --brand-mark-left: auto;       /* 左からの距離（右配置のときは auto のまま） */
  --brand-mark-top: auto;        /* 上からの距離（下配置のときは auto のまま） */
  --brand-mark-bottom: 28px;     /* 下からの距離（上配置なら auto に） */
  --brand-mark-height: 90px;    /* ロゴの高さ（幅は自動） */
  --brand-mark-opacity: 0.1;    /* 0(透明) 〜 1(不透明) */
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  background: #2b2620;
  color: var(--navy);
  font-family: var(--font-mono);
}

body.is-intro-locked {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

body.is-intro-locked .poster-shell {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

body.is-intro-locked .crt-screen-container {
  height: 100%;
  overflow: hidden;
}

button {
  font: inherit;
}

/* Landscape blocker — touch devices only.
   Shown when device is in landscape AND has coarse pointer (touch).
   Desktop browsers in landscape are unaffected. */
.orientation-block {
  display: none;
}

@media (orientation: landscape) and (pointer: coarse) and (max-device-width: 1024px) {
  .orientation-block {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05070d;
    color: var(--paper);
    font-family: var(--font-mono);
    padding: 24px;
    text-align: center;
  }
  .poster-shell {
    display: none !important;
  }
  body {
    overflow: hidden;
  }
}

.orientation-block__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: 420px;
}

.orientation-block__icon {
  color: var(--pink);
  animation: orientationRotateHint 1.8s ease-in-out infinite;
}

.orientation-block__title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--pink);
}

.orientation-block__msg {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--paper);
  opacity: .85;
}

@keyframes orientationRotateHint {
  0%, 60%, 100% { transform: rotate(0deg); }
  30% { transform: rotate(-90deg); }
}

.poster-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  /* svh だと iPhone 14 Pro Max のような大型端末でコンテンツが小さくなりすぎるため dvh に戻す。
     SE のスクロール対策は JS の touchmove preventDefault と body position:fixed で別途担保している。 */
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  padding: var(--crt-bezel-top) var(--crt-bezel-right) var(--crt-bezel-bottom) var(--crt-bezel-left);
  background-color: var(--pc-cabinet); /* Matches the outer beige PC monitor cabinet color */
  background-image: radial-gradient(circle at 50% 54%, rgba(0, 185, 194, .035), transparent 28%);
}

.binary-rain {
  position: absolute;
  /* システムバーの高さ(56px) + バー上部の余白(16px) */
  inset: 72px 0 0;
  z-index: 0;
  display: flex;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 18px);
  overflow: hidden;
  opacity: var(--binary-rain-opacity);
  pointer-events: none;
  mix-blend-mode: multiply;
  mask-image: linear-gradient(90deg, transparent 0%, #000 9%, #000 91%, transparent 100%);
}

.binary-rain p {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: clamp(14px, 2.1vmax, 30px);
  min-height: 100%;
  margin: 0;
  line-height: 1;
}

.binary-rain span {
  display: block;
  width: clamp(14px, 2.1vmax, 30px);
  height: clamp(14px, 2.1vmax, 30px);
  color: rgba(255, 62, 165, .08);
  font-family: "VT323", var(--font-pixel);
  font-size: clamp(16px, 2.2vmax, 34px);
  line-height: 1;
  text-align: center;
  text-shadow: none;
}

.system-bar {
  position: relative;
  z-index: 3;
  height: 56px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(24px, 4.5vw, 48px);
  border-bottom: 1.5px solid var(--line);
  background: rgba(246, 246, 248, 0.72);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.02), 0 1px 0 rgba(255, 62, 165, 0.1);
  animation: systemBarBoot .55s steps(7, end) both;
  /* 平面モニターのためパースペクティブ歪みは無効化 */
  transform: none;
  transform-origin: left center;
  /* バー上部の余白 — binary-rain inset と poster-stage height も同じ分だけ調整済み */
  margin-top: 16px;
}

.system-bar,
.poster-stage,
.binary-rain {
  transition: opacity .75s ease, filter .75s ease;
}

.poster-shell:not(.boot-complete) .system-bar,
.poster-shell:not(.boot-complete) .poster-stage,
.poster-shell:not(.boot-complete) .binary-rain {
  opacity: 0;
  filter: blur(2px);
}

.poster-shell.boot-complete:not(.map-ready) .system-bar {
  opacity: 1;
  filter: none;
}

.poster-shell.boot-complete:not(.map-ready) .poster-stage {
  opacity: .18;
  filter: blur(1px);
}

.poster-shell.boot-complete:not(.map-ready) .group47-stage {
  opacity: 1;
}

.poster-shell.boot-complete:not(.map-ready) .binary-rain {
  opacity: .08;
  filter: blur(1px);
}

/* === NEK ロゴ画像スタイル（コメントアウト中） — 戻すときは以下と HTML 内のブロックを有効化
.system-logo-group {
  display: inline-flex;
  align-items: center;
  gap: 0;
  --local-transform: skewY(0deg);
  --local-translate-y: -1px;
  transform: var(--local-transform);
  animation: textBoot .7s .12s both;
}

.system-symbol,
.system-logo {
  display: block;
  width: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.system-symbol {
  height: clamp(34px, 4.6vw, 50px);
  margin-right: clamp(-14px, -1.2vw, -8px);
}

.system-logo {
  height: clamp(28px, 3.9vw, 42px);
}
=== */

/* === SYSTEM v0.1 テキストロゴ（復元） === */
.system-logo {
  color: var(--navy);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  --local-transform: skewY(0deg);
  --local-translate-y: -2px;
  transform: var(--local-transform);
  animation: textBoot .7s .12s both;
}

.system-logo::before {
  content: "";
  display: block;
  width: 7px;
  height: 7px;
  background-color: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--cyan), 0 0 3px var(--cyan);
  animation: systemPulse 2s infinite ease-in-out;
}

@keyframes systemPulse {
  0%, 100% {
    opacity: 0.3;
    transform: scale(0.9);
    box-shadow: 0 0 6px var(--cyan);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 12px var(--cyan), 0 0 5px var(--cyan);
  }
}

.system-logo span {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--pink);
  background: rgba(255, 62, 165, 0.08);
  border: 1px solid rgba(255, 62, 165, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: normal;
  text-transform: none;
  margin-left: 4px;
  box-shadow: inset 0 0 4px rgba(255, 62, 165, 0.05);
}

.status-dots i.is-active {
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink), 0 0 3px var(--pink);
}

.system-time {
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  font-style: normal;
  letter-spacing: .06em;
  white-space: nowrap;
  background: rgba(4, 8, 106, 0.04);
  border: 1px solid rgba(4, 8, 106, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
  /* 平面モニターのため傾きは無効化 */
  --local-transform: skewY(0deg);
  transform: var(--local-transform);
  animation: textBoot .65s .36s both;
}

.poster-stage {
  position: relative;
  z-index: 1;
  /* システムバー(56px) + バー上部の余白(16px) */
  height: calc(100% - 72px);
  width: min(100%, 1540px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: clamp(16px, 2vw, 32px) clamp(24px, 3vw, 48px);
}

.group47-stage {
  position: relative;
  container-type: inline-size;
  display: grid;
  place-items: center;
  width: min(100%, 1097px, calc((100vh - 240px) * 1.15));
  aspect-ratio: 1097 / 950;
  opacity: 0;
}

.poster-shell.map-ready .group47-stage {
  animation: contentReveal .8s .2s both;
}

.group47-picture,
.group47-image {
  display: block;
  width: 100%;
  height: 100%;
}

.group47-picture {
  position: relative;
  filter: drop-shadow(0 14px 30px rgba(255, 62, 165, .08));
  transform-origin: center;
  animation: group47Boot .82s .52s cubic-bezier(.2, .8, .2, 1) both;
}

.group47-image {
  object-fit: contain;
}

.group47-image-mobile {
  display: none;
}

.shibuya-pulse {
  --shibuya-x: 72.5%;
  --shibuya-y: 63.8%;
  position: absolute;
  left: var(--shibuya-x);
  top: var(--shibuya-y);
  z-index: 3;
  width: clamp(12px, 1.8cqw, 22px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 1) 0 22%, rgba(255, 241, 118, 1) 24% 48%, rgba(255, 62, 165, 0.85) 52% 100%);
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.95),
    0 0 22px rgba(255, 241, 118, 0.95),
    0 0 38px rgba(255, 62, 165, 0.85),
    0 0 64px rgba(109, 244, 255, 0.45);
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  animation: shibuyaPulse 4.8s ease-in-out infinite;
}

.shibuya-pulse::before,
.shibuya-pulse::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(255, 241, 118, 0.95);
  box-shadow:
    0 0 16px rgba(255, 62, 165, 0.75),
    inset 0 0 8px rgba(255, 241, 118, 0.5);
  opacity: 0;
  transform: scale(1);
  pointer-events: none;
}

.shibuya-pulse::before {
  animation: shibuyaPing 4.8s ease-out infinite;
}

.shibuya-pulse::after {
  animation: shibuyaPing 4.8s 1.15s ease-out infinite;
}

/* NEK! ワードマーク — CRT 画面のブランドウォーターマーク
   位置・サイズ・濃度の調整は :root の --brand-mark-* 変数を編集 */
.screen-brand-mark {
  position: absolute;
  top: var(--brand-mark-top);
  right: var(--brand-mark-right);
  bottom: var(--brand-mark-bottom);
  left: var(--brand-mark-left);
  height: var(--brand-mark-height);
  width: auto;
  z-index: 1;
  opacity: var(--brand-mark-opacity);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  /* 暗いロゴをピンクに着色 → opacity でフェードして背景になじませる */
  filter: brightness(0) invert(43%) sepia(98%) saturate(4500%) hue-rotate(305deg) brightness(108%);
  pointer-events: none;
}

.group47-terminal-copy {
  position: absolute;
  left: 4.9%;
  top: 32.8%;
  width: 63%;
  color: #6df4ff;
  font-family: var(--font-mono);
  font-size: clamp(12px, 2.75cqw, 27px);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: .015em;
  text-shadow: 0 0 8px rgba(109, 244, 255, .25);
  z-index: 2;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

/* テキスト選択時 — 文字はピンク、背景は水色（みずいろ） */
.group47-terminal-copy ::selection,
.group47-terminal-copy::selection {
  background-color: #aee9ff;
  color: #ff3ea5;
  text-shadow: none;
}

.group47-terminal-copy ::-moz-selection,
.group47-terminal-copy::-moz-selection {
  background-color: #aee9ff;
  color: #ff3ea5;
  text-shadow: none;
}

/* NEK! ロゴ — ターミナルポップアップ背景ウォーターマーク（一時非表示 — 戻すときはコメントアウト解除）
.group47-terminal-copy::before {
  content: "";
  position: absolute;
  left: -4%;
  top: -8%;
  width: 108%;
  height: 130%;
  background-image: url("img/nek-logo.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  opacity: 0.13;
  mix-blend-mode: screen;
  filter: hue-rotate(310deg) saturate(2.4) brightness(1.1);
  z-index: -1;
  pointer-events: none;
}
*/

.group47-terminal-copy p {
  display: block;
  width: 0;
  margin: 0 0 .62em;
  overflow: hidden;
  white-space: nowrap;
}

.poster-shell.map-ready .group47-terminal-copy p:nth-child(1) {
  animation: terminalTypewriter .48s 1.45s steps(37, end) both;
}

.poster-shell.map-ready .group47-terminal-copy p:nth-child(2) {
  animation: terminalTypewriter .5s 2.05s steps(36, end) both;
}

.group47-terminal-copy span {
  color: inherit;
}

.group47-terminal-copy .terminal-prompt {
  margin-top: .72em;
  color: #ff73cf;
}

.poster-shell.map-ready .group47-terminal-copy .terminal-prompt {
  animation: terminalPromptType .14s 2.72s steps(2, end) both;
}

.terminal-prompt span {
  display: inline-block;
  width: .48em;
  height: 1.04em;
  margin-left: .08em;
  vertical-align: -.16em;
  background: currentColor;
  box-shadow: 0 0 10px rgba(255, 115, 207, .35);
  animation: terminalCursorBlink .85s steps(1, end) infinite;
}

.dot-character-lane {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(76px, 15vh, 132px);
  z-index: 4;
  pointer-events: none;
}

.dot-character {
  position: absolute;
  bottom: 0;
  display: block;
  padding: 0;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background-color: transparent;
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: contain;
  cursor: pointer;
  image-rendering: pixelated;
  transform-origin: center bottom;
  filter: drop-shadow(0 6px 1px rgba(4, 8, 106, .12));
  opacity: 0;
  pointer-events: auto;
}

.poster-shell.map-ready .dot-character {
  animation:
    dotCharacterWalk .68s steps(1, end) infinite,
    dotCharacterDrift calc(var(--drift-speed, 3.8s) * 2) linear infinite,
    dotCharacterReveal .55s var(--reveal-delay, 1.45s) both;
}

.character-speech-wrap {
  position: absolute;
  bottom: 0;
  width: clamp(42px, 5.6vw, 78px);
  aspect-ratio: 214 / 361;
  pointer-events: none;
}

.poster-shell.map-ready .character-speech-wrap {
  animation:
    speechBubbleDrift calc(var(--drift-speed, 3.8s) * 2) linear infinite,
    dotCharacterReveal .55s var(--reveal-delay, 1.45s) both;
}

.dot-character.is-short {
  width: clamp(42px, 5.6vw, 78px);
  aspect-ratio: 214 / 361;
  --walk-frame-1: url("img/walks_01.png");
  --walk-frame-2: url("img/walks_02.png");
  --walk-frame-3: url("img/walks_03.png");
  --walk-frame-4: url("img/walks_04.png");
  background-image: url("img/walks_01.png");
}

.character-1 {
  left: 13%;
  --drift-x: 30px;
  --drift-y: -4px;
  --drift-speed: 3.4s;
  --reveal-delay: 1.42s;
  --dir-sign: 1;
  --dir-sign-opp: -1;
}

.character-2 {
  left: 30%;
  --drift-x: -24px;
  --drift-y: -5px;
  --drift-speed: 4.2s;
  --reveal-delay: 1.58s;
  --dir-sign: -1;
  --dir-sign-opp: 1;
}

.character-3 {
  left: 55%;
  --drift-x: 26px;
  --drift-y: -3px;
  --drift-speed: 3.8s;
  --reveal-delay: 1.5s;
  --dir-sign: 1;
  --dir-sign-opp: -1;
}

.character-4 {
  left: 80%;
  --drift-x: -30px;
  --drift-y: -4px;
  --drift-speed: 4.5s;
  --reveal-delay: 1.66s;
  --dir-sign: -1;
  --dir-sign-opp: 1;
}

.character-speech {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  max-width: min(220px, 58vw);
  padding: 9px 13px 10px;
  border: 2px solid var(--navy);
  border-radius: 6px;
  background: rgba(255, 255, 255, .94);
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: clamp(13px, 1.45vw, 18px);
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 4px 4px 0 rgba(255, 62, 165, .22), 0 0 14px rgba(0, 185, 194, .12);
  opacity: 0;
  transform: translateX(-50%) translateY(8px) scale(.96);
  transform-origin: center bottom;
  transition: opacity .18s steps(2, end), transform .18s steps(2, end);
  pointer-events: none;
  visibility: hidden;
}

.character-speech::after {
  position: absolute;
  left: 50%;
  bottom: -11px;
  width: 18px;
  height: 18px;
  background: inherit;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.dot-character-lane.is-speaking .character-speech {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  visibility: visible;
}

.map-panel {
  position: relative;
  justify-self: end;
  width: min(100%, 620px);
  min-width: 0;
  height: 100%;
  display: grid;
  align-items: center;
  justify-content: center;
  opacity: 0;
}

.map-wrap {
  position: relative;
  width: min(100%, 620px, calc((100vh - 120px) * .85));
  max-width: 620px;
  aspect-ratio: 770 / 860;
  animation: mapBoot .9s .42s cubic-bezier(.2, .8, .2, 1) both;
}

.map-wrap::before,
.map-wrap::after {
  position: absolute;
  left: 57.1%;
  top: 56.45%;
  width: 18%;
  aspect-ratio: 1;
  border: 2px solid var(--pink);
  border-radius: 50%;
  content: "";
  pointer-events: none;
  transform: translate(-50%, -50%) scale(.28);
}

.map-wrap::before {
  opacity: .55;
  animation: shibuyaPulse 1.65s .95s ease-out infinite;
}

.map-wrap::after {
  opacity: .35;
  animation: shibuyaPulse 1.65s 1.45s ease-out infinite;
}

.japan-map-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: mapFocus .9s .5s both;
}

.coord-card {
  position: absolute;
  left: 42%;
  top: 80%;
  width: 40%;
  margin: 0;
  padding: 0;
  color: var(--slate);
  line-height: 1.18;
  letter-spacing: .04em;
  text-align: left;
}

.coord-card > * {
  opacity: 0;
  transform: translateY(8px);
  animation: coordBoot .5s both;
}

.coord-card p {
  animation-delay: .95s;
}

.coord-card strong:nth-of-type(1) {
  animation-delay: 1.1s;
}

.coord-card strong:nth-of-type(2) {
  animation-delay: 1.22s;
}

.coord-card small {
  animation-delay: 1.36s;
}

.coord-card p,
.coord-card strong,
.coord-card small {
  display: block;
  margin: 0;
  font-weight: 400;
  letter-spacing: .04em;
}

.coord-card p {
  font-size: clamp(17px, calc((100vh - 120px) * .042), 30px);
  margin-bottom: .42em;
  white-space: nowrap;
}

.coord-card strong {
  color: var(--cyan);
  font-size: clamp(17px, calc((100vh - 120px) * .04), 29px);
  font-weight: 700;
  line-height: 1.22;
  white-space: nowrap;
}

.coord-card small {
  margin-top: .46em;
  color: var(--slate);
  font-size: clamp(11px, calc((100vh - 120px) * .024), 18px);
  letter-spacing: .08em;
  text-transform: lowercase;
  white-space: nowrap;
}

.transmission-panel {
  display: grid;
  place-items: center;
  justify-self: center;
  width: 100%;
  min-width: 0;
  height: 100%;
  opacity: 0;
}

.panel-frame {
  position: relative;
  width: min(100%, 600px);
  margin-inline: auto;
  aspect-ratio: 858 / 771;
  padding: 10% 9% 10% 11%;
  background: url("img/textarea01.svg") center/100% 100% no-repeat;
  filter: drop-shadow(0 10px 24px rgba(255, 62, 165, .08));
  transform-origin: center;
  animation: panelBoot .82s .72s cubic-bezier(.2, .8, .2, 1) both, panelFloat 5s 1.8s ease-in-out infinite;
}

.panel-frame h1 {
  margin: 0 0 14px;
  color: var(--pink);
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: .06em;
  animation: revealText .75s 1.08s steps(16, end) both;
}

.dash-rule {
  width: 70%;
  margin: 0 0 26px;
  border-top: 1.5px dashed var(--pink);
  transform-origin: left center;
  animation: ruleBoot .55s 1.25s both;
}

.transmission-data {
  display: grid;
  gap: 22px;
  margin: 0;
}

.transmission-data > div {
  display: grid;
  gap: 8px;
  opacity: 0;
  transform: translateY(8px);
  animation: dataLineBoot .46s both;
}

.transmission-data > div:nth-child(1) {
  animation-delay: 1.42s;
}

.transmission-data > div:nth-child(2) {
  animation-delay: 1.58s;
}

.transmission-data > div:nth-child(3) {
  animation-delay: 1.74s;
}

.transmission-data > div:nth-child(4) {
  animation-delay: 1.9s;
}

.transmission-data dt {
  margin: 0;
  color: var(--slate);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .12em;
}

.transmission-data dd {
  margin: 0 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  animation: revealText .62s steps(18, end) both;
  animation-delay: inherit;
}

.cyan {
  color: var(--cyan);
}

.pink {
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 62, 165, .15);
}

.status-row {
  display: flex !important;
  align-items: center;
  gap: 16px;
  color: var(--pink);
  flex-wrap: nowrap;
}

.status-dots {
  display: grid;
  grid-template-columns: repeat(20, 7px);
  grid-template-rows: repeat(2, 7px);
  grid-auto-flow: column;
  gap: 5px;
}

.status-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
  opacity: 0;
  transform: scale(.25);
  animation: dotBoot .32s both;
  animation-delay: calc(1.9s + var(--dot-index, 0) * 16ms);
}

.status-row b {
  color: var(--pink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .06em;
  animation: percentBlink 1.8s 2.3s steps(2, end) infinite;
}

.teaser-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 90;
  --teaser-nudge-x: 0px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: clamp(12px, 2vw, 22px);
  padding: 32px 32px calc(32px + var(--decode-lift));
  background: rgba(246, 246, 248, .58);
  backdrop-filter: blur(var(--decode-blur));
  -webkit-backdrop-filter: blur(var(--decode-blur));
  color: var(--navy);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .55s ease, visibility 0s linear .55s;
  will-change: opacity;
}

.teaser-overlay::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgba(0, 0, 0, .035) 4px, rgba(0, 0, 0, .035) 4px);
  mix-blend-mode: multiply;
  pointer-events: none;
}

.poster-shell.teaser-active:not(.map-ready) .teaser-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity .55s ease, visibility 0s;
}

.poster-shell.map-ready .teaser-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.poster-shell.teaser-gone .teaser-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: none;
}

.poster-shell.teaser-exiting .teaser-overlay {
  opacity: 0;
  visibility: visible;
  pointer-events: none;
  transition: opacity .48s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .48s;
}

.teaser-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.2vw, 34px);
  margin-left: var(--teaser-nudge-x);
  color: var(--ink);
  font-family: "VT323", var(--font-pixel);
  font-size: clamp(52px, 5.9vw, 108px);
  line-height: .9;
}

.teaser-title img {
  width: clamp(160px, 23vw, 420px);
  height: auto;
  image-rendering: pixelated;
}

.teaser-title span {
  display: inline-block;
  transform: translateY(.04em);
  white-space: nowrap;
}

.teaser-counter {
  display: flex;
  align-items: baseline;
  justify-content: center;
  width: min(1780px, 90vw);
  margin-left: var(--teaser-nudge-x);
  padding: clamp(24px, 3vw, 54px) clamp(28px, 5vw, 70px);
  border: 1.5px solid var(--line);
  background: rgba(255, 255, 255, .38);
  color: var(--pink);
  font-family: "VT323", var(--font-pixel);
  font-size: clamp(66px, 9.8vw, 168px);
  letter-spacing: .06em;
  line-height: .9;
  box-shadow: 0 0 24px rgba(255, 62, 165, .05);
}

.teaser-counter small {
  margin: 0 .18em 0 .06em;
  font-size: .42em;
}

.teaser-counter .sep {
  color: var(--slate);
  font-size: .7em;
}

.teaser-button {
  width: min(1040px, 54vw);
  min-width: 420px;
  margin-left: var(--teaser-nudge-x);
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(4px 4px 0 rgba(255, 62, 165, .18));
  transition: transform .14s ease, filter .14s ease, opacity .14s ease;
}

/* Entrance animations triggered only once on initial boot screen exit */
.poster-shell.teaser-entrance .teaser-title {
  animation: teaserPop .75s .15s both;
}
.poster-shell.teaser-entrance .teaser-counter {
  animation: decodeIntro .7s .35s both;
}
.poster-shell.teaser-entrance .teaser-button {
  animation: decodeIntro .7s .55s both;
}

.teaser-button img {
  display: block;
  width: 100%;
  height: auto;
}

.teaser-button:hover {
  transform: translate(2px, 2px);
  filter: drop-shadow(2px 2px 0 rgba(255, 62, 165, .24));
}

.teaser-button:active {
  transform: translate(5px, 5px);
  filter: drop-shadow(0 0 0 rgba(255, 62, 165, 0));
}

.teaser-button:disabled {
  cursor: progress;
  opacity: .72;
}

.poster-shell.teaser-decoding .teaser-counter {
  animation: scrambleJitter .08s steps(2) infinite;
}

.poster-shell.teaser-exiting .teaser-title,
.poster-shell.teaser-exiting .teaser-counter,
.poster-shell.teaser-exiting .teaser-button {
  transform: translateY(-8px) scale(.985);
  filter: blur(1px);
  opacity: 0;
  transition: opacity .38s ease, transform .38s ease, filter .38s ease;
}

.poster-shell.decoded .group47-image,
.poster-shell.decoded .group47-terminal-copy {
  animation-name: glitchIn;
  animation-duration: .55s;
  animation-timing-function: steps(4, end);
  animation-fill-mode: both;
}

@keyframes decodeIntro {
  from {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(1px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes teaserPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.96);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes contentReveal {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes overlayWash {
  from {
    opacity: 1;
  }

  to {
    opacity: var(--decode-wash-opacity);
  }
}

@keyframes scrambleJitter {
  0% {
    transform: translate(-1px, 0);
  }

  50% {
    transform: translate(1px, 1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes glitchIn {
  0% {
    opacity: .2;
    transform: translate(-4px, 0);
  }

  25% {
    opacity: .55;
    transform: translate(3px, -1px);
  }

  50% {
    opacity: .7;
    transform: translate(-2px, 2px);
  }

  75% {
    opacity: .9;
    transform: translate(1px, 0);
  }

  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

@keyframes systemBarBoot {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0);
  }
}

@keyframes textBoot {
  from {
    opacity: 0;
    /* --local-translate-y は要素ごとの最終 Y 位置オフセット (例: ロゴを少し上に持ち上げる) */
    transform: translateY(calc(-4px + var(--local-translate-y, 0px))) var(--local-transform, translate(0));
    filter: blur(1px);
  }

  to {
    opacity: 1;
    transform: translateY(var(--local-translate-y, 0px)) var(--local-transform, translate(0));
    filter: blur(0);
  }
}

@keyframes dotBoot {
  0% {
    opacity: 0;
    transform: scale(.2);
  }

  70% {
    opacity: 1;
    transform: scale(1.28);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes mapBoot {
  from {
    opacity: 0;
    transform: translateY(18px) scale(.985);
    filter: blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes group47Boot {
  from {
    opacity: 0;
    transform: translateY(14px) scale(.985);
    filter: drop-shadow(0 0 0 rgba(255, 62, 165, 0)) blur(2px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 14px 30px rgba(255, 62, 165, .08)) blur(0);
  }
}

@keyframes terminalCopyBoot {
  from {
    opacity: 0;
    filter: blur(1px);
  }

  to {
    opacity: 1;
    filter: blur(0);
  }
}

@keyframes terminalTypewriter {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

@keyframes terminalPromptType {
  from {
    width: 0;
  }

  to {
    width: 1.62em;
  }
}

@keyframes terminalCursorBlink {
  0%,
  48% {
    opacity: 1;
  }

  49%,
  100% {
    opacity: 0;
  }
}

@keyframes dotCharacterReveal {
  from {
    opacity: 0;
    filter: drop-shadow(0 6px 1px rgba(4, 8, 106, 0)) blur(1px);
  }

  to {
    opacity: 1;
    filter: drop-shadow(0 6px 1px rgba(4, 8, 106, .12)) blur(0);
  }
}

@keyframes dotCharacterDrift {
  0% {
    transform: translateX(calc(var(--drift-x) * -1)) translateY(0) scaleX(var(--dir-sign));
    animation-timing-function: ease-in-out;
  }
  25% {
    transform: translateX(0) translateY(var(--drift-y)) scaleX(var(--dir-sign));
    animation-timing-function: ease-in-out;
  }
  49.99% {
    transform: translateX(var(--drift-x)) translateY(0) scaleX(var(--dir-sign));
    animation-timing-function: ease-in-out;
  }
  50% {
    transform: translateX(var(--drift-x)) translateY(0) scaleX(var(--dir-sign-opp));
    animation-timing-function: ease-in-out;
  }
  75% {
    transform: translateX(0) translateY(var(--drift-y)) scaleX(var(--dir-sign-opp));
    animation-timing-function: ease-in-out;
  }
  99.99% {
    transform: translateX(calc(var(--drift-x) * -1)) translateY(0) scaleX(var(--dir-sign-opp));
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: translateX(calc(var(--drift-x) * -1)) translateY(0) scaleX(var(--dir-sign));
  }
}

@keyframes speechBubbleDrift {
  0% {
    transform: translateX(calc(var(--drift-x) * -1)) translateY(0);
    animation-timing-function: ease-in-out;
  }
  25% {
    transform: translateX(0) translateY(var(--drift-y));
    animation-timing-function: ease-in-out;
  }
  50% {
    transform: translateX(var(--drift-x)) translateY(0);
    animation-timing-function: ease-in-out;
  }
  75% {
    transform: translateX(0) translateY(var(--drift-y));
    animation-timing-function: ease-in-out;
  }
  100% {
    transform: translateX(calc(var(--drift-x) * -1)) translateY(0);
  }
}

@keyframes dotCharacterWalk {
  0%,
  24.99% {
    background-image: var(--walk-frame-1);
  }

  25%,
  49.99% {
    background-image: var(--walk-frame-2);
  }

  50%,
  74.99% {
    background-image: var(--walk-frame-3);
  }

  75%,
  100% {
    background-image: var(--walk-frame-4);
  }
}

@keyframes mapFocus {
  0% {
    filter: contrast(.8) brightness(1.05);
  }

  60% {
    filter: contrast(1.18) brightness(1.02);
  }

  100% {
    filter: contrast(1) brightness(1);
  }
}

@keyframes shibuyaPulse {
  0%,
  58%,
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.62);
    filter: blur(.2px);
  }

  6% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.15);
    filter: blur(0);
  }

  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    filter: blur(0);
  }

  28% {
    opacity: .95;
    transform: translate(-50%, -50%) scale(1.05);
    filter: blur(0);
  }

  42% {
    opacity: .55;
    transform: translate(-50%, -50%) scale(.9);
  }
}

@keyframes shibuyaPing {
  0%,
  100% {
    opacity: 0;
    transform: scale(.6);
  }

  9% {
    opacity: .95;
    transform: scale(1);
  }

  46% {
    opacity: 0;
    transform: scale(4.8);
  }
}

@keyframes coordBoot {
  from {
    opacity: 0;
    transform: translateY(8px);
    filter: blur(1px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes panelBoot {
  from {
    opacity: 0;
    transform: translateX(18px) scale(.985);
    filter: drop-shadow(0 0 0 rgba(255, 62, 165, 0)) blur(1px);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
    filter: drop-shadow(0 10px 24px rgba(255, 62, 165, .08)) blur(0);
  }
}

@keyframes panelFloat {
  0%,
  100% {
    transform: translate(0, 0);
  }

  50% {
    transform: translate(.8px, -1px);
  }
}

@keyframes ruleBoot {
  from {
    transform: scaleX(0);
    opacity: 0;
  }

  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes dataLineBoot {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes revealText {
  from {
    clip-path: inset(0 100% 0 0);
  }

  to {
    clip-path: inset(0);
  }
}

@keyframes percentBlink {
  0%,
  82%,
  100% {
    opacity: 1;
  }

  88% {
    opacity: .42;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (max-width: 1100px) {
  :root {
    --crt-bezel-top: 22px;
    --crt-bezel-right: 22px;
    --crt-bezel-bottom: 60px;
    --crt-bezel-left: 22px;
    --crt-bezel-radius: 10px;
  }


  .crt-controls {
    left: calc(var(--crt-bezel-left) + 20px);
    right: calc(var(--crt-bezel-right) + 20px);
    bottom: calc(var(--crt-bezel-bottom) / 2 - 18px);
    gap: 14px;
  }

  html,
  body {
    /* iPhone SE のように viewport が小さい端末でコンテンツがはみ出すと auto だとスクロールしてしまうため、
       モバイルでも明示的に hidden を維持してスクロールを止める */
    overflow: hidden;
  }

  /* iOS Safari は overflow: hidden だけでは body がスクロールしてしまう場合があるので、
     position: fixed で viewport に完全に固定する (SE で顕著) */
  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .poster-shell {
    height: 100vh;
    /* 14 Pro Max など大画面で svh だと小さく見えるため dvh に戻す.
       SE のスクロールは JS touchmove preventDefault でブロック済み */
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }


  .poster-stage {
    /* システムバー(56px) + バー上部の余白(16px) */
    height: calc(100% - 72px);
    width: 100%;
    margin: 0;
    place-items: center;
    padding: 28px 32px 44px;
  }

  .group47-stage {
    width: min(92vw, 820px, calc((100vh - 128px) * 1.15));
  }

  .group47-terminal-copy {
    font-size: clamp(10px, 2.75cqw, 23px);
  }

  .teaser-overlay {
    --teaser-nudge-x: 0px;
    grid-template-columns: minmax(0, 1fr);
  }

  .teaser-title {
    flex-direction: column;
    gap: 8px;
    font-size: clamp(32px, 10vw, 58px);
  }

  .teaser-title img {
    width: clamp(132px, 42vw, 220px);
  }

  .teaser-counter {
    width: min(100%, 680px);
    padding: clamp(16px, 5vw, 28px) clamp(14px, 4vw, 24px);
    font-size: clamp(32px, 11vw, 78px);
  }

  .teaser-button {
    width: min(78vw, 420px);
    min-width: 0;
  }
}

@media (max-width: 900px) {
  :root {
    --crt-bezel-top: 14px;
    --crt-bezel-right: 14px;
    --crt-bezel-bottom: 60px;
    --crt-bezel-left: 14px;
    --crt-bezel-radius: 8px;
  }

  /* 모바일은 베젤 음각/내부 그림자를 더 약화 (외곽 그루브 띠만 유지) */
  .crt-bezel::before {
    box-shadow:
      0 0 0 1px #2a241d,
      0 0 0 2px var(--pc-cabinet-shadow),
      0 0 0 3px var(--pc-cabinet-highlight),
      0 0 0 4px var(--pc-cabinet-edge),
      0 0 0 9999px var(--pc-cabinet),
      inset 0 1px 4px 0 rgba(0, 0, 0, 0.12);
  }

  .crt-glass-edge {
    box-shadow:
      inset 0 0 8px rgba(0, 0, 0, 0.12),
      inset 0 0 4px rgba(0, 0, 0, 0.15);
  }

  .poster-shell.boot-complete .crt-glass-edge {
    opacity: .3;
  }

  .crt-led {
    width: 4px;
    height: 4px;
  }

  /* max-width: 900px は 14 Pro Max 等の大きめモバイル基準。SE 用の更に小さい値は max-width: 420px に分離。 */
  .system-bar {
    height: auto;
    min-height: 17px;
    padding: 7px 16px 9px 16px;
    /* 平面モニターのためモバイルでもパースペクティブ歪みは無効化 */
    transform: none;
  }

  /* === NEK ロゴ画像 モバイルスタイル（コメントアウト中）
  .system-logo-group {
    --local-transform: skewY(0deg);
    margin-left: 8px;
    gap: 0;
  }

  .system-symbol {
    height: clamp(30px, 8vw, 40px);
    margin-right: -8px;
  }

  .system-logo {
    height: clamp(26px, 6.8vw, 34px);
  }
  === */

  /* === SYSTEM v0.1 テキストロゴ モバイル（復元） === */
  .system-logo {
    font-size: 16px;
    --local-transform: skewY(0deg);
    margin-left: 8px;
  }

  .system-logo span {
    font-size: 11px;
    padding: 1px 6px;
  }

  .system-time {
    font-size: 12px;
    padding: 3px 8px;
    letter-spacing: .02em;
    /* 平面モニターのため傾きは無効化 */
    --local-transform: skewY(0deg);
    /* モバイルでは右端から少し内側に寄せる */
    margin-right: 8px;
  }

  .poster-stage {
    padding: 20px 16px 32px;
    overflow-x: hidden;
  }

  .group47-stage {
    width: min(94vw, 560px, calc((100vh - 112px) * 1.15));
  }

  .group47-picture {
    filter: none;
  }

  .group47-image-desktop {
    display: none;
  }

  .group47-image-mobile {
    display: block;
    position: relative;
    top: -20px;
    left: -10px;
  }

  .shibuya-pulse {
    --shibuya-x: 59.5%;
    --shibuya-y: 62.5%;
    width: clamp(12px, 3.6cqw, 18px);
  }

  /* モバイル: ブランドウォーターマーク調整値（数値を直接編集して調整） */
  :root {
    --brand-mark-right: 18px;
    --brand-mark-left: auto;
    --brand-mark-top: auto;
    --brand-mark-bottom: 18px;
    --brand-mark-height: 45px;
    --brand-mark-opacity: 0.1;
  }

  .group47-terminal-copy {
    left: 6%;
    top: 33%;
    width: 84%;
    font-size: clamp(11px, 3.5cqw, 16px);
    text-shadow: 1px 1px 0px #000, 2px 2px 0px #000, 0 0 8px rgba(109, 244, 255, .4);
  }

  .dot-character-lane {
    bottom: 0;
    height: clamp(70px, 14vh, 112px);
  }

  .character-speech-wrap,
  .dot-character.is-short {
    width: clamp(34px, 10vw, 50px);
  }

  .character-speech {
    font-size: clamp(15px, 4.5vw, 19px);
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4);
  }
}

@media (max-width: 420px) {
  /* SE 等の小さいモバイル: バー全体をさらにスリム化 */
  .system-bar {
    min-height: 11px;
    padding: 3px 14px 8px 14px;
  }

  /* === NEK ロゴ画像 小モバイル（コメントアウト中）
  .system-symbol {
    height: 28px;
    margin-right: -6px;
  }

  .system-logo {
    height: 24px;
  }
  === */

  /* === SYSTEM v0.1 テキストロゴ 小モバイル（復元） === */
  .system-logo {
    font-size: 14px;
  }

  .system-logo span {
    font-size: 9px;
    padding: 0 5px;
  }

  .system-time {
    font-size: 10px;
    padding: 2px 5px;
  }


  .group47-stage {
    width: min(94vw, calc((100vh - 104px) * 1.15));
  }

  .group47-terminal-copy {
    left: 6%;
    top: 33%;
    width: 82%;
    font-size: clamp(10px, 3.5cqw, 15px);
  }
}

/* ==========================================================================
   Global CRT Screen Effect (Scanlines, Vignette Curvature, Screen Flicker)
   ========================================================================== */

/* Flat desktop PC monitor screen container */
.crt-screen-container {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper);
  background-image: linear-gradient(180deg, #fbfbfd 0%, var(--paper) 100%);
  display: flex;
  flex-direction: column;
  filter: blur(0.5px);
}

@media (max-width: 900px) {
  .crt-screen-container {
    filter: blur(0.3px);
  }
}

/* Diagonal glass reflection glare */
.crt-glass-specular {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 94; /* Sits below bezel frame, above content */
  background: 
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 20%, transparent 20.2%, transparent 100%);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.poster-shell.boot-complete .crt-glass-specular {
  opacity: .55;
}

/* Glass edge dark vignette shadow (follows clip-path boundaries) */
.crt-glass-edge {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 93;
  box-shadow:
    inset 0 0 24px rgba(0, 0, 0, 0.34),
    inset 0 0 8px rgba(0, 0, 0, 0.42),
    inset 0 3px 0 0 rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.8s ease;
}

.poster-shell.boot-complete .crt-glass-edge {
  opacity: .62;
}

.crt-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 92;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  mix-blend-mode: multiply;
  background: 
    /* Vignette gradient for depth */
    radial-gradient(ellipse at center, rgba(246, 246, 248, 0) 44%, rgba(4, 8, 106, 0.035) 74%, rgba(4, 8, 106, 0.11) 100%),
    /* Rolling horizontal scanline beam */
    linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 62, 165, 0.02) 10%, rgba(255, 255, 255, 0) 20%);
  background-size: 100% 100%, 100% 200%;
}

/* Show CRT overlays only when boot loader is complete */
.poster-shell.boot-complete .crt-overlay {
  opacity: .4;
}

/* Scanlines pattern layer (drift/scrolling scanlines) */
.crt-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.07) 0 1px,
    rgba(4, 8, 106, 0.12) 1px 3px,
    transparent 3px 5px
  );
  mix-blend-mode: multiply;
  opacity: 0.42;
  z-index: 1;
}

/* Static noise layer (animated phosphor dust noise) */
.crt-overlay::after {
  content: "";
  position: absolute;
  inset: -10px;
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.14) 1px, transparent 1px),
    radial-gradient(rgba(4, 8, 106, 0.09) 1px, transparent 1px);
  background-size: 3px 3px, 5px 5px;
  background-position: 0 0, 1px 2px;
  opacity: 0.16;
  z-index: 2;
}

/* CRT monitor outer bezel frame (cabinet) */
.crt-bezel {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 1; /* Always visible to wrap BIOS as well */
}

.crt-bezel::before {
  content: "";
  position: absolute;
  top: calc(var(--crt-bezel-top) + 2px);
  left: calc(var(--crt-bezel-left) + 2px);
  right: calc(var(--crt-bezel-right) + 2px);
  bottom: calc(var(--crt-bezel-bottom) + 2px);
  border-radius: calc(var(--crt-bezel-radius) - 1px);
  box-shadow:
    /* 1) Deepest groove shadow hugging the screen */
    0 0 0 3px #2a241d,
    /* 2) Engraved inner wall (darker beige) */
    0 0 0 6px var(--pc-cabinet-shadow),
    /* 3) Bevel lip highlight back up to cabinet level */
    0 0 0 9px var(--pc-cabinet-highlight),
    /* 4) Outer edge line where the bevel meets the cabinet face */
    0 0 0 11px var(--pc-cabinet-edge),
    /* 5) Beige 90s desktop PC cabinet body */
    0 0 0 9999px var(--pc-cabinet),
    /* Sharp inner top-edge shadow (engraved top wall in deep shade) */
    inset 0 3px 0 0 rgba(0, 0, 0, 0.45),
    /* Strong inner recess shadow falling from the top down */
    inset 0 8px 18px 1px rgba(0, 0, 0, 0.48),
    /* Side wall shading reinforcing depth */
    inset 5px 0 10px -4px rgba(0, 0, 0, 0.28),
    inset -5px 0 10px -4px rgba(0, 0, 0, 0.28),
    /* Inner bottom highlight (light bouncing off recess floor) */
    inset 0 -2px 0 0 rgba(255, 255, 255, 0.15);
}


.crt-controls {
  position: absolute;
  bottom: calc(var(--crt-bezel-bottom) / 2 - 24px);
  left: clamp(28px, 5.5vw, 86px);
  right: clamp(28px, 5.5vw, 86px);
  display: grid;
  grid-template-columns: minmax(100px, 1fr) auto;
  align-items: center;
  column-gap: clamp(18px, 4vw, 52px);
  min-height: 24px;
  pointer-events: none;
}

.pc-group {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 20px;
  gap: 10px;
}

.pc-group-power {
  justify-self: start;
}

.pc-group-fdd {
  justify-self: end;
}

.pc-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.1em;
  color: rgba(21, 74, 91, 0.85);
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.pc-btn {
  display: inline-block;
  flex: 0 0 auto;
  background: var(--pc-cabinet-highlight);
  border: 1px solid var(--pc-cabinet-edge);
  border-radius: 1px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(0, 0, 0, 0.25);
}

.pc-btn-power {
  width: 30px;
  height: 14px;
}

.pc-led {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background-color: #00ff66;
  border-radius: 50%;
  box-shadow: 0 0 8px #00ff66, 0 0 2px #00ff66;
  animation: ledGlow 3s infinite ease-in-out;
}

.pc-led-fdd {
  background-color: #ffb347;
  box-shadow: 0 0 7px #ffb347, 0 0 2px #ffb347;
  animation-duration: 4.5s;
}

.pc-fdd-slot {
  position: relative;
  isolation: isolate;
  width: clamp(240px, 30vw, 360px);
  height: clamp(26px, 3vw, 36px);
}

.pc-fdd-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  /* background:
    linear-gradient(180deg,
      rgba(21, 74, 91, 0.18) 0%,
      transparent 35%,
      rgba(190, 230, 240, 0.22) 100%),
    linear-gradient(180deg, var(--pc-cabinet-edge) 0%, var(--pc-cabinet) 50%, var(--pc-cabinet-shadow) 100%); */
  border-radius: 3px;
  box-shadow:
    inset 0 1px 1.5px rgba(21, 74, 91, 0.45),
    inset 0 -1px 0 rgba(190, 230, 240, 0.55),
    0 -1px 0 rgba(190, 230, 240, 0.6),
    0 1px 1px rgba(21, 74, 91, 0.5);
}

.pc-fdd-slot::after {
  content: none;
}

/* 가로 슬릿 — Mac SE 플로피 입구 */
.pc-fdd-mouth {
  position: absolute;
  left: 5%;
  right: 14%;
  top: 50%;
  transform: translateY(-50%);
  height: 22%;
  z-index: 3;
  background: linear-gradient(180deg, #000 0%, #02060a 50%, #0d1a1f 100%);
  border-radius: 1.5px;
  box-shadow:
    inset 0 1px 1.5px rgba(0, 0, 0, 0.95),
    inset 0 -0.5px 0 rgba(255, 255, 255, 0.05),
    0 -0.5px 0 rgba(21, 74, 91, 0.6),
    0 1px 0.5px rgba(190, 230, 240, 0.55);
}

.pc-fdd-mouth::after {
  content: none;
}

.pc-fdd-screw {
  position: absolute;
  right: 6%;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 4px;
  z-index: 4;
  background: radial-gradient(circle at 50% 60%, #000 0%, #0a0805 65%, #1a1610 100%);
  border-radius: 50%;
  box-shadow:
    inset 0 0.5px 0.5px rgba(0, 0, 0, 0.95),
    0 -0.5px 0 rgba(48, 38, 22, 0.55),
    0 0.5px 0 rgba(255, 250, 235, 0.5);
}

@keyframes ledGlow {
  0%, 100% {
    opacity: 0.75;
    box-shadow: 0 0 6px #00ff66;
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 12px #00ff66, 0 0 4px #00ff66;
  }
}

@media (max-width: 1100px) {
  .crt-bezel {
    --crt-bezel-size: 16px;
    --crt-bezel-radius: 24px;
  }
}

@media (max-width: 900px) {
  .crt-bezel {
    --crt-bezel-size: 8px;
    --crt-bezel-radius: 12px;
  }

  .crt-controls {
    left: clamp(18px, 4vw, 30px);
    right: clamp(18px, 4vw, 30px);
    bottom: calc(var(--crt-bezel-bottom) / 2 - 14px);
    grid-template-columns: minmax(86px, 1fr) auto;
    column-gap: clamp(8px, 2vw, 14px);
    min-height: 20px;
  }

  .pc-group {
    gap: 7px;
  }

  .pc-label {
    font-size: 10px;
    letter-spacing: 0.08em;
  }

  .pc-btn-power {
    width: 26px;
    height: 12px;
  }

  .pc-fdd-slot {
    width: clamp(150px, 32vw, 210px);
    height: clamp(20px, 3vw, 26px);
  }

  .pc-fdd-screw {
    width: 3px;
    height: 3px;
  }

  .pc-led {
    width: 7px;
    height: 7px;
  }
}

@media (max-width: 420px) {
  .crt-controls {
    left: 14px;
    right: 14px;
    grid-template-columns: minmax(74px, 1fr) auto;
    column-gap: 6px;
  }

  .pc-group {
    gap: 5px;
  }

  .pc-label {
    font-size: 9px;
  }

  .pc-btn-power {
    width: 22px;
    height: 10px;
  }

  .pc-led {
    width: 6px;
    height: 6px;
  }

  .pc-fdd-slot {
    width: clamp(132px, 35vw, 154px);
    height: 22px;
  }

  .pc-fdd-screw {
    width: 3px;
    height: 3px;
  }
}
