/* Colours live in brand.css (generated from brand/brand.json). Only fonts are defined here. */
:root {
  --display: 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.5 var(--body); }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; }
h2 { font-size: 1.5rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary-dark); }   /* the darker green: the main green is a touch too light for small text on the mint page */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
main { max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; outline: none; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: 960px; margin: 0 auto; padding: 1rem 1.25rem 0; }
.brand { font: 800 1.35rem var(--display); color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: .5rem; }
.brand { line-height: 0; }
.brand-logo { display: block; width: auto; }
.brand-wordmark, .brand-wordmark .brand-logo { display: block; height: 3.4rem; }   /* about 145px wide; the sheet's minimum for the wordmark is 120px */
.brand-icon { display: none; height: 2.6rem; }
@media (max-width: 480px) { .brand-wordmark { display: none; } .brand-icon { display: block; } }
.who { display: flex; align-items: center; gap: .75rem; color: var(--ink-soft); font-size: .95rem; }

/* controls */
.btn { font: 600 1rem var(--body); border: 0; border-radius: 10px; padding: .7rem 1.1rem; background: var(--primary); color: var(--on-primary); cursor: pointer; min-height: 44px; }
.btn:hover { background: var(--primary-dark); }
.btn.ghost { background: transparent; color: var(--secondary); border: 1.5px solid var(--secondary); }
.btn.ghost:hover { background: color-mix(in srgb, var(--secondary) 12%, var(--card)); }
.btn.danger { background: transparent; color: var(--bad); border: 1.5px solid var(--line); }
.btn.small { padding: .35rem .7rem; min-height: 34px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: default; }
.link { background: none; border: 0; color: var(--primary-dark); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .25rem; }
.hint { color: var(--ink-soft); font-size: .88rem; margin-top: .25rem; }
input, select { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: .65rem .8rem; min-height: 44px; }
.field { margin-bottom: 1rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.err { background: var(--bad-bg); color: var(--bad); border-radius: 10px; padding: .6rem .8rem; margin-bottom: 1rem; font-weight: 500; }
.panel { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 1.5rem; }

/* landing */
.hero { display: grid; gap: 2rem; grid-template-columns: 1.15fr 1fr; align-items: start; padding-top: 1.5rem; }
.hero .lead { color: var(--ink-soft); font-size: 1.15rem; margin: 1rem 0 1.5rem; max-width: 34ch; }
.codebox { font: 800 2rem var(--display); letter-spacing: .18em; text-transform: uppercase; text-align: center; padding: .9rem .5rem; min-height: 72px; }
.codebox::placeholder { color: var(--line); letter-spacing: .18em; }
.teacher-cta { margin-top: 1.25rem; color: var(--ink-soft); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }

/* tiles: the join code, shown like game tiles so it can be read from the back of a room */
.tiles { display: flex; gap: .35rem; flex-wrap: wrap; }
.tile { display: grid; place-items: center; width: 2.6rem; height: 3.2rem; background: var(--accent); color: var(--on-accent); font: 800 1.7rem var(--display); border-radius: 8px; box-shadow: 0 4px 0 var(--accent-edge); }
.tile.gap { width: .6rem; background: none; box-shadow: none; }
.tiles.big .tile { width: clamp(2.3rem, 8.5vw, 4.4rem); height: clamp(2.9rem, 10.5vw, 5.4rem); font-size: clamp(1.5rem, 6vw, 3rem); border-radius: 12px; box-shadow: 0 6px 0 var(--accent-edge); }
.tiles.big .tile.gap { width: clamp(.4rem, 2vw, 1.2rem); }
.tiles.mini .tile { width: 1.4rem; height: 1.8rem; font-size: .95rem; border-radius: 5px; box-shadow: 0 2px 0 var(--accent-edge); }
.tiles.mini .tile.gap { width: .3rem; }
.tiles.dim { opacity: .35; filter: grayscale(.6); }

/* teacher lists */
.head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 1rem; }
.classrow { display: grid; grid-template-columns: 1fr auto auto; gap: 1.25rem; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 1rem 1.25rem; margin-bottom: .75rem; text-decoration: none; color: inherit; }
.classrow:hover { border-color: var(--primary); }
.classrow .meta { color: var(--ink-soft); font-size: .92rem; }
.count { text-align: right; font-weight: 600; min-width: 5.5rem; }
.count small { display: block; color: var(--ink-soft); font-weight: 400; }
@media (max-width: 640px) { .classrow { grid-template-columns: 1fr auto; } .classrow .tiles { grid-column: 1 / -1; order: 3; } }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }
.empty h3 { color: var(--ink); margin-bottom: .4rem; }

