/* ============================================================
   Package Name Generator Game — Styles
   npm-themed red/white with package.json card design
   ============================================================ */
:root {
  --npm-red: #CB3837;
  --npm-dark: #231F20;
  --npm-bg: #FAFAFA;
  --bg: #0E0C15;
  --bg-card: rgba(20, 17, 30, 0.9);
  --text: #E8E0F0;
  --text-dim: #8A7AA0;
  --text-muted: #5A4A70;
  --green: #22C55E;
  --amber: #F59E0B;
  --red: #EF4444;
  --border: rgba(203, 56, 55, 0.1);
  --radius: 10px;
  --font: 'Inter', -apple-system, sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; display: flex; justify-content: center; }
#app { width: 100%; max-width: 560px; margin: 1rem; }
.screen { display: flex; flex-direction: column; min-height: 80vh; }

/* Menu */
.menu-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; flex: 1; text-align: center; }
.npm-logo { font-size: 3rem; }
.title { font-size: 1.4rem; font-weight: 700; color: var(--npm-red); }
.subtitle { font-size: 0.75rem; color: var(--text-dim); }
.menu-actions { display: flex; flex-direction: column; gap: 0.4rem; min-width: 200px; }

/* Buttons */
.btn-primary { padding: 0.6rem 1.5rem; background: var(--npm-red); color: #fff; font-weight: 700; font-family: var(--font); border: none; border-radius: var(--radius); cursor: pointer; font-size: 0.8rem; transition: transform 0.1s; }
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-primary:hover:not(:disabled) { transform: scale(1.02); }
.btn-ghost { padding: 0.4rem 1rem; background: transparent; color: var(--text-dim); font-family: var(--font); border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; font-size: 0.7rem; }
.btn-ghost:hover { color: var(--text); }

/* Game Bar */
.game-bar { display: flex; justify-content: space-between; padding: 0.5rem 0; font-size: 0.7rem; color: var(--text-dim); }
#timer-display { color: var(--amber); font-weight: 600; }
#score-display { color: var(--npm-red); font-weight: 600; }

/* Prompt Card */
.prompt-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.prompt-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.prompt-text { font-size: 0.85rem; margin-top: 0.4rem; line-height: 1.5; }

/* Input */
.input-section { display: flex; flex-direction: column; gap: 0.5rem; }
.pkg-input-wrap { display: flex; align-items: center; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 0.75rem; }
.prefix { font-family: var(--mono); font-size: 0.8rem; color: var(--npm-red); font-weight: 600; margin-right: 0.5rem; white-space: nowrap; }
.name-input { flex: 1; background: transparent; border: none; outline: none; color: var(--text); font-family: var(--mono); font-size: 0.85rem; caret-color: var(--npm-red); }
.input-meta { display: flex; justify-content: space-between; font-size: 0.6rem; color: var(--text-muted); }
#avail-status { font-weight: 600; }
.suggestions { display: flex; flex-wrap: wrap; gap: 0.3rem; font-size: 0.55rem; }
.sug-chip { background: rgba(203,56,55,0.08); color: var(--npm-red); padding: 0.15rem 0.4rem; border-radius: 4px; cursor: pointer; border: 1px solid rgba(203,56,55,0.15); }
.sug-chip:hover { background: rgba(203,56,55,0.15); }

/* Score Card — package.json style */
.score-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.pkg-json { font-family: var(--mono); font-size: 0.75rem; background: rgba(0,0,0,0.3); border-radius: 8px; padding: 0.75rem; margin-bottom: 1rem; }
.json-brace { color: var(--text-muted); }
.json-line { padding-left: 1rem; }
.json-key { color: var(--npm-red); }
.json-val { color: var(--green); }
.breakdown { font-size: 0.7rem; color: var(--text-dim); line-height: 1.7; margin-bottom: 0.75rem; }

/* Results */
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1rem; font-size: 0.8rem; text-align: left; margin-bottom: 1rem; }
.r-label { color: var(--text-muted); }
.r-value { font-weight: 700; color: var(--npm-red); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.modal-inner { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; max-width: 380px; width: 90%; text-align: center; }
.modal-inner h2 { margin-bottom: 0.75rem; }
.hall-entry { display: flex; justify-content: space-between; font-size: 0.65rem; font-family: var(--mono); padding: 0.2rem 0; border-bottom: 1px solid rgba(255,255,255,0.05); }

@media (max-width: 480px) {
  #app { margin: 0.5rem; }
}
