/* ============================================
   Ms. Doria's Class, Fancy Pants style
   Hand-drawn notebook doodle aesthetic:
   ink-on-paper, wobbly borders, sketchy fonts
   Fonts: Rock Salt (display) + Gochi Hand (body)
   ============================================ */

:root {
  --paper: #fdfcf5;
  --paper-shade: #f5f2e8;
  --ink: #26221f;
  --ink-soft: #4a443e;
  --purple: #6d28c9;
  --purple-light: #b28ae8;
  --purple-wash: #ece2fa;
  --pencil-yellow: #f5c531;
  --pencil-green: #6fbf4c;
  --pencil-blue: #5aa9d6;
  --pencil-red: #e05656;

  /* the hand-drawn wobbly border trick */
  --wobble: 255px 25px 225px 25px / 25px 225px 25px 255px;
  --wobble-2: 25px 255px 25px 225px / 225px 25px 255px 25px;
  --wobble-3: 125px 20px 155px 20px / 20px 155px 20px 125px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.15rem;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* sketchbook paper: faint dot grid (ruled lines read as strikethrough over text) */
  background-color: var(--paper);
  background-image: radial-gradient(rgba(74, 68, 62, 0.13) 1.2px, transparent 1.2px);
  background-size: 26px 26px;
}

h1, h2, h3, .display {
  font-family: 'Rock Salt', cursive;
}

/* ---------- Header: like a strip of paper taped on ---------- */
.site-header {
  background: var(--paper);
  border-bottom: 3px solid var(--ink);
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  position: relative;
}

.site-header .logo {
  font-family: 'Rock Salt', cursive;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: rotate(-1.5deg);
}

.site-header .logo:hover { transform: rotate(1deg) scale(1.03); }

.site-header nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.site-header nav a {
  font-family: 'Gochi Hand', cursive;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.15rem;
  padding: 0.3rem 1rem;
  border: 2.5px solid transparent;
  border-radius: var(--wobble-3);
  transition: transform 0.15s;
}

.site-header nav a:hover {
  border-color: var(--ink);
  transform: rotate(-2deg);
}

.site-header nav a.active {
  border-color: var(--ink);
  background: var(--purple-wash);
  transform: rotate(1.5deg);
}

/* ---------- Layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.site-footer {
  text-align: center;
  padding: 1.25rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
  border-top: 3px dashed var(--ink);
  background: var(--paper);
}

.site-footer .paws { letter-spacing: 0.5rem; }

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
}

.hero h1 {
  font-size: clamp(1.5rem, 4.5vw, 2.6rem);
  line-height: 1.5;
  color: var(--ink);
}

.hero h1 .scribble-purple {
  color: var(--purple);
  position: relative;
  display: inline-block;
}

/* hand-drawn squiggle underline (pseudo-element: Rock Salt's font metrics
   make the span's content box huge, so a bottom background paints too low) */
.hero h1 .scribble-purple::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='12' viewBox='0 0 120 12'%3E%3Cpath d='M2 8 Q 15 2, 30 7 T 60 7 T 90 6 T 118 8' fill='none' stroke='%236d28c9' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
}

.hero h1 .wiggle {
  display: inline-block;
  animation: wiggle 2.5s ease-in-out infinite;
}

@keyframes wiggle {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

.hero p.tagline {
  margin-top: 1rem;
  font-size: 1.35rem;
  color: var(--ink-soft);
  transform: rotate(-0.5deg);
}

/* ---------- Day badge: doodled pill ---------- */
.day-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.5rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: 0.55rem 1.2rem;
  font-size: 1.2rem;
  transform: rotate(-1deg);
  box-shadow: 3px 4px 0 rgba(38, 34, 31, 0.25);
}

.day-badge button {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.15rem;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.25rem 1rem;
  cursor: pointer;
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.15s, background 0.2s;
}

.day-badge button.selected-a {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--paper);
  transform: rotate(-3deg) scale(1.08);
}

.day-badge button.selected-b {
  background: var(--pencil-green);
  border-color: var(--ink);
  color: var(--ink);
  transform: rotate(3deg) scale(1.08);
}

.day-badge button:hover { transform: rotate(-2deg) scale(1.08); }

