/* Design tokens for the room theme system. A `data-theme` attribute set on
   the document root selects one of the blocks below. Tokens are scoped to
   :root rather than #app so ancestors of #app — namely <body> — can read
   them too: a custom property defined on #app only cascades to #app's own
   descendants, never to its ancestors. */

:root {
  --bg: #0b0b0b;
  --fg: #cfe8d5;
  --accent: #5bbf7a;
  --border: #2b4a35;
  --dim: #5c7d67;
  /* --panel-bg is a resting-state background deliberately close to --bg,
     tinted toward --accent's hue rather than a generic gray, so the
     focused state (--panel-bg-focus) reads as this theme's own glow rather
     than a one-size-fits-all highlight. */
  --panel-bg: #0d100e;
  --panel-bg-focus: #16301f;

  /* Per-category entity colors. Each category keeps the same semantic hue
     across every theme (mob=red/danger, npc=blue, player=yellow/sociable,
     dressing=violet) so the association transfers between zones, while
     each theme picks its own shade so nothing clashes with that theme's
     own --accent/--fg. --entity-item reuses --accent directly rather than
     a dedicated hue, since items read as extensions of the world's own
     accent color. --entity-dressing is full-brightness violet rather than
     a muted tone because set dressing can be searched, opened, and hide
     real loot, so it needs the same prominence as items/npcs/mobs. */
  --entity-mob: #d4685a;
  --entity-npc: #6a8fd4;
  --entity-player: #d4c25a;
  --entity-item: var(--accent);
  --entity-dressing: #b57ad4;
  /* Corpses use a desaturated, muted version of --entity-mob's hue rather
     than a fresh color family, so a corpse reads as "that creature, spent"
     rather than an unrelated category. */
  --entity-corpse: #7a6559;

  /* HP bar fill thresholds — the same red/yellow/green semantics as most
     game HUDs regardless of theme, so a critical HP reading is recognizable
     on sight rather than requiring the player to learn each theme's
     palette. */
  --hp-good: #5bbf7a;
  --hp-warn: #e0c15c;
  --hp-critical: #e0685c;

  /* XP bar fill — deliberately one constant color rather than a
     good/warn/critical threshold swap like the HP fill above: XP progress
     isn't a danger signal, so reusing red/yellow/green would wrongly imply
     low XP is bad. A muted blue distinct from --entity-npc keeps this from
     echoing an unrelated entity-color meaning. */
  --xp-fill: #6c8ebf;
}

#app {
  background: var(--bg);
  color: var(--fg);
}

/* The starting zone's theme — a ship's warm, close, lamplit feel. */
:root[data-theme='ship'] {
  --bg: #0b0b0b;
  --fg: #e8dcc8;
  --accent: #c9a24b;
  --border: #4a3c28;
  --dim: #7d6f57;
  --panel-bg: #100f0b;
  --panel-bg-focus: #332616;

  --entity-mob: #c85c4a;
  --entity-npc: #7a8fc9;
  --entity-player: #e0c878;
  --entity-item: var(--accent);
  --entity-dressing: #b586d9;
  --entity-corpse: #8c6b5c;
}

/* Cool, green, untamed — the fallback theme applied when a room's zone has
   no matching theme block above. */
:root[data-theme='wilderness'] {
  --bg: #0b0b0b;
  --fg: #cfe8d5;
  --accent: #5bbf7a;
  --border: #2b4a35;
  --dim: #5c7d67;
  --panel-bg: #0d100e;
  --panel-bg-focus: #16301f;

  --entity-mob: #d4685a;
  --entity-npc: #6a8fd4;
  --entity-player: #d4c25a;
  --entity-item: var(--accent);
  --entity-dressing: #b57ad4;
  --entity-corpse: #7a6559;
}
