/* ==========================================================================
   The Corridor (Argon Studio / Corridor Engine) — Diegetic Horror Viewport Styles
   Owns: styles.css
   ========================================================================== */

:root {
  --pt-bg-black: #050506;
  --pt-panel-bg: rgba(9, 8, 8, 0.78);
  --pt-panel-border: rgba(215, 198, 172, 0.16);
  --pt-panel-border-active: rgba(235, 210, 170, 0.48);
  --pt-text-primary: #eae3d5;
  --pt-text-secondary: #a89f90;
  --pt-text-muted: #6f675b;
  --pt-amber: #d9a75a;
  --pt-crimson: #d82222;
  --pt-crimson-glow: rgba(225, 24, 24, 0.55);
  --pt-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pt-font-serif: 'Georgia', 'Times New Roman', serif;
  --pt-font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--pt-bg-black);
  color: var(--pt-text-primary);
  font-family: var(--pt-font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* 3D WebGL Canvas Viewport */
.pt-viewport,
#viewport,
canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  z-index: 1;
}

/* CRITICAL: ?clean=1 and setCleanMode(true) hides 100% of HUD overlays */
html.clean-mode #pt-ui-root,
body.clean-mode #pt-ui-root,
html.clean-mode .pt-hud-layer,
body.clean-mode .pt-hud-layer {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Main Diegetic HUD Root Layer */
.pt-hud-layer {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.hidden {
  display: none !important;
}

/* ==========================================================================
   CRITICAL: Simulator Toolbar & Telemetry Badge Hidden by Default!
   Only visible when ?debug=1, ?hud=1, Backquote (`) key, or setDebugHudVisible(true)
   ========================================================================== */
#pt-telemetry-badge,
#pt-bottom-dock,
#pt-dock-restore-tab,
.pt-drawer-actions {
  display: none !important;
}

html.debug-hud-visible:not(.clean-mode) #pt-telemetry-badge:not(.hidden),
body.debug-hud-visible:not(.clean-mode) #pt-telemetry-badge:not(.hidden) {
  display: flex !important;
}

html.debug-hud-visible:not(.clean-mode) #pt-bottom-dock:not(.hidden),
body.debug-hud-visible:not(.clean-mode) #pt-bottom-dock:not(.hidden) {
  display: block !important;
}

html.debug-hud-visible:not(.clean-mode) #pt-dock-restore-tab:not(.hidden),
body.debug-hud-visible:not(.clean-mode) #pt-dock-restore-tab:not(.hidden) {
  display: inline-block !important;
}

html.debug-hud-visible .pt-drawer-actions,
body.debug-hud-visible .pt-drawer-actions {
  display: flex !important;
}

/* ==========================================================================
   1. Developer Telemetry Badge (Opt-In Debug Mode Only)
   ========================================================================== */
.pt-telemetry-badge {
  position: fixed;
  top: 16px;
  left: 18px;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 9px 14px;
  background: rgba(8, 7, 7, 0.68);
  border: 1px solid var(--pt-panel-border);
  border-left: 2px solid var(--pt-amber);
  border-radius: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  transition: opacity 0.25s ease, transform 0.25s ease, border-color 0.3s ease;
}

.pt-telemetry-badge.is-red-hell {
  border-left-color: var(--pt-crimson);
  box-shadow: 0 8px 28px rgba(140, 10, 10, 0.35);
}

.pt-telemetry-badge.hud-minimized {
  opacity: 0.35;
}

.pt-telemetry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--pt-text-secondary);
}

.pt-rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pt-crimson);
  box-shadow: 0 0 8px var(--pt-crimson-glow);
  animation: ptRecPulse 1.8s infinite ease-in-out;
}

@keyframes ptRecPulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.28; transform: scale(0.86); }
}

.pt-engine-tag {
  font-weight: 600;
  color: #bfb5a4;
}

.pt-clock-led {
  margin-left: auto;
  padding: 1px 6px;
  font-family: var(--pt-font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #ff2e2e;
  background: rgba(45, 4, 4, 0.72);
  border: 1px solid rgba(255, 48, 48, 0.32);
  border-radius: 3px;
  text-shadow: 0 0 8px rgba(255, 32, 32, 0.75);
}

.pt-loop-title {
  font-family: var(--pt-font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--pt-text-primary);
}

.pt-telemetry-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  color: var(--pt-text-secondary);
}

.pt-meta-sep {
  color: var(--pt-text-muted);
}

.pt-photo-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(217, 167, 90, 0.12);
  border: 1px solid rgba(217, 167, 90, 0.28);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  color: #eed3a5;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pt-photo-badge-btn:hover {
  background: rgba(217, 167, 90, 0.24);
  border-color: rgba(217, 167, 90, 0.55);
}

.pt-badge-key {
  color: var(--pt-amber);
  font-weight: 700;
}

