/* AFTER HOURS - Retro DOS Horror Aesthetic */

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

body {
  background: #000;
  color: #4FC3F7;
  font-family: 'VT323', monospace;
  overflow: hidden;
  cursor: default;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

#game-container {
  position: relative;
  width: 1024px;
  height: 800px;
  background: #0a0a1a;
  border: 2px solid #1a2a3a;
  box-shadow: 0 0 40px rgba(79, 195, 247, 0.1), inset 0 0 80px rgba(0, 0, 0, 0.5);
}

/* === TITLE SCREEN === */
#title-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #0a0a1a url('bg-title.png') center/cover no-repeat;
  z-index: 100;
}

.title-text {
  text-align: center;
  animation: flicker 4s infinite;
  background: rgba(5, 5, 20, 0.75);
  padding: 40px 60px;
  border-radius: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(79, 195, 247, 0.1);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

.title-flicker {
  font-size: 84px;
  color: #4FC3F7;
  text-shadow:
    0 0 10px #4FC3F7,
    0 0 20px #4FC3F7,
    0 0 40px #2288bb,
    0 0 80px #114466;
  letter-spacing: 12px;
  margin-bottom: 8px;
  animation: titlePulse 3s ease-in-out infinite;
}

@keyframes titlePulse {
  0%, 100% { opacity: 1; text-shadow: 0 0 10px #4FC3F7, 0 0 20px #4FC3F7, 0 0 40px #2288bb; }
  50% { opacity: 0.85; text-shadow: 0 0 5px #4FC3F7, 0 0 10px #2288bb; }
  73% { opacity: 0.95; }
  74% { opacity: 0.3; }
  75% { opacity: 0.95; }
}

.subtitle {
  font-size: 24px;
  color: #7ab8d4;
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 12px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.8), 0 0 20px rgba(79, 195, 247, 0.4);
}

.title-divider {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #4FC3F7, transparent);
  margin: 16px auto 32px;
}

.chapter-label {
  font-size: 20px;
  color: #7ab8d4;
  letter-spacing: 3px;
  margin-top: 24px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.8), 0 0 20px rgba(79, 195, 247, 0.4);
}

#options-panel, #credits-panel {
  text-align: center;
  padding: 40px 60px;
  background: rgba(5, 5, 20, 0.75);
  border-radius: 12px;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(79, 195, 247, 0.1);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.7);
}

#options-panel h2, #credits-panel h2 {
  font-size: 48px;
  color: #4FC3F7;
  text-shadow: 0 0 10px #4FC3F7, 0 0 20px rgba(79, 195, 247, 0.5);
  margin-bottom: 32px;
  letter-spacing: 8px;
}

.option-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 300px;
  margin: 0 auto 16px;
  padding: 8px 0;
  border-bottom: 1px solid #1a2a3a;
}

.option-row label {
  font-size: 22px;
  color: #4FC3F7;
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.6);
}

.option-row select {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #4FC3F7;
  background: rgba(10, 10, 26, 0.8);
  border: 1px solid #1a2a3a;
  padding: 4px 12px;
  cursor: pointer;
  text-shadow: 0 0 6px rgba(79, 195, 247, 0.5);
}

.credit-line {
  font-size: 18px;
  color: #7ab8d4;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-top: 20px;
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.5);
}

.credit-name {
  font-size: 26px;
  color: #4FC3F7;
  margin-top: 4px;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.8), 0 0 20px rgba(79, 195, 247, 0.4);
}

.menu-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 48px;
}

.menu-btn {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: #4FC3F7;
  background: transparent;
  border: 2px solid #1a2a3a;
  padding: 8px 48px;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.15s;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.8), 0 0 20px rgba(79, 195, 247, 0.4);
}

.menu-btn:hover {
  background: #4FC3F7;
  color: #0a0a1a;
  border-color: #4FC3F7;
  text-shadow: none;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
}

.footer-text {
  font-size: 18px;
  color: #7ab8d4;
  text-shadow: 0 0 10px rgba(79, 195, 247, 0.8), 0 0 20px rgba(79, 195, 247, 0.4);
  animation: blink 2s infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.8; }
  94% { opacity: 1; }
  96% { opacity: 0.9; }
  97% { opacity: 1; }
}

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

