/*
 * One look for three screens: a laptop, a smart board, and the teacher's page.
 * Dark, large, and slow-moving, because everything here has to be readable
 * from the back of a room.
 */

:root {
  --ink: #08080a;
  --ink-2: #101015;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.18);
  --paper: #f4f3f1;
  --muted: rgba(244, 243, 241, 0.58);
  --faint: rgba(244, 243, 241, 0.34);
  --amber: #ff7a29;
  --amber-soft: rgba(255, 122, 41, 0.14);
  --cold: #6aa6ff;
  --cold-soft: rgba(106, 166, 255, 0.16);
  --hot: #ffb545;
  --green: #5fd39b;
  --red: #ff6b6b;
  --r: 16px;
  --pad: clamp(18px, 3.4vw, 54px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--ink); color: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; overflow-x: hidden; }

.glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(58vw 58vw at 10% -12%, rgba(255, 122, 41, 0.16), transparent 60%),
    radial-gradient(48vw 48vw at 100% 112%, rgba(106, 166, 255, 0.12), transparent 60%);
}

main, header { position: relative; z-index: 2; }

h1, h2, h3 { margin: 0; font-weight: 560; letter-spacing: -0.026em; line-height: 1.06; }
h1 { font-size: clamp(34px, 6vw, 88px); }
h2 { font-size: clamp(24px, 3.2vw, 50px); }
h3 { font-size: clamp(17px, 1.5vw, 25px); }
p { margin: 0; line-height: 1.5; }

.kicker { font-family: var(--mono); font-size: clamp(11px, 0.85vw, 13px); letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); }
.lead { font-size: clamp(16px, 1.45vw, 24px); line-height: 1.45; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.big { font-size: clamp(20px, 2vw, 34px); }
.mono { font-family: var(--mono); }

.wrap { padding: var(--pad); max-width: 1560px; margin: 0 auto; }
.stack { display: grid; gap: clamp(12px, 1.4vw, 24px); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.grow { flex: 1; }
.hero { min-height: calc(100vh - 190px); display: flex; flex-direction: column; justify-content: center; }

.bar { display: flex; align-items: center; gap: 14px; padding: 12px var(--pad); border-bottom: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.dot.off { background: var(--red); }
.rail { height: 2px; background: var(--line); position: relative; }
.rail i { position: absolute; inset: 0 auto 0 0; background: var(--amber); transition: width 0.5s var(--ease); }

.card { background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02)); border: 1px solid var(--line); border-radius: var(--r); padding: clamp(14px, 1.5vw, 26px); }
.card.on { border-color: var(--amber); background: linear-gradient(180deg, var(--amber-soft), rgba(255,255,255,0.02)); }
.card.right { border-color: rgba(95,211,155,0.5); background: linear-gradient(180deg, rgba(95,211,155,0.12), rgba(255,255,255,0.02)); }

.chip { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; color: var(--amber); border: 1px solid rgba(255,122,41,0.38); background: rgba(255,122,41,0.07); }
.chip.plain { color: var(--muted); border-color: var(--line-2); background: none; }

.btn { font: inherit; font-size: 15px; font-weight: 500; padding: 11px 18px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.05); color: var(--paper); cursor: pointer; transition: transform 0.18s var(--ease), background 0.18s var(--ease); }
.btn:hover { background: rgba(255,255,255,0.1); }
.btn:active { transform: scale(0.97); }
.btn.go { background: var(--amber); border-color: var(--amber); color: #fff; font-weight: 600; }
.btn.ghost { background: none; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 9px; }
.btn:disabled { opacity: 0.45; cursor: default; }

input, textarea { font: inherit; color: var(--paper); width: 100%; background: rgba(255,255,255,0.04); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 15px; outline: none; }
input:focus, textarea:focus { border-color: var(--amber); }
::placeholder { color: var(--faint); }

/* ---- the answer buttons a student presses ---- */
.choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.choice { font: inherit; font-size: clamp(16px, 1.5vw, 22px); padding: clamp(16px, 2vw, 28px); border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.05); color: var(--paper); cursor: pointer; text-align: left; transition: all 0.2s var(--ease); }
.choice:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.choice.picked { border-color: var(--amber); background: var(--amber-soft); }
.choice.answer { border-color: rgba(95,211,155,0.6); background: rgba(95,211,155,0.14); }
.choice:disabled { cursor: default; }

/* ---- the cards with shapes on them ---- */
.deck { display: grid; gap: clamp(10px, 1.2vw, 18px); grid-template-columns: repeat(4, 1fr); }
.deck.small { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.face { position: relative; aspect-ratio: 1 / 1.15; border-radius: 14px; border: 1px solid var(--line-2); background: rgba(255,255,255,0.04); display: grid; place-items: center; }
.face svg { width: 62%; height: 62%; }
.mark { position: absolute; top: 8px; right: 10px; font-size: clamp(16px, 1.6vw, 24px); font-weight: 700; }
.mark.bad { color: var(--red); }
.mark.good { color: var(--green); }
.face.asked { border-color: var(--amber); border-width: 2px; }

/* ---- the table of orders ---- */
.sheet { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: clamp(11px, 0.95vw, 15px); }
.sheet th, .sheet td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.sheet th { color: var(--amber); font-weight: 500; position: sticky; top: 0; background: var(--ink-2); }
.sheet td.cold { color: var(--cold); }
.sheet tr.is-cold td { background: var(--cold-soft); }
.scroll { max-height: 64vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); }

