/* =====================================================================
   Embedded text-adventure terminal (src/game)
   Uses its own CSS variables so it can theme independently.
   ===================================================================== */

.game-terminal-embedded,
.game-terminal-fullscreen {
  position: relative;
  display: flex;
  flex-direction: column;
  font-family: "VT323", "Courier Prime", monospace;
  font-size: var(--game-font-size, 16px);
  color: var(--game-foreground, #33ff33);
  background-color: var(--game-background, #030a03);
  overflow: hidden;
  line-height: 1.35;
}

.game-terminal-fullscreen {
  min-height: 100vh;
}

.game-terminal-embedded {
  min-height: 420px;
  border: 1px solid var(--game-border, #226633);
}

.game-crt-overlay,
.game-scanline-overlay,
.game-screen-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.game-crt-overlay {
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.35) 80%, rgba(0, 0, 0, 0.65) 100%);
}

.game-scanline-overlay {
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0) 0px,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.35) 3px,
    rgba(0, 0, 0, 0) 4px
  );
  opacity: var(--game-scanlines, 0.25);
}

.game-screen-glow {
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.7);
}

.game-terminal-inner {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

.game-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--game-border, #226633);
  margin-bottom: 0.75rem;
}

.game-terminal-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  color: var(--game-primary, #ccffcc);
  margin: 0;
}

.game-terminal-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--game-muted, #1a6620);
}

.game-icon-button {
  font-family: "Press Start 2P", monospace;
  font-size: 0.45rem;
  color: var(--game-muted, #1a6620);
  background: transparent;
  border: 1px solid var(--game-border, #226633);
  padding: 0.4rem 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
}

.game-icon-button:hover {
  color: var(--game-background, #030a03);
  background-color: var(--game-foreground, #33ff33);
  border-color: var(--game-foreground, #33ff33);
}

.game-log {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.game-log-line {
  margin-bottom: 0.35rem;
  animation: var(--game-flicker, none);
}

.game-log-line-title {
  color: var(--game-primary, #ccffcc);
  font-weight: bold;
}

.game-log-line-body {
  color: var(--game-foreground, #33ff33);
}

.game-log-line-command {
  color: var(--game-accent, #00ff66);
}

.game-log-line-system {
  color: var(--game-muted, #1a6620);
}

.game-log-line-error {
  color: #ff5555;
}

.game-log-line-hint {
  color: #888;
  font-style: italic;
}

.game-log-line-grant {
  color: #ffd700;
}

.game-log-line-ending-win {
  color: #ffd700;
  font-weight: bold;
}

.game-log-line-ending-lose {
  color: #ff5555;
  font-weight: bold;
}

.game-log-line-ending-neutral {
  color: var(--game-primary, #ccffcc);
  font-weight: bold;
}

.game-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.game-suggestion {
  font-family: "Press Start 2P", monospace;
  font-size: 0.42rem;
  line-height: 1.4;
  color: var(--game-foreground, #33ff33);
  background: transparent;
  border: 1px solid var(--game-border, #226633);
  padding: 0.35rem 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.game-suggestion:hover:not(.locked) {
  color: var(--game-background, #030a03);
  background-color: var(--game-foreground, #33ff33);
  border-color: var(--game-foreground, #33ff33);
}

.game-suggestion.locked {
  color: var(--game-muted, #1a6620);
  border-style: dashed;
  cursor: not-allowed;
}

.game-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--game-border, #226633);
  padding-top: 0.75rem;
}

.game-input-prompt {
  font-weight: bold;
  color: var(--game-accent, #00ff66);
}

.game-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--game-foreground, #33ff33);
  font-family: "VT323", "Courier Prime", monospace;
  font-size: var(--game-font-size, 16px);
  caret-color: var(--game-foreground, #33ff33);
}

.game-input::placeholder {
  color: var(--game-muted, #1a6620);
}

.game-settings-toggle {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--game-muted, #1a6620);
  background: transparent;
  border: 1px solid var(--game-border, #226633);
  cursor: pointer;
}

.game-settings-toggle:hover {
  color: var(--game-background, #030a03);
  background-color: var(--game-foreground, #33ff33);
  border-color: var(--game-foreground, #33ff33);
}

.game-save-toast {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  font-family: "Press Start 2P", monospace;
  font-size: 0.4rem;
  color: var(--game-background, #030a03);
  background-color: var(--game-foreground, #33ff33);
  padding: 0.35rem 0.5rem;
}

/* Settings modal */
.game-settings-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.75);
  padding: 1rem;
}

.game-settings-panel {
  width: 100%;
  max-width: 24rem;
  background-color: var(--game-background, #030a03);
  border: 1px solid var(--game-border, #226633);
  padding: 1rem;
}

.game-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--game-border, #226633);
}

.game-settings-title {
  font-family: "Press Start 2P", monospace;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--game-primary, #ccffcc);
}

.game-settings-close {
  color: var(--game-foreground, #33ff33);
  background: transparent;
  border: 1px solid var(--game-border, #226633);
  cursor: pointer;
  padding: 0.25rem;
}

.game-settings-close:hover {
  color: var(--game-background, #030a03);
  background-color: var(--game-foreground, #33ff33);
}

.game-settings-row {
  margin-bottom: 1rem;
}

.game-settings-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-settings-label {
  display: block;
  font-family: "Press Start 2P", monospace;
  font-size: 0.42rem;
  color: var(--game-muted, #1a6620);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}

.game-settings-row-inline .game-settings-label {
  margin-bottom: 0;
}

.game-settings-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.game-settings-segmented button {
  flex: 1;
  min-width: 5rem;
  font-family: "Press Start 2P", monospace;
  font-size: 0.4rem;
  color: var(--game-foreground, #33ff33);
  background: transparent;
  border: 1px solid var(--game-border, #226633);
  padding: 0.4rem 0.3rem;
  cursor: pointer;
}

.game-settings-segmented button.active,
.game-settings-segmented button:hover {
  color: var(--game-background, #030a03);
  background-color: var(--game-foreground, #33ff33);
  border-color: var(--game-foreground, #33ff33);
}

.game-settings-row input[type="range"] {
  width: 100%;
  accent-color: var(--game-foreground, #33ff33);
}

.game-settings-row input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--game-foreground, #33ff33);
}

/* Boot screen */
.game-boot-screen {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  font-family: "VT323", "Courier Prime", monospace;
  font-size: calc(var(--game-font-size, 16px) * 1.1);
  color: var(--game-foreground, #33ff33);
}

.game-boot-line {
  margin-bottom: 0.25rem;
}

.game-boot-cursor-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.game-boot-prompt {
  color: var(--game-accent, #00ff66);
}

.game-boot-cursor {
  font-weight: bold;
}

@keyframes flicker-soft {
  0% { opacity: 0.97; }
  50% { opacity: 1; }
  100% { opacity: 0.98; }
}

