/* -------------------------------------------------------------
 * Monochrome Escape - style.css
 * Sleek Black & White Noir Aesthetic
 * ----------------------------------------------------------- */

/* Variables / Theme Tokens */
:root {
  --color-bg-darkest: #050505;
  --color-bg-dark: #0c0c0c;
  --color-bg-card: #151515;
  --color-bg-terminal: #020202;
  --color-text-light: #ffffff;
  --color-text-muted: #888888;
  --color-text-dim: #444444;
  --color-accent-glow: rgba(255, 255, 255, 0.4);
  --color-glow-green: rgba(50, 255, 50, 0.2);
  --color-text-green: #33ff33;
  --color-text-red: #ff3333;
  --border-radius-sm: 4px;
  --border-radius-md: 8px;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Roboto Mono', monospace;
}

/* Base resets & scrollbar */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: var(--color-text-muted);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-light);
}

body {
  background-color: var(--color-bg-darkest);
  color: var(--color-text-light);
  font-family: var(--font-sans);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  width: 100vw;
  margin: 0;
}

.hidden {
  display: none !important;
}

/* App Wrapper for Jekyll Iframe Compatibility */
.app-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 900px;
  max-height: 600px;
  aspect-ratio: 3/2;
  background-color: var(--color-bg-dark);
  border: 2px solid var(--color-text-light);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Screen Management */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  padding: 16px;
  background-color: var(--color-bg-dark);
}
.screen.active {
  display: flex;
  animation: fadeIn 0.4s ease forwards;
}

/* Buttons Styling */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--color-text-light);
  background: transparent;
  border: 2px solid var(--color-text-light);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  letter-spacing: 0.5px;
}
.btn:hover {
  background-color: var(--color-text-light);
  color: var(--color-bg-darkest);
  box-shadow: 0 0 12px var(--color-accent-glow);
}
.btn-primary {
  background-color: var(--color-text-light);
  color: var(--color-bg-darkest);
}
.btn-primary:hover {
  background-color: transparent;
  color: var(--color-text-light);
}
.btn-secondary {
  border-color: var(--color-text-muted);
  color: var(--color-text-muted);
}
.btn-secondary:hover {
  border-color: var(--color-text-light);
  color: var(--color-text-light);
}

.btn-circle-sm {
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-text-light);
  background: transparent;
  color: var(--color-text-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-circle-sm:hover {
  background-color: var(--color-text-light);
  color: var(--color-bg-darkest);
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--color-text-light);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s;
  padding: 0 4px;
}
.btn-close:hover {
  opacity: 0.7;
}

/* -------------------------------------------------------------
 * 1. HOME SCREEN STYLE
 * ----------------------------------------------------------- */
#home-screen {
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
}

.title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.monochrome-logo {
  position: relative;
  width: 60px;
  height: 60px;
  border: 3px solid var(--color-text-light);
  margin-bottom: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.monochrome-logo::after {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--color-text-light);
}
.monochrome-logo::before {
  content: '';
  position: absolute;
  top: 35px;
  width: 6px;
  height: 12px;
  background: var(--color-text-light);
}

.game-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 4px;
  margin-bottom: 6px;
}
.game-subtitle {
  font-size: 14px;
  color: var(--color-text-muted);
  letter-spacing: 2px;
}

.menu-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 220px;
}

.home-footer {
  margin-top: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
  letter-spacing: 1px;
}

/* -------------------------------------------------------------
 * 2. GAME SCREEN STYLE
 * ----------------------------------------------------------- */
.game-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  border-bottom: 1.5px solid var(--color-text-light);
  padding-bottom: 8px;
  position: relative;
  z-index: 110;
}

.hud-left {
  display: flex;
  gap: 8px;
}

.wall-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.stat-label {
  font-size: 9px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}

/* VIEWPORT LAYOUT */
.game-viewport-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-grow: 1;
  position: relative;
  margin: 12px 0;
}

