/* Christmas Tree Builder shared styles. Layout, font (Lexend, self-hosted) and buttons come from
   mwaths.com (via Mystery Bag); the colours are Christmas ones (see the tokens below). */
@font-face {
  font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/lexend/lexend-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Lexend"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/vendor/lexend/lexend-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Christmas palette. Light board: a snowy day (snow white, pine green, berry red, gold).
   Dark board: Christmas night (deep pine, berry red, gold, moonlit snow in the 3D views).
   Same token names as mwaths.com, so the layout and buttons are unchanged. */
:root {
  --bg: #f1f6f3;
  --board: #ffffff;
  --ink: #14301f;
  --muted: #557062;
  --line: #d2e1d7;
  --accent: #1d6b3a;
  --accent-ink: #ffffff;
  --answer: #c41e3a;
  --answer-wash: rgba(196, 30, 58, 0.08);
  --good: #1d6b3a;
  --good-wash: rgba(29, 107, 58, 0.10);
  --hover: rgba(20, 48, 31, 0.06);
  --shadow: 0 18px 50px rgba(20, 48, 31, 0.22);
  --title: #b3122f;
  --gold: #c9971a;
  --scene: #dce8f1;
  --ground: #f8fbfd;
  --grid: #cfdce6;
  --plot-edge: #9db3c4;
  --chip: #e9f3ec;
  --pattern: url(/img/snowflakes-light.svg);
  --font: "Lexend", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --w-text: 375;
  --w-semi: 500;
  --w-bold: 600;
  --red: #c41e3a;
  --blue: #2563c9;
  --green: #1d6b3a;
  --yellow: #e8b931;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1d15; --board: #11281d; --ink: #f6f3ea; --muted: #a7bdb0; --line: #24452f;
    --accent: #23824a; --accent-ink: #ffffff; --answer: #ff6476; --answer-wash: rgba(255, 100, 118, 0.12);
    --good: #7fdca5; --good-wash: rgba(127, 220, 165, 0.12);
    --hover: rgba(246, 243, 234, 0.08); --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    --title: #ff7a88; --gold: #e8b931; --pattern: url(/img/snowflakes-dark.svg);
    --scene: #0c1a28; --ground: #5e7587; --grid: #7f97aa; --plot-edge: #b4c6d4; --chip: #183526;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1d15; --board: #11281d; --ink: #f6f3ea; --muted: #a7bdb0; --line: #24452f;
  --accent: #23824a; --accent-ink: #ffffff; --answer: #ff6476; --answer-wash: rgba(255, 100, 118, 0.12);
  --good: #7fdca5; --good-wash: rgba(127, 220, 165, 0.12);
  --hover: rgba(246, 243, 234, 0.08); --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --title: #ff7a88; --gold: #e8b931; --pattern: url(/img/snowflakes-dark.svg);
  --scene: #0c1a28; --ground: #5e7587; --grid: #7f97aa; --plot-edge: #b4c6d4; --chip: #183526;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg) var(--pattern) 0 0 / 520px 320px;
  color: var(--ink);
  font-family: var(--font);
  font-weight: var(--w-text);
  font-size: 16px;
  line-height: 1.4;
}
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: var(--w-bold); text-wrap: balance; }
b, strong { font-weight: var(--w-bold); }
p { margin: 0; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

button, select, input { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 10px;
  border: 1.5px solid var(--ink);
  background: none;
  padding: 9px 18px;
  font-weight: var(--w-bold);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, filter .15s, transform .08s;
}
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn.quiet { border-color: var(--line); }
.btn.danger { border-color: var(--answer); color: var(--answer); }
.btn.icon { padding: 9px 11px; border-color: var(--line); }
.btn[aria-pressed="true"] { background: var(--answer); border-color: var(--answer); color: var(--board); }
.themeBtn .sun { display: none; }
:root[data-theme="dark"] .themeBtn .sun { display: block; }
:root[data-theme="dark"] .themeBtn .moon { display: none; }
@media (prefers-color-scheme: dark) {

.fsBtn .fsOut { display: none; }
:root.isFs .fsBtn .fsIn { display: none; }
:root.isFs .fsBtn .fsOut { display: block; }
:root.noFs .fsBtn { display: none; }

/* ---------- page frame: header, then one screen of panels on a laptop ---------- */
html, body { height: 100%; }
body { display: flex; flex-direction: column; }
.top {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding-block: 8px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.top h1 { font-size: 1.3rem; color: var(--title); }
/* Bunting hangs from the bottom of the header, over the top edge of the panels. */
.top { position: relative; margin-bottom: 14px; }
.top::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -20px; height: 22px; z-index: 5; pointer-events: none;
  background: url(/img/bunting.svg) 0 0 / 110px 22px repeat-x;
}
.mark { height: 30px; width: auto; flex: none; display: block; }
/* Holly in the top-left corner of a panel; its heading moves over to make room. */
.holly { position: relative; }
.holly::before {
  content: ""; position: absolute; left: 6px; top: 5px; width: 30px; height: 33px; pointer-events: none;
  background: url(/img/holly.svg) center / contain no-repeat;
}
.holly .panelHead h2 { padding-left: 34px; }
.btnIcon { width: 1.25em; height: 1.25em; flex: none; display: block; }
.top .titles { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.top .spacer { flex: 1; }
/* The site address, so the projected board and every student screen show where to go. */
.top .site { font-weight: var(--w-bold); color: var(--accent, var(--title)); text-decoration: none; white-space: nowrap; }
.top .site:hover { text-decoration: underline; }
@media (max-width: 640px) { .top .site { display: none; } }
.top .btn { padding: 7px 14px; font-size: 0.95rem; }
.top .btn.icon { padding: 7px 9px; }
.brand { height: 34px; }

.panel { background: var(--board); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; min-width: 0; min-height: 0; }
.panelHead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; }
.panelHead h2 { font-size: 1.15rem; }
.panelHead .hint { color: var(--muted); font-size: 0.85rem; }
.view { position: relative; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--line); background: var(--scene); min-height: 0; }
.view canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.chipName { position: absolute; left: 8px; top: 8px; background: var(--board); border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 11px; font-weight: var(--w-bold); font-size: 0.85rem; pointer-events: none; }

.btn.sm { padding: 5px 11px; font-size: 0.88rem; border-radius: 8px; border-width: 1.5px; }
.btn.danger:hover { background: var(--answer-wash); }
.slider { display: grid; grid-template-columns: minmax(80px, 7.6em) minmax(0, 1fr) 4.6em; gap: 8px; align-items: center; }
.slider label { font-size: 0.88rem; }
.slider input[type=number] { width: 100%; padding: 2px 6px; border-radius: 7px; font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.slider input[type=range] { min-width: 0; accent-color: var(--accent); }
.note { color: var(--muted); font-size: 0.85rem; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); flex: none; }
.status { min-height: 1.3em; color: var(--good); font-size: 0.88rem; }
.status.warn { color: var(--answer); }
