/* Divided Realms Character Planner - shared styles across all pages in this folder.
   Palette matches the Divided Realms server page (https://whozon.ca/othlyn) and this project's
   own desktop app (src/App.css) - a dark parchment/gold theme, kept consistent everywhere so
   this reads as part of the same project, not a bolted-on separate tool. */

:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --bg: #14100c;
  --panel: #1f1912;
  --panel-raised: #271f16;
  --border: #4a3a24;
  --gold: #c8a95c;
  --text: #e8ddc8;
  --muted: #a8977e;
  /* A clearly, unmistakably red warning color (not the muted parchment-pink this used to be,
   * which read as barely-there against the dark background) - used for "you've overspent your
   * points" and "this class is disabled" warnings specifically, where standing out matters more
   * than matching the rest of the palette. */
  --danger: #ff5c5c;

  /* Traditional DAoC realm colors - Albion red, Midgard a light "snow" blue, Hibernia a light
     "grass" green - same values the desktop app's own Classes tab uses. */
  --albion: #e0a0a0;
  --albion-border: #8a4a4a;
  --albion-bg: #2a1616;
  --midgard: #a8d4e8;
  --midgard-border: #4a7a8a;
  --midgard-bg: #141f26;
  --hibernia: #a8d8a0;
  --hibernia-border: #4a7a4a;
  --hibernia-bg: #16221a;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--gold);
}

header.site-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

header.site-header h1 {
  font-size: 1.3rem;
  margin: 0;
  color: var(--gold);
  letter-spacing: 0.02em;
}

header.site-header nav {
  display: flex;
  gap: 0.5rem;
}

header.site-header nav a {
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.9rem;
  color: var(--text);
}

header.site-header nav a.active,
header.site-header nav a:hover {
  background: var(--gold);
  color: #1a1308;
  border-color: var(--gold);
  font-weight: 600;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem;
}

main.wide {
  max-width: 1400px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

h2 {
  color: var(--gold);
  margin-top: 0;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
}

footer.site-footer {
  text-align: center;
  padding: 1.5rem;
  color: var(--muted);
  font-size: 0.8rem;
}

code, pre {
  background: var(--panel-raised);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
}

pre {
  padding: 0.75rem;
  overflow-x: auto;
}

button, select, input {
  font-family: inherit;
  background: var(--panel-raised);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
}

button {
  cursor: pointer;
}

button:hover {
  border-color: var(--gold);
}

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

button.primary {
  background: var(--gold);
  color: #1a1308;
  border-color: var(--gold);
  font-weight: 600;
}

/* ---- Character Planner page ---- */

.planner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.planner-toolbar .field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.planner-toolbar .field span {
  font-size: 0.78rem;
  color: var(--muted);
}

.realm-tabs {
  display: flex;
  gap: 0.5rem;
}

.realm-tabs button {
  border-radius: 999px;
  padding: 0.35rem 1rem;
}

.realm-tabs button.active.realm-Albion {
  background: var(--albion-bg);
  color: var(--albion);
  border-color: var(--albion-border);
}

.realm-tabs button.active.realm-Midgard {
  background: var(--midgard-bg);
  color: var(--midgard);
  border-color: var(--midgard-border);
}

.realm-tabs button.active.realm-Hibernia {
  background: var(--hibernia-bg);
  color: var(--hibernia);
  border-color: var(--hibernia-border);
}

.points-summary {
  display: flex;
  gap: 1.5rem;
  font-size: 0.95rem;
}

.points-summary strong {
  color: var(--gold);
}

.points-summary .over-budget {
  color: var(--danger);
  font-weight: 600;
}

.spec-layout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.spec-rows {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.spec-row {
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

/* Groups a spec's always-available base-line block together with its own trainable row, so the
   two visually read as "one spec, two halves" rather than two unrelated rows - see planner.js's
   own renderBaseLineBlock doc comment for the real mechanic this distinguishes. */
.spec-row-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.spec-row-baseline {
  background: var(--panel);
  border-style: dashed;
}

.spec-row-baseline .spec-row-name {
  font-weight: 500;
  font-style: italic;
}

.spec-row-top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.spec-row-name {
  font-weight: 600;
  min-width: 140px;
}

.spec-row-cost {
  font-size: 0.78rem;
  color: var(--muted);
  margin-left: auto;
}

/* One real progression within a spec (e.g. Mending's own "Minor Heal"/"Heal"/"Heal (group)"/
   "Resurrect") - the classic DAoC charplanner layout again, one level down: the progression's
   own name on the left, its pips flowing to the right, same as a spec's own top-level row. */
.spec-subline {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

.spec-subline-name {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 140px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.stepper button {
  padding: 0.1rem 0.55rem;
  line-height: 1.2;
}

.stepper .value {
  min-width: 1.6rem;
  text-align: center;
  font-weight: 600;
  color: var(--gold);
}

/* The classic DAoC charplanner layout: a spec line's own display name on the left (above, in
   .spec-row-top), with every level a new skill/spell is actually granted at laid out as a dense
   row of clickable numbers to its right - maximizes how many levels are visible at once compared
   to a scrolling name-per-row list, and matches what every real DAoC planner (including the
   Eden-DAoC one this was modeled on) already does. */
.level-pips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.level-pip {
  min-width: 1.8rem;
  padding: 0.15rem 0.3rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.level-pip.unlocked {
  background: var(--gold);
  color: #1a1308;
  border-color: var(--gold);
}

.level-pip:hover {
  border-color: var(--gold);
}

.spec-details {
  position: sticky;
  top: 1rem;
  width: 320px;
  flex-shrink: 0;
  background: var(--panel-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  font-size: 0.85rem;
  max-height: 80vh;
  overflow-y: auto;
}

.spec-details h3 {
  margin: 0 0 0.4rem;
  color: var(--gold);
}

.spec-details dl {
  margin: 0;
}

.spec-details dt {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.4rem;
}

.spec-details dd {
  margin: 0;
}

@media (max-width: 900px) {
  .spec-layout {
    flex-direction: column;
  }
  .spec-details {
    position: static;
    width: 100%;
    max-height: none;
  }
}

.ra-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.ra-table th,
.ra-table td {
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.ra-table th {
  color: var(--gold);
}

.ra-description {
  color: var(--muted);
  font-size: 0.8rem;
  max-width: 420px;
}

.ra-cost-note {
  font-size: 0.78rem;
  color: var(--muted);
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border);
  color: var(--muted);
}

.badge.disabled {
  color: var(--danger);
  border-color: var(--danger);
}

/* Matches the Divided Realms server page's own download button exactly (whozon.ca/othlyn) -
   same class name too, so this stays a drop-in match if that page's own markup is ever reused
   directly. */
.download-btn {
  display: inline-block;
  background: var(--gold);
  color: #1a1308;
  font-weight: bold;
  text-decoration: none;
  padding: 0.85rem 1.75rem;
  border-radius: 6px;
  font-size: 1.1rem;
  border: 1px solid #8a703a;
}

.download-btn:hover {
  background: #d8b96c;
}

.download-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

