/* TESHIMA LAB portfolio — CENOTAPH for & Scene Architecture */
:root {
  --ink: #f5f2e9;
  --hair: rgba(245, 242, 233, 0.42);
  --screen: 100svh;
  --screen: 100dvh;
  --ease: cubic-bezier(0.2, 0.7, 0.23, 1);
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0d0f14;
  color: var(--ink);
  font: 400 12px/1.45 -apple-system, BlinkMacSystemFont, 'Helvetica Neue', 'Noto Sans JP', Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

button, a {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

.lab [hidden] {
  display: none !important;
}

.stage {
  position: fixed;
  inset: 0;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  height: 100%;
  height: 100svh;
  height: 100dvh;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background: #08090d;
}

/* ==========================================================================
   Background Layers
   ========================================================================== */
.layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s var(--ease, ease);
}
.layer img, .layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
}

/* --- Hero entrance layer --- */
.layer--hero {
  background: #07090e url('assets/scenes/hero_start.webp?v=133') center center / cover no-repeat;
  z-index: 1;
  transition: opacity 0.6s var(--ease, ease);
}
.heroOverlay {
  display: none !important;
}

/* --- Lobby frame sequence (Canvas) --- */
.layer--seq {
  background: transparent;
  z-index: 2;
}
.layer--seq canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.seqScrim {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.8s ease;
  background: linear-gradient(90deg, rgba(8, 6, 5, 0.82) 0%, rgba(8, 6, 5, 0.55) 24%, rgba(8, 6, 5, 0) 48%);
}

/* --- Floor plates & Dolly videos --- */
.layer--video {
  z-index: 3;
  pointer-events: none;
}
.layer--plate {
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.layer--plate.is-end {
  opacity: 1;
}
.layer--plate img.b {
  opacity: 1;
}
.layer--plate.no-fade {
  transition: none;
}

/* --- Dip to black for instant transitions --- */
.layer--dip {
  background: #050608;
  transition: opacity 0.28s ease;
  z-index: 90;
}
.layer--dip.is-on {
  opacity: 1;
}

/* ==========================================================================
   Layer State Control
   ========================================================================== */
.stage[data-state=hero] .layer--hero {
  opacity: 1;
  pointer-events: auto;
}
.stage[data-state=lobby] .layer--hero,
.stage[data-state=floor][data-floor="0"] .layer--hero {
  opacity: 1;
  pointer-events: none !important;
}
.stage[data-state=floor]:not([data-floor="0"]) .layer--hero {
  opacity: 0 !important;
  pointer-events: none !important;
}
.stage[data-state=hero] .layer--seq,
.stage[data-state=hero] .layer--plate,
.stage[data-state=hero] .layer--video {
  opacity: 0 !important;
  transition: none !important;
}
.stage[data-state=lobby] .layer--seq,
.stage[data-state=floor][data-floor="0"] .layer--seq {
  opacity: 1 !important;
  transition: none !important;
}
.stage[data-state=floor]:not([data-floor="0"]) .layer--seq {
  opacity: 0 !important;
  transition: none !important;
}
.stage[data-state=floor][data-floor="0"] .layer--plate {
  opacity: 0;
  pointer-events: none;
}
.stage[data-state=floor][data-floor="0"] .layer--plate.is-end {
  opacity: 1 !important;
  pointer-events: none;
  z-index: 5;
}
.stage[data-state=floor][data-floor="0"] .seqScrim {
  opacity: 1;
}
.stage[data-state=floor]:not([data-floor="0"]) .layer--video {
  opacity: 1;
}
.stage[data-state=floor]:not([data-floor="0"]) .layer--plate {
  opacity: 0;
}
.stage[data-state=floor]:not([data-floor="0"]) .layer--plate.is-end {
  opacity: 1;
}

/* --- Static image fallback when video playback fails or is disabled (?novideo=1) --- */
.stage.is-video-fallback .layer--video {
  opacity: 0 !important;
  display: none !important;
}
.stage[data-state=floor]:not([data-floor="0"]).is-video-fallback .layer--plate {
  opacity: 1 !important;
  pointer-events: auto;
}
.stage.is-video-fallback .layer--plate img.b {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.stage.is-video-fallback .layer--plate.is-end img.b {
  opacity: 1 !important;
}
.stage.is-hero-fallback .layer--hero video {
  opacity: 0 !important;
  display: none !important;
}
.stage.is-hero-fallback .layer--hero {
  background: #07090e url('assets/scenes/hero_start.webp?v=133') center center / cover no-repeat !important;
}

/* ==========================================================================
   UI Overlays
   ========================================================================== */
.stage .lab {
  position: absolute;
  inset: 0;
  width: auto;
  height: 100%;
  min-height: 0 !important;
  background: none;
  pointer-events: none;
  z-index: 10;
  isolation: auto;
}
.stage .lab button,
.stage .lab a,
.stage .lab__portal.is-visible {
  pointer-events: auto;
}

/* --- CENOTAPH for Cinematic Typography (LA HAINE aesthetic) --- */
.cenotaph {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 95vw;
  max-width: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  z-index: 15;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.8s ease, filter 0.8s ease;
}
.cenotaph__title {
  margin: 0;
  padding: 0;
  font-family: "Archivo Black", sans-serif;
  font-weight: 900;
  font-size: clamp(2.8rem, min(14.2vw, 34vh), 13.5rem);
  line-height: 0.9;
  letter-spacing: -0.048em;
  color: #000000;
  -webkit-text-stroke: 0.045em #ffffff;
  paint-order: stroke fill;
  text-transform: uppercase;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  filter: none;
  white-space: nowrap;
}
.cenotaph__n {
  display: inline-block;
  margin-left: -0.022em;
  clip-path: polygon(-30% 6.2%, 130% 6.2%, 130% 93.5%, -30% 93.5%);
}
.cenotaph__t {
  display: inline-block;
  margin-left: 0.028em;
}
.cenotaph__a {
  display: inline-block;
  margin-left: -0.11em;
}
.cenotaph__prefix {
  display: block;
  font-family: "Inter", "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-style: normal;
  font-size: clamp(0.9rem, min(2.3vw, 4vh), 2.2rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  margin-bottom: clamp(-0.1rem, 0.1vw, 0.25rem);
  transform: translateY(3px);
}
.cenotaph__for {
  display: block;
  font-family: "Cormorant Garamond", "Baskerville", "Libre Baskerville", "Didot", "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(0.9rem, min(2.3vw, 4vh), 2.2rem);
  font-weight: 300;
  letter-spacing: 0.06em;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.95);
  margin-top: clamp(-0.4rem, -0.8vw, -0.1rem);
  transform: translateY(-4px);
}

/* --- 画面最下段の SCROLL Cue --- */
.scrollCue {
  position: absolute;
  bottom: clamp(24px, 4vh, 44px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(9px, 1.1vw, 11px);
  font-weight: 600;
  letter-spacing: 0.28em;
  color: rgba(255, 255, 255, 0.75);
  pointer-events: none;
  z-index: 20;
  animation: cueBounce 2.4s ease-in-out infinite;
  transition: opacity 0.6s ease;
  opacity: 0;
}
.scrollCue svg {
  width: 18px;
  height: 18px;
  opacity: 0.8;
}
@keyframes cueBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.75; }
  50% { transform: translateX(-50%) translateY(6px); opacity: 1; }
}
.stage[data-state=hero] .scrollCue:not(.is-hidden),
.stage[data-state=floor].is-waiting-scroll .scrollCue:not(.is-hidden) {
  opacity: 1 !important;
  display: flex !important;
  pointer-events: none !important;
}
.stage:not([data-state=hero]):not(.is-waiting-scroll) .scrollCue,
.stage .layer--plate.is-end ~ .lab .scrollCue,
.stage[data-state=floor]:has(.layer--plate.is-end) .scrollCue,
.scrollCue.is-hidden {
  opacity: 0 !important;
  display: none !important;
  pointer-events: none !important;
}

.stage[data-state=hero] .cenotaph {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1) !important;
  filter: none;
  pointer-events: auto;
  transition: none;
}
.stage[data-state=lobby] .cenotaph {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(1) !important;
  filter: blur(8px) !important;
}
.stage[data-state=floor] .cenotaph {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translate(-50%, -50%) scale(1) !important;
}