/* ---------- Game cards: index cards taped at angles ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.6rem;
  margin-top: 2.2rem;
}

.game-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: 1.7rem 1.4rem 1.5rem;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 4px 5px 0 rgba(38, 34, 31, 0.22);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
}

.card-grid .game-card:nth-child(odd) { transform: rotate(-1.2deg); }
.card-grid .game-card:nth-child(even) { transform: rotate(1.3deg); }

.game-card:hover {
  transform: rotate(0deg) translateY(-6px) !important;
  box-shadow: 6px 9px 0 rgba(109, 40, 201, 0.35);
}

/* washi tape strip on top of each card */
.game-card::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 22px;
  transform: translateX(-50%) rotate(-4deg);
  background: rgba(178, 138, 232, 0.5);
  border-left: 2px dashed rgba(38, 34, 31, 0.25);
  border-right: 2px dashed rgba(38, 34, 31, 0.25);
}

.game-card .emoji {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 0.6rem;
}

.game-card h3 {
  font-size: 1.15rem;
  color: var(--purple);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.game-card p {
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

.game-card .badge {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  font-family: 'Gochi Hand', cursive;
  background: transparent;
  color: var(--pencil-red);
  border: 2.5px solid var(--pencil-red);
  border-radius: var(--wobble-3);
  font-size: 0.85rem;
  padding: 0.1rem 0.6rem;
  transform: rotate(8deg);
  letter-spacing: 0.03em;
}

.game-card.soon { opacity: 0.7; cursor: default; }
.game-card.soon:hover {
  transform: rotate(-1.2deg) !important;
  box-shadow: 4px 5px 0 rgba(38, 34, 31, 0.22);
}
.game-card.soon .badge { color: var(--pencil-blue); border-color: var(--pencil-blue); }

/* ---------- Bell ringer: highlighted note ---------- */
.bell-ringer {
  margin-top: 2.5rem;
  background: var(--purple-wash);
  border: 3px solid var(--ink);
  border-radius: var(--wobble-2);
  padding: 1.6rem;
  text-align: center;
  transform: rotate(0.5deg);
  box-shadow: 4px 5px 0 rgba(38, 34, 31, 0.22);
}

.bell-ringer h2 {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.6;
}

.bell-ringer p { margin-top: 0.7rem; font-size: 1.25rem; color: var(--ink-soft); }

/* ---------- Game page shells ---------- */
.game-page { text-align: center; }

.game-page h1 {
  font-size: clamp(1.4rem, 4.5vw, 2.1rem);
  color: var(--ink);
  line-height: 1.6;
}

.game-page .subtitle {
  margin-top: 0.7rem;
  margin-bottom: 1.6rem;
  font-size: 1.25rem;
  color: var(--ink-soft);
}

/* ---------- Wordle: penciled grid ---------- */
.wordle-board {
  display: grid;
  gap: 7px;
  margin: 0 auto 1.5rem;
  width: min(330px, 90vw);
}

.wordle-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 7px;
}

.wordle-tile {
  aspect-ratio: 1;
  border: 2.5px solid var(--ink-soft);
  border-radius: var(--wobble-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Gochi Hand', cursive;
  font-size: 2rem;
  text-transform: uppercase;
  background: var(--paper);
  transition: transform 0.1s;
}

.wordle-row:nth-child(odd) .wordle-tile:nth-child(even),
.wordle-row:nth-child(even) .wordle-tile:nth-child(odd) {
  border-radius: var(--wobble-2);
}

.wordle-tile.filled { border-color: var(--ink); transform: scale(1.06) rotate(-1deg); }
.wordle-tile.correct { background: var(--pencil-green); border-color: var(--ink); color: var(--ink); transform: rotate(-2deg); }
.wordle-tile.present { background: var(--pencil-yellow); border-color: var(--ink); color: var(--ink); transform: rotate(2deg); }
.wordle-tile.absent  { background: var(--paper-shade); border-color: var(--ink-soft); color: var(--ink-soft); opacity: 0.65; }

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  margin-top: 0.5rem;
}

.keyboard-row { display: flex; gap: 6px; }

.key {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.05rem;
  padding: 0.7rem 0.55rem;
  min-width: 2.1rem;
  border: 2px solid var(--ink);
  border-radius: var(--wobble-3);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  text-transform: uppercase;
  transition: transform 0.12s, background 0.15s;
  box-shadow: 2px 2px 0 rgba(38, 34, 31, 0.25);
}

.key.wide { padding: 0.7rem 0.7rem; font-size: 0.85rem; }
.key:hover { transform: rotate(-2deg) scale(1.08); background: var(--purple-wash); }
.key:active { transform: translateY(2px); box-shadow: none; }
.key.correct { background: var(--pencil-green); }
.key.present { background: var(--pencil-yellow); }
.key.absent  { background: var(--paper-shade); color: var(--ink-soft); opacity: 0.55; box-shadow: none; }

/* ---------- Connections: scribbled tiles ---------- */
.connections-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  max-width: 560px;
  margin: 0 auto 1.2rem;
}

