/* NEUROMANCER: Night City Run — Sierra-style adventure game UI */
/* CRT retro aesthetic with cyberpunk color palette */

@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&family=Share+Tech+Mono&display=swap');

:root {
  --bg-dark: #0a0a0f;
  --bg-panel: #111118;
  --bg-panel-light: #1a1a25;
  --border-cyan: #00cccc;
  --border-dim: #333344;
  --text-green: #00ff88;
  --text-cyan: #00ddee;
  --text-amber: #ffaa00;
  --text-white: #ccccdd;
  --text-dim: #667788;
  --text-red: #ff4444;
  --text-pink: #ff66aa;
  --accent-purple: #8844cc;
  --hover-glow: rgba(0, 204, 204, 0.3);
  --verb-active: #00cccc;
  --verb-bg: #1a1a2e;
  --inventory-bg: #0d0d18;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-white);
  font-family: 'VT323', monospace;
  font-size: 18px;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  cursor: default;
}

#game-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* === SCANLINES & CRT EFFECTS === */
#scanlines {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 1000;
}

#crt-flicker {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 999;
  animation: flicker 0.15s infinite;
  opacity: 0;
}

@keyframes flicker {
  0% { opacity: 0; }
  5% { opacity: 0.02; background: rgba(0, 255, 136, 0.01); }
  10% { opacity: 0; }
}

/* === TITLE SCREEN === */
#title-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.title-art {
  text-align: center;
  padding: 40px;
}

.title-text h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 48px;
  color: var(--text-cyan);
  text-shadow: 0 0 20px rgba(0, 221, 238, 0.5), 0 0 40px rgba(0, 221, 238, 0.2);
  margin-bottom: 10px;
  letter-spacing: 4px;
  animation: glow-pulse 3s ease-in-out infinite;
}

.title-text h2 {
  font-family: 'Share Tech Mono', monospace;
  font-size: 24px;
  color: var(--text-amber);
  letter-spacing: 8px;
  text-transform: uppercase;
  margin-bottom: 60px;
}

@keyframes glow-pulse {
  0%, 100% { text-shadow: 0 0 20px rgba(0, 221, 238, 0.5), 0 0 40px rgba(0, 221, 238, 0.2); }
  50% { text-shadow: 0 0 30px rgba(0, 221, 238, 0.8), 0 0 60px rgba(0, 221, 238, 0.4); }
}

.title-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.title-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: var(--text-green);
  background: transparent;
  border: 2px solid var(--border-cyan);
  padding: 12px 40px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.2s;
  min-width: 240px;
}

.title-btn:hover:not(:disabled) {
  background: var(--hover-glow);
  color: #fff;
  box-shadow: 0 0 15px rgba(0, 204, 204, 0.4);
}

.title-btn:disabled {
  color: var(--text-dim);
  border-color: var(--border-dim);
  cursor: not-allowed;
}

/* === CHARACTER CREATION === */
#char-creation {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-panel {
  max-width: 700px;
  padding: 40px;
  text-align: center;
}

.char-panel h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  color: var(--text-cyan);
  margin-bottom: 20px;
}

.char-intro {
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1.5;
  margin-bottom: 30px;
}

.skill-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.skill-option {
  border: 2px solid var(--border-dim);
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.skill-option:hover {
  border-color: var(--border-cyan);
  background: rgba(0, 204, 204, 0.05);
}

.skill-option.selected {
  border-color: var(--text-green);
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.2);
}

.skill-icon { font-size: 36px; margin-bottom: 8px; }
.skill-name {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--text-amber);
  margin-bottom: 8px;
}
.skill-desc {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.4;
}

.char-status {
  color: var(--text-green);
  font-size: 20px;
  margin-bottom: 20px;
}

/* === MAIN GAME SCREEN === */
#game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Scene Display */
#scene-container {
  flex: 1;
  position: relative;
  min-height: 0;
  background: #000;
  display: flex;
  flex-direction: column;
}

#scene-image {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#scene-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  image-rendering: auto;
}

