/* prototype/design.css -- Chiha's shared design language (Jon, 2026-10-03: "That should just be part of
   the design language. All things should use standardized options."). One palette, one set of standard
   components (buttons, panels, inputs, headings, toasts, badges), loaded by the game, admin, the sprite
   hub and the front page, so the four can never drift apart again the way admin.html/sprite_hub.html's
   near-identical-but-copy-pasted :root blocks already had. A page keeps its own LAYOUT (grid templates,
   table CSS, hero sizing) -- this file is palette + the handful of components every page reaches for.

   VIOLET (Jon, 2026-10-03, matching the front page's own mark and Roo's owl -- the trio game.html's
   palette.js already defines for that art, 'violet': ['#5a3a78', '#9a5fc2', '#d7a2f0']) is now the main UI
   accent: button hover/active outlines, headings, the menu, selection. The old teal stays, renamed
   --progress, for exactly what it still means: progress/activity bars and done states, never general
   chrome. --accent (light violet) is for TEXT/outlines against the dark backgrounds below -- checked for
   contrast; --accent-solid (mid violet) is for FILLED button backgrounds, which need #17131c (near-black)
   text on top, not --ink, to stay readable. */
:root {
  color-scheme: dark;
  --ground: #111018; --desk: #1c2230; --panel: #221c2a; --line: #3a3146;
  --ink: #ece3d2; --soft: #a99db8;
  --accent: #d7a2f0; --accent-solid: #a86bd0; --accent-dark: #5a3a78;   /* accent-solid: game.html's own
    #9a5fc2 lightened a touch -- #9a5fc2 under near-black button text only reaches 4.18:1, just under WCAG
    AA's 4.5:1 for normal text; this reaches 4.95:1 while staying clearly violet. */
  --progress: #7fd6b8;
  --warm: #f4c05a; --bad: #e0703f;
  --on-solid: #17131c;   /* text colour on top of a filled --accent-solid/--progress/--warm/--bad block */
  --accent-wash: #2d1d3c88;   /* a dark, translucent violet fill for a selected/active chip or button
    (topdown.css's own "pair var(--accent) border with a flat colour wash" convention, e.g. .rosterrow.
    following, .ctab.on, .councilidea.picked) -- was a hardcoded dark teal (#0a3a2e88) before the violet
    swap, same family as --accent-dark (#5a3a78) just darkened further for a wash, not a border. */
}
[hidden] { display: none !important; }
html.chihaDesign, body.chihaDesign { background: var(--ground); color: var(--ink); }

/* HEADINGS -- a page picks its own font-family (Silkscreen for the game/front page, Pixelify Sans for
   admin/the hub today); this just fixes the colour and weight-by-size-not-synthesis convention. */
.chihaDesign h1 { color: var(--accent); margin: 0 0 4px; }
.chihaDesign h2 { color: var(--ink); margin: 28px 0 10px; border-bottom: 2px solid var(--line); padding-bottom: 4px; }

/* BUTTONS -- the standard dark-panel button every page already converged on independently. .btn-solid is
   the filled, high-emphasis variant (a hero CTA, a primary Save); plain .btn/button is everything else.
   .btn-bad/.btn-good are the two semantic variants pages already needed (a destructive action, a
   progress/done action) -- .btn-good uses --progress, per "teal stays only where it means progress/good". */
.chihaDesign button, .chihaDesign .btn {
  /* no font-family here -- left entirely to the page (Silkscreen, Pixelify Sans, ...) so a page's own
     lower-specificity button rule can still set it without this higher-specificity one winning */
  font-weight: 700; font-size: 12px; background: var(--panel); color: var(--ink); border: 2px solid var(--line);
  padding: 4px 9px; cursor: pointer;
}
.chihaDesign button:hover:not(:disabled), .chihaDesign .btn:hover:not(:disabled) { border-color: var(--accent); }
.chihaDesign button:disabled, .chihaDesign .btn:disabled { opacity: 0.4; cursor: default; }
.chihaDesign button:focus-visible, .chihaDesign .btn:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
.chihaDesign .btn-solid { background: var(--accent-solid); color: var(--on-solid); border-color: var(--accent-solid); }
.chihaDesign .btn-solid:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); }
.chihaDesign .btn-bad, .chihaDesign button.bad { border-color: var(--bad); }
.chihaDesign .btn-bad:hover:not(:disabled), .chihaDesign button.bad:hover:not(:disabled) { background: var(--bad); color: var(--on-solid); }
.chihaDesign .btn-good, .chihaDesign button.good { border-color: var(--progress); }
.chihaDesign .btn-good:hover:not(:disabled), .chihaDesign button.good:hover:not(:disabled) { background: var(--progress); color: var(--on-solid); }

