/* Algorithm Museum: shared look.
   Colors follow the homeschool lessons: orange = the thing we keep / found / prime,
   blue = ruled out / crossed out / not prime. */
:root {
  --keep: #ff8c5a;      /* orange */
  --out: #6aa8ff;       /* blue */
  --focus: #f5d35b;     /* yellow: "looking at this right now" */
  --good: #6fd38b;      /* green: done / answer */
  --ink: #e6e6e6; --muted: #9aa0a6; --bg: #16181d; --soft: #222730; --softer: #1c2027; --rule: #4a505a;
  --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root { --keep: #c2410c; --out: #1f6fd1; --focus: #b8860b; --good: #1f8a4c;
          --ink: #222; --muted: #666; --bg: #fdfcf8; --soft: #eef2f8; --softer: #f6f7fa; --rule: #aab; }
}
* { box-sizing: border-box; }
html { color-scheme: dark light; }
body { font-family: "Comic Neue", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif; color: var(--ink);
       background: var(--bg); font-size: 17px; line-height: 1.45; margin: 0; }
main { max-width: 960px; margin: 0 auto; padding: 16px 20px 60px; }
a { color: var(--out); }
h1 { font-size: 2rem; margin: 0.2em 0 0.1em; }
h2 { font-size: 1.35rem; margin: 1.4em 0 0.4em; border-bottom: 3px solid var(--rule); padding-bottom: 2px; }
h3 { font-size: 1.1rem; margin: 1em 0 0.3em; }
p { margin: 0.45em 0; }
code, .mono { font-family: "DejaVu Sans Mono", Menlo, Consolas, monospace; font-size: 0.9em; }
code { background: var(--soft); padding: 0 4px; border-radius: 4px; }
.keep { color: var(--keep); font-weight: bold; }
.out { color: var(--out); font-weight: bold; }
.focus { color: var(--focus); font-weight: bold; }
.good { color: var(--good); font-weight: bold; }
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }

/* Top bar */
.topbar { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap;
          max-width: 960px; margin: 0 auto; padding: 12px 20px 0; font-size: 0.95rem; }
.topbar a { text-decoration: none; }
.topbar .brand { font-weight: bold; color: var(--ink); }

/* Exhibit placard */
.plaque { display: inline-block; border: 2px solid var(--rule); border-radius: 6px; padding: 1px 10px;
          font-size: 0.9rem; color: var(--muted); margin-bottom: 0.4em; }
.lede { font-size: 1.1rem; }
.box { border: 2px solid var(--rule); border-radius: var(--radius); padding: 10px 16px; margin: 12px 0; }
.box > b:first-child { display: block; margin-bottom: 2px; }
.box.define { background: var(--soft); border-style: dashed; }
.box.detective { border-style: dotted; border-width: 3px; }
.box.recipe { border-color: var(--out); border-width: 3px; }
.box ol, .box ul { margin: 4px 0; padding-left: 1.4em; }
.box li { margin: 3px 0; }
details { margin: 6px 0 2px; }
details summary { cursor: pointer; color: var(--muted); }
details[open] summary { margin-bottom: 4px; }

/* The interactive area */
.exhibit { background: var(--softer); border: 2px solid var(--rule); border-radius: 14px; padding: 14px 16px; margin: 16px 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.spread { justify-content: space-between; }
button, select, input { font: inherit; color: var(--ink); }
button, select { background: var(--soft); border: 1.5px solid var(--rule); border-radius: 8px; padding: 4px 12px; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--ink); }
button:disabled { opacity: 0.4; cursor: default; }
button.primary { border-color: var(--keep); }
input[type=text], input[type=number] { background: var(--bg); border: 1.5px solid var(--rule); border-radius: 8px; padding: 4px 8px; }
input[type=number] { width: 6.5em; }
input:focus-visible, button:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
label { white-space: nowrap; }
.msg { min-height: 3.2em; margin: 10px 0 4px; padding: 6px 12px; border-left: 4px solid var(--focus); background: var(--soft);
       border-radius: 0 8px 8px 0; }
.stats { display: flex; gap: 18px; flex-wrap: wrap; font-size: 0.95rem; color: var(--muted); }
.stats b { color: var(--ink); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); margin-top: 6px; }
.swatch { display: inline-block; width: 0.95em; height: 0.95em; border-radius: 3px; vertical-align: -0.1em; margin-right: 4px; border: 2px solid; }

/* Step player controls */
.player { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.player .count { color: var(--muted); font-size: 0.9rem; min-width: 8em; }
.player input[type=range] { width: 110px; }

/* Lobby */
.wing { margin-top: 1.6em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { display: block; text-decoration: none; color: var(--ink); background: var(--softer); border: 2px solid var(--rule);
        border-radius: 14px; padding: 12px 14px; transition: border-color 0.15s, transform 0.15s; }
.card:hover { border-color: var(--keep); transform: translateY(-2px); }
.card h3 { margin: 0 0 2px; }
.card .era { font-size: 0.85rem; color: var(--muted); }
.card p { margin: 6px 0 0; font-size: 0.95rem; }
.card .art { height: 64px; margin-bottom: 6px; }
.card .art svg { height: 100%; width: 100%; }

footer { max-width: 960px; margin: 0 auto; padding: 20px; color: var(--muted); font-size: 0.85rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
