/* ============================================================
   Kid-Games Stylesheet v1.0
   ============================================================
   THEMING: All colors and fonts live in :root. To re-theme for
   a different game (pirate, dino, jungle), override these vars
   in a <style> block in index.html or in a per-game theme file.

   Default theme: cosmic / space (dark with purple accents)
   ============================================================ */

:root {
  /* === COLORS — override per game === */
  --bg-primary: #0a0e1a;
  --bg-secondary: #131829;
  --bg-tertiary: #1c2238;
  --bg-info: #1a2f4a;
  --bg-danger: #3a1518;
  --bg-success: #15321f;

  --text-primary: #e8ecf5;
  --text-secondary: #a8b0c5;
  --text-tertiary: #6b7390;
  --text-info: #6db4ff;
  --text-danger: #ff8a8a;
  --text-success: #7adc9a;

  --border-tertiary: rgba(255,255,255,0.12);
  --border-secondary: rgba(255,255,255,0.25);
  --accent: #7f77dd;

  /* === STARFIELD — set to "none" for non-space themes === */
  --bg-pattern:
    radial-gradient(2px 2px at 20% 30%, white, transparent),
    radial-gradient(1px 1px at 60% 70%, white, transparent),
    radial-gradient(1px 1px at 80% 20%, white, transparent),
    radial-gradient(2px 2px at 40% 80%, white, transparent),
    radial-gradient(1px 1px at 90% 50%, white, transparent),
    radial-gradient(1px 1px at 10% 60%, white, transparent),
    radial-gradient(2px 2px at 70% 10%, white, transparent),
    radial-gradient(1px 1px at 30% 90%, white, transparent);

  /* === FONTS — override for theme-specific feel === */
  --font-mono: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Courier New', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  /* === LAYOUT === */
  --radius-md: 8px;
  --radius-lg: 12px;

  /* === SIGIL — the symbol shown next to the game title === */
  --sigil: '◈';
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
}

body {
  background-image: var(--bg-pattern);
  background-size: 800px 800px;
  background-repeat: repeat;
}

.page-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.header {
  text-align: center;
  margin-bottom: 16px;
}

.header h1 {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  margin: 0 0 4px;
  color: var(--accent);
  letter-spacing: 1px;
}

.header .subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0;
}

.game-shell {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-secondary);
  border: 0.5px solid var(--border-tertiary);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 16px;
}

.ascii-frame {
  background: var(--bg-tertiary);
  border: 0.5px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  white-space: pre;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.2;
  overflow-x: auto;
  min-height: 140px;
  color: var(--text-primary);
}

.stat-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  font-size: 12px;
  font-family: var(--font-sans);
}

.stat-pill strong {
  color: var(--accent);
}

.narration {
  background: var(--bg-tertiary);
  border: 0.5px solid var(--border-tertiary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 12px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 60px;
}

.choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

button {
  font-family: var(--font-sans);
  background: transparent;
  color: var(--text-primary);
  border: 0.5px solid var(--border-secondary);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}

button:hover:not(:disabled) {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

button:active:not(:disabled) {
  transform: scale(0.98);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.choice-btn {
  font-size: 14px;
  text-align: left;
}

input[type="text"] {
  background: var(--bg-tertiary);
  border: 0.5px solid var(--border-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 16px;
  padding: 8px 12px;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(127, 119, 221, 0.3);
}

.puzzle-input {
  width: 140px;
  margin-right: 8px;
}

.feedback-good {
  color: var(--text-success);
  font-family: var(--font-sans);
  font-size: 13px;
  margin-top: 8px;
}

.feedback-bad {
  color: var(--text-danger);
  font-family: var(--font-sans);
  font-size: 13px;
  margin-top: 8px;
}

.feedback-hint {
  color: var(--text-info);
  font-family: var(--font-sans);
  font-size: 13px;
  margin-top: 8px;
}

.meta-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  align-items: center;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 0.5px solid var(--border-tertiary);
}

.meta-btn {
  font-size: 12px;
  padding: 4px 10px;
}

.save-badge {
  background: var(--bg-info);
  color: var(--text-info);
  padding: 3px 8px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 500;
}

.game-over-frame {
  background: var(--bg-danger);
  border: 0.5px solid var(--text-danger);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 12px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

.victory-frame {
  background: var(--bg-success);
  border: 0.5px solid var(--text-success);
  border-radius: var(--radius-md);
  padding: 16px;
  margin: 12px 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
}

.learning-frame {
  background: var(--bg-info);
  border: 0.5px solid var(--text-info);
  color: var(--text-info);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 12px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.6;
}

.location-title {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 8px;
  font-family: var(--font-sans);
}

.vocab-tag {
  background: rgba(109, 180, 255, 0.15);
  color: var(--text-info);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.95em;
  cursor: help;
  border-bottom: 1px dashed currentColor;
}

.footer {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-tertiary);
}

@media (max-width: 480px) {
  .ascii-frame { font-size: 11px; }
  .header h1 { font-size: 18px; }
}
