/* The sections (the redesign, Option A, approved by the owner 28 Nov 2026: docs/REDESIGN.md; Compete, the sixth, while
   accounts are on: the owner, 3 Dec 2026).

   Colours, one meaning each, used as light tints and edges, never as full slabs:
     --sec-play      lapis     Play
     --sec-compete   copper    Compete
     --sec-learn     saffron   Learn
     --sec-mansubat  orchid    Mansubat
     --sec-history   teal      History
     --action        crimson   actions only (the one main button of a screen): the logo's --accent
     --moss          green     the Garden only (css/garden-highlight.css keeps its own --g-* set)
   An element inside a section reads its colour as --sec (set by data-sec, on the page's <html> by js/app.js, and on
   the sidebar's items and a section's tabs), with --sec-tint (a light ground) and --sec-edge (a thin line) made from it.
   Every colour was checked at 3 to 1 or better as a line against the ground behind it, in both themes. */

:root {                                          /* night (the default in css/app.css) */
  --sec-play: #8fa8ff;
  --sec-compete: #f0a070;
  --sec-learn: #f2b552;
  --sec-mansubat: #d6a2f4;
  --sec-history: #56d4e2;
  --action: var(--accent);
  --moss: #86c777;
  --sec: var(--text-3);
}
:root[data-theme="light"] {                      /* day */
  --sec-play: #3157c0;
  --sec-compete: #a4502a;
  --sec-learn: #9a640a;
  --sec-mansubat: #8640aa;
  --sec-history: #0a7686;
  --moss: #3f6b3b;
}
[data-sec="home"] { --sec: var(--text-2); }
[data-sec="play"] { --sec: var(--sec-play); }
[data-sec="compete"] { --sec: var(--sec-compete); }
[data-sec="learn"] { --sec: var(--sec-learn); }
[data-sec="mansubat"] { --sec: var(--sec-mansubat); }
[data-sec="history"] { --sec: var(--sec-history); }
:root, [data-sec] { --sec-tint: color-mix(in srgb, var(--sec) 9%, var(--panel)); --sec-edge: color-mix(in srgb, var(--sec) 55%, transparent); }