/* Pre-paint suppression ONLY during initial page load with direct floor hash */
html[data-page-floor] .stage .layer--hero {
  opacity: 0 !important;
  pointer-events: none !important;
}
html[data-page-floor] .stage .cenotaph {
  opacity: 0 !important;
  visibility: hidden !important;
  display: none !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Floor Select Rail (Right)
   ========================================================================== */
.lab__rail {
  position: absolute;
  z-index: 50 !important;
  right: clamp(18px, 2.75vw, 44px);
  top: 50%;
  transform: translateY(-50%);
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.stage[data-state=floor] .lab__rail {
  opacity: 1 !important;
  pointer-events: auto !important;
}
.stage[data-state=floor] .lab .lab__rail button {
  pointer-events: auto !important;
}
.rail__divider {
  width: 100%;
  height: 1px;
  background: rgba(255, 255, 255, 0.22);
  margin: 3px 0;
  border: none;
  box-sizing: border-box;
}

/* Header & 画面右上の白文字CREDITボタン (元あったCONTACTの場所で全デバイス統一) */
.lab__header {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: 0;
  height: clamp(58px, 6.4vh, 78px);
  padding: 0 clamp(24px, 3.5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.lab__header-left {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 26px);
  pointer-events: auto;
}
.lab__header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: auto;
}
.lab__credit.is-next-to-portfolio {
  margin-left: 0;
  display: inline-block;
  vertical-align: middle;
}
.lab__brand,
.lab__credit {
  pointer-events: auto;
  display: inline-block;
  background: none;
  border: 0;
  padding: 10px 0;
  color: #ffffff !important;
  text-decoration: none;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.5);
  transition: opacity 0.2s ease;
  cursor: pointer;
  line-height: 1;
  text-transform: uppercase;
}
.lab__brand:hover,
.lab__credit:hover {
  opacity: 0.7;
}
.lab__credit[hidden] {
  display: none !important;
}


/* Portal base layout (merged from hero-v13.css) */
.lab__portal {
  position: absolute;
  z-index: 18;
  left: clamp(24px, 3.8vw, 64px);
  top: 50%;
  width: min(280px, 32vw);
  padding: 16px 0 0;
  border-top: 1px solid var(--hair);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-38%) translateX(-12px);
  transition: opacity 0.45s ease, transform 0.5s var(--ease);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.75);
}
.lab__portal.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}
.lab__portal h2 {
  font-size: clamp(14px, 1.25vw, 19px);
  line-height: 1.25;
  letter-spacing: 0.08em;
  font-weight: 400;
  margin: 12px 0 18px;
}

/* OPEN PAGE: 白縁完全排除（border: none）、50%透過シック背景、影なし */
/* OPEN PAGE & フロア選択レール: 完全統一された50%透過ダークシック背景（rgba(18, 18, 18, 0.5)） */
.lab__portal a {
  color: #ffffff !important;
  background: rgba(18, 18, 18, 0.5) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 10px 16px !important;
  display: inline-flex !important;
  width: auto !important;
  gap: 16px !important;
  align-items: center !important;
  justify-content: center !important;
  text-decoration: none !important;
  font-size: 10px !important;
  font-family: inherit !important;
  font-weight: 400 !important;
  letter-spacing: 0.16em !important;
  line-height: 1 !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  cursor: pointer !important;
  transition: background 0.25s, transform 0.2s !important;
  border-radius: 0 !important;
  transform: none !important;
}
.lab__portal a:after {
  content: '↗';
  font-size: 13px;
}
.lab__portal a:hover {
  background: rgba(48, 48, 52, 0.5) !important;
  border: none !important;
  transform: none !important;
}