#hotspot-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.hotspot-area {
  position: absolute;
  cursor: pointer;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.hotspot-area:hover {
  border-color: rgba(0, 204, 204, 0.4);
  background: rgba(0, 204, 204, 0.08);
}

.hotspot-area.exit-hotspot:hover {
  border-color: rgba(255, 170, 0, 0.5);
  background: rgba(255, 170, 0, 0.08);
}

#cursor-label {
  position: fixed;
  background: rgba(0, 0, 0, 0.85);
  color: var(--text-cyan);
  font-size: 14px;
  padding: 3px 8px;
  border: 1px solid var(--border-cyan);
  pointer-events: none;
  display: none;
  z-index: 100;
  white-space: nowrap;
}

#scene-name {
  background: var(--bg-panel);
  color: var(--text-amber);
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  text-align: center;
  padding: 6px;
  border-top: 1px solid var(--border-dim);
  letter-spacing: 2px;
}

/* Verb Bar */
#verb-bar {
  display: flex;
  background: var(--bg-panel);
  border-top: 2px solid var(--border-cyan);
  border-bottom: 1px solid var(--border-dim);
  padding: 4px 8px;
  gap: 4px;
  flex-shrink: 0;
}

.verb-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 11px;
  color: var(--text-green);
  background: var(--verb-bg);
  border: 1px solid var(--border-dim);
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}

.verb-btn:hover {
  border-color: var(--border-cyan);
  color: var(--text-cyan);
}

.verb-btn.active {
  background: var(--verb-active);
  color: var(--bg-dark);
  border-color: var(--text-cyan);
  box-shadow: 0 0 8px rgba(0, 204, 204, 0.4);
}

.verb-spacer { flex: 1; }

.verb-system {
  color: var(--text-dim);
  font-size: 9px;
}

/* Inventory Bar */
#inventory-bar {
  display: flex;
  align-items: center;
  background: var(--inventory-bg);
  border-bottom: 1px solid var(--border-dim);
  padding: 4px 8px;
  min-height: 48px;
  flex-shrink: 0;
  gap: 4px;
}

#inventory-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: var(--text-dim);
  margin-right: 8px;
  white-space: nowrap;
}

#inventory-slots {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.inventory-item {
  background: var(--bg-panel-light);
  border: 1px solid var(--border-dim);
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.inventory-item:hover {
  border-color: var(--border-cyan);
  background: rgba(0, 204, 204, 0.1);
}

.inventory-item.selected {
  border-color: var(--text-green);
  background: rgba(0, 255, 136, 0.15);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.inventory-item .item-icon { font-size: 18px; }
.inventory-item .item-name {
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  color: var(--text-white);
}

/* Text Output */
#text-output {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-dim);
  padding: 10px 16px;
  min-height: 80px;
  max-height: 120px;
  overflow-y: auto;
  flex-shrink: 0;
}

#text-content {
  font-family: 'VT323', monospace;
  font-size: 20px;
  line-height: 1.4;
  color: var(--text-green);
}

#text-content .text-description { color: var(--text-white); }
#text-content .text-action { color: var(--text-green); }
#text-content .text-failure { color: var(--text-red); }
#text-content .text-item { color: var(--text-amber); }
#text-content .text-skill { color: var(--text-cyan); }
#text-content .text-cyber { color: var(--text-pink); }

/* Dialogue Overlay */
#dialogue-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#dialogue-box {
  background: var(--bg-panel);
  border: 2px solid var(--border-cyan);
  max-width: 600px;
  width: 90%;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 204, 204, 0.2);
}

#dialogue-speaker {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: var(--text-amber);
  margin-bottom: 12px;
  letter-spacing: 1px;
}

#dialogue-text {
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-white);
  margin-bottom: 16px;
}

#dialogue-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dialogue-choice {
  font-family: 'VT323', monospace;
  font-size: 20px;
  color: var(--text-cyan);
  background: transparent;
  border: 1px solid var(--border-dim);
  padding: 8px 16px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.dialogue-choice:hover {
  border-color: var(--border-cyan);
  background: var(--hover-glow);
  color: #fff;
}