/* ---------- the sidebar: where you are is marked in the section's colour (crimson is for actions) ---------- */
.nav-link[aria-current="page"]::before { background: var(--sec, var(--text-2)); }
.nav .nav-link[aria-current="page"] { background: color-mix(in srgb, var(--sec) 12%, transparent); }
.nav .nav-link[aria-current="page"] .ico { color: var(--sec); }
:root[data-theme="light"] .nav .nav-link[aria-current="page"] { background: color-mix(in srgb, var(--sec) 12%, #ece5d4); }


/* a small red dot on Compete while an arena is on or about to start (js/app.js): a word for a screen reader, none to see */
.nav-dot { flex: none; width: 8px; height: 8px; margin-left: auto; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
@media (max-width: 1100px) { .nav-dot { position: absolute; top: 5px; right: calc(50% - 17px); margin: 0; } }

/* six on the phone's bar (Compete with accounts on): each item a sixth of 375 px, so the words are a little smaller and
   never break inside themselves ("Mansubat" is the longest) */
@media (max-width: 720px) {
  .nav.n6 > .nav-item > .nav-link { padding-left: 1px; padding-right: 1px; font-size: 12.5px; letter-spacing: -.01em; }
  .nav.n6 > .nav-item > .nav-link .lbl { white-space: nowrap; }
}

/* six in the sidebar of a short window (a laptop at 125 %: about 1093 x 550): each a little lower, so Settings and the
   bell stay in the window as they did with five */
@media (min-width: 721px) and (max-height: 700px) {
  .nav.n6 { gap: 0; }
  .nav.n6 > .nav-item > .nav-link { padding-top: 4px; padding-bottom: 4px; }
}

/* in-page tabs elsewhere mark the chosen one in the section's colour too, not in the action's crimson */
.tab[aria-selected="true"]::after { background: var(--sec, var(--text-2)); }

/* where you are: the Garden's moss on the phone's garden pill */
@media (max-width: 720px) { .gh-top[aria-current="page"]::after { background: var(--moss); } }

/* the foot of the sidebar is "You": Your garden (moss, css/garden-highlight.css), Your games, Settings, Notifications */
.side-lbl { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: var(--w-label); color: var(--text-3); padding: 2px 10px 4px; }
.side-foot .nav-link[aria-current="page"]::before { background: var(--text-2); }
.side-foot .nav-link[href="#/garden"][aria-current="page"]::before { background: var(--moss); }
.nav-tool .ico-fill, .side-foot .bell-btn .ico-fill { opacity: .9; }
.fly .fly-theme { width: 100%; justify-content: flex-start; font-size: 14px; padding: 8px 10px; color: var(--text); }
.fly .fly-theme .lbl { display: inline; }
.fly .fly-title + .toggles, .fly .fly-theme + .fly-title { margin-top: 2px; }
.nav-item.is-open > .fly { opacity: 1; visibility: visible; transform: none; }   /* held open after the theme changes (js/app.js keepOpen) */
@media (min-width: 721px) and (max-width: 1100px) { .side-lbl { display: none; } }

/* ---------- a section's tabs (js/section-tabs.js): Learn, History ---------- */
.sec-tabs { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 4px 6px; margin: 0 0 22px; border-bottom: 1px solid var(--line); }
.sec-name { font-size: 12px; font-weight: var(--w-label); letter-spacing: .08em; text-transform: uppercase; color: var(--sec); padding: 0 12px 11px 0; margin-right: 4px; }
/* by day the label is small text on the cream ground: the section's colour a shade darker, so that every section's name
   reads at 4.5 to 1 or better (Learn's saffron stood at 4.36 as it was; the tabs' lines and tints keep the colour itself) */
:root[data-theme="light"] .sec-name { color: color-mix(in srgb, var(--sec) 86%, #000); }
.sec-tab { position: relative; padding: 9px 14px 10px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; text-decoration: none; font-family: var(--font-ui); font-size: 15px; font-weight: var(--w-meta); color: var(--text-2); }
.sec-tab:hover { color: var(--text); background: color-mix(in srgb, var(--sec) 7%, transparent); }
.sec-tab[aria-current="page"] { color: var(--text); font-weight: var(--w-label); background: color-mix(in srgb, var(--sec) 10%, transparent); }
.sec-tab[aria-current="page"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--sec); }
.sec-tab:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: -2px; }
/* a section with one page: no lone tab, and this unseen stand-in keeps the bar as tall as the others (js/section-tabs.js) */
.sec-ghost { visibility: hidden; padding: 9px 14px 10px; font-family: var(--font-ui); font-size: 15px; }
@media (max-width: 720px) {
  .sec-tabs { margin-bottom: 16px; gap: 2px; }
  .sec-name { width: 100%; padding: 0 0 2px; }
  .sec-tab { padding: 8px 12px 9px; font-size: 14.5px; }
  .sec-ghost { padding: 8px 12px 9px; font-size: 14.5px; }
}

/* Play's two board pages (Two players, the Board editor) keep Play's bar with its tabs (design A, 3 Dec 2026), drawn
   tight: the section's name beside the tabs, short tabs, a small gap, so that the board keeps its size on a 900 px
   laptop (tests/play-section.mjs measures it) */
.sec-tabs.on-board { margin-bottom: 8px; }
.sec-tabs.on-board .sec-name { padding-bottom: 8px; }
.sec-tabs.on-board .sec-tab { padding: 6px 12px 7px; font-size: 14.5px; }
@media (max-width: 720px) {
  .sec-tabs.on-board { margin-bottom: 8px; }
  .sec-tabs.on-board .sec-name { display: none; }   /* (the bottom bar's lit Play says it: the three tabs keep to one row) */
  .sec-tabs.on-board .sec-tab { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; font-size: 14px; }   /* (a finger's room: tests/touch-access.mjs) */
}

/* a short wide window (a phone held sideways): the section's name beside its tabs, all lower, so the page's first lines
   stay on the first screen (Home's Continue row, the review of 30 Nov 2026) */
@media (orientation: landscape) and (max-height: 500px) {
  .sec-tabs { margin-bottom: 6px; }
  .sec-name { width: auto; padding: 0 10px 7px 0; }
  .sec-tab { padding: 5px 12px 6px; }
}

/* a minimal tab: its title, small headings and a plain list of links (GOV.UK's lists rather than a grid of tiles) */
.sec-h { margin: 0 0 14px; }
.sec-sub { margin: 22px 0 8px; font: var(--w-title) 15px/1.2 var(--font); color: var(--text-2); }
.sec-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-width: 760px; }
.sec-item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-radius: var(--radius); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); color: var(--text); text-decoration: none; transition: background .15s, box-shadow .15s; }
.sec-item:hover { background: var(--sec-tint); box-shadow: inset 3px 0 0 var(--sec), inset 0 0 0 1px var(--line); }
.sec-item:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.sec-item-t { display: grid; gap: 2px; min-width: 0; }
.sec-item-t b { font-weight: var(--w-title); font-size: 15.5px; overflow-wrap: anywhere; }
.sec-item-t small { color: var(--text-2); font-size: 13.5px; line-height: 1.35; }
.sec-state { font-size: 12.5px; font-weight: var(--w-label); color: var(--text-2); white-space: nowrap; padding: 2px 9px; border-radius: 999px; background: var(--sec-tint); box-shadow: inset 0 0 0 1px var(--sec-edge); }
.sec-chev { width: 18px; height: 18px; color: var(--text-3); }
@media (max-width: 480px) { .sec-item { grid-template-columns: minmax(0, 1fr) auto; } .sec-state { grid-column: 1; justify-self: start; } .sec-chev { grid-row: 1 / span 2; grid-column: 2; } }

/* a master's name says he is a bot, quietly (js/ladder.js); pre, not nowrap: "· bot" never starts a line (C22) */
.lad-bot { font-weight: var(--w-meta); color: var(--text-3); white-space: pre; }

/* ---------- a History chapter's picture (js/pages/story.js chapterPic): the owner draws them later ---------- */
/* until then a low band in the History colour with the chapter's number: calm, and never a large empty frame */
.ch-pic { display: flex; align-items: center; height: 52px; padding: 0 14px; margin-bottom: 6px; border-radius: 10px; background: color-mix(in srgb, var(--sec-history) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sec-history) 24%, transparent); }
.ch-pic b { font: var(--w-display) 26px/1 var(--font-display); color: var(--sec-history); }
.ch-pic.has-art { height: auto; aspect-ratio: 16 / 9; padding: 0; overflow: hidden; background: none; }
.ch-pic.has-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