.conn-tile {
  font-family: 'Gochi Hand', cursive;
  font-size: clamp(0.7rem, 2.2vw, 1.05rem);
  text-transform: uppercase;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  background: var(--paper);
  color: var(--ink);
  padding: 0;
  aspect-ratio: 2.1 / 1;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s;
  word-break: break-word;
  line-height: 1.15;
  box-shadow: 2px 3px 0 rgba(38, 34, 31, 0.2);
}

.connections-grid .conn-tile:nth-child(3n) { transform: rotate(-1deg); }
.connections-grid .conn-tile:nth-child(3n+1) { transform: rotate(0.8deg); }

.conn-tile:hover { transform: scale(1.05) rotate(-1.5deg); background: var(--purple-wash); }
.conn-tile.selected {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--paper);
  transform: scale(0.95) rotate(1deg);
  box-shadow: none;
}

.solved-group {
  grid-column: 1 / -1;
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: 0.75rem;
  color: var(--ink);
  animation: pop-in 0.35s ease;
  box-shadow: 3px 4px 0 rgba(38, 34, 31, 0.2);
}

@keyframes pop-in {
  from { transform: scale(0.85) rotate(-3deg); opacity: 0; }
  to { transform: scale(1) rotate(0deg); opacity: 1; }
}

.solved-group .group-name {
  font-family: 'Rock Salt', cursive;
  font-size: 0.85rem;
  text-transform: uppercase;
}

.solved-group .group-words { font-size: 1.05rem; margin-top: 4px; }

.solved-yellow { background: var(--pencil-yellow); }
.solved-green  { background: var(--pencil-green); }
.solved-blue   { background: var(--pencil-blue); }
.solved-purple { background: var(--purple-light); }

.conn-controls {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

.mistakes {
  margin: 0.6rem 0 1rem;
  font-size: 1.2rem;
  color: var(--ink-soft);
}

/* ---------- Buttons & toast ---------- */
.btn {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.15rem;
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  padding: 0.55rem 1.5rem;
  cursor: pointer;
  transition: transform 0.15s;
  box-shadow: 3px 4px 0 rgba(38, 34, 31, 0.25);
}

.btn:hover { transform: rotate(-1.5deg) scale(1.05); }
.btn:active { transform: translateY(2px); box-shadow: none; }
.btn-primary { background: var(--purple); color: var(--paper); border-color: var(--purple); }
.btn-outline { background: var(--paper); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }

.toast {
  position: fixed;
  top: 5.2rem;
  left: 50%;
  transform: translateX(-50%) rotate(-1.5deg);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Gochi Hand', cursive;
  font-size: 1.2rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--wobble);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 50;
}

.toast.show { opacity: 1; }

/* ---------- Pickers & forms ---------- */
.picker {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.picker select,
.picker input,
.admin-panel textarea {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.15rem;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.5rem 1rem;
  max-width: 100%;
}

.picker select:focus,
.picker input:focus,
.admin-panel textarea:focus {
  outline: 3px solid var(--purple-light);
}

.day-label { color: var(--purple); }
.day-label.day-2 { color: var(--pencil-green); }

.error-text { color: var(--pencil-red); margin-top: 0.6rem; }

.switch-links { margin-top: 0.8rem; font-size: 0.95rem; }
.switch-links a { color: var(--ink-soft); }

.admin-link { margin-top: 0.4rem; font-size: 0.95rem; }
.admin-link a { color: var(--ink-soft); }

/* ---------- Admin panels ---------- */
.admin-panel {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: 4px 5px 0 rgba(38, 34, 31, 0.22);
  padding: 1.6rem;
  margin-top: 2rem;
  text-align: center;
}

.admin-panel h2 { font-size: 1.25rem; line-height: 1.6; }
.admin-panel p { margin-top: 0.5rem; color: var(--ink-soft); }

.admin-panel textarea {
  width: min(420px, 100%);
  margin-top: 1rem;
  resize: vertical;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.2rem;
  text-align: left;
}

.theme-box h3 { font-size: 1rem; line-height: 1.6; color: var(--purple); }

.theme-box input {
  display: block;
  width: 100%;
  margin-top: 0.7rem;
  font-family: 'Gochi Hand', cursive;
  font-size: 1.1rem;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.5rem 1rem;
}

.theme-box input:focus { outline: 3px solid var(--purple-light); }

.ai-status { font-size: 1rem; opacity: 0.8; }

.roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 1.2rem;
  text-align: left;
}

