/* Firing Solution — command deck theme */
:root {
  --bg: #0b1220;
  --panel: #121c2e;
  --line: #24314c;
  --text: #e6ecf4;
  --muted: #8fa0b8;
  --brass: #c9a227;
  --radar: #38d98a;
  --danger: #e05a4a;
  --font: "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

.view { display: none; }
.view.active { display: block; }

#app {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--panel);
  border: 1px solid var(--brass);
  color: var(--brass);
  font-family: var(--font);
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--brass); color: var(--bg); }
.btn-primary {
  background: var(--radar);
  border-color: var(--radar);
  color: #0b1220;
}
.btn-primary:hover { background: #2eb873; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Muted text */
.muted { color: var(--muted); }

/* Command deck */
.deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.deck-header h1 { margin: 0; font-size: 1.6rem; }
.rank-badge {
  border: 1px solid var(--brass);
  color: var(--brass);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.rank-insignia {
  height: 28px;
  width: auto;
  display: inline-block;
}
#rank-up .rank-insignia { height: 36px; vertical-align: middle; }
.banner .rank-insignia { height: 32px; vertical-align: middle; margin-left: 8px; }

/* XP card */
.xp-card { display: flex; flex-direction: column; gap: 8px; }
.progress {
  height: 10px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.xp-bar {
  height: 100%;
  background: var(--radar);
  transition: width 0.3s ease;
}

/* Mission list */
#mission-list { display: grid; gap: 12px; }
.mission-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s;
  gap: 12px;
}
.mission-thumb {
  width: 96px;
  height: 64px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.mission-card:hover .mission-thumb { border-color: var(--brass); }
.mission-card.locked .mission-thumb { filter: grayscale(0.8) brightness(0.6); }
.mission-card .mission-name { flex: 1; }
.mission-card.locked {
  cursor: not-allowed;
  border-color: var(--danger);
  opacity: 0.7;
}
.mission-card .year { color: var(--muted); font-size: 0.9rem; }

/* Section headings */
h2 { margin: 24px 0 12px; font-size: 1.1rem; }

/* Mission / problem views */
.briefing {
  border-left: 3px solid var(--radar);
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 0 10px 10px 0;
  margin-bottom: 16px;
}
.question { font-size: 1.15rem; margin-bottom: 16px; }
.answer-box { display: flex; gap: 12px; margin-bottom: 16px; }
.answer-box input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 1rem;
  padding: 10px 12px;
  border-radius: 6px;
}
.choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.choice button {
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
}
.choice button:hover { border-color: var(--brass); }

.hint {
  color: var(--brass);
  font-style: italic;
  margin-bottom: 12px;
}
.debrief {
  border-left: 3px solid var(--brass);
  padding: 12px 16px;
  background: var(--panel);
  border-radius: 0 10px 10px 0;
}
.banner {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
}
.banner.success { background: rgba(56, 217, 138, 0.15); color: var(--radar); border: 1px solid var(--radar); }
.banner.error { background: rgba(224, 90, 74, 0.15); color: var(--danger); border: 1px solid var(--danger); }
.banner.rank-up { background: rgba(201, 162, 39, 0.15); color: var(--brass); border: 1px solid var(--brass); }

/* Mission view */
#mission-briefing { margin-bottom: 16px; }
#mission-briefing h3 { margin: 0 0 6px; color: var(--brass); }
#mission-briefing p { margin: 0; }
.mission-hero { margin: 0 0 16px; }
.mission-hero img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.mission-hero figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}
.mission-hero figcaption a { color: var(--muted); }
.answer-box label { color: var(--muted); font-size: 0.9rem; display: block; margin-bottom: 2px; }
.answer-box input { margin-bottom: 4px; }
#problem-area .hint { margin-top: 4px; }

/* Rank-up banner (command deck) */
#rank-up {
  text-align: center;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-weight: 600;
  background: rgba(201, 162, 39, 0.15);
  color: var(--brass);
  border: 1px solid var(--brass);
  display: none;
}
#rank-up.show {
  display: block;
  animation: slideIn 0.4s ease;
}
@keyframes slideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Badges & ships */
.badge-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.badge {
  display: inline-block;
  border: 1px solid var(--brass);
  color: var(--brass);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
}
.ship-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ship-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow: hidden; }
.ship-card h3 { margin: 0 0 6px; color: var(--brass); }
.ship-card p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.ship-card.locked { opacity: 0.55; border-style: dashed; }
.ship-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  margin-bottom: 8px;
}
.ship-card.locked .ship-photo { filter: grayscale(0.8) brightness(0.6); }
.ship-credit {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 8px;
}
.ship-credit:hover { text-decoration: underline; }

/* Settings */
.setting-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.setting-row label { color: var(--muted); }
.setting-row select {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--font);
}
.setting-row input[type="checkbox"] {
  accent-color: var(--radar);
  width: 18px;
  height: 18px;
  cursor: pointer;
}
.settings-card { max-width: 520px; }

/* Deck header actions (settings button + rank badge) */
.deck-header-actions { display: flex; gap: 12px; align-items: center; }
.btn-sm { font-size: 0.9rem; padding: 6px 12px; }
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #c94a3a; }