/* フロア選択レール: 完全50%透過で統一、active状態も50%透過を維持し左ハイライト線で識別 */
.lab__rail button {
  background: rgba(18, 18, 18, 0.5) !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  padding: 8px 14px !important;
  border-radius: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  cursor: pointer !important;
  transition: background 0.25s, border-left-color 0.2s !important;
  color: #ffffff !important;
  transform: none !important;
  border-left: 2px solid transparent !important;
}
.lab__rail button:before {
  display: none !important;
  content: none !important;
}
.lab__rail button span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.1em !important;
  padding: 0 !important;
  color: #ffffff !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
}
.lab__rail button b {
  font-size: 10px !important;
  font-weight: 400 !important;
  letter-spacing: 0.16em !important;
  color: #ffffff !important;
  text-transform: uppercase;
}
.lab__rail button:hover {
  background: rgba(48, 48, 52, 0.5) !important;
  border: none !important;
  transform: none !important;
  border-left: 2px solid rgba(255, 255, 255, 0.4) !important;
}
.lab__rail button.is-active {
  background: rgba(65, 65, 72, 0.5) !important;
  border: none !important;
  border-left: 2px solid #ffffff !important;
  box-shadow: none !important;
  transform: none !important;
}
.lab__rail button.is-active:before {
  display: none !important;
}
.lab__rail button.is-active span {
  color: #ffffff !important;
}

/* 静止画サムネイル領域のクリッカブルホットスポット */
.floorHotspot {
  position: absolute;
  z-index: 12;
  cursor: pointer;
  pointer-events: auto;
  outline: none;
  border: none;
  background: transparent;
}
.floorHotspot[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* --- モーダル表示時の背景完全ロック --- */
body.cipher-locked {
  overflow: hidden !important;
  touch-action: none !important;
}
body.cipher-locked .stage > *:not(#cipherModal),
body.cipher-locked .lab > *:not(#cipherModal),
body.cipher-locked nav,
body.cipher-locked aside,
body.cipher-locked header,
body.cipher-locked canvas {
  pointer-events: none !important;
  user-select: none !important;
}

/* --- B2F アトム人形インタラクション（マスター写真上に完全一致で接地・足元乗算影） --- */
.atomLayer {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
}
.atomLayer[hidden] {
  display: none !important;
}
.atomDollWrap {
  position: absolute;
  pointer-events: auto;
  cursor: default !important;
  background: transparent;
  outline: none;
  border: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.atomDoll {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 2;
  user-select: none;
  -webkit-user-select: none;
  transform-origin: 50% 98%;
}

@keyframes atomBobblehead {
  0% { transform: rotate(0deg) scale(1); }
  12% { transform: rotate(-9deg) scale(1.02); }
  24% { transform: rotate(8deg) scale(0.99); }
  36% { transform: rotate(-6deg) scale(1.01); }
  50% { transform: rotate(4deg) scale(0.995); }
  66% { transform: rotate(-2deg) scale(1); }
  82% { transform: rotate(1deg) scale(1); }
  100% { transform: rotate(0deg) scale(1); }
}

.atomDollWrap.is-bobbling .atomDoll {
  animation: atomBobblehead 1.1s cubic-bezier(0.25, 1, 0.5, 1) !important;
}

.atomShadow {
  position: absolute;
  left: -15%;
  bottom: -6px;
  width: 130%;
  height: 22px;
  background:
    radial-gradient(ellipse 26% 40% at 38% 50%, rgba(10, 8, 5, 0.88) 0%, rgba(20, 15, 10, 0.5) 45%, transparent 75%),
    radial-gradient(ellipse 24% 40% at 72% 52%, rgba(10, 8, 5, 0.88) 0%, rgba(20, 15, 10, 0.5) 45%, transparent 75%),
    url("assets/scenes/atom_shadow.png") no-repeat center bottom / contain,
    radial-gradient(ellipse 55% 45% at 52% 48%, rgba(25, 18, 12, 0.55) 0%, rgba(35, 25, 18, 0.25) 50%, transparent 80%);
  border-radius: 50%;
  mix-blend-mode: multiply;
  pointer-events: none;
  filter: blur(1.5px);
  z-index: 1;
}
/* 吹き出し: シンプルな白吹き出し + クリップボードコピーボタン */
.atomBubble {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: #0b0f17;
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  opacity: 1;
  transition: opacity 0.35s ease, transform 0.35s ease;
  z-index: 20;
}
.atomBubble.is-hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(6px);
}
.atomBubble[hidden] {
  display: none !important;
}
.atomBubbleArrow {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #ffffff;
}
.atomBubbleContent {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.atomBubbleLabel {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.05em;
}
.atomBubbleKeyword {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #0b0f17;
  letter-spacing: 0.06em;
  user-select: all;
  -webkit-user-select: all;
}
.atomCopyBtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 0;
  color: #334155;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}
.atomCopyBtn:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}
.atomCopyBtn:active {
  transform: scale(0.92);
}
.atomCopyBtn.is-copied {
  background: #22c55e;
  border-color: #16a34a;
  color: #ffffff;
}

/* --- 認証モーダル (Secured Access Terminal UI) --- */
/* --- 認証モーダル (HAL 9000 Console Terminal UI) --- */
/* 背景を暗くせず、CREDITのようにモーダル本体のみが浮遊。背景クリック・操作は透明オーバーレイで完全遮断 */
.cipherModal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 100000 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 20px 16px !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
  animation: cipherFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cipherModal[hidden] {
  display: none !important;
}
@keyframes cipherFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.cipherModal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
  cursor: default;
}

/* HAL 9000 ミニマルコンソール (外枠黒背景カードのみ角R14px) */
.auth-card.hal-console {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 380px;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 30px 24px 20px;
  background: #000000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95);
  text-align: center;
  margin: auto;
  box-sizing: border-box;
  animation: authCardPop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}
@keyframes authCardPop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-card.success-border {
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95) !important;
}

/* HAL 9000 円形アイレンズ (実写レンズ画像 & 中央焦点ブリージングランプ) */
.hal-eye-wrapper {
  width: 104px;
  height: 104px;
  margin: 0 auto 18px auto;
  border-radius: 50%;
  overflow: hidden;
  position: relative;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.9);
}

.hal-eye-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: opacity 0.35s ease;
}

.hal-eye-img--green {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  filter: none !important;
}