/* === GAME SCREEN === */
#game-screen {
  position: relative;
  width: 100%;
  height: 100%;
}

#game-canvas {
  display: block;
  background: #0a0a1a;
  image-rendering: pixelated;
}

/* === CRT SCANLINE OVERLAY === */
#scanline-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1024px;
  height: 640px;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  mix-blend-mode: multiply;
}

#scanline-overlay::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
}

/* === CURSOR MODES BAR === */
#cursor-modes {
  position: absolute;
  top: 644px;
  left: 0;
  width: 1024px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #0d0d22;
  border-top: 1px solid #1a2a3a;
  border-bottom: 1px solid #1a2a3a;
  z-index: 20;
}

.cursor-btn {
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: #336633;
  background: transparent;
  border: 1px solid #1a2a1a;
  padding: 4px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
}

.cursor-btn:hover {
  color: #4FC3F7;
  border-color: #4FC3F7;
}

.cursor-btn.active {
  color: #4FC3F7;
  background: #1a2a3a;
  border-color: #4FC3F7;
  text-shadow: 0 0 8px #4FC3F7;
}

.cursor-icon {
  font-size: 18px;
}

/* === INVENTORY BAR === */
#inventory-bar {
  position: absolute;
  top: 688px;
  left: 0;
  width: 1024px;
  height: 72px;
  background: #0d0d22;
  border-top: 1px solid #1a2a3a;
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 20;
}

#inventory-label {
  font-size: 14px;
  color: #336633;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 2px;
  margin-right: 8px;
  user-select: none;
}

#inventory-slots {
  display: flex;
  gap: 6px;
  flex: 1;
  height: 56px;
  overflow-x: auto;
}

.inventory-slot {
  width: 56px;
  height: 56px;
  min-width: 56px;
  border: 1px solid #1a2a3a;
  background: #0a0a18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.inventory-slot:hover {
  border-color: #4FC3F7;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.2);
}

.inventory-slot.selected {
  border-color: #ffaa00;
  background: #1a1a0a;
  box-shadow: 0 0 12px rgba(255, 170, 0, 0.3);
}

.inventory-slot .item-icon {
  font-size: 24px;
  line-height: 1;
}

.inventory-slot .item-name {
  font-size: 10px;
  color: #4FC3F7;
  margin-top: 2px;
  text-align: center;
  line-height: 1;
}

/* === DIALOG BOX === */
#dialog-box {
  position: absolute;
  bottom: 164px;
  left: 32px;
  right: 32px;
  background: rgba(10, 10, 26, 0.95);
  border: 2px solid #4FC3F7;
  padding: 16px 20px;
  z-index: 50;
  box-shadow: 0 0 20px rgba(79, 195, 247, 0.15), inset 0 0 30px rgba(0, 0, 0, 0.5);
  max-height: 180px;
}

#dialog-speaker {
  font-size: 18px;
  color: #ffaa00;
  margin-bottom: 6px;
  letter-spacing: 2px;
  text-transform: uppercase;
}

#dialog-text {
  font-size: 22px;
  color: #4FC3F7;
  line-height: 1.4;
  min-height: 40px;
}

#dialog-continue {
  font-size: 14px;
  color: #336633;
  text-align: right;
  margin-top: 8px;
  animation: blink 1.5s infinite;
}

/* === PUZZLE OVERLAY === */
#puzzle-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1024px;
  height: 640px;
  background: rgba(0, 0, 0, 0.85);
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: center;
}

#puzzle-content {
  background: #0a0a1a;
  border: 2px solid #4FC3F7;
  padding: 32px;
  max-width: 600px;
  width: 90%;
  box-shadow: 0 0 40px rgba(79, 195, 247, 0.2);
}

#puzzle-content h2 {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: #4FC3F7;
  margin-bottom: 16px;
  text-align: center;
  text-shadow: 0 0 8px #4FC3F7;
}

#puzzle-content p {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #88bb88;
  margin-bottom: 12px;
  line-height: 1.4;
}

