/* Shared by every view: the green, gold and clay palette in light and dark mode, and base element styles. */

:root {
  --bg: #f6f0e3;
  --surface: #fffaf0;
  --ink: #2f261d;
  --muted: #7a6d5c;
  --line: #d9ccb4;
  --accent: #7b2d26;
  --accent-ink: #fffaf0;
  --hit: #36744a;       /* green: right letter, right place */
  --near: #c08a26;
  --miss: #8d8273;
  --mark-ink: #fffdf8;
  --hit-ink: #fffdf8;   /* letters on green tiles */
  --near-ink: #2f261d;  /* white on gold is only 3:1, dark ink is 4.9:1 */
  --tile-line: #9c8c71; /* empty tile outline, 3:1 against the tile */
  --key: #e7dcc6;
  --key-ink: #2f261d;
  --miss-ink: #fffdf8;      /* letters on clay tiles */
  --accent-fill: #7b2d26;   /* selected tab, buttons; --accent itself is for links and text */
  --accent-fill-ink: #fffaf0;
  --tile-bg: #fffaf0;       /* empty tiles */
  --toast-bg: #2f261d;
  --toast-ink: #f6f0e3;
  --hit-mark: #36744a;      /* small green marks: the "done" dot, the iOS Share icon */
  --gold-line: #c08a26;     /* the verse's left rule */
  --shadow: 0 10px 30px rgba(47, 38, 29, .18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* "only" tells browsers with a forced dark mode (Samsung Internet, Chrome's auto-dark) not to
     recolour the page. Without it, they darken the light theme and invert the tiles. */
  color-scheme: only light;
}
/* Dark theme. data-theme is set before the page draws (inline script in index.html, then js/theme.js),
   from the player's choice: light, dark, or matching the device. Warm charcoal rather than near-black,
   with panels, keys and tiles clearly lighter than the page; green and gold are bright with dark letters.

   Samsung Internet's own "Dark mode" repaints every page by its own rules and ignores color-scheme,
   so players there get a tip (js/theme.js) to switch it off and use this theme instead. */
:root[data-theme="dark"] {
  --bg: #1c1a17; --surface: #332d27; --ink: #f3ece0; --muted: #b5a998; --line: #4d463f;
  --accent: #e09a85; --accent-ink: #1b1510;
  --accent-fill: #e09a85; --accent-fill-ink: #1b1510;
  --hit: #5fae73; --hit-ink: #0f1a12; --hit-mark: #5fae73;
  --near: #e0b04a; --near-ink: #1b1510; --gold-line: #e0b04a;
  --miss: #766c62; --miss-ink: #fffdf8; --mark-ink: #fffdf8;
  --tile-bg: #332d27; --tile-line: #877c70;
  --key: #4a443d; --key-ink: #f3ece0;
  --toast-bg: #f3ece0; --toast-ink: #1c1a17;
  --shadow: 0 10px 30px rgba(0,0,0,.55);
  color-scheme: only dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; }