/* ---- the groups ---- */
/* One under another: side by side they read as a pair of answers. */
.groups { display: grid; gap: 12px; grid-template-columns: 1fr; }
.means { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.group { border: 1px solid var(--line); border-radius: var(--r); padding: clamp(12px, 1.3vw, 20px); background: rgba(255,255,255,0.03); display: flex; align-items: center; gap: clamp(12px, 2vw, 30px); flex-wrap: wrap; }
.group .name { font-size: clamp(15px, 1.4vw, 22px); font-weight: 560; min-width: 5.5em; }
.group .count { font-family: var(--mono); font-size: clamp(18px, 2vw, 32px); }
.group .count b { color: var(--cold); font-weight: 560; }
.group .dots { margin-top: 0; }
.dots { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.dots i { width: clamp(12px, 1.1vw, 18px); height: clamp(12px, 1.1vw, 18px); border-radius: 4px; background: rgba(255,255,255,0.12); }
.dots i.cold { background: var(--cold); }
.group.worse { border-color: rgba(106,166,255,0.5); }
.group.tiny { border-style: dashed; }

/* ---- a round, on one screen: known cards left, the question right ---- */
.round { display: grid; gap: clamp(16px, 2.5vw, 40px); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) {
  .round { grid-template-columns: 1.55fr 1fr; }
  .round > :last-child { border-left: 1px solid var(--line); padding-left: clamp(16px, 2.5vw, 40px); }
}
.round { --cardw: clamp(110px, 11.5vw, 190px); }
.round .deck { grid-template-columns: repeat(4, var(--cardw)); }
.round .face { aspect-ratio: 1 / 1; }
/* The card being asked about: the same size as the ones on the left, so a
   big shape is big in both places. */
.facebox { width: var(--cardw, 150px); margin: 0 auto; }

/* Buttons only as wide as what is written on them, centred under the question. */
.choices.marks, .choices.compact { grid-template-columns: auto auto; justify-content: center; gap: 14px; }
.choices.compact .choice { text-align: center; padding: 12px 34px; font-size: clamp(16px, 1.4vw, 21px); }
.choices.marks .choice {
  text-align: center; font-size: clamp(24px, 2.4vw, 38px); line-height: 1;
  padding: clamp(10px, 1.2vw, 16px) clamp(24px, 2.6vw, 40px);
}
.choices.marks .mark-tick { color: var(--green); }
.choices.marks .mark-cross { color: var(--red); }
.choice .chip { display: block; margin: 8px auto 0; width: fit-content; font-size: 10px; }

/* Two sets of options, side by side. */
.pair { display: grid; gap: clamp(14px, 2vw, 34px); grid-template-columns: 1fr; }
@media (min-width: 900px) { .pair { grid-template-columns: 1fr 1fr; } }

/* The filters over the table: click a value, the table follows. */
.filters { display: grid; gap: 8px; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter .kicker { min-width: 8.5em; }
.pill {
  font: inherit; font-size: 13px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255,255,255,0.04); color: var(--muted);
}
.pill:hover { color: var(--paper); }
.pill.on { border-color: var(--amber); background: var(--amber-soft); color: var(--paper); }

/* ---- one order, laid out like its row in the table ---- */
.orderrow { display: flex; flex-wrap: wrap; gap: clamp(10px, 1.6vw, 26px); font-family: var(--mono); font-size: clamp(12px, 1vw, 16px); }
.orderrow .colname { display: block; font-style: normal; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); margin-bottom: 2px; }

/* ---- options one under another, where they are a list of answers ---- */
.choices.stack-one { grid-template-columns: 1fr; }

/* ---- scores and lines ---- */
.scores { display: grid; gap: 8px; }
.score { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.score b { font-family: var(--mono); font-size: clamp(16px, 1.6vw, 24px); }
.score.top { border-color: var(--amber); background: var(--amber-soft); }

.in { animation: rise 0.55s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .in { animation: none; } * { transition-duration: 0.01ms !important; } }

/* ---- the smart board is a projector ---- */
body.board { font-size: 18px; }
body.board .wrap { max-width: 1800px; }
body.board .btn, body.board .choice { pointer-events: none; }

/* ---- the teacher's page ---- */
body.admin .wrap { max-width: 1700px; }
.panel { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1100px) { .panel { grid-template-columns: 1.35fr 1fr; align-items: start; } }
.screen { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: #000; position: relative; }
.screen iframe { width: 1600px; height: 900px; border: 0; transform-origin: top left; display: block; }
.note { border-left: 2px solid var(--amber); padding-left: 12px; color: var(--muted); font-size: 14px; }
.steps { display: flex; flex-wrap: wrap; gap: 6px; }
