/* ==========================================================================
   Goblin Miners — theme.css
   Design tokens only. No selectors other than :root live in this file.

   PALETTE v2 — warm earth (Spelunky), replacing the cold slate original.

   The first palette followed "warm light, cold dark". That is a sound rule in
   general and it was the wrong one here: it made every shadow blue, and the
   result read as a cavern in space rather than a hole in the ground. In an
   earth cave the shadow is still earth — umber, burnt brown, a near-black with
   red in it. So the rule is now **warm dark, warmer light**, and cool is spent
   deliberately rather than being the ambient temperature of the room.

   Where the cool went: iron, silver, mithril, voidstone, bars-blue and the
   prestige violet. Those are the things that should feel like they do not
   belong to the rock around them, and against a warm ground they now read as
   genuinely alien instead of blending into a blue-grey world.

   Structure is unchanged: a 9-step neutral ramp, 7 hue pairs, 8 ore pairs.
   This is a revision of the ramp, not a set of ad-hoc swaps — every neutral
   sits between hue 20 and 32 with saturation falling as it lightens, which is
   what keeps dirt looking like dirt instead of like tinted grey.
   ========================================================================== */

:root {
  color-scheme: dark;

  /* ---- palette: contract §4 -------------------------------------------- *
   * The neutral ramp is warm earth: deep umber through to a bone/tan light.
   * Saturation is kept moderate so ore stays the most saturated thing on
   * screen — the rule from ARTSTYLE §1, now holding against a warm ground.  */
  --gm-bg:        #100b08;   /* page background, darkest — umber near-black */
  --gm-bg-2:      #1a1310;   /* panel background                            */
  --gm-bg-3:      #271c15;   /* raised surface / row background             */
  --gm-line:      #453224;   /* 1px borders and pixel outlines              */
  --gm-ink:       #f6ece0;   /* primary text — warm bone, 15.7:1 on bg-2     */
  --gm-ink-dim:   #d3bda6;   /* secondary text — tan, 10.1:1 on bg-2         */
  --gm-ink-mute:  #9d8571;   /* disabled text — 5.2:1 on bg-2, 4.8:1 on bg-3 */
  --gm-gold:      #ffc63f;   /* gold currency accent                        */
  --gm-green:     #8ec44a;   /* goblin green / affordable — pushed a touch
                                yellower so it reads as a living thing
                                against brown rather than fighting it       */
  --gm-red:       #e85c4a;   /* danger / unaffordable — lightened from
                                #e04a3a, which measured 4.12:1 on --gm-bg-3
                                once the row background warmed. It carries the
                                unaffordable cost, so it has to clear 4.5.    */
  --gm-blue:      #46a8dc;   /* info / bars — deliberately cool             */
  --gm-violet:    #9d6cf2;   /* prestige / runestones / void                */
  --gm-amber:     #ffa23a;   /* lantern light / warnings                    */

  /* ---- per-ore accents: contract §4, GDD §4 ---------------------------- *
   * Rebalanced against warm stone. The three that needed it:
   *   coal   — was cold slate, which looked like a chip of sky in the wall.
   *            Now warm anthracite grey. The two tokens do different jobs and
   *            that is why they sit either side of the stone: the light one is
   *            the chip icon and the flying particle, which have to be visible
   *            against a dark cave (it measured 1.99:1 there before and now
   *            clears 3:1); the dark one is the seam inside the rock, which
   *            has to stay well below the stone to read as coal at all.
   *   copper — was #cf7f3e, almost exactly the new --gm-stone. It has been
   *            pushed brighter and cleaner so it separates from the rock it
   *            is embedded in rather than camouflaging against it.
   *   adamantite — nudged toward pink so it does not read as a hot variant
   *            of the same orange family as copper and amber.
   * The five cool ores were left alone; they gain contrast for free.        */
  --gm-ore-coal:        #6f645b;
  --gm-ore-copper:      #e37b38;
  --gm-ore-iron:        #93a3c0;
  --gm-ore-silver:      #dde7f4;
  --gm-ore-gold:        #ffd447;
  --gm-ore-mithril:     #5ce0d4;
  --gm-ore-adamantite:  #ec5cc8;
  --gm-ore-voidstone:   #8b5cf0;
  /* The ninth band (v1.12). Pale violet with a near-white core - it fell from
     outside, so it is the only ore that reads as LIT rather than as coloured stone,
     and that is what keeps it distinct from voidstone one band above it. */
  --gm-ore-starmetal:   #c9b6ff;

  /* ---- sprite shade ramp ----------------------------------------------- *
   * Additive to contract §4. Every hue needs a dark partner to shade with.  */
  --gm-stone:     #634831;   /* mid stone — earth, not slate */
  --gm-stone-lt:  #86664a;   /* lit stone                    */
  --gm-gold-dk:      #b8781c;
  --gm-green-dk:     #477f2c;
  --gm-red-dk:       #9c3227;
  --gm-blue-dk:      #24618f;
  --gm-violet-dk:    #58359b;
  --gm-amber-dk:     #c26016;

  /* Wood had to move. Against cold slate #8a5a34 was obviously timber; against
     the new stone ramp it was nearly the same colour. It is now redder and
     more saturated than any stone tone, which is what keeps a pit prop, a
     cart and a crate legible where they overlap rock. */
  --gm-wood:         #9c5a2c;
  --gm-wood-dk:      #54301a;
  /* v1.10. Four additive tokens, and none of them changes anything already drawn.
   *
   * --gm-wood-lt and --gm-green-lt are the THIRD TONE. ARTSTYLE section 1 sets a
   * three-tone minimum per material and the goblins had been shipping on two since
   * v1.6 - an audit found it, and it is why they read flat. The Horn goblin the
   * owner picked uses all three.
   *
   * The skin trio is the stall keeper, who is a DWARF and must not share a single
   * colour with the goblins. Ruddy against their green, and warm enough to sit in
   * the same cave without going grey. */
  --gm-wood-lt:      #c8814a;
  --gm-green-lt:     #c3e878;
  --gm-skin:         #d9976a;
  --gm-skin-dk:      #a3653f;
  --gm-skin-lt:      #f2c39b;

  --gm-ore-coal-dk:       #2b2521;
  --gm-ore-copper-dk:     #8f4419;
  --gm-ore-iron-dk:       #4d5c7a;
  --gm-ore-silver-dk:     #8d9db4;
  --gm-ore-gold-dk:       #b8871c;
  --gm-ore-mithril-dk:    #23887f;
  --gm-ore-adamantite-dk: #8e2c74;
  --gm-ore-voidstone-dk:  #43248a;
  --gm-ore-starmetal-dk:  #6a55b0;

  /* ---- metrics: contract §4 -------------------------------------------- */
  --gm-px:     4px;   /* one pixel-art unit — the scaling base */
  --gm-gap:    8px;
  --gm-radius: 2px;   /* this is pixel art; 2px is the ceiling */

  --gm-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
             Arial, "Noto Sans", sans-serif;
  --gm-font-num: ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo,
                 Consolas, "DejaVu Sans Mono", monospace;

  /* Height of the tab bar when it is docked to the viewport floor on a phone.
     Two readers - the bar sets it as a min-height, the scrolling pane reserves it
     as padding - and they must be the same number. The owner found them disagreeing
     in v1.12: the pane reserved 60px against a bar that is nearer 62, so the last
     row of the two longest panes sat under the buttons. A shared token is the fix
     for the class, not just for the two panes where it showed. */
  --gm-tabbar-h: 62px;

  /* Height of the resource strip when it is pinned to the viewport ceiling on a
     phone (v1.18.6, the mobile HUD redesign) - the same fallback-then-measured
     pattern as --gm-tabbar-h just above, sized from #gm-res itself in ui.js's
     measure() the moment it can be, and standing in only for the first paint or a
     browser that has not laid out yet. */
  --gm-resbar-h: 52px;

  /* ---- derived metrics ------------------------------------------------- */
  --gm-gap-sm: 4px;
  --gm-gap-lg: 16px;

  /* Focus moved from amber to blue with the palette. On a warm ground amber
     is no longer a standout — it is the ambient colour of the lantern — so a
     cool ring is now the most visible thing that can be drawn, and it cannot
     be mistaken for a warning. */
  --gm-focus:  var(--gm-blue);
  --gm-dur:    140ms;             /* base interaction duration */
}