.roster-grid h3 { font-size: 1rem; line-height: 1.6; color: var(--purple); }

.roster-list { list-style: none; margin-top: 0.7rem; }

.roster-list li {
  padding: 0.35rem 0;
  border-bottom: 2px dashed rgba(38, 34, 31, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.roster-list li.empty { color: var(--ink-soft); border: none; }

.remove-btn {
  font-family: 'Gochi Hand', cursive;
  font-size: 0.85rem;
  background: none;
  border: 2px solid var(--pencil-red);
  border-radius: var(--wobble-3);
  color: var(--pencil-red);
  padding: 0.1rem 0.6rem;
  cursor: pointer;
}

.remove-btn:hover { background: var(--pencil-red); color: var(--paper); }

/* ---------- Word Scramble ---------- */
.scramble-progress { font-size: 1.3rem; color: var(--purple); margin-bottom: 1rem; }

.scramble-letters {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.3rem;
  min-height: 3.5rem;
}

.scramble-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  background: var(--purple-wash);
  font-family: 'Gochi Hand', cursive;
  font-size: 1.9rem;
  box-shadow: 2px 3px 0 rgba(38, 34, 31, 0.2);
}

.scramble-tile:nth-child(odd) { transform: rotate(-3deg); }
.scramble-tile:nth-child(even) { transform: rotate(2.5deg); }

.scramble-input {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
  flex-wrap: wrap;
}

.scramble-input input {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.4rem;
  text-transform: uppercase;
  text-align: center;
  width: min(300px, 80vw);
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.5rem 1rem;
}

.scramble-input input:focus { outline: 3px solid var(--purple-light); }

.scramble-done { margin-top: 1.5rem; }
.scramble-done h2 { font-size: 1.4rem; line-height: 1.6; color: var(--purple); }
.scramble-done p { font-size: 1.4rem; margin-top: 0.5rem; }

/* ---------- Class board (smartboard view) ---------- */
.board-page { max-width: 1100px; }

.board-title {
  text-align: center;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  line-height: 1.5;
  color: var(--purple);
}

.board-date {
  text-align: center;
  font-size: 1.4rem;
  color: var(--ink-soft);
  margin: 0.5rem 0 1.5rem;
}

.board-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--radius, 18px);
  box-shadow: 5px 6px 0 rgba(38, 34, 31, 0.22);
  overflow: hidden;
  font-size: 1.35rem;
}

.board-table th {
  font-family: 'Rock Salt', cursive;
  font-size: 1rem;
  padding: 0.9rem 0.7rem;
  border-bottom: 3px solid var(--ink);
  background: var(--purple-wash);
}

.board-table td {
  padding: 0.7rem;
  text-align: center;
  border-bottom: 2px dashed rgba(38, 34, 31, 0.18);
}

.board-table tr:last-child td { border-bottom: none; }

.board-table .student-name { text-align: left; padding-left: 1.2rem; font-size: 1.4rem; }
.board-table .done { color: var(--ink); background: rgba(111, 191, 76, 0.25); }
.board-table .lost { color: var(--ink); background: rgba(245, 197, 49, 0.3); }
.board-table .waiting { color: var(--ink-soft); opacity: 0.6; }
.board-table .total { font-family: 'Rock Salt', cursive; font-size: 1.05rem; color: var(--purple); }

.board-note {
  text-align: center;
  margin-top: 1rem;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* ---------- Mini crossword ---------- */
:root { --mini-cell: clamp(2.1rem, 7vw, 3rem); }

.mini-wrap {
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
}

.mini-grid {
  display: grid;
  gap: 3px;
}

.mini-cell {
  width: var(--mini-cell);
  height: var(--mini-cell);
  position: relative;
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  background: var(--paper);
}

.mini-cell.blank { border-color: transparent; background: transparent; }

.mini-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 0.55rem;
  font-family: 'Nunito', sans-serif;
  font-weight: bold;
  color: var(--ink-soft);
  pointer-events: none;
}

.mini-cell input {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-family: 'Gochi Hand', cursive;
  font-size: calc(var(--mini-cell) * 0.55);
  color: var(--ink);
  text-transform: uppercase;
  caret-color: var(--purple);
}

