/* ═══════════════════════════════════════════════════════════
   OCEAN PARK — PC-98 INTERFACE
   ═══════════════════════════════════════════════════════════ */

body {
  overflow: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  image-rendering: pixelated;
}

#vn-stage {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: #000;
}

#vn-back {
  position: fixed;
  top: 0.7rem;
  left: 0.9rem;
  z-index: 50;
  font-family: 'DotGothic16', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: #888;
  background: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 0.3rem 0.7rem;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0.55;
  transition: opacity 0.15s, color 0.15s;
}

#vn-back:hover,
#vn-back:focus {
  color: #f5c542;
  opacity: 1;
  outline: none;
}

/* ── TELA INICIAL ──────────────────────────────────── */
#vn-start-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: #000;
  cursor: pointer;
  z-index: 10;
}

#game-title {
  font-family: 'DotGothic16', monospace;
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 4rem);
  color: #fff;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

#start-hint {
  font-family: 'DotGothic16', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.5;
  animation: hint-pulse 2s ease-in-out infinite;
  margin: 0;
}

/* ── SCENE SELECT ──────────────────────────────────── */
#scene-select-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  flex-direction: column;
  min-width: 280px;
  background: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 1.2rem 1.4rem;
  z-index: 5;
}

/* ── CENA VN — wrapper fullscreen ─────────────────── */
#vn-scene {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  background: #000;
  padding: 1rem;
  box-sizing: border-box;
}

/* Layout PC-98: grid de 2 colunas + 1 linha full width */
#vn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  grid-template-rows: auto auto;
  gap: 0.75rem;
  width: 100%;
  max-width: min(96vw, calc((100vh - 80px) * 1.6));
  max-height: calc(100vh - 50px);
}

/* ── VIEWPORT (arte) — coluna esquerda, linha 1 ─── */
#vn-frame-outer {
  grid-column: 1;
  grid-row: 1;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #000;
  line-height: 0;
  position: relative;
  overflow: hidden;
}

#center-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
  background-image:
    repeating-linear-gradient(
      45deg,
      #0a0a0a 0,
      #0a0a0a 2px,
      #000 2px,
      #000 4px
    );
}

#vn-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
}

/* Personagem centralizada, cabe inteira no quadro */
#vn-character {
  position: absolute;
  bottom: -6%;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  pointer-events: none;
}

#vn-character img {
  height: 100%;
  max-height: 95%;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  display: block;
  image-rendering: pixelated;
}

/* ── NAME BOX — painel próprio, absolute no viewport ── */
#name-box {
  position: absolute;
  top: -2px;
  left: -2px;
  background: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 0.6rem 1.4rem;
  font-family: 'DotGothic16', monospace;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #fff;
  min-width: 180px;
  z-index: 5;
  min-height: 1rem;
}

/* ── CHOICES — coluna direita, painel sólido ──────── */
#choice-container {
  grid-column: 2;
  grid-row: 1;
  display: none;
  flex-direction: column;
  background: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  align-self: start;
}

#choice-container.is-active {
  display: flex;
}

.choice-btn {
  font-family: 'DotGothic16', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  color: #fff;
  background: transparent;
  border: none;
  padding: 0.4rem 0 0.4rem 1.6rem;
  cursor: pointer;
  text-align: left;
  line-height: 1.4;
  position: relative;
  transition: color 0.1s;
}

.choice-btn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: #f5c542;
  font-size: 0.85rem;
  opacity: 0;
}

.choice-btn--active {
  color: #f5c542;
}

.choice-btn--active::before {
  content: '▶';
  opacity: 1;
}

.choice-btn:hover,
.choice-btn:focus {
  color: #f5c542;
  outline: none;
}

.choice-btn:hover::before,
.choice-btn:focus::before {
  content: '▶';
  opacity: 1;
}

/* ── PLACEHOLDER pra coluna direita quando não há choice ── */
#choice-placeholder {
  grid-column: 2;
  grid-row: 1;
  background: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 1rem;
  align-self: start;
  min-height: 140px;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
}

#choice-container.is-active ~ #choice-placeholder {
  display: none;
}

/* ── MINIGAME PANEL — coluna direita quando ativo ─── */
#minigame-panel {
  grid-column: 2;
  grid-row: 1;
  display: none;
  flex-direction: column;
  background: #000;
  border: 2px solid #fff;
  border-radius: 8px;
  padding: 0.6rem;
  align-self: start;
  gap: 0.4rem;
}

#minigame-panel.is-active {
  display: flex;
}

#minigame-canvas {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  border: 1px solid #fff;
  border-radius: 4px;
  image-rendering: pixelated;
  display: block;
}

#minigame-hint {
  font-family: 'DotGothic16', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5c542;
  text-align: center;
  opacity: 0.7;
}

@media (max-width: 700px) {
  #minigame-panel {
    padding: 0.4rem;
    gap: 0.3rem;
  }
  #minigame-hint {
    font-size: 0.55rem;
  }
}

/* ── DIALOGUE BOX — full width, linha 2 ──────────── */
#vn-bottom {
  grid-column: 1 / -1;
  grid-row: 2;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #000;
}

#dialogue-box {
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  background: #000;
  min-height: 90px;
  position: relative;
}

#dialogue-text {
  font-family: 'DotGothic16', monospace;
  font-size: 1rem;
  line-height: 1.7;
  color: #fff;
  letter-spacing: 0.03em;
  min-height: 2.8rem;
}

#advance-hint {
  font-family: 'DotGothic16', monospace;
  font-size: 0.8rem;
  color: #f5c542;
  text-align: right;
  position: absolute;
  right: 1rem;
  bottom: 0.5rem;
  opacity: 0;
  animation: hint-pulse 1s ease-in-out infinite;
}

@keyframes hint-pulse {
  0%, 100% { opacity: 0.2; }
  50%       { opacity: 1; }
}

/* ── RESPONSIVO ────────────────────────────────────── */
@media (max-width: 700px) {
  #vn-scene {
    padding: 0.5rem;
  }

  #vn-layout {
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 0.5rem;
    max-width: 100vw;
  }

  #name-box {
    font-size: 0.7rem;
    padding: 0.3rem 0.6rem;
    min-width: 90px;
  }

  #choice-container {
    padding: 0.6rem 0.7rem;
  }

  #choice-placeholder {
    padding: 0.6rem;
    min-height: 100px;
  }

  .choice-btn {
    font-size: 0.72rem;
    padding: 0.3rem 0 0.3rem 1.1rem;
  }

  .choice-btn::before,
  .choice-btn--active::before {
    font-size: 0.7rem;
  }

  #dialogue-box {
    padding: 0.7rem 0.9rem;
    min-height: 80px;
  }

  #dialogue-text {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  #advance-hint {
    font-size: 0.7rem;
    right: 0.7rem;
    bottom: 0.4rem;
  }
}