.nav-arrow-btn {
  background: transparent;
  border: 1.5px solid var(--color-text-muted);
  color: var(--color-text-muted);
  width: 44px;
  height: 80px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.2s ease;
}
.nav-arrow-btn:hover {
  border-color: var(--color-text-light);
  color: var(--color-text-light);
  background-color: rgba(255, 255, 255, 0.05);
}
.nav-arrow-btn.left {
  margin-right: 8px;
}
.nav-arrow-btn.right {
  margin-left: 8px;
}

.game-viewport {
  flex-grow: 1;
  height: 100%;
  border: 2px solid var(--color-text-light);
  border-radius: var(--border-radius-md);
  position: relative;
  background-color: var(--color-bg-darkest);
  overflow: hidden;
}

.walls-container {
  display: flex;
  width: 400%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1);
}

.wall {
  width: 25%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.wall-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 35%, #222 0%, #050505 100%);
  opacity: 0.95;
}

/* -------------------------------------------------------------
 * WALL GRAPHICS & HOTSPOTS
 * ----------------------------------------------------------- */
.hotspot {
  position: absolute;
  cursor: pointer;
  transition: all 0.2s ease;
}
.hotspot:hover {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8));
}
.hotspot-nested {
  position: absolute;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 3;
}

/* --- WALL A: Exit Door & Desk --- */
.exit-door {
  bottom: 0;
  left: 15%;
  width: 110px;
  height: 220px;
}
.door-frame {
  width: 100%;
  height: 100%;
  border: 3.5px solid var(--color-text-light);
  border-bottom: none;
  padding: 6px;
  background: #000;
}
.door-panel {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--color-text-light);
  position: relative;
  background: repeating-linear-gradient(90deg, #090909, #090909 2px, #000 2px, #000 10px);
}
.door-handle {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 12px;
  height: 5px;
  background: var(--color-text-light);
  border-radius: 2px;
  transform: translateY(-50%);
}
.door-keyhole {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 6px;
  height: 14px;
  background: var(--color-text-light);
  border-radius: 3px 3px 0 0;
  transform: translateY(6px);
}
.door-keyhole::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: -2px;
  width: 10px;
  height: 6px;
  background: var(--color-text-light);
}