/* class detail */
.back { display: inline-block; margin-top: 1rem; color: var(--ink-soft); }
.codepanel { text-align: center; padding: 2rem 1rem 1.5rem; margin: 1rem 0 1.25rem; }
.codepanel .tiles { justify-content: center; margin: .75rem 0 1.25rem; }
.codepanel .instr { color: var(--ink-soft); }
.actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.meter { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; margin: .5rem 0; }
.meter > div { height: 100%; background: var(--primary); border-radius: 99px; }
.meter.full > div { background: var(--bad); }
.status { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.pill { display: inline-block; padding: .15rem .6rem; border-radius: 99px; font-size: .85rem; font-weight: 600; background: #d8f5e9; color: #0b5c40; }
.pill.off { background: var(--bad-bg); color: var(--bad); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.25rem; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .9rem; color: var(--ink-soft); font-weight: 600; }
td.act { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
.reveal { font: 600 1rem ui-monospace, Menlo, Consolas, monospace; background: var(--paper); padding: .15rem .45rem; border-radius: 6px; }

#toast { position: fixed; left: 50%; bottom: 1.25rem; transform: translate(-50%, 150%); background: var(--ink); color: var(--paper); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 500; transition: transform .2s; max-width: 90vw; z-index: 10; }
#toast.show { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* overrides placed last so size variants can't resurrect the gap tile's shadow */
.tiles .tile.gap { background: none; box-shadow: none; }
#toast { visibility: hidden; }
#toast.show { visibility: visible; }
.cols { align-items: start; }

/* ---- step 2: games ---- */
.who a { color: var(--ink); font-weight: 600; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .75rem; margin-bottom: .5rem; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr; } }
.gamegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: .5rem; }
.gamecard { display: flex; flex-direction: column; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit; }
.gamecard:hover { border-color: var(--primary); }
.gametile { display: grid; place-items: center; font-size: 3.2rem; height: 110px; }
.gametile.big { font-size: 4.5rem; width: 150px; height: 150px; border-radius: 20px; flex: none; }
.gamebody { padding: 1rem 1.1rem 1.2rem; }
.gamebody .pill { margin-top: .5rem; }
.pill.plain { background: var(--line); color: var(--ink); }
.meta { color: var(--ink-soft); font-size: .92rem; }
.gamehero { display: flex; gap: 1.5rem; align-items: center; }
@media (max-width: 640px) { .gamehero { flex-direction: column; align-items: flex-start; } }
.stds { margin: 0; padding-left: 1.1rem; }
.stds li { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88rem; margin-bottom: .25rem; word-break: break-all; }
.playhead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1rem; }
.playtools { display: flex; gap: .5rem; align-items: center; }
.hudbar { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; color: var(--ink-soft); font-weight: 600; }
.hudbar b { color: var(--ink); }
.stage { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; }
.gameframe { display: block; width: 100%; height: min(78vh, 760px); min-height: 460px; border: 0; background: var(--paper); }
.stage:fullscreen .gameframe { height: 100vh; }
.resultbox { text-align: center; padding: 3rem 1rem; min-height: 460px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; }
.bigscore { font: 800 2.6rem var(--display); }