/* ==========================================================================
   2. Center The Corridor Focus Reticle & Contextual Inspect Prompt
   ========================================================================== */
.pt-reticle-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.pt-reticle-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(242, 234, 218, 0.56);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.18s ease, height 0.18s ease, background 0.18s ease, border 0.18s ease;
}

.pt-reticle-eye {
  width: 16px;
  height: 16px;
  color: #f3dfb9;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.pt-reticle-dot.is-focused {
  width: 28px;
  height: 28px;
  background: rgba(14, 12, 10, 0.65);
  border: 1px solid rgba(235, 202, 145, 0.68);
  box-shadow: 0 0 14px rgba(217, 167, 90, 0.35);
}

.pt-reticle-dot.is-focused .pt-reticle-eye {
  opacity: 0.95;
  transform: scale(1);
}

.pt-reticle-prompt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  background: rgba(6, 5, 5, 0.72);
  border: 1px solid rgba(226, 194, 140, 0.28);
  border-radius: 3px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--pt-text-primary);
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7);
}

.pt-prompt-key {
  padding: 1px 4px;
  background: rgba(217, 167, 90, 0.18);
  border: 1px solid rgba(217, 167, 90, 0.42);
  border-radius: 2px;
  color: #f4d398;
  font-weight: 700;
}

/* ==========================================================================
   3. Atmospheric Diegetic The Corridor Subtitles (Bottom-Center, Zero Box Clutter)
   ========================================================================== */
.pt-subtitle-bar {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  max-width: min(760px, 88vw);
  padding: 6px 24px;
  background: radial-gradient(ellipse at center, rgba(4, 3, 3, 0.68) 0%, rgba(4, 3, 3, 0.0) 76%);
  border: none;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.35s ease, bottom 0.25s ease;
}

html.debug-hud-visible .pt-subtitle-bar,
body.debug-hud-visible .pt-subtitle-bar {
  bottom: 94px;
}

.pt-subtitle-speaker {
  display: none !important;
}

.pt-subtitle-text {
  font-family: var(--pt-font-serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.48;
  letter-spacing: 0.03em;
  color: rgba(242, 236, 225, 0.94);
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.98),
    0 2px 10px rgba(0, 0, 0, 0.92),
    0 0 22px rgba(0, 0, 0, 0.85);
}

/* ==========================================================================
   4. Subtle Diegetic Corner Control Whisper & Top-Right Fragment Whisper
   ========================================================================== */
.pt-diegetic-hint {
  position: fixed;
  right: 24px;
  bottom: 18px;
  font-family: var(--pt-font-sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(234, 227, 213, 0.92);
  opacity: 0.55;
  text-shadow:
    0 1px 3px rgba(0, 0, 0, 0.98),
    0 0 10px rgba(0, 0, 0, 0.9);
  background: none;
  border: none;
  padding: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 1.4s ease;
}

.pt-diegetic-hint.is-moving-faded {
  opacity: 0.18;
}

.pt-photo-whisper {
  position: fixed;
  top: 22px;
  right: 24px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(238, 219, 186, 0.82);
  text-shadow:
    0 1px 4px rgba(0, 0, 0, 0.98),
    0 0 12px rgba(0, 0, 0, 0.9);
  background: none;
  border: none;
  padding: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.45s ease;
}

/* ==========================================================================
   5. Interactive Clue & 6-Piece Torn Photograph Inspection Drawer ([Tab] / [P])
   ========================================================================== */
.pt-photo-drawer {
  position: fixed;
  top: 44px;
  right: 24px;
  width: 340px;
  max-height: calc(100vh - 115px);
  overflow-y: auto;
  padding: 14px;
  background: rgba(10, 9, 9, 0.9);
  border: 1px solid rgba(217, 167, 90, 0.32);
  border-radius: 6px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.82);
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pt-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pt-drawer-kicker {
  font-family: var(--pt-font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--pt-amber);
}

.pt-drawer-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--pt-text-primary);
}

.pt-drawer-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  width: 24px;
  height: 24px;
  color: var(--pt-text-secondary);
  cursor: pointer;
  font-size: 12px;
}

.pt-drawer-close:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.pt-portrait-assembly-frame {
  background: rgba(4, 4, 4, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 8px;
}

.pt-portrait-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(2, 64px);
  gap: 4px;
}

.pt-portrait-tile {
  position: relative;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background-color: #12100f;
  background-image: url('./assets/textures/tex_family_portrait_gouged.jpg');
  background-size: 300% 200%;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease, filter 0.2s ease;
}

.pt-portrait-tile.is-missing {
  background-image: none;
  background-color: rgba(20, 17, 15, 0.92);
  border-style: dashed;
  border-color: rgba(217, 167, 90, 0.22);
}

.pt-portrait-tile:hover {
  transform: scale(1.02);
  border-color: var(--pt-amber);
}