.is-authenticated .hal-eye-img:not(.hal-eye-img--green) {
  opacity: 0 !important;
}

.is-authenticated .hal-eye-img--green {
  opacity: 1 !important;
  display: block !important;
}

/* 赤ランプの中央の焦点部分のみが小さくふわっとゆっくり点滅 (デフォルト・縦長) */
.hal-eye-focal {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px 3px #ffffff, 0 0 20px 8px #ff1a2a;
  animation: halFocalPulse 3.2s ease-in-out infinite;
  pointer-events: none;
  z-index: 4;
  transition: opacity 0.3s ease;
}

@keyframes halFocalPulse {
  0%, 100% {
    transform: scale(0.82);
    opacity: 0.45;
    box-shadow: 0 0 6px 2px #ffffff, 0 0 15px 5px rgba(255, 26, 42, 0.45);
  }
  50% {
    transform: scale(1.18);
    opacity: 1;
    box-shadow: 0 0 10px 4px #ffffff, 0 0 24px 9px #ff1a2a;
  }
}

/* 認証時: 赤点滅を非表示にし、高精細グリーン光学写真を表示 */
.is-authenticated .hal-eye-focal {
  opacity: 0 !important;
  display: none !important;
}

.hal-eye-green-glow {
  display: none !important;
}

/* 認証モーダル タイトル・説明テキスト (中央揃え・白/グレー) */
.auth-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffffff;
  margin: 0 0 6px 0;
  text-transform: uppercase;
  text-align: center;
}

.auth-desc {
  font-size: 12px;
  line-height: 1.6;
  color: #a0a6b2;
  margin: 0 0 20px 0;
  letter-spacing: 0.02em;
  text-align: center;
}

/* 認証フォーム */
.auth-form {
  display: flex;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
}

.field-label {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #ffffff;
  margin-bottom: 14px;
  text-align: center;
  text-transform: uppercase;
}

.input-field {
  width: 100%;
  height: 52px;
  background: #000000;
  border: 2px solid #ffffff;
  border-radius: 0;
  padding: 0 16px;
  font-size: 20px;
  letter-spacing: 0.35em;
  text-align: center;
  color: #ffffff;
  outline: none;
  -webkit-appearance: none;
  margin-bottom: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.input-field::placeholder {
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.75);
}

.input-field:focus {
  border-color: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
}

.input-field.input-valid {
  border-color: #ffffff;
  box-shadow: none;
}