.dialogue-choice .choice-skill-tag {
  font-size: 14px;
  color: var(--text-pink);
  margin-left: 8px;
}

.dialogue-choice:disabled {
  color: var(--text-dim);
  border-color: #222;
  cursor: not-allowed;
}

/* Status Bar */
#status-bar {
  display: flex;
  background: var(--bg-dark);
  border-top: 1px solid var(--border-dim);
  padding: 4px 12px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  gap: 20px;
  flex-shrink: 0;
}

#status-skills { color: var(--text-cyan); }
#status-cyberware { color: var(--text-pink); }
#status-credits { color: var(--text-amber); }

/* === END SCREEN === */
#end-screen {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.end-panel {
  max-width: 600px;
  padding: 40px;
  text-align: center;
  border: 2px solid var(--border-cyan);
}

.end-panel h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 20px;
  color: var(--text-cyan);
  margin-bottom: 20px;
}

.end-panel p {
  font-size: 22px;
  line-height: 1.6;
  color: var(--text-white);
  margin-bottom: 30px;
}

/* === CURSOR STATES === */
body.cursor-look { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ccircle cx='10' cy='10' r='7' fill='none' stroke='%2300ddee' stroke-width='2'/%3E%3Cline x1='15' y1='15' x2='22' y2='22' stroke='%2300ddee' stroke-width='2'/%3E%3C/svg%3E") 10 10, pointer; }
body.cursor-use { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M12 2L14 8H20L15 12L17 18L12 14L7 18L9 12L4 8H10Z' fill='%2300ff88' stroke='%23005533' stroke-width='1'/%3E%3C/svg%3E") 12 12, pointer; }
body.cursor-talk { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect x='2' y='4' width='18' height='12' rx='3' fill='none' stroke='%23ffaa00' stroke-width='2'/%3E%3Cpolygon points='6,16 10,16 4,22' fill='%23ffaa00'/%3E%3C/svg%3E") 6 10, pointer; }
body.cursor-take { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpath d='M5 14C5 14 5 8 12 8C19 8 19 14 19 14' fill='none' stroke='%23ff66aa' stroke-width='2'/%3E%3Cline x1='12' y1='8' x2='12' y2='2' stroke='%23ff66aa' stroke-width='2'/%3E%3Cline x1='9' y1='4' x2='12' y2='2' stroke='%23ff66aa' stroke-width='2'/%3E%3Cline x1='15' y1='4' x2='12' y2='2' stroke='%23ff66aa' stroke-width='2'/%3E%3C/svg%3E") 12 12, pointer; }
body.cursor-walk { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Cpolygon points='12,2 22,18 2,18' fill='none' stroke='%2300cccc' stroke-width='2'/%3E%3C/svg%3E") 12 12, pointer; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-dim); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-cyan); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .title-text h1 { font-size: 28px; }
  .title-text h2 { font-size: 16px; }
  .skill-grid { grid-template-columns: 1fr; }
  .verb-btn { padding: 8px 10px; font-size: 10px; }
  #text-output { min-height: 60px; }
}

/* === TYPEWRITER EFFECT === */
.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--text-green);
  white-space: normal;
  animation: blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--text-green); }
}

/* === SCENE TRANSITION === */
.scene-fade-out {
  animation: fadeOut 0.4s ease-out forwards;
}
.scene-fade-in {
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === NOTIFICATION FLASH === */
.item-flash {
  animation: itemFlash 0.6s ease-out;
}

@keyframes itemFlash {
  0% { background: rgba(0, 255, 136, 0.4); }
  100% { background: transparent; }
}

/* === SKILL CHECK ANIMATION === */
.skill-check-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  padding: 12px 24px;
  border: 2px solid;
  z-index: 60;
  animation: skillPop 1.5s ease-out forwards;
}

.skill-check-overlay.success {
  color: var(--text-green);
  border-color: var(--text-green);
  background: rgba(0, 30, 15, 0.9);
}

.skill-check-overlay.failure {
  color: var(--text-red);
  border-color: var(--text-red);
  background: rgba(30, 0, 0, 0.9);
}

@keyframes skillPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  30% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}