.pt-tile-num {
  position: absolute;
  top: 4px;
  left: 5px;
  font-family: var(--pt-font-mono);
  font-size: 9px;
  color: rgba(234, 227, 213, 0.75);
  background: rgba(0, 0, 0, 0.65);
  padding: 1px 4px;
  border-radius: 2px;
}

.pt-tile-digit {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font-family: var(--pt-font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ff4545;
  background: rgba(0, 0, 0, 0.72);
  padding: 1px 5px;
  border-radius: 2px;
}

.pt-riddle-code-strip {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
}

.pt-riddle-label {
  color: var(--pt-text-secondary);
}

.pt-riddle-digits {
  color: #ff3b3b;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.pt-active-clue-card {
  padding: 8px 10px;
  background: rgba(217, 167, 90, 0.08);
  border-left: 2px solid var(--pt-amber);
  border-radius: 4px;
}

.pt-active-clue-title {
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: #f0d29c;
  margin-bottom: 3px;
}

.pt-active-clue-caption {
  font-family: var(--pt-font-serif);
  font-style: italic;
  font-size: 12px;
  color: var(--pt-text-primary);
  line-height: 1.35;
}

.pt-clue-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 175px;
  overflow-y: auto;
}

.pt-clue-item {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pt-clue-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(217, 167, 90, 0.35);
}

.pt-clue-item.is-collected {
  border-color: rgba(217, 167, 90, 0.26);
}

.pt-clue-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--pt-font-mono);
  font-size: 10px;
  color: var(--pt-text-primary);
}

.pt-clue-status {
  color: var(--pt-amber);
  font-weight: 700;
}

.pt-clue-digit-tag {
  margin-left: auto;
  color: #ff4c4c;
  font-weight: 700;
}

.pt-clue-item-body {
  margin-top: 2px;
  font-size: 11px;
  color: var(--pt-text-secondary);
  line-height: 1.3;
}

.pt-drawer-diegetic-footer {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--pt-font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-align: center;
  color: rgba(217, 167, 90, 0.72);
}

.pt-drawer-actions {
  display: none;
  gap: 6px;
}

.pt-drawer-btn {
  flex: 1;
  padding: 7px 9px;
  background: rgba(217, 167, 90, 0.16);
  border: 1px solid rgba(217, 167, 90, 0.42);
  border-radius: 5px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: #f5dfb5;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.pt-drawer-btn:hover {
  background: rgba(217, 167, 90, 0.28);
}

.pt-drawer-btn-crimson {
  background: rgba(185, 24, 24, 0.22);
  border-color: rgba(235, 45, 45, 0.5);
  color: #ffc5c5;
}

.pt-drawer-btn-crimson:hover {
  background: rgba(210, 28, 28, 0.36);
}

/* ==========================================================================
   5. Unified Collapsible Bottom Control Dock (Zero Mid-Screen Occlusion)
   ========================================================================== */
.pt-bottom-dock {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  max-width: 96vw;
  pointer-events: auto;
  z-index: 15;
}

.pt-dock-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 11px;
  background: var(--pt-panel-bg);
  border: 1px solid var(--pt-panel-border);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.72);
}

.pt-dock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
}

.pt-dock-section-label {
  font-family: var(--pt-font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--pt-text-muted);
  margin-right: 3px;
}

.pt-loop-pill-group {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pt-dock-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 3px;
}

.pt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(24, 22, 20, 0.82);
  border: 1px solid rgba(215, 198, 172, 0.16);
  border-radius: 5px;
  font-family: var(--pt-font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--pt-text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.pt-pill:hover {
  background: rgba(46, 40, 34, 0.92);
  border-color: rgba(235, 210, 170, 0.42);
}

.pt-pill:active {
  transform: translateY(1px);
}

.pt-pill.active {
  background: rgba(217, 167, 90, 0.22);
  border-color: rgba(235, 192, 120, 0.68);
  color: #f9e6c1;
  box-shadow: 0 0 12px rgba(217, 167, 90, 0.18);
}

.pt-pill-danger {
  border-color: rgba(220, 48, 48, 0.35);
  color: #f4b8b8;
}

.pt-pill-danger:hover {
  background: rgba(140, 18, 18, 0.38);
  border-color: rgba(245, 68, 68, 0.65);
  color: #ffe0e0;
}

.pt-pill kbd {
  display: inline-block;
  padding: 0 4px;
  font-family: var(--pt-font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: #d6c3a5;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 3px;
}

.pt-dock-restore-tab {
  padding: 5px 12px;
  background: rgba(10, 9, 9, 0.82);
  border: 1px solid var(--pt-panel-border);
  border-radius: 6px;
  font-family: var(--pt-font-mono);
  font-size: 10.5px;
  color: var(--pt-text-secondary);
  cursor: pointer;
}

.pt-dock-restore-tab:hover {
  color: var(--pt-text-primary);
  border-color: var(--pt-panel-border-active);
}