.input-field.is-error {
  border-color: #ef4444;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
  animation: inputShake 0.35s ease;
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.btn-hint {
  width: 100%;
  height: 50px;
  background: #000000;
  border: 1px solid #333333;
  border-radius: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-hint:hover {
  background: #151515;
  border-color: #555555;
}

.btn-auth {
  width: 100%;
  height: 50px;
  background: #0099cc;
  border: none;
  border-radius: 0;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  box-sizing: border-box;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn-auth:hover {
  background: #00abeb;
}
.btn-auth:active {
  transform: scale(0.985);
}
.btn-auth.btn-success {
  background: #111827 !important;
  border: 1px solid #374151 !important;
  color: #10b981 !important;
  box-shadow: none !important;
}

.btn-back {
  background: transparent;
  border: none;
  color: #888888;
  font-size: 14px;
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: center;
  padding: 6px 0;
  transition: color 0.2s ease;
}
.btn-back:hover {
  color: #ffffff;
}

@media (max-height: 720px) {
  .auth-card.hal-console {
    padding: 16px 20px 14px;
    max-width: 340px;
  }
  .hal-eye-wrapper {
    width: 68px;
    height: 68px;
    margin: 0 auto 10px auto;
  }
  .auth-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .auth-desc {
    font-size: 10px;
    margin-bottom: 10px;
    line-height: 1.35;
  }
  .field-label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .input-field {
    height: 36px;
    font-size: 16px !important;
    margin-bottom: 8px;
  }
  .btn-hint {
    height: 34px;
    font-size: 12px;
    margin-bottom: 6px;
  }
  .btn-auth {
    height: 36px;
    font-size: 12px;
    margin-bottom: 6px;
  }
  .btn-back {
    padding: 2px 0;
    font-size: 11px;
  }
}

@media (max-height: 480px) {
  .cipherModal {
    padding: 6px 12px !important;
  }
  .auth-card.hal-console {
    padding: 10px 16px 8px;
    max-width: 300px;
    max-height: 96vh;
    max-height: 96dvh;
  }
  .hal-eye-wrapper {
    width: 46px;
    height: 46px;
    margin: 0 auto 6px auto;
  }
  .auth-title {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .auth-desc {
    display: none;
  }
  .field-label {
    font-size: 10px;
    margin-bottom: 4px;
  }
  .input-field {
    height: 30px;
    font-size: 16px !important;
    margin-bottom: 6px;
  }
  .btn-hint {
    height: 30px;
    font-size: 11px;
    margin-bottom: 5px;
  }
  .btn-auth {
    height: 30px;
    font-size: 11px;
    margin-bottom: 5px;
  }
  .btn-back {
    padding: 1px 0;
    font-size: 10px;
  }
}

/* ==============================================================
   横長表示（orientation: landscape）時のみ赤ライトの明滅・サイズを抑制
   ============================================================== */
@media (orientation: landscape) {
  .hal-eye-wrapper {
    width: 68px;
    height: 68px;
    margin: 0 auto 12px auto;
  }
  .hal-eye-focal {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 6px 2px #ffffff, 0 0 16px 6px #ff1a2a;
    animation: halFocalPulse 3.2s ease-in-out infinite;
  }
}

@media (orientation: landscape) and (max-height: 720px) {
  .auth-card.hal-console {
    padding: 16px 20px 14px;
    max-width: 320px;
  }
  .hal-eye-wrapper {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px auto;
  }
  .hal-eye-focal {
    width: 7px;
    height: 7px;
    box-shadow: 0 0 5px 2px #ffffff, 0 0 14px 5px #ff1a2a;
    animation: halFocalPulse 3.2s ease-in-out infinite;
  }
  .auth-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  .auth-desc {
    font-size: 10px;
    margin-bottom: 10px;
    line-height: 1.35;
  }
  .field-label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .input-field {
    height: 34px;
    font-size: 16px !important;
    margin-bottom: 8px;
  }
  .btn-hint {
    height: 32px;
    font-size: 11px;
    margin-bottom: 6px;
  }
  .btn-auth {
    height: 34px;
    font-size: 12px;
    margin-bottom: 6px;
  }
  .btn-back {
    padding: 2px 0;
    font-size: 11px;
  }
}

@media (orientation: landscape) and (max-height: 480px) {
  .cipherModal {
    padding: 6px 12px !important;
  }
  .auth-card.hal-console {
    padding: 10px 16px 8px;
    max-width: 290px;
    max-height: 96vh;
    max-height: 96dvh;
  }
  .hal-eye-wrapper {
    width: 40px;
    height: 40px;
    margin: 0 auto 6px auto;
  }
  .hal-eye-focal {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 1px 0.5px #ffffff, 0 0 3px 1px rgba(255, 26, 42, 0.7);
  }
  .auth-title {
    font-size: 11px;
    margin-bottom: 2px;
  }
  .auth-desc {
    display: none;
  }
  .field-label {
    font-size: 10px;
    margin-bottom: 3px;
  }
  .input-field {
    height: 28px;
    font-size: 16px !important;
    margin-bottom: 5px;
  }
  .btn-hint {
    height: 28px;
    font-size: 11px;
    margin-bottom: 4px;
  }
  .btn-auth {
    height: 28px;
    font-size: 11px;
    margin-bottom: 4px;
  }
  .btn-back {
    padding: 1px 0;
    font-size: 10px;
  }
}

/* ==========================================================================
   Step 3: Transparent Thumbnail Hotspot & B???F Shelf Credits
   ========================================================================== */
.stageHotspot {
  position: absolute;
  z-index: 25;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: none !important;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  display: block;
  box-sizing: border-box;
  background: transparent;
  border: none;
  outline: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.stageHotspot[hidden] {
  display: none !important;
  pointer-events: none !important;
}

.emailHotspot {
  position: absolute;
  z-index: 30;
  cursor: pointer !important;
  pointer-events: auto !important;
  display: block;
  box-sizing: border-box;
  background: transparent;
  border: none;
  outline: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.emailHotspot[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* サムネイル選択範囲 可視化検証用スタイル */
.stage.is-debug-hotspots .stageHotspot {
  outline: 2px solid #00f3ff !important;
  background: rgba(0, 243, 255, 0.22) !important;
  box-shadow: 0 0 16px rgba(0, 243, 255, 0.45) !important;
}
.stage.is-debug-hotspots .emailHotspot {
  outline: 2px solid #ff0055 !important;
  background: rgba(255, 0, 85, 0.35) !important;
  box-shadow: 0 0 16px rgba(255, 0, 85, 0.6) !important;
}
.stage.is-debug-hotspots .jacketHotspot {
  outline: 2px solid #00ff88 !important;
  background: rgba(0, 255, 136, 0.25) !important;
  box-shadow: 0 0 16px rgba(0, 255, 136, 0.5) !important;
}
.stage.is-debug-hotspots .hatHotspot {
  outline: 2px solid #ffcc00 !important;
  background: rgba(255, 204, 0, 0.25) !important;
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.5) !important;
}
.stage.is-debug-hotspots .shelfHotspot {
  outline: 2px solid #a855f7 !important;
  background: rgba(168, 85, 247, 0.25) !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.5) !important;
}

/* --- 認証ヒント ポップアップモーダル (HAL 9000 SEARCH FOR CLUES) --- */
.cipherHintModal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100005 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  animation: cipherFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto !important;
}
.cipherHintModal[hidden] {
  display: none !important;
  pointer-events: none !important;
}
.cipherHintModal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 12, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cipherHintModal__dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 320px;
  background: #0c0e12;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  padding: 24px 20px 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 24px rgba(255, 255, 255, 0.12);
  color: #fff;
  box-sizing: border-box;
  text-align: center;
}
.cipherHintModal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.cipherHintModal__close:hover {
  color: #fff;
}
.cipherHintModal__header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cipherHintModal__tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #ffffff;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}
.cipherHintModal__title {
  margin: 4px 0 16px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ffffff;
  text-align: center;
}
.cipherHintModal__list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.cipherHintModal__list li {
  font-size: 13px;
  line-height: 1.5;
  color: #ffffff;
  padding: 0;
  margin: 0;
  letter-spacing: 0.03em;
  text-align: center;
  width: 100%;
}
.cipherHintModal__list li::before {
  display: none !important;
}
.cipherHintModal__okBtn {
  width: 100%;
  padding: 11px 14px;
  background: #ffffff;
  border: none;
  border-radius: 4px;
  color: #000000;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.cipherHintModal__okBtn:hover {
  background: #e6e6e6;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   制作クレジット ポップアップモーダル（シンプル・中央表示・目立たない洗練されたトーン）
   - 表示中は枠外の操作（クリック・スクロール等）を一切受け付けない
   ========================================================================== */
.creditModal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  animation: creditModalFadeIn 0.25s ease;
  pointer-events: auto !important;
}
.creditModal[hidden] {
  display: none !important;
}
@keyframes creditModalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.creditModal__backdrop {
  position: absolute;
  inset: 0;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
  cursor: default;
}

.creditModal__dialog {
  position: relative;
  z-index: 2;
  width: min(440px, 92vw);
  max-height: 86vh;
  overflow: visible;
  background: rgba(18, 16, 14, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 34px 28px 28px;
  box-sizing: border-box;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
  border-radius: 0;
  animation: creditModalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto !important;
}
@keyframes creditModalSlideUp {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.creditModal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 15px;
  line-height: 1;
  padding: 6px;
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.creditModal__close:hover {
  color: #ffffff;
}

/* CREDITモーダルの「Hire me!」吹き出し（アトムの吹き出しと完全同一トーン・白背景・黒文字・三角矢印） */
.hireMeBubble {
  position: absolute;
  bottom: calc(100% + 8px);
  right: -4px;
  background: #ffffff;
  color: #0b0f17;
  padding: 5px 11px;
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}
.hireMeBubbleArrow {
  position: absolute;
  top: 100%;
  right: 10px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #ffffff;
}
.creditModal__close:hover .hireMeBubble {
  opacity: 1;
  transform: translateY(0);
}

.creditModal__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  width: 100%;
  max-height: calc(86vh - 68px);
  overflow-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}

.creditModal__title {
  margin: 0 0 4px 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.92);
  text-transform: uppercase;
}

.creditModal__section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5px;
  width: 100%;
}

.creditModal__role {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.42);
  margin-bottom: 1px;
}

.creditModal__val {
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
  text-align: center;
}

.creditModal__ai {
  margin: 6px 0 0 0;
  font-size: 10px;
  font-style: italic;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

.creditModal__footer {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.creditModal__copy {
  margin: 0;
  font-size: 9.5px;
  letter-spacing: 0.09em;
  color: rgba(255, 255, 255, 0.55);
}

/* ==========================================================================
   Mobile & Tablet Responsive Adjustments
   ========================================================================== */
@media (max-width: 780px) {
  .cenotaph {
    width: 96vw;
  }
  .cenotaph__prefix,
  .cenotaph__for {
    font-size: clamp(0.95rem, 3vw, 1.35rem);
  }
  .cenotaph__prefix {
    margin-bottom: 0rem;
    transform: translateY(1.5px);
  }
  .cenotaph__for {
    margin-top: -0.2rem;
  }
  .cenotaph__title {
    font-size: clamp(2.8rem, 13.8vw, 7rem);
    letter-spacing: -0.045em;
    -webkit-text-stroke: 0.045em #ffffff;
  }
  
  /* B2F アトム吹き出しの画面端はみ出し防止 */
  .atomBubble {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
  .atomBubbleArrow {
    left: auto !important;
    right: 18px !important;
    transform: none !important;
  }

  /* Mobile header & rail (枠の二重化を完全排除、ボタン単体の枠のみ) */
  .lab__header {
    height: 56px;
    padding: 0 20px;
  }
  .lab__rail {
    right: 12px !important;
    top: auto !important;
    bottom: 16px !important;
    transform: none !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    gap: 6px !important;
  }
  .lab__rail button {
    padding: 6px 8px !important;
    min-height: 34px !important;
    justify-content: center !important;
  }
  .lab__rail button span {
    font-size: 10px !important;
  }
  .lab__rail button b {
    display: none !important;
  }
  .rail__btn--secret {
    margin-top: 4px !important;
    padding-top: 6px !important;
  }
  
  .lab__portal {
    left: 20px !important;
    top: auto !important;
    bottom: 24px !important;
    width: min(280px, 72vw) !important;
    transform: translateY(12px);
  }
  .lab__portal.is-visible {
    transform: translateY(0);
  }
  .lab__portal h2 {
    font-size: clamp(2rem, 7.5vw, 3rem) !important;
    margin: 8px 0 14px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .lab__header {
    height: 40px;
    padding: 0 max(20px, var(--sa-r)) 0 max(20px, var(--sa-l));
  }
  .lab__rail {
    top: 50% !important;
    bottom: auto !important;
    right: max(12px, var(--sa-r)) !important;
    transform: translateY(-50%) !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    gap: 4px !important;
  }
  .lab__rail button {
    padding: 4px 8px !important;
    min-height: 28px !important;
    min-width: 44px !important;
    width: auto !important;
    justify-content: center !important;
  }
  .lab__rail button span {
    font-size: 9.5px !important;
  }
  .lab__rail button b {
    display: none !important;
  }
  .rail__divider {
    margin: 1px 0 !important;
  }
  .rail__btn--secret {
    margin-top: 2px !important;
    padding-top: 4px !important;
  }
  .lab__portal {
    top: auto !important;
    bottom: max(16px, var(--sa-b)) !important;
    left: max(20px, var(--sa-l)) !important;
    width: auto !important;
    max-width: 220px !important;
    padding-top: 10px !important;
    transform: translateY(8px);
  }
  .lab__portal.is-visible {
    transform: translateY(0);
  }
  .lab__portal h2 {
    font-size: 15px !important;
    margin: 6px 0 10px !important;
  }
  .lab__portal a {
    padding: 8px 13px !important;
    font-size: 9.5px !important;
  }
  .atomBubble {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
    font-size: 11px !important;
    padding: 6px 10px !important;
  }
  .atomBubbleArrow {
    left: auto !important;
    right: 18px !important;
    transform: none !important;
  }
  .creditModal {
    padding: 8px max(16px, var(--sa-r)) 8px max(16px, var(--sa-l)) !important;
  }
  .creditModal__dialog {
    width: min(420px, 84vw) !important;
    max-height: calc(100dvh - 16px) !important;
    padding: 16px 22px 12px !important;
    overflow: hidden !important;
  }
  .creditModal__close {
    top: 8px !important;
    right: 10px !important;
  }
  .hireMeBubble {
    bottom: auto !important;
    top: 50% !important;
    right: calc(100% + 6px) !important;
    transform: translateY(-50%) !important;
  }
  .hireMeBubbleArrow {
    display: none !important;
  }
  .creditModal__content {
    max-height: calc(100dvh - 48px) !important;
    gap: 6px !important;
  }
  .creditModal__title {
    margin-bottom: 2px !important;
    font-size: 10.5px !important;
  }
  .creditModal__role {
    font-size: 8px !important;
  }
  .creditModal__val {
    font-size: 9.5px !important;
    line-height: 1.35 !important;
  }
  .creditModal__footer {
    margin-top: 2px !important;
    padding-top: 6px !important;
  }
}

.stage:has(.creditModal:not([hidden])) .lab__header,
.stage:has(.creditModal:not([hidden])) .lab__rail,
.stage:has(.creditModal:not([hidden])) .lab__portal,
.stage:has(.creditModal:not([hidden])) .atomLayer {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ==========================================================================
   Landscape Mobile Viewports (Handheld rotated landscape ONLY)
   ========================================================================== */
@media (max-width: 950px) and (max-height: 560px) and (orientation: landscape) {
  .cenotaph {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) scale(1) !important;
    width: 94vw !important;
    max-width: 94vw !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 auto !important;
  }
  .cenotaph__title {
    font-size: clamp(2.8rem, min(13vw, 27vh), 7.2rem) !important;
    -webkit-text-stroke: 0.045em #ffffff !important;
    max-width: 100% !important;
    white-space: nowrap !important;
    letter-spacing: -0.048em !important;
  }
  .cenotaph__prefix,
  .cenotaph__for {
    font-size: clamp(0.85rem, min(2.2vw, 4.2vh), 1.35rem) !important;
  }
  .cenotaph__prefix {
    transform: translateY(1px) !important;
    margin-bottom: 0 !important;
  }
  .cenotaph__for {
    margin-top: -0.1rem !important;
  }
  .scrollCue {
    bottom: clamp(6px, 1.8vh, 12px) !important;
    gap: 3px !important;
    font-size: 8px !important;
  }
  .scrollCue svg {
    width: 12px !important;
    height: 12px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}


/* --- Safe area (notch / rounded corners / home indicator) ---
   Keep .lab at full 100%x100% stage coordinates so background-synced hotspots (atomDollWrap, stageHotspot, emailHotspot)
   have zero coordinate offset; apply safe-area insets only to UI chrome elements. */
:root{--sa-t:env(safe-area-inset-top,0px);--sa-r:env(safe-area-inset-right,0px);--sa-b:env(safe-area-inset-bottom,0px);--sa-l:env(safe-area-inset-left,0px)}
.stage .lab {
  inset: 0;
  width: 100%;
  height: 100%;
}
.lab__header {
  padding-left: max(clamp(20px, 3.5vw, 48px), var(--sa-l));
  padding-right: max(clamp(20px, 3.5vw, 48px), var(--sa-r));
}
.lab__rail {
  right: max(clamp(12px, 2.75vw, 44px), var(--sa-r));
}
.lab__portal {
  left: max(clamp(20px, 3.8vw, 64px), var(--sa-l));
}

/* ==========================================================================
   BRAUN Audio Console & Floor Hotspot (B2F / B3F)
   Ultra-minimalist: invisible hitbox (no borders/tooltips), 2-album chooser,
   and compact official SoundCloud embed player (50% translucent chic).
   ========================================================================== */
.braunHotspot {
  position: absolute;
  z-index: 45;
  cursor: default !important;
  pointer-events: auto !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
}

/* --- BRAUN Floating Audio Dock (フロア表示・レールと完全同一の50%透過ダークシック・角丸なし・影なし) --- */
.braunModal {
  position: fixed;
  left: clamp(20px, 3.8vw, 64px);
  bottom: clamp(20px, 3.8vw, 48px);
  z-index: 85;
  display: block;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  width: 290px;
  max-width: calc(100vw - 32px);
}

.braunModal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 背景オーバーレイは完全に非表示・非遮断 */
.braunModal__backdrop {
  display: none !important;
  pointer-events: none !important;
}

.braunModal__dialog {
  position: relative;
  width: 100%;
  background: rgba(18, 18, 18, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px;
  box-sizing: border-box;
}

.braunSelectHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.braunSelectTitle {
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
}

.braunCloseBtn {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  padding: 2px 6px !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
}

.braunCloseBtn:hover {
  color: #ffffff !important;
}

/* View 1: Album List */
.braunAlbumList {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.braunAlbumCard {
  background: rgba(18, 18, 18, 0.5) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-left: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 8px 10px !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  cursor: pointer !important;
  transition: background 0.25s, border-left-color 0.2s !important;
  text-align: left !important;
  user-select: none !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.braunAlbumCard:hover,
.braunAlbumCard:focus-visible {
  background: rgba(48, 48, 52, 0.5) !important;
  border-left-color: #ffffff !important;
}

.braunAlbumCard__cover {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: hidden;
  background: #000;
}

.braunAlbumCard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.braunAlbumCard__info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.braunAlbumCard__title {
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.braunAlbumCard__meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
}

/* View 2: Player Header & Iframe Tracklist */
.braunPlayerHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.braunModal.is-dragging,
.braunModal.is-dragging .braunSelectHeader,
.braunModal.is-dragging .braunPlayerHeader {
  cursor: grabbing !important;
}

.braunBackBtn {
  background: rgba(18, 18, 18, 0.5) !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #ffffff !important;
  font-size: 9.5px !important;
  letter-spacing: 0.16em !important;
  cursor: pointer !important;
  padding: 4px 8px !important;
  transition: background 0.2s ease !important;
  line-height: 1 !important;
}

.braunBackBtn:hover {
  background: rgba(48, 48, 52, 0.5) !important;
}

.braunCurrentAlbum {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  text-transform: uppercase;
}

.braunSelectView,
.braunPlayerView {
  width: 100%;
  transition: opacity 0.2s ease;
}

.braunSelectView.is-hidden,
.braunPlayerView.is-hidden {
  height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.braunIframeWrap {
  width: 100%;
  height: 275px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000;
}

.braunIframe {
  width: 100%;
  height: 600px;
  margin-top: -168px;
  border: none;
  border-radius: 0 !important;
  display: block;
}

.braunIframe.is-hidden {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mobile & Tablet adjustments */
@media (max-width: 780px) {
  .braunModal {
    left: 16px;
    bottom: 16px;
    width: min(290px, calc(100vw - 32px)) !important;
  }
  .braunIframeWrap {
    height: min(275px, calc(100vh - 120px));
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .braunModal {
    left: max(16px, var(--sa-l));
    bottom: max(12px, var(--sa-b));
    width: 260px !important;
  }
  .braunModal__dialog {
    padding: 8px;
  }
  .braunAlbumCard {
    padding: 6px 8px !important;
    gap: 8px !important;
  }
  .braunAlbumCard__cover {
    width: 28px;
    height: 28px;
    min-width: 28px;
  }
  .braunIframeWrap {
    height: min(200px, calc(100vh - 80px));
  }
}

/* --- B3F STARSON Ball & Mouse Hotspots (隠しギミック・マウス変化なし) --- */
.ballHotspot,
.mouseHotspot {
  position: absolute;
  z-index: 60;
  cursor: default !important;
  border-radius: 50%;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
}
.mouseHotspot {
  border-radius: 12px;
}

/* --- B???F JUGEND TECHNOKRAT Down Jacket, Hat & Shelf Hotspots (隠しギミック・マウス変化なし) --- */
.jacketHotspot,
.hatHotspot,
.shelfHotspot {
  position: absolute;
  z-index: 60;
  cursor: default !important;
  pointer-events: auto !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
  user-select: none !important;
}
.shelfHotspot {
  z-index: 45;
}
.hatHotspot {
  border-radius: 50% !important;
}
.jacketHotspot[hidden],
.hatHotspot[hidden],
.shelfHotspot[hidden] {
  display: none !important;
  pointer-events: none !important;
}

/* --- B???F 棚 絵本全画面モーダル (book_pagination ふわっと全画面表示・消去) --- */
.bookModal {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 100020 !important;
  background: #0a0908 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.9s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity;
}

.bookModal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.bookModal__iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
  background: #0a0908;
}

/* --- STARSON YouTube Floating Modal (50%透過ダークシック・角丸なし・影なし・ドラッグ可能) --- */
.starsonModal {
  position: fixed;
  left: clamp(140px, 14vw, 260px);
  bottom: clamp(220px, 28vh, 340px);
  z-index: 86;
  display: block;
  pointer-events: auto;
  opacity: 0;
  transition: opacity 0.25s ease;
  width: clamp(440px, 36vw, 580px);
  max-width: calc(100vw - 32px);
  touch-action: none;
  user-select: none;
}

.starsonModal.is-active {
  opacity: 1;
}

.starsonModal__dialog {
  position: relative;
  width: 100%;
  background: rgba(18, 18, 18, 0.5) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 12px;
  box-sizing: border-box;
}

.starsonHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.starsonModal.is-dragging,
.starsonModal.is-dragging .starsonHeader {
  cursor: grabbing !important;
}

.starsonTitle {
  font-family: inherit;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: #ffffff;
  text-transform: uppercase;
}

.starsonIframeWrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #000;
  overflow: hidden;
  pointer-events: auto;
  touch-action: auto;
}

.starsonIframeWrap iframe,
.starsonIframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  display: block;
  pointer-events: auto;
  touch-action: auto;
}

@media (max-width: 780px) {
  .starsonModal {
    left: 16px;
    right: 16px;
    margin: 0 auto;
    top: max(76px, var(--sa-t, 76px));
    bottom: auto;
    width: min(360px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .starsonModal {
    right: max(16px, var(--sa-r, 16px));
    left: auto;
    top: max(12px, var(--sa-t, 12px));
    bottom: auto;
    width: min(340px, 50vw);
  }
  .starsonModal__dialog {
    padding: 8px;
  }
}



/* --- B???F Jacket 2-Site Chooser Modal (SELECT STORE) --- */
.jacketModal {
  position: fixed;
  left: clamp(20px, 3.8vw, 64px);
  bottom: clamp(20px, 3.8vw, 48px);
  z-index: 85;
  display: block;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  width: clamp(340px, 30vw, 440px);
  max-width: calc(100vw - 32px);
}

.jacketModal.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.jacketModal__dialog {
  position: relative;
  width: 100%;
  background: rgba(18, 18, 18, 0.65) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 0 !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6) !important;
  padding: 12px 14px;
  box-sizing: border-box;
}

.jacketSelectHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.jacketModal.is-dragging,
.jacketModal.is-dragging .jacketSelectHeader {
  cursor: grabbing !important;
  transition: none !important;
}

.jacketSelectTitle {
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: #ffffff;
  margin: 0;
  text-transform: uppercase;
}

.jacketCloseBtn {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 13px !important;
  line-height: 1 !important;
  padding: 2px 6px !important;
  cursor: pointer !important;
  transition: color 0.2s ease !important;
}

.jacketCloseBtn:hover {
  color: #ffffff !important;
}

.jacketSiteList {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.jacketSiteCard {
  background: #000000 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: block !important;
  cursor: pointer !important;
  transition: border-color 0.2s ease, transform 0.2s ease !important;
  width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  text-decoration: none !important;
}

.jacketSiteCard:hover,
.jacketSiteCard:focus-visible {
  border-color: rgba(255, 255, 255, 0.8) !important;
}

.jacketSiteCard__cover {
  width: 100%;
  aspect-ratio: 3 / 1;
  overflow: hidden;
  background: #000;
  display: block;
}

.jacketSiteCard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.jacketSiteCard:hover .jacketSiteCard__img {
  transform: scale(1.02);
}

@media (max-width: 780px) {
  .jacketModal {
    left: 16px;
    bottom: 16px;
    width: min(340px, calc(100vw - 32px)) !important;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .jacketModal {
    left: max(16px, var(--sa-l));
    bottom: max(12px, var(--sa-b));
    width: 320px !important;
  }
  .jacketModal__dialog {
    padding: 8px 10px;
  }
  .jacketSiteList {
    gap: 6px;
  }
}

/* --- B3F メインモニター画面内 STARSON YouTube プレイヤー --- */
.starsonMonitorScreen {
  position: absolute;
  z-index: 45;
  display: block;
  box-sizing: border-box;
  background: #000000;
  overflow: visible;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.95);
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.starsonMonitorScreen[hidden] {
  display: none !important;
}

.starsonMonitorScreen.is-active {
  opacity: 1;
  visibility: visible;
}

.starsonMonitorScreen__inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: #000000;
}

.starsonMonitorScreen__inner iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.starsonMonitorCloseBtn {
  position: absolute;
  top: -34px;
  right: 0;
  z-index: 50;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.88) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  padding: 0 !important;
  cursor: pointer !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7) !important;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease !important;
  user-select: none;
}

.starsonMonitorCloseBtn:hover {
  opacity: 1;
  transform: scale(1.1);
  background: rgba(45, 45, 50, 0.98) !important;
}