/* Desk */
.desk {
  bottom: 0;
  right: 12%;
  width: 240px;
  height: 110px;
}
.desk-surface {
  position: absolute;
  top: 30px;
  width: 100%;
  height: 8px;
  background: var(--color-text-light);
  border-radius: 2px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.desk::before { /* Left Leg */
  content: '';
  position: absolute;
  top: 38px;
  left: 20px;
  width: 8px;
  height: 72px;
  background: var(--color-text-light);
}
.desk::after { /* Right Leg & cabinet back */
  content: '';
  position: absolute;
  top: 38px;
  right: 20px;
  width: 60px;
  height: 72px;
  border: 2px solid var(--color-text-light);
  background: #000;
}

/* Desk cabinet Drawer (Nested) */
.desk-drawer {
  top: 42px;
  right: 20px;
  width: 60px;
  height: 30px;
  border-bottom: 2px solid var(--color-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.desk-drawer .drawer-handle {
  width: 24px;
  height: 5px;
  border: 1.5px solid var(--color-text-light);
  border-radius: 1px;
}
.desk-drawer .drawer-keyhole {
  position: absolute;
  top: 4px;
  width: 4px;
  height: 6px;
  background: var(--color-text-light);
  border-radius: 50% 50% 0 0;
}

/* Dark spot under desk */
.dark-under-desk {
  bottom: 0;
  left: 28px;
  width: 124px;
  height: 72px;
  background-color: var(--color-bg-darkest);
}
.dark-shadow-mask {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(45deg, #000, #000 4px, #111 4px, #111 8px);
  border: 1px dashed var(--color-text-dim);
}

/* Computer nested */
.computer-monitor {
  top: -24px;
  left: 45px;
  width: 70px;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.monitor-screen {
  width: 70px;
  height: 44px;
  border: 2px solid var(--color-text-light);
  background: #000;
  border-radius: 4px;
  position: relative;
}
.monitor-screen::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 58px;
  height: 32px;
  background: #111;
  border-radius: 2px;
}
.monitor-stand {
  width: 24px;
  height: 8px;
  border: 2px solid var(--color-text-light);
  border-bottom: none;
}
.computer-monitor:hover .monitor-screen::after {
  background: #333;
}

/* Trash can */
.trash-can {
  bottom: 0;
  right: 5%;
  width: 40px;
  height: 50px;
  border: 2px solid var(--color-text-light);
  border-top: none;
  background: #000;
  border-radius: 0 0 4px 4px;
  display: flex;
  justify-content: space-around;
  padding: 4px;
}
.bin-lines {
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(90deg, transparent, transparent 6px, var(--color-text-light) 6px, var(--color-text-light) 8px);
}

/* --- WALL B: Bookshelf & Painting --- */
/* Abstract Painting & Safe Behind */
.painting-area {
  top: 30px;
  left: 15%;
  width: 160px;
  height: 120px;
}
.painting-frame {
  width: 100%;
  height: 100%;
  border: 4px solid var(--color-text-light);
  background: #000;
  padding: 4px;
  transition: transform 0.5s ease;
  z-index: 2;
  position: relative;
}
.painting-frame.tilted {
  transform: rotate(22deg) translate(15px, -35px);
}
.painting-canvas {
  width: 100%;
  height: 100%;
  border: 1px solid var(--color-text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.canvas-art {
  width: 80px;
  height: 80px;
  border: 2px solid var(--color-text-light);
  border-radius: 50%;
  position: relative;
}
.canvas-art::after {
  content: '';
  position: absolute;
  top: 18px;
  left: 18px;
  width: 40px;
  height: 40px;
  border: 2px dashed var(--color-text-light);
  border-radius: 50%;
}
.canvas-art::before {
  content: '';
  position: absolute;
  top: 33px;
  left: 33px;
  width: 10px;
  height: 10px;
  background: var(--color-text-light);
  border-radius: 50%;
}

/* Nested Safe */
.wall-safe {
  top: 0;
  left: 0;
  width: 160px;
  height: 120px;
  border: 3px double var(--color-text-light);
  background: #111;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.safe-door {
  width: 140px;
  height: 100px;
  border: 1px solid var(--color-text-light);
  background: #080808;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 20px;
}
.safe-dial {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-text-light);
  border-radius: 50%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.safe-dial::after {
  content: '';
  width: 4px;
  height: 16px;
  background: var(--color-text-light);
  transform: translateY(-8px);
}

/* Bookshelf */
.bookshelf {
  bottom: 0;
  right: 15%;
  width: 220px;
  height: 250px;
  border: 3px solid var(--color-text-light);
  background: #000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 10px 0;
}
.shelf {
  height: 65px;
  border-bottom: 3px solid var(--color-text-light);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 0 10px 2px 10px;
  gap: 4px;
}
.shelf-3 {
  border-bottom: none;
}
.book {
  width: 14px;
  border: 1.5px solid var(--color-text-light);
  background: #0c0c0c;
  transition: all 0.2s;
  cursor: pointer;
}
.book:hover {
  background: #fff;
}
.book-1 { height: 50px; }
.book-2 { height: 42px; transform: rotate(-5deg); margin-left: 2px; }
.book-3 { height: 48px; }
.book-4 { height: 45px; }
.book-5 { height: 52px; }
.book-6 { height: 40px; transform: rotate(8deg); }
.book-7 { height: 44px; }
.book-8 { height: 48px; }
.book-9 { height: 46px; }

/* Riddle details on book */
.book.shadow-riddle {
  border-style: double;
}

/* Flashlight pickup element */
.flashlight-pickup {
  position: absolute;
  bottom: 2px;
  right: 15px;
  width: 32px;
  height: 14px;
  border: 1.5px solid var(--color-text-light);
  background: #151515;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.flashlight-pickup::after {
  content: '';
  position: absolute;
  left: -4px;
  width: 4px;
  height: 8px;
  background: var(--color-text-light);
  border-radius: 1px 0 0 1px;
}

/* --- WALL C: Clock & Fuse Box --- */
/* Clock */
.wall-clock {
  top: 40px;
  left: 25%;
  width: 90px;
  height: 90px;
}
.clock-face {
  width: 100%;
  height: 100%;
  border: 3px solid var(--color-text-light);
  border-radius: 50%;
  position: relative;
  background: #000;
}
.clock-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  background: var(--color-text-light);
  border-radius: 50%;
}
.clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  background: var(--color-text-light);
  transform-origin: bottom center;
  border-radius: 2px;
}
/* Showing 8:40 approx */
.hour-hand {
  width: 3.5px;
  height: 22px;
  transform: rotate(-100deg); /* points around 8-9 */
  left: calc(50% - 1.75px);
}
.minute-hand {
  width: 2px;
  height: 32px;
  transform: rotate(-120deg); /* points at 8 (40m) */
  left: calc(50% - 1px);
}

/* Fuse box wall */
.fuse-box-wall {
  bottom: 50px;
  right: 25%;
  width: 80px;
  height: 110px;
  border: 2px solid var(--color-text-light);
  background: #111;
}
.fusebox-door {
  width: 100%;
  height: 100%;
  border: 1.5px solid var(--color-text-light);
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

/* --- WALL D: Window & Locked Chest --- */
/* Window */
.wall-window {
  top: 30px;
  left: 15%;
  width: 180px;
  height: 150px;
  border: 4px solid var(--color-text-light);
  background: #000;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
}
.window-pane {
  background: radial-gradient(circle at center, #151515, #000);
  border: 1px solid var(--color-text-dim);
  overflow: hidden;
  position: relative;
}

/* Chest */
.metal-chest {
  bottom: 20px;
  right: 15%;
  width: 180px;
  height: 90px;
}
.chest-body {
  width: 100%;
  height: 100%;
  border: 3px solid var(--color-text-light);
  border-radius: 4px;
  background: #0a0a0a;
  position: relative;
}
.chest-lid {
  position: absolute;
  top: 0;
  width: 100%;
  height: 25px;
  border-bottom: 2px solid var(--color-text-light);
  background: #151515;
}
.chest-lock-plate {
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 20px;
  border: 1.5px solid var(--color-text-light);
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chest-keyhole-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-text-light);
  position: relative;
}
.chest-keyhole-indicator::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 2px;
  width: 2px;
  height: 4px;
  background: var(--color-text-light);
}

/* -------------------------------------------------------------
 * INVENTORY SYSTEM
 * ----------------------------------------------------------- */
.inventory-container {
  background: var(--color-bg-card);
  border: 2px solid var(--color-text-light);
  border-radius: var(--border-radius-md);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 110;
}

.inventory-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.inventory-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.inventory-slot {
  height: 52px;
  border: 2px dashed var(--color-text-dim);
  border-radius: var(--border-radius-sm);
  background-color: var(--color-bg-darkest);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 2px;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
  user-select: none;
}
.inventory-slot.has-item {
  border: 2px solid var(--color-text-light);
  color: var(--color-text-light);
  background-color: #1a1a1a;
}
.inventory-slot.has-item:hover {
  background-color: #2a2a2a;
}
.inventory-slot.selected {
  border-color: var(--color-text-light);
  box-shadow: 0 0 10px var(--color-text-light);
  transform: translateY(-2px);
}

/* Action feedback bar */
.sub-message {
  height: 28px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-light);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

/* -------------------------------------------------------------
 * MODAL OVERLAYS (GLASSMORPHISM)
 * ----------------------------------------------------------- */
.modal-overlay, .zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.zoom-overlay {
  top: 58px;
  height: calc(100% - 58px - 94px);
}

.modal-card {
  width: 85%;
  max-width: 460px;
  background: var(--color-bg-card);
  border: 2px solid var(--color-text-light);
  border-radius: var(--border-radius-md);
  box-shadow: 0 15px 35px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  animation: modalPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-header {
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--color-text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
}

.modal-content {
  padding: 20px;
  max-height: 350px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}
.modal-content.text-left {
  text-align: left;
}
.modal-content p {
  margin-bottom: 12px;
}
.modal-content ol {
  margin-left: 20px;
  margin-bottom: 12px;
}
.modal-content li {
  margin-bottom: 8px;
}

/* Leadersboard table */
.score-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.score-table th, .score-table td {
  padding: 10px 8px;
  text-align: center;
  border-bottom: 1px solid var(--color-text-dim);
}
.score-table th {
  font-weight: 800;
  color: var(--color-text-muted);
  font-size: 12px;
  text-transform: uppercase;
}
.score-table tbody tr:first-child {
  font-weight: bold;
  color: var(--color-text-light);
}

/* -------------------------------------------------------------
 * CLOSE-UP ZOOM CARD & CUSTOM PUZZLES UI
 * ----------------------------------------------------------- */
.zoom-modal-card {
  width: 85%;
  max-width: 440px;
  max-height: 100%;
  background: var(--color-bg-dark);
  border: 2px solid var(--color-text-light);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  animation: zoomPop 0.25s ease forwards;
}

.zoom-header {
  padding: 12px 16px;
  border-bottom: 1.5px solid var(--color-text-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--color-bg-card);
}
.zoom-header h3 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
}

.zoom-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background-color: var(--color-bg-darkest);
  overflow-y: auto;
}

.zoom-footer-hint {
  padding: 10px 16px;
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-text-dim);
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- ZOOM: Drawer Zoom --- */
.drawer-zoom-ui {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.drawer-face {
  width: 160px;
  height: 90px;
  border: 3.5px solid var(--color-text-light);
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
}
.drawer-handle-large {
  width: 60px;
  height: 12px;
  border: 2.5px solid var(--color-text-light);
  border-radius: 3px;
}
.drawer-keyhole-large {
  position: absolute;
  top: 15px;
  width: 8px;
  height: 12px;
  background: var(--color-text-light);
  border-radius: 50% 50% 0 0;
}
.drawer-interior {
  width: 100%;
  text-align: center;
}
.drawer-info-text {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.drawer-items {
  display: flex;
  gap: 25px;
  justify-content: center;
  margin-top: 10px;
}
.item-in-drawer {
  width: 50px;
  height: 50px;
  border: 1.5px solid var(--color-text-light);
  background: #111;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  position: relative;
}
.item-in-drawer:hover {
  background: #222;
}

/* Screwdriver representation */
.screwdriver-pickup::before {
  content: '';
  position: absolute;
  top: 22px;
  left: 8px;
  width: 34px;
  height: 6px;
  background: var(--color-text-light);
  transform: rotate(-45deg);
}
.screwdriver-pickup::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 28px;
  width: 12px;
  height: 12px;
  background: var(--color-text-light);
  border: 1px solid #000;
  transform: rotate(-45deg);
}

/* Notebook representation */
.notebook-pickup::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 12px;
  width: 26px;
  height: 34px;
  border: 1.5px solid var(--color-text-light);
  background: #000;
}
.notebook-pickup::after {
  content: '📓';
  position: absolute;
  top: 12px;
  left: 14px;
  font-size: 18px;
}

/* --- ZOOM: Dark Area Zoom --- */
.dark-zoom-ui {
  width: 100%;
  display: flex;
  flex-direction: column;
}
.dark-box-bg {
  width: 100%;
  height: 200px;
  background: #020202;
  border: 1.5px solid var(--color-text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.dark-tip-text {
  text-align: center;
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.5;
  user-select: none;
}
.flashlight-spotlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle 70px at var(--mouse-x, 50%) var(--mouse-y, 50%), transparent 95%, #000000 100%);
  pointer-events: none;
  z-index: 2;
}
.illuminated-item {
  position: absolute;
  pointer-events: auto; /* make sure player can click it */
  z-index: 1;
}
.key-pickup {
  top: 80px;
  left: 180px;
  width: 40px;
  height: 20px;
  border: 1.5px solid var(--color-text-light);
  background: #111;
  border-radius: 50% 0 0 50%;
  cursor: pointer;
}
.key-pickup::after {
  content: '';
  position: absolute;
  right: -10px;
  top: 6px;
  width: 14px;
  height: 6px;
  background: var(--color-text-light);
}

/* --- ZOOM: Clock Zoom --- */
.clock-zoom-ui {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.clock-large {
  width: 160px;
  height: 160px;
  margin-bottom: 16px;
}
.clock-large-face {
  width: 100%;
  height: 100%;
  border: 4px solid var(--color-text-light);
  border-radius: 50%;
  position: relative;
  background: #000;
}
.clock-large-marker {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: bold;
  color: var(--color-text-light);
}
.marker-12 { top: 6px; left: 50%; transform: translateX(-50%); }
.marker-3  { right: 8px; top: 50%; transform: translateY(-50%); }
.marker-6  { bottom: 6px; left: 50%; transform: translateX(-50%); }
.marker-9  { left: 8px; top: 50%; transform: translateY(-50%); }

.clock-large-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--color-text-light);
  border-radius: 50%;
  z-index: 5;
}
.clock-large-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  background: var(--color-text-light);
  transform-origin: bottom center;
  border-radius: 3px;
}
.large-hour-hand {
  width: 5px;
  height: 42px;
  transform: rotate(-100deg);
  left: calc(50% - 2.5px);
  z-index: 3;
}
.large-minute-hand {
  width: 3px;
  height: 62px;
  transform: rotate(-120deg);
  left: calc(50% - 1.5px);
  z-index: 4;
}
.clock-clue-text {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* --- ZOOM: Safe Zoom --- */
.safe-zoom-ui {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.safe-dial-panel {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.safe-screen {
  background: #000;
  border: 2px solid var(--color-text-light);
  height: 38px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.safe-code-display {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 6px;
}
.safe-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.keypad-btn {
  height: 36px;
  background: var(--color-bg-card);
  border: 1.5px solid var(--color-text-light);
  color: var(--color-text-light);
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.keypad-btn:active {
  background: var(--color-text-light);
  color: var(--color-bg-darkest);
}
.btn-clear {
  font-size: 11px;
}
.btn-enter {
  font-size: 11px;
}

.safe-interior {
  width: 100%;
  text-align: center;
}
.safe-info-text {
  font-size: 14px;
  color: var(--color-text-light);
  margin-bottom: 16px;
}
.safe-items {
  display: flex;
  gap: 30px;
  justify-content: center;
}
.item-in-safe {
  width: 50px;
  height: 50px;
  border: 1.5px solid var(--color-text-light);
  background: #111;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  position: relative;
}
.item-in-safe:hover {
  background: #222;
}

/* Fuse pickup */
.fuse-pickup::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 18px;
  width: 14px;
  height: 30px;
  border: 1.5px solid var(--color-text-light);
  background: #000;
  border-radius: 2px;
}
.fuse-pickup::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 21px;
  width: 8px;
  height: 5px;
  background: var(--color-text-light);
}

/* USB Drive */
.usb-pickup::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 10px;
  width: 30px;
  height: 18px;
  border: 1.5px solid var(--color-text-light);
  background: #000;
  border-radius: 2px;
}
.usb-pickup::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 38px;
  width: 6px;
  height: 8px;
  border: 1px solid var(--color-text-light);
}

/* --- ZOOM: Fusebox Zoom --- */
.fusebox-zoom-ui {
  width: 100%;
}
.fusebox-panel {
  width: 260px;
  border: 2px solid var(--color-text-light);
  background: #0a0a0a;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}
.fuse-socket {
  border: 1.5px dashed var(--color-text-dim);
  border-radius: var(--border-radius-sm);
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 15px;
  background: #020202;
  cursor: pointer;
}
.fuse-socket.has-fuse {
  border: 1.5px solid var(--color-text-light);
}
.fuse-cylinder {
  width: 36px;
  height: 18px;
  border: 1.5px solid var(--color-text-light);
  background: linear-gradient(90deg, #555 0%, #aaa 10%, #fff 25%, #aaa 70%, #555 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.4);
}
.socket-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-muted);
}
.fuse-socket.has-fuse .socket-label {
  color: var(--color-text-light);
}

.wire-grid {
  border-top: 1px solid var(--color-text-dim);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.circuit-wire {
  height: 2px;
  background: var(--color-text-dim);
}
.circuit-wire.active {
  background: var(--color-text-light);
  box-shadow: 0 0 6px var(--color-text-light);
}
.circuit-status-indicator {
  font-family: var(--font-mono);
  font-size: 11px;
  text-align: right;
  color: var(--color-text-red);
}
.circuit-status-indicator.active {
  color: var(--color-text-green);
}

/* --- ZOOM: Computer Zoom --- */
.computer-zoom-ui {
  width: 100%;
  display: flex;
  justify-content: center;
}
.terminal-bezel {
  width: 320px;
  border: 8px solid var(--color-text-light);
  border-radius: var(--border-radius-md);
  background: var(--color-bg-card);
  padding: 10px;
}
.terminal-screen {
  background: var(--color-bg-terminal);
  border: 2px solid #222;
  height: 240px;
  border-radius: var(--border-radius-sm);
  padding: 12px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-text-muted);
}
.terminal-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.terminal-text {
  margin-bottom: 6px;
}
.green-text {
  color: var(--color-text-light);
  font-weight: bold;
}
.terminal-text-error {
  color: #fff;
  font-weight: bold;
  animation: flashRed 1.5s infinite;
  text-align: center;
  margin-top: 20px;
}
.terminal-input-line {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}
.terminal-code-display {
  color: var(--color-text-light);
  font-size: 16px;
  letter-spacing: 4px;
}
.terminal-cursor {
  animation: blink 1s infinite;
  color: var(--color-text-light);
}
.terminal-divider {
  border-bottom: 1px dashed var(--color-text-dim);
  margin: 6px 0;
}
.terminal-hint-text {
  font-size: 9px;
  color: var(--color-text-dim);
  margin-top: auto;
  line-height: 1.3;
}

.terminal-keyboard-mock {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  margin: 6px 0;
}
.key-row {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.comp-key {
  padding: 4px 10px;
  font-size: 12px;
  background: #111;
  border: 1px solid var(--color-text-muted);
  color: var(--color-text-light);
  font-family: inherit;
  cursor: pointer;
  border-radius: 2px;
  width: 44px;
}
.comp-key:active {
  background: var(--color-text-light);
  color: #000;
}

.binary-pattern-display {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  margin: 10px 0;
}
.binary-grid-row {
  display: flex;
  gap: 8px;
}
.binary-cell {
  font-size: 18px;
  color: var(--color-text-dim);
}
.binary-cell.active {
  color: var(--color-text-light);
}

/* --- ZOOM: Window Zoom --- */
.window-zoom-ui {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.window-large-view {
  width: 180px;
  height: 150px;
  border: 3.5px solid var(--color-text-light);
  position: relative;
  overflow: hidden;
  margin-bottom: 12px;
}
.starry-sky-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #020202;
}
.moon {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-text-light);
  box-shadow: 0 0 10px rgba(255,255,255,0.4);
}
.window-large-panes {
  position: absolute;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  background: var(--color-text-light);
}
.pane-quad {
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.etched-symbol {
  font-size: 20px;
  color: rgba(255, 255, 255, 0.75);
}
.etched-number {
  position: absolute;
  bottom: 4px;
  right: 6px;
  font-size: 12px;
  font-weight: bold;
  color: rgba(255,255,255,0.7);
  font-family: var(--font-mono);
}
.window-clue-text {
  font-size: 13px;
  color: var(--color-text-muted);
  text-align: center;
}

/* --- ZOOM: Chest Zoom --- */
.chest-zoom-ui {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.chest-lock-interface {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.chest-lock-instruction {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
}
.chest-grid-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.chest-grid-btn {
  width: 44px;
  height: 44px;
  border: 2px solid var(--color-text-light);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  transition: all 0.2s;
  box-shadow: inset 0 0 5px rgba(255,255,255,0.1);
}
.chest-grid-btn.active {
  background-color: var(--color-text-light);
  box-shadow: 0 0 10px var(--color-text-light);
}

.chest-interior-panel {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}
.chest-unlocked-text {
  font-size: 14px;
  color: var(--color-text-light);
}
.masterkey-pickup {
  width: 60px;
  height: 60px;
  border: 2.5px solid var(--color-text-light);
  background: #111;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.masterkey-pickup:hover {
  background: #222;
  box-shadow: 0 0 12px var(--color-text-light);
}
.masterkey-pickup::before {
  content: '🔑';
  font-size: 28px;
}

/* -------------------------------------------------------------
 * 3. GAME WIN / VICTORY MODAL
 * ----------------------------------------------------------- */
.win-card {
  border-color: var(--color-text-light);
  text-align: center;
  background-color: #000;
}
.win-banner {
  background: var(--color-text-light);
  color: #000;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 6px;
}
.win-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 18px 0;
}
.win-stat-box {
  background: var(--color-bg-card);
  border: 1px solid var(--color-text-dim);
  border-radius: var(--border-radius-sm);
  padding: 12px;
  width: 130px;
}
.win-stat-lbl {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.win-stat-val {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: bold;
}

.new-record-section {
  border: 1px solid var(--color-text-muted);
  padding: 14px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.new-record-section h3 {
  font-size: 14px;
  font-weight: 800;
}
.input-row {
  display: flex;
  gap: 8px;
}
#player-name-input {
  flex-grow: 1;
  background: #111;
  border: 1.5px solid var(--color-text-light);
  color: #fff;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}
#player-name-input:focus {
  box-shadow: 0 0 8px var(--color-accent-glow);
}

.win-menu {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* -------------------------------------------------------------
 * RIDDLE OBJECT HIGHLIGHT DETAILS (Books)
 * ----------------------------------------------------------- */
/* Star Symbol: Star = 3 on Window */
/* Triangle Symbol: Triangle = 9 behind painting */
/* Square Symbol: Square = 5 in Book 1 */
/* Circle Symbol: Circle = 2 on bottom of Trash Can */
/* Sequence is Star, Triangle, Square, Circle -> 3952 */
.book.shadow-riddle::after {
  content: '▲';
  font-size: 6px;
  color: var(--color-text-muted);
  position: absolute;
  top: 10px;
  left: 4px;
}
/* We will show specific symbols inside zoom pages when books are opened */
.book-open-ui {
  text-align: center;
}
.book-page-large {
  width: 200px;
  height: 140px;
  border: 2px solid var(--color-text-light);
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 12px;
  position: relative;
}
.book-page-large::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: #ccc;
}
.page-symbol {
  font-size: 32px;
  font-weight: bold;
}

/* -------------------------------------------------------------
 * ANIMATIONS
 * ----------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalPop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes zoomPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes flashRed {
  0%, 100% { color: var(--color-text-muted); }
  50% { color: #fff; text-shadow: 0 0 8px rgba(255,255,255,0.6); }
}

.shake {
  animation: shakeAnim 0.3s ease;
}
@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.success-pulse {
  animation: successPulseAnim 0.5s ease;
}
@keyframes successPulseAnim {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); border-color: #33ff33; box-shadow: 0 0 15px rgba(50, 255, 50, 0.4); }
  100% { transform: scale(1); }
}

/* Responsive Mobile Layout adjustments */
@media (max-width: 600px) {
  .app-container {
    aspect-ratio: auto;
    height: 100%;
    max-height: 100vh;
    border: none;
  }
  .nav-arrow-btn {
    width: 32px;
    height: 60px;
  }
  .inventory-slot {
    height: 44px;
    font-size: 8px;
  }
  .exit-door {
    height: 180px;
    width: 90px;
  }
  .desk {
    width: 180px;
    right: 5%;
  }
  .bookshelf {
    width: 170px;
    right: 5%;
  }
  .painting-area {
    left: 8%;
    width: 120px;
    height: 90px;
  }
  .wall-safe {
    width: 120px;
    height: 90px;
  }
  .wall-clock {
    left: 15%;
  }
  .fuse-box-wall {
    right: 15%;
  }
  .wall-window {
    left: 8%;
    width: 140px;
    height: 120px;
  }
  .metal-chest {
    right: 8%;
    width: 140px;
  }
}