.mini-cell.in-word { background: var(--purple-wash); }
.mini-cell input:focus { outline: none; background: var(--purple-light); border-radius: 4px; }

.mini-active-clue {
  max-width: 560px;
  margin: 0 auto 1.2rem;
  background: var(--purple-wash);
  border: 3px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.7rem 1.2rem;
  font-size: 1.25rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 4px 0 rgba(38, 34, 31, 0.2);
}

.mini-active-clue b { color: var(--purple); margin-right: 0.5rem; white-space: nowrap; }

.mini-clues li.active { color: var(--purple); font-weight: bold; }
.mini-cell input.wrong { color: var(--pencil-red); background: rgba(224, 86, 86, 0.15); }
.mini-cell input.correct { color: var(--ink); background: rgba(111, 191, 76, 0.25); }

.mini-clues {
  text-align: left;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  max-width: 340px;
}

.mini-clues h3 {
  font-size: 0.95rem;
  color: var(--purple);
  line-height: 1.6;
}

.mini-clues ol {
  margin: 0.5rem 0 1rem 1.4rem;
  font-size: 1.05rem;
}

.mini-clues li { margin-bottom: 0.35rem; cursor: pointer; }
.mini-clues li:hover { color: var(--purple); }

/* ---------- Admin answer key ---------- */
.answer-key { text-align: left; margin-top: 1rem; }
.answer-key h3 { font-size: 0.95rem; color: var(--purple); margin-top: 1rem; line-height: 1.6; }
.answer-key p, .answer-key li { font-size: 1.1rem; }
.answer-key ul { margin-left: 1.4rem; }
.answer-key .key-word { color: var(--purple); }

.key-btn {
  font-size: 0.85rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  cursor: pointer;
  vertical-align: middle;
}

.key-btn:hover { background: var(--purple-wash); transform: rotate(-3deg); }

.storage-warning {
  background: rgba(224, 86, 86, 0.15);
  border: 3px dashed var(--pencil-red);
  border-radius: var(--wobble-3);
  padding: 0.9rem 1.2rem;
  margin-bottom: 1.2rem;
  font-size: 1.1rem;
}

.key-warn {
  background: rgba(245, 197, 49, 0.25);
  border: 2px dashed var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.5rem 0.9rem;
  margin-top: 0.6rem;
  font-size: 1.05rem;
}

/* ---------- Data tables ---------- */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 1rem;
  font-size: 1.05rem;
}

.data-table th {
  font-family: 'Rock Salt', cursive;
  font-size: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-bottom: 3px solid var(--ink);
  background: var(--purple-wash);
}

.data-table td {
  padding: 0.45rem 0.5rem;
  text-align: center;
  border-bottom: 2px dashed rgba(38, 34, 31, 0.15);
}

.data-table td:first-child { text-align: left; padding-left: 1rem; }
.data-table tr:last-child td { border-bottom: none; }

/* ---------- Teacher toggle (lives in the header bar) ---------- */
.nav-teacher {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--purple-wash);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.3rem 1rem;
  margin-left: 0.6rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}

.nav-teacher:hover { transform: rotate(-2deg) scale(1.05); background: var(--purple-light); }

/* ---------- Calendar ---------- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.2rem 0 0.8rem;
}

.cal-nav h3 { font-size: 1.05rem; line-height: 1.6; min-width: 12rem; }

.cal-head {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  min-height: 3.6rem;
  border: 2px solid rgba(38, 34, 31, 0.25);
  border-radius: 8px;
  padding: 0.2rem 0.3rem;
  text-align: left;
  cursor: pointer;
  background: var(--paper);
  position: relative;
}

.cal-cell.out { opacity: 0.25; cursor: default; }
.cal-cell.weekend { background: var(--paper-shade); opacity: 0.6; }
.cal-cell.d1 { background: var(--purple-wash); border-color: var(--purple); }
.cal-cell.d2 { background: rgba(111, 191, 76, 0.2); border-color: var(--pencil-green); }
.cal-cell.closed { background: rgba(224, 86, 86, 0.12); }
.cal-cell.override { border-width: 3px; border-style: dashed; border-color: var(--ink); }
.cal-cell.selected { outline: 3px solid var(--pencil-yellow); }

.cal-date { font-size: 0.85rem; font-weight: bold; }

.cal-badge {
  display: block;
  font-size: 0.72rem;
  margin-top: 0.15rem;
  color: var(--ink-soft);
}

.cal-cell.d1 .cal-badge { color: var(--purple); }
.cal-cell.d2 .cal-badge { color: #3f7a26; }

.cal-actions { margin-top: 1rem; }
.cal-actions .picker { margin-top: 0.6rem; }
.cal-actions .btn { font-size: 0.95rem; padding: 0.4rem 1rem; }

/* ---------- Admin sidebar tabs ---------- */
.admin-layout {
  display: flex;
  gap: 1.6rem;
  align-items: flex-start;
  margin-top: 1rem;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 180px;
  position: sticky;
  top: 1rem;
}