/* INPUTS */
.chihaDesign input[type=text], .chihaDesign input[type=password], .chihaDesign input[type=number],
.chihaDesign select, .chihaDesign textarea {
  font: inherit; background: var(--ground); color: var(--ink); border: 1px solid var(--line); padding: 5px 7px;
}
/* TEXTAREA (Jon, 2026-10-03): full width of whatever contains it, a sensible min/max starting size --
   shared.js's autosizeTextarea() grows it to fit content within this range, scrolling past max-height --
   still resizable by hand. Every textarea on every page gets this (news body, report notes, the sprite
   hub's own form fields), not just the one Jon filed the report about. */
.chihaDesign textarea {
  display: block; width: 100%; box-sizing: border-box; min-height: 68px; max-height: 420px;
  overflow-y: auto; resize: vertical;
}
.chihaDesign input[type=checkbox] { accent-color: var(--accent); }
.chihaDesign label { color: var(--soft); }

/* PANELS -- the dark card every popover/section on every page already uses under one name or another. */
.chihaDesign .panel { background: var(--desk); border: 1px solid var(--line); padding: 14px 16px; }

/* TOAST -- a quiet, auto-dismissing status line (not a modal), the shape the game's own .toast and a
   generic page notice both want. */
.chihaDesign .toast { color: var(--accent); text-shadow: 0 1px 0 #000c, 0 0 6px #0008; }

/* BADGE -- a small status chip (new/denied/etc.), warm by default, bad for anything negative. */
.chihaDesign .badge { font-size: 9px; font-weight: 700; padding: 1px 4px; background: var(--warm); color: var(--on-solid); }
.chihaDesign .badge.bad { background: var(--bad); }

/* ===== THE STANDARD CLOSE (queue 248) -- shared by the game, the sprite hub and the admin ===== */
/* THE STANDARD CLOSE (queue 248, Jon 2026-10-09: "the close button should be the standardized way"): ONE class, drawn by ui_kit.js's
   UIKit.popup() into every popup/card/panel/dialog/menu -- same glyph, 26px hit area, top-right, hover, focus ring, aria-label "Close".
   No other rule styles a close button; a popup registers with UIKit.popup() and gets this, nothing else (popup_close_accept.mjs checks). */
html button.chihaClose { position: absolute; top: 6px; right: 6px; z-index: 3; box-sizing: border-box; width: 26px; height: 26px; padding: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  font: 400 17px/1 "Silkscreen", monospace; background: transparent; border: 1px solid #ffffff33; color: var(--ink, #ece3d2); cursor: pointer; }
html button.chihaClose:hover { background: #ffffff1f; color: var(--accent, #7fd6b8); border-color: var(--accent, #7fd6b8); }
html button.chihaClose:focus-visible { outline: 2px solid var(--accent, #7fd6b8); outline-offset: 1px; }
/* every popup's first row/heading leaves room for the button */
.chihaPopup:not(.chihaHosted) > :first-child:not(.chihaClose), .chihaPopup:not(.chihaHosted) > .cardHead > .row:first-child, .chihaPopupHost > :first-child:not(.chihaClose) { padding-right: 34px; box-sizing: border-box; }
