/* One look for both pages: the kids' page (index.html) and the teacher's (teacher.html). */
:root {
  color-scheme: light dark;
  --ground: #fbf7f0; --card: #ffffff; --words: #1d2433; --quiet: #5b6577; --edge: #cfc7b8;
  --accent: #4338ca; --on-accent: #ffffff; --glow: #eceafd; --trouble: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #12161d; --card: #1b222c; --words: #e6edf3; --quiet: #9aa7b5; --edge: #3a4756;
    --accent: #a5b4fc; --on-accent: #12161d; --glow: #252b4a; --trouble: #ffb4ab;
  }
}
* { box-sizing: border-box; }
/* The pages show and put away their parts with the hidden attribute, and it has to win over display: grid below. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--ground); color: var(--words); font: 18px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
main { max-width: 680px; margin: 0 auto; padding: 40px 16px 64px; display: grid; gap: 20px; }
main.wide { max-width: 1040px; }
h1 { margin: 0; font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
form, section { display: grid; gap: 14px; }
label { font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
input[type="text"], input[type="password"] {
  flex: 1 1 200px; min-width: 0; font: inherit; padding: 12px 14px;
  border: 2px solid var(--edge); border-radius: 10px; background: var(--card); color: var(--words);
}
button {
  font: inherit; font-weight: 600; padding: 12px 20px; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--on-accent); cursor: pointer;
}
button:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
/* The line under a box that says what is happening. It keeps its height when empty so nothing jumps. */
.says { min-height: 1.5em; font-weight: 600; }
.says.trouble { color: var(--trouble); }

/* Where a picture is dropped. The whole box is the label of the file chooser inside it, so a click anywhere opens
   the chooser. The chooser itself is too small to see but the keyboard still reaches it. */
.zone {
  position: relative; display: grid; justify-items: center; gap: 6px; padding: 52px 20px; text-align: center;
  border: 3px dashed var(--edge); border-radius: 18px; background: var(--card); color: var(--quiet);
  font-weight: 400; cursor: pointer; transition: border-color 120ms, background 120ms;
}
.zone .big { font-size: 1.5rem; font-weight: 700; color: var(--words); }
.zone .small { font-size: 0.9rem; }
.zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.zone:focus-within, .zone.over { border-color: var(--accent); }
.zone.over { background: var(--glow); }
.zone.busy { opacity: 0.6; cursor: progress; }

/* One row for each picture sent: its file name, the line for Twine, and the button that copies the line. */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lines li {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 14px 16px;
  background: var(--card); border: 2px solid var(--edge); border-radius: 14px;
}
.lines li.fresh { border-color: var(--accent); }
.lines .name { grid-column: 1 / -1; font-size: 0.9rem; color: var(--quiet); overflow-wrap: anywhere; }
.lines code { font: 0.9rem/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }

/* The teacher's page: every picture, in a grid. */
.wall { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.wall li {
  display: grid; gap: 8px; align-content: start; padding: 12px;
  background: var(--card); border: 2px solid var(--edge); border-radius: 14px;
}
.wall .look { display: block; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--ground); }
.wall img { display: block; width: 100%; height: 100%; object-fit: contain; }
.wall .name { font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.wall .when { font-size: 0.8rem; color: var(--quiet); }
.wall button { padding: 8px 12px; background: transparent; color: var(--trouble); border: 2px solid var(--edge); }