.tab-btn {
  font-family: 'Gochi Hand', cursive;
  font-size: 1.15rem;
  text-align: left;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: var(--wobble-3);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  box-shadow: 2px 3px 0 rgba(38, 34, 31, 0.2);
  transition: transform 0.15s, background 0.2s;
}

.tab-btn:hover { transform: rotate(-1.5deg) scale(1.04); background: var(--purple-wash); }

.tab-btn.active {
  background: var(--purple);
  border-color: var(--purple);
  color: var(--paper);
  transform: rotate(1deg);
}

.admin-content { flex: 1; min-width: 0; }
.admin-content .admin-panel:first-child { margin-top: 0; }

@media (max-width: 640px) {
  .admin-layout { flex-direction: column; }
  .admin-sidebar { flex-direction: row; flex-wrap: wrap; position: static; min-width: 0; }
}

/* ---------- Board scribbles & podium ---------- */
.time-scribble {
  width: 3.4rem;
  height: 1.1rem;
  color: var(--ink-soft);
  vertical-align: middle;
}

.board-controls {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

.podium-overlay[hidden] { display: none; }

.podium-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 34, 31, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.podium-card {
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--wobble);
  box-shadow: 6px 8px 0 rgba(38, 34, 31, 0.4);
  padding: 2rem 1.5rem;
  text-align: center;
  width: min(760px, 96vw);
  animation: pop-in 0.35s ease;
}

.podium-title {
  font-size: clamp(1.3rem, 3.5vw, 1.9rem);
  line-height: 1.5;
  color: var(--purple);
}

.podium-row {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin: 1.8rem 0 1.5rem;
}

.podium-spot { flex: 1; max-width: 220px; }
.podium-spot.empty-spot { visibility: hidden; }

.podium-medal { font-size: 2.6rem; }
.podium-spot.first .podium-medal { font-size: 3.4rem; animation: wiggle 2.5s ease-in-out infinite; }

.podium-name {
  font-family: 'Rock Salt', cursive;
  font-size: 1rem;
  line-height: 1.5;
  margin: 0.4rem 0;
}

.podium-games { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0.5rem; }

.podium-block {
  border: 3px solid var(--ink);
  border-radius: var(--wobble-3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 3px 4px 0 rgba(38, 34, 31, 0.25);
}

.podium-spot.first .podium-block { height: 7.5rem; background: var(--pencil-yellow); }
.podium-spot.second .podium-block { height: 5.5rem; background: var(--purple-light); }
.podium-spot.third .podium-block { height: 4rem; background: var(--pencil-blue); }

.podium-total {
  font-family: 'Rock Salt', cursive;
  font-size: 1.3rem;
  color: var(--ink);
}

.podium-empty { font-size: 1.25rem; margin-bottom: 1.2rem; }

.podium-fastest {
  border-top: 3px dashed rgba(38, 34, 31, 0.25);
  margin: 0.5rem 0 1.2rem;
  padding-top: 0.8rem;
  font-size: 1.05rem;
  text-align: right;
}

.podium-fastest h3 {
  font-size: 0.85rem;
  color: var(--purple);
  line-height: 1.6;
}

.podium-fastest div { margin-top: 0.15rem; }

@media (max-width: 560px) {
  .podium-row { flex-direction: column; align-items: stretch; }
  .podium-spot { max-width: none; }
  .podium-spot.first .podium-block,
  .podium-spot.second .podium-block,
  .podium-spot.third .podium-block { height: 3.2rem; }
}

/* ---------- 404 ---------- */
.lost {
  text-align: center;
  padding: 4rem 1rem;
}

.lost .emoji { font-size: 5rem; }
.lost h1 { color: var(--ink); font-size: 1.8rem; margin-top: 1rem; line-height: 1.6; }
.lost p { margin-top: 0.8rem; font-size: 1.3rem; }
.lost a { color: var(--purple); }

@media (max-width: 480px) {
  .key { min-width: 1.65rem; padding: 0.6rem 0.4rem; }
}