#puzzle-content input {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: #4FC3F7;
  background: #0d0d22;
  border: 1px solid #1a2a3a;
  padding: 8px 16px;
  width: 100%;
  outline: none;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 4px;
}

#puzzle-content input:focus {
  border-color: #4FC3F7;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
}

#puzzle-content button {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #4FC3F7;
  background: transparent;
  border: 1px solid #4FC3F7;
  padding: 8px 32px;
  cursor: pointer;
  display: block;
  margin: 0 auto;
  transition: all 0.15s;
}

#puzzle-content button:hover {
  background: #4FC3F7;
  color: #0a0a1a;
}

.puzzle-hint {
  font-size: 16px !important;
  color: #554400 !important;
  text-align: center;
  font-style: italic;
}

.puzzle-tickets {
  list-style: none;
  margin: 12px 0;
}

.puzzle-tickets li {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: #88bb88;
  padding: 6px 12px;
  border: 1px solid #1a2a3a;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.puzzle-tickets li:hover {
  border-color: #4FC3F7;
  color: #4FC3F7;
}

.puzzle-tickets li.completed {
  color: #336633;
  text-decoration: line-through;
  border-color: #0d2a0d;
  cursor: default;
}

/* === ROOM LABEL === */
#room-label {
  font-size: 16px;
  color: #4FC3F7;
  letter-spacing: 4px;
  text-transform: uppercase;
  pointer-events: none;
  text-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
  margin-right: 16px;
  white-space: nowrap;
}

/* === STATUS BAR === */
#status-bar {
  position: absolute;
  top: 760px;
  left: 0;
  width: 1024px;
  height: 36px;
  background: #080818;
  border-top: 1px solid #1a2a3a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 20;
}

#btn-menu {
  font-family: 'VT323', monospace;
  font-size: 16px;
  color: #4FC3F7;
  background: transparent;
  border: 1px solid #1a2a3a;
  padding: 4px 14px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.15s;
}

#btn-sound {
  font-family: 'VT323', monospace;
  font-size: 14px;
  color: #4FC3F7;
  background: transparent;
  border: 1px solid #1a2a3a;
  padding: 2px 10px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.15s;
  margin-right: 6px;
}

#btn-sound:hover {
  background: #4FC3F7;
  color: #0a0a1a;
  border-color: #4FC3F7;
}

#btn-menu:hover {
  background: #4FC3F7;
  color: #0a0a1a;
  border-color: #4FC3F7;
  box-shadow: 0 0 8px rgba(79, 195, 247, 0.3);
}

#status-text {
  font-size: 16px;
  color: #336633;
}

#debug-indicator {
  font-size: 14px;
  color: #ff4444;
  animation: blink 1s infinite;
}

/* === CUSTOM CURSORS === */
.cursor-walk { cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><text y="18" font-size="18" fill="%2300ff44">%E2%86%91</text></svg>') 12 4, pointer; }
.cursor-examine { cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><text y="18" font-size="18" fill="%2300ff44">%E2%97%89</text></svg>') 12 12, help; }
.cursor-take { cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><text y="18" font-size="18" fill="%2300ff44">%E2%9C%8B</text></svg>') 12 12, grab; }
.cursor-use { cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><text y="18" font-size="18" fill="%2300ff44">%E2%9A%99</text></svg>') 12 12, crosshair; }
.cursor-talk { cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"><text y="18" font-size="16" fill="%2300ff44">%E2%98%B6</text></svg>') 12 12, text; }

/* === FADE TRANSITION === */
#fade-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 1024px;
  height: 640px;
  background: #000;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#fade-overlay.active {
  opacity: 1;
}

/* === SCROLLBAR === */
#inventory-slots::-webkit-scrollbar {
  height: 4px;
}

#inventory-slots::-webkit-scrollbar-track {
  background: #0a0a18;
}

#inventory-slots::-webkit-scrollbar-thumb {
  background: #1a2a3a;
}

/* === CHAPTER COMPLETE OVERLAY === */
.chapter-complete {
  text-align: center;
}

.chapter-complete h2 {
  font-size: 48px !important;
  margin-bottom: 24px !important;
}

.chapter-complete p {
  font-size: 24px !important;
  color: #4FC3F7 !important;
}
