/* Computer science, one class, one year.
   Big text, short lines, high contrast, and a picture on everything.
   Nothing here loads from another domain. The fonts are the machine's own. */

:root {
  --ink: #14181f;
  --ink-soft: #46505e;
  --paper: #ffffff;
  --sky: #eef3fb;
  --edge: #c3ccd9;
  --go: #1b52c4;
  --go-dark: #123a90;
  --right: #137a3a;
  --right-soft: #e3f5e9;
  --held: #c05a00;
  --held-soft: #fdf0e2;
  --focus: #6a2ba8;
  --tap: 3rem;
  --round: 0.75rem;
}

* { box-sizing: border-box; }

html {
  font-size: 20px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--sky);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  padding-bottom: 6rem;
}

.wrap {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1rem;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5rem; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 0.75rem; max-width: 34rem; }

/* ---------------------------------------------------------------- the door */

.door {
  text-align: center;
  padding-top: 1.5rem;
}

.door .brand {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

.door .photo {
  width: 100%;
  max-width: 22rem;
  aspect-ratio: 2 / 1;
  margin: 0 auto 1rem;
}

.door .photo .glyph { font-size: 6rem; }

.door .day {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.door .promise {
  font-size: 1.6rem;
  font-weight: 600;
  max-width: 22rem;
  margin: 0 auto 1.5rem;
}

.door .scrolldown {
  margin-top: 3rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--tap);
  min-width: 9rem;
  padding: 0.6rem 1.4rem;
  border: 3px solid transparent;
  border-radius: var(--round);
  background: var(--go);
  color: #fff;
  font: inherit;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--go-dark); }
.btn.big { font-size: 1.5rem; min-width: 12rem; min-height: 4rem; }
.btn.quiet {
  background: var(--paper);
  color: var(--go);
  border-color: var(--go);
}
.btn.quiet:hover { background: var(--sky); }
.btn[disabled] {
  background: var(--edge);
  color: #6b7480;
  cursor: default;
}

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

/* ------------------------------------------------------------------- panels */

.panelbar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.pip {
  flex: 1 1 3rem;
  height: 0.6rem;
  border-radius: 0.3rem;
  background: var(--edge);
}
.pip.done { background: var(--right); }
.pip.now { background: var(--go); }

.panel {
  background: var(--paper);
  border: 2px solid var(--edge);
  border-radius: var(--round);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.panel h2 .mins {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin-left: 0.5rem;
}

.ask {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0.5rem 0 1rem;
}

/* ------------------------------------------------------------- the pictures */

.pic {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--sky);
  border: 2px solid var(--edge);
  border-radius: 0.5rem;
  overflow: hidden;
}

.pic .glyph {
  font-size: 3rem;
  line-height: 1;
}

.pic.small { max-width: 9rem; }
.pic.wide { aspect-ratio: 16 / 9; }

.pic.todo {
  border-style: dashed;
  border-color: var(--held);
  background: var(--held-soft);
}

.pic-words {
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: center;
  padding: 0.25rem;
}

/* --------------------------------------------------------------- pick one   */

.options {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 1fr;
  list-style: none;
  padding: 0;
  margin: 0;
}

@media (min-width: 34rem) {
  .options { grid-template-columns: repeat(3, 1fr); }
  .options.few { grid-template-columns: repeat(2, 1fr); }
}

.option {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  padding: 0.75rem;
  min-height: var(--tap);
  border: 3px solid var(--edge);
  border-radius: var(--round);
  background: var(--paper);
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
  cursor: pointer;
}

.option:hover { border-color: var(--go); }
.option.right {
  border-color: var(--right);
  background: var(--right-soft);
}
.option.wrong { opacity: 0.45; }
/* The child's own pick. Blue, not green: green is the colour this site
   uses for a right answer, and a colour or a character has no right
   answer. Nothing else fades, because nothing else is wrong. */
.option.mine {
  border-color: var(--go);
  background: var(--sky);
}
.option .label { font-weight: 600; }

.why {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-left: 6px solid var(--right);
  background: var(--right-soft);
  border-radius: 0.4rem;
  font-size: 1.1rem;
}

/* Help, drawn by the page. The same amber as the Stuck? button that asked
   for it, so a child sees where it came from. Never a system box. */
.hint {
  margin: 1rem 0;
  padding: 0.9rem 1rem;
  border-left: 6px solid var(--held);
  background: var(--held-soft);
  border-radius: 0.4rem;
  font-size: 1.1rem;
}

/* ------------------------------------------------------ the worked example  */

.steps { counter-reset: step; }

.step {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-top: 2px solid var(--edge);
}
.step:first-child { border-top: 0; }
.step.ahead { display: none; }

.step .n {
  flex: 0 0 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: var(--go);
  color: #fff;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.step .tag {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.15rem 0.6rem;
  border-radius: 1rem;
  background: var(--sky);
  border: 2px solid var(--edge);
  font-size: 0.9rem;
  font-weight: 700;
}

/* ------------------------------------------------------------- the widgets  */

.tray, .slots, .bins {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.75rem 0;
}