/* ---- step 3: assignments ---- */
textarea { width: 100%; font: inherit; color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: .65rem .8rem; resize: vertical; }
.gametile.mini { width: 3rem; height: 3rem; font-size: 1.6rem; border-radius: 10px; flex: none; }
.pickgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; margin-top: .75rem; }
.pickrow { display: flex; gap: .75rem; align-items: center; text-align: left; font: inherit; color: inherit; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: .6rem; cursor: pointer; }
.pickrow:hover { border-color: var(--primary); }
.pickrow.on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.asgrow { display: flex; gap: .9rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--line); text-decoration: none; color: inherit; }
.asgrow:hover .asgmain b { text-decoration: underline; }
.asgmain { flex: 1; min-width: 0; }
.asgcount { text-align: right; font-weight: 700; white-space: nowrap; }
.asgcount small { display: block; font-weight: 500; color: var(--ink-soft); }
.asgcount small.warn { color: var(--bad); font-weight: 700; }
.asgtitle { display: flex; gap: .9rem; align-items: center; }
.spill { display: inline-block; padding: .15rem .6rem; border-radius: 99px; font-size: .85rem; font-weight: 700; white-space: nowrap; }
.st-done { background: #d8f5e9; color: #0b5c40; }
.st-late { background: #e4f0d0; color: #3d5a0f; }
.st-in_progress { background: #fff0c2; color: #7a5600; }
.st-not_started { background: var(--line); color: var(--ink); }
.st-missing { background: var(--bad-bg); color: var(--bad); }
@media (prefers-color-scheme: dark) { .st-done { background: #14463a; color: #8fe9c6; } .st-late { background: #2f4318; color: #c9e8a0; } .st-in_progress { background: #4a3a0c; color: #ffdf85; } }
.segbar { display: flex; height: 16px; border-radius: 99px; overflow: hidden; gap: 2px; background: var(--line); }
.seg.st-done { background: #1ea87a; } .seg.st-late { background: #8bbf3f; } .seg.st-in_progress { background: #f0b429; } .seg.st-not_started { background: #b8bfdc; } .seg.st-missing { background: #d64545; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; padding: 0; margin: .75rem 0 0; }
.legend li { display: flex; align-items: center; gap: .4rem; }
.dot { width: .8rem; height: .8rem; border-radius: 50%; display: inline-block; }
.dot.st-done { background: #1ea87a; } .dot.st-late { background: #8bbf3f; } .dot.st-in_progress { background: #f0b429; } .dot.st-not_started { background: #b8bfdc; } .dot.st-missing { background: #d64545; }
.stats { display: flex; gap: 2rem; flex-wrap: wrap; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.stat b { display: block; font: 800 1.5rem var(--display); }
.stat span { color: var(--ink-soft); font-size: .9rem; }
.hard { list-style: none; margin: 0; padding: 0; }
.hard li { display: grid; grid-template-columns: minmax(7rem, 1.2fr) 2fr auto; gap: .75rem; align-items: center; padding: .4rem 0; }
.hbar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.hbar i { display: block; height: 100%; background: #d64545; border-radius: 99px; }
.hpct { white-space: nowrap; font-weight: 700; } .hpct small { color: var(--ink-soft); font-weight: 400; }
@media (max-width: 560px) { .hard li { grid-template-columns: 1fr auto; } .hbar { grid-column: 1 / -1; order: 3; } }
.todo { display: flex; gap: .9rem; align-items: center; padding: .9rem 0; border-top: 1px solid var(--line); }
.todomain { flex: 1; min-width: 0; }
.todoact { display: flex; flex-direction: column; gap: .5rem; align-items: flex-end; }
.note { display: block; margin-top: .35rem; padding: .35rem .6rem; background: var(--paper); border-radius: 8px; font-size: .92rem; }
.doneBox { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: .75rem; } .doneBox summary { cursor: pointer; font-weight: 600; }
@media (max-width: 560px) { .todo { flex-wrap: wrap; } .todoact { flex-direction: row; width: 100%; justify-content: space-between; align-items: center; } }
.asgbar { background: var(--card); border: 1.5px solid var(--primary); border-radius: 12px; padding: .6rem .9rem; margin: .6rem 0; }
.goalmsg { font-weight: 700; padding: .5rem .9rem; border-radius: 10px; }
.goalmsg.ok { background: #d8f5e9; color: #0b5c40; } .goalmsg.no { background: #fff0c2; color: #7a5600; }

a.btn { text-decoration: none; display: inline-block; text-align: center; }

.canvaspanel { border-color: var(--primary); }

/* ---- step 5 ---- */
.foot { max-width: 960px; margin: 0 auto; padding: 0 1.25rem 2rem; font-size: .9rem; } .foot a { color: var(--ink-soft); }
.danger-zone { border-color: var(--bad); }
.menu { display: inline-block; position: relative; vertical-align: middle; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.menulist { position: absolute; right: 0; z-index: 5; margin-top: .25rem; min-width: 12.5rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: .4rem; display: flex; flex-direction: column; gap: .15rem; text-align: left; }
.menulist a, .menulist button { padding: .45rem .6rem; border-radius: 6px; font: inherit; text-align: left; text-decoration: none; color: var(--ink); background: none; border: 0; cursor: pointer; }
.menulist a:hover, .menulist button:hover { background: var(--paper); } .menulist .danger { color: var(--bad); text-decoration: none; }
.legal { max-width: 46rem; margin: 0 auto; } .legal h2 { margin: 1.75rem 0 .5rem; } .legal p, .legal li { margin-bottom: .6rem; } .legal table { margin: .75rem 0 1rem; font-size: .95rem; }
.legal .draft { background: #fff0c2; color: #5c4200; border-radius: 10px; padding: .75rem 1rem; font-weight: 600; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- mascot ---- */
.mascot { display: block; height: 7rem; width: auto; margin: 0 auto .5rem; }
.mascot.hero { height: 12rem; margin: 1.25rem 0 0; }
.empty .mascot { height: 7.5rem; }
.resultbox .mascot { height: 9rem; margin-bottom: 0; }