.slots { flex-direction: column; }

.card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.8rem;
  min-height: var(--tap);
  border: 3px solid var(--edge);
  border-radius: var(--round);
  background: var(--paper);
  font: inherit;
  font-size: 1rem;
  text-align: left;
  cursor: grab;
}

.card .pic { width: 2.6rem; height: 2.6rem; aspect-ratio: 1; flex: 0 0 auto; }
.card.held {
  border-color: var(--held);
  background: var(--held-soft);
  box-shadow: 0 0 0 4px var(--held-soft);
}
.card.placed { cursor: default; }
.card.locked {
  border-color: var(--right);
  background: var(--right-soft);
  cursor: default;
}

.slot {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  padding: 0.4rem;
  border: 3px dashed var(--edge);
  border-radius: var(--round);
  background: var(--paper);
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.slot.over, .slot.target { border-color: var(--held); background: var(--held-soft); }
.slot .n { font-weight: 700; color: var(--ink-soft); padding: 0 0.4rem; }

.bin {
  flex: 1 1 10rem;
  min-height: 8rem;
  padding: 0.6rem;
  border: 3px dashed var(--edge);
  border-radius: var(--round);
  background: var(--paper);
}
.bin h4 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.bin.over { border-color: var(--held); background: var(--held-soft); }

.findbox { position: relative; }
.hit {
  position: absolute;
  border: 3px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  min-width: var(--tap);
  min-height: var(--tap);
}
.hit:hover { border-color: var(--go); }
.hit.found {
  border-color: var(--right);
  background: rgba(19, 122, 58, 0.18);
}
.hit .name {
  position: absolute;
  left: 50%;
  bottom: -1.7rem;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--right);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  border-radius: 0.4rem;
}

.made {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 4px solid var(--go);
  border-radius: var(--round);
  background: var(--paper);
  justify-items: center;
}
.made .caption { font-size: 1.3rem; font-weight: 700; }

.done {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.35rem 0.8rem;
  border-radius: 1rem;
  background: var(--right-soft);
  color: var(--right);
  font-weight: 700;
}

/* ----------------------------------------------------------- the stuck path */

.stuck {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  min-width: 0;
  background: var(--held);
  border-color: var(--held);
}
.stuck:hover { background: #9c4900; }

.sheet {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 50;
  background: var(--paper);
  border-top: 4px solid var(--held);
  border-radius: var(--round) var(--round) 0 0;
  padding: 1rem;
  max-height: 80vh;
  overflow: auto;
}
.sheet .wrap { padding: 0; }
.sheet .rungs { display: grid; gap: 0.6rem; }
.sheet .rungs .btn { width: 100%; }

.veil {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(20, 24, 31, 0.45);
}

[hidden] { display: none !important; }

/* -------------------------------------------------------------- the way back */

.daylist {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  list-style: none;
  padding: 0;
}

.daylist a, .daylist span {
  display: block;
  padding: 0.6rem 0.4rem;
  min-height: var(--tap);
  border: 3px solid var(--edge);
  border-radius: 0.6rem;
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  text-align: center;
  font-weight: 700;
}
.daylist a:hover { border-color: var(--go); }
.daylist .shut {
  color: #8a929c;
  background: var(--sky);
  border-style: dashed;
}
.daylist .shut small { display: block; font-weight: 400; font-size: 0.7rem; }

.meter {
  font-size: 1.2rem;
  font-weight: 700;
  padding: 0.75rem 1rem;
  background: var(--paper);
  border: 2px solid var(--edge);
  border-radius: var(--round);
  display: inline-block;
}

/* ------------------------------------------------------------------ the rest */

.note {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.foot {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--edge);
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.foot a { color: var(--ink-soft); }

.grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
}

table.plain {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85rem;
}
table.plain th, table.plain td {
  border: 1px solid var(--edge);
  padding: 0.4rem;
  text-align: left;
  vertical-align: top;
}

@media (max-width: 33rem) {
  html { font-size: 18px; }
  .wrap { padding: 0.75rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .card, .option, .slot { transition: border-color 120ms, background 120ms; }
}

/* ------------------------------------------------- the wall, and signing in */

.wallcard {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border: 3px solid var(--edge);
  border-radius: var(--round);
  background: var(--paper);
  justify-items: center;
}
.wallcard .made { border-width: 3px; padding: 0.6rem; width: 100%; }
.wallcard .caption { font-size: 1rem; color: var(--right); }
.wallcard .btn { min-height: var(--tap); font-size: 0.9rem; padding: 0.4rem 0.8rem; }

.daytab {
  display: block;
  width: 100%;
  min-height: var(--tap);
  padding: 0.6rem 0.4rem;
  border: 3px solid var(--edge);
  border-radius: 0.6rem;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.daytab.on { border-color: var(--go); background: var(--sky); }

.signin {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 2px dashed var(--edge);
  border-radius: var(--round);
  background: var(--paper);
}
.signin .note { margin: 0.5rem 0 0; }
.mypic { font-size: 2rem; vertical-align: middle; }
.cardface {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}
