@font-face { font-family: "Poppins"; font-weight: 400; src: url(fonts/Poppins-Regular.ttf); }
@font-face { font-family: "Poppins"; font-weight: 500; src: url(fonts/Poppins-Medium.ttf); }
@font-face { font-family: "Poppins"; font-weight: 600; src: url(fonts/Poppins-SemiBold.ttf); }
@font-face { font-family: "Poppins"; font-weight: 700; src: url(fonts/Poppins-Bold.ttf); }

:root {
  --ink: #10201A; --ink2: #1A3128; --green: #04965F; --mint: #E3F2EA; --light: #7CC9A4;
  --gold: #F5C443; --gold2: #E0A91C; --red: #E2574C; --white: #FFFFFF; --grey: #9DB3A9;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(ellipse at top, #1D3A2E 0%, var(--ink) 60%) fixed, var(--ink);
  color: var(--white); font-family: "Poppins", system-ui, sans-serif; overflow-x: hidden;
  -webkit-user-select: none; user-select: none;
}
button { font-family: inherit; cursor: pointer; border: 0; }
input { font-family: inherit; }

/* ---------------------------------------------------------------- top bar */
header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px;
  padding: 10px 20px; background: rgba(16, 32, 26, .92); border-bottom: 1px solid #24443A;
}
header[hidden] { display: none; }
header .who { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
header .who b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
header .who span { font-size: 13px; color: var(--light); }
header .dots { flex: 1; display: flex; justify-content: center; gap: 8px; }
.dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px;
       background: #24443A; color: #5E8576; }
.dot.done { background: var(--gold); color: var(--ink); }
.dot.now { outline: 3px solid var(--light); outline-offset: 2px; color: var(--white); }
header .clock { display: flex; gap: 6px; align-items: center; font-size: 20px; font-variant-numeric: tabular-nums; }

main { max-width: 1000px; margin: 0 auto; padding: 24px 20px 90px; }
.screen { animation: rise .35s ease-out; text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

h1 { font-size: clamp(40px, 7vw, 72px); line-height: 1; margin: 18px 0 8px; letter-spacing: -1px; }
h1 .dot-g { color: var(--green); }
h2 { font-size: clamp(28px, 4.5vw, 42px); margin: 8px 0 6px; line-height: 1.1; }
.kicker { color: var(--light); font-weight: 600; letter-spacing: 3px; font-size: 14px; text-transform: uppercase; }
.lead { font-size: clamp(18px, 2.6vw, 24px); color: #CFE3DA; margin: 6px auto 20px; max-width: 720px; line-height: 1.4; }
.big-icon { font-size: 96px; line-height: 1; margin: 10px 0; filter: drop-shadow(0 6px 16px rgba(0,0,0,.4)); }

.card { background: var(--ink2); border: 1px solid #2B5446; border-radius: 26px; padding: 24px; margin: 16px auto; max-width: 820px; }
.btn { background: var(--green); color: var(--white); font-weight: 700; font-size: 22px; padding: 16px 34px; border-radius: 999px;
       box-shadow: 0 6px 0 #036B44; transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #036B44; }
.btn.gold { background: var(--gold); color: var(--ink); box-shadow: 0 6px 0 var(--gold2); }
.btn.ghost { background: transparent; border: 2px solid #3C6B5B; box-shadow: none; color: #CFE3DA; font-size: 17px; padding: 10px 22px; }
.btn[disabled] { opacity: .35; pointer-events: none; }
.row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.msg { min-height: 34px; font-size: 20px; font-weight: 600; margin: 10px 0; }
.msg.bad { color: #FF9B91; } .msg.good { color: var(--gold); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }

/* ---------------------------------------------------------------- welcome */
.field { display: block; text-align: left; max-width: 460px; margin: 14px auto; }
.field span { display: block; font-size: 15px; color: var(--light); font-weight: 600; margin-bottom: 6px; }
.field input { width: 100%; font-size: 26px; padding: 14px 18px; border-radius: 16px; border: 2px solid #3C6B5B;
               background: #0C1914; color: var(--white); text-transform: uppercase; letter-spacing: 2px; outline: none; }
.field input.cls { text-transform: none; letter-spacing: 0; }
.field input:focus { border-color: var(--light); }

/* tap your year, then your class (no typing) */
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 760px; margin: 16px auto 6px; }
.pick { background: var(--mint); color: var(--ink); border-radius: 22px; padding: 22px 8px; font-size: clamp(20px, 3vw, 28px);
        font-weight: 700; box-shadow: 0 6px 0 #A9CDBC; display: flex; flex-direction: column; align-items: center; gap: 2px;
        transition: transform .08s; }
.pick:active { transform: translateY(4px); box-shadow: 0 2px 0 #A9CDBC; }
.pick small { font-size: 14px; font-weight: 600; }
.pick.off { background: #24443A; color: #7C9A8E; box-shadow: none; opacity: .55; pointer-events: none; }
.dym.small { font-size: 15px; color: var(--grey); }
@media (max-width: 560px) { .picks { grid-template-columns: repeat(2, 1fr); } }

/* ---------------------------------------------------------------- code entry */
.slots { display: flex; gap: 12px; justify-content: center; margin: 14px 0; }
.slot { width: 86px; height: 86px; border-radius: 20px; background: #0C1914; border: 3px dashed #3C6B5B; font-size: 52px;
        display: grid; place-items: center; }
.slot.full { border-style: solid; border-color: var(--light); }
.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; max-width: 640px; margin: 10px auto; }
.key { font-size: 44px; background: var(--ink2); border: 2px solid #2B5446; border-radius: 18px; padding: 10px 0; }
.key:active { background: #2B5446; }

/* ---------------------------------------------------------------- clue / golden letter */
.letters { display: flex; gap: 10px; justify-content: center; margin: 12px 0; }
.gl { width: 56px; height: 66px; border-radius: 14px; display: grid; place-items: center; font-size: 34px; font-weight: 700;
      background: #24443A; color: #5E8576; }
.gl.got { background: linear-gradient(160deg, #FFE08A, var(--gold) 45%, var(--gold2)); color: var(--ink); box-shadow: 0 4px 14px rgba(245, 196, 67, .35); }
.golden { font-size: 120px; font-weight: 700; width: 170px; height: 190px; margin: 6px auto; border-radius: 32px; display: grid; place-items: center;
          color: var(--ink); background: linear-gradient(160deg, #FFE08A, var(--gold) 45%, var(--gold2)); animation: pop .6s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { from { transform: scale(.2) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }
.clue { font-size: clamp(22px, 3.2vw, 32px); font-weight: 600; line-height: 1.35; color: var(--white); }

/* ---------------------------------------------------------------- puzzles */
.puzzle-head { display: flex; align-items: center; justify-content: center; gap: 14px; }
.puzzle-head .big-icon { font-size: 60px; margin: 0; }
.instr { font-size: 20px; color: #CFE3DA; margin: 4px 0 12px; }
.tools { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }

.wslots { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0; }
.wslot { width: 64px; height: 74px; border-radius: 14px; border: 3px dashed #3C6B5B; display: grid; place-items: center; font-size: 38px; font-weight: 700; position: relative; }
.wslot.full { border-style: solid; border-color: var(--light); background: #0C1914; }
.wslot .ghost { color: #3C6B5B; position: absolute; }
.tiles { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 16px 0; }
.tile { width: 70px; height: 76px; border-radius: 16px; background: var(--mint); color: var(--ink); font-size: 40px; font-weight: 700; box-shadow: 0 5px 0 #A9CDBC; }
.tile.used { visibility: hidden; }
.pic { font-size: 84px; line-height: 1.1; }

.facts { display: flex; flex-direction: column; gap: 10px; align-items: center; margin: 8px 0 14px; }
.fact { font-size: clamp(30px, 5vw, 46px); font-weight: 600; background: var(--ink2); border-radius: 18px; padding: 6px 26px; }
.ask { font-size: clamp(34px, 6vw, 54px); font-weight: 700; color: var(--gold); }
.numshow { font-size: 54px; font-weight: 700; min-width: 180px; padding: 4px 20px; border-radius: 18px; background: #0C1914; border: 3px solid #3C6B5B; display: inline-block; min-height: 82px; }
.numpad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; max-width: 620px; margin: 12px auto; }
.numpad button { font-size: 34px; font-weight: 700; background: var(--ink2); color: var(--white); border: 2px solid #2B5446; border-radius: 16px; padding: 12px 0; }

.pads { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 520px; margin: 14px auto; }
.pad { height: 150px; border-radius: 30px; font-size: 64px; opacity: .55; transition: opacity .1s, transform .1s; }
.pad.lit { opacity: 1; transform: scale(1.05); box-shadow: 0 0 40px rgba(255,255,255,.45); }

.target { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 8px 0; }
.swatch { width: 130px; height: 130px; border-radius: 50%; border: 6px solid var(--white); box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.pots { display: flex; gap: 16px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pot { width: 100px; height: 100px; border-radius: 50%; border: 6px solid transparent; box-shadow: 0 6px 0 rgba(0,0,0,.35); font-size: 15px; font-weight: 700; }
.pot.sel { border-color: var(--gold); transform: translateY(-6px); }
.pot.pulse { animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(245, 196, 67, .5); } }
.mixout { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 90px; font-size: 22px; font-weight: 600; }
.mixout .swatch { width: 80px; height: 80px; border-width: 4px; }

.warm { font-size: clamp(34px, 6vw, 56px); font-weight: 700; line-height: 1.15; margin: 10px 0; }
.count { font-size: 80px; font-weight: 700; color: var(--gold); font-variant-numeric: tabular-nums; }
.cards { display: grid; gap: 12px; margin: 14px auto; max-width: 820px; }
.mcard { aspect-ratio: 1; border-radius: 18px; font-size: clamp(34px, 6vw, 56px); background: var(--green); color: var(--ink); box-shadow: 0 5px 0 #036B44;
         display: grid; place-items: center; padding: 4px; }
.mcard .face { visibility: hidden; }
.mcard.up .face, .mcard.gone .face { visibility: visible; }
.mcard.word .face { font-size: clamp(14px, 2.2vw, 20px); font-weight: 700; line-height: 1.15; }
.mcard.up { background: var(--mint); box-shadow: 0 5px 0 #A9CDBC; }
.mcard.gone { background: var(--mint); box-shadow: none; opacity: .4; }

.grid { display: grid; gap: 6px; margin: 12px auto; padding: 10px; background: #0C1914; border-radius: 20px; width: min(92vw, 520px, 58vh); margin: 0; }
.cell { aspect-ratio: 1; border-radius: 10px; background: #1F3A30; display: grid; place-items: center; font-size: clamp(18px, min(5vw, 4.4vh), 44px); }
.cell.wall { background: #4A3428; }
.grid.big { gap: 4px; padding: 8px; width: min(92vw, 520px, 50vh); }
.grid.big .cell { border-radius: 7px; font-size: clamp(13px, min(3.6vw, 3.1vh), 30px); }
.arrows { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.arrows .btn { width: auto; height: auto; font-size: 20px; }
.arrows .btn.ghost { font-size: 18px; }
.arrows button { font-size: 40px; width: 84px; height: 76px; border-radius: 18px; background: var(--mint); color: var(--ink); font-weight: 700; box-shadow: 0 5px 0 #A9CDBC; }
.program { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; min-height: 54px; padding: 8px; margin: 8px auto; max-width: 720px;
           background: #0C1914; border-radius: 16px; }
.program span { font-size: 28px; background: var(--gold); color: var(--ink); border-radius: 10px; width: 44px; height: 44px; display: grid; place-items: center; font-weight: 700; }
.program span.run { background: var(--white); }
.program span.rep { width: auto; min-width: 44px; padding: 0 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 2px; }
.program span small { font-size: 17px; font-weight: 700; }
.pcount { font-size: 15px; font-weight: 600; color: var(--light); margin-top: -2px; }
.dym { font: inherit; color: var(--gold); background: none; text-decoration: underline; padding: 0; }

/* ---------------------------------------------------------------- escaped */
.escaped h1 { font-size: clamp(54px, 10vw, 110px); color: var(--gold); }
.stamp { display: inline-block; margin: 10px auto; padding: 18px 34px; border-radius: 24px; background: var(--mint); color: var(--ink); }
.stamp b { display: block; font-size: 34px; } .stamp span { font-size: 20px; }

/* ---------------------------------------------------------------- teacher button + modal */
#teacher { position: fixed; right: 14px; bottom: 14px; width: 48px; height: 48px; border-radius: 50%; background: #1F3A30; color: #5E8576; font-size: 22px; z-index: 6; }
#modal { position: fixed; inset: 0; background: rgba(5, 12, 9, .8); z-index: 20; display: grid; place-items: center; padding: 20px; }
#modal[hidden] { display: none; }
#modal .card { max-width: 520px; width: 100%; text-align: center; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; }

@media (max-width: 700px) {
  .dot { width: 26px; height: 26px; font-size: 12px; }
  .keypad { grid-template-columns: repeat(4, 1fr); }
  .numpad { grid-template-columns: repeat(4, 1fr); }
  .slot { width: 66px; height: 66px; font-size: 40px; }
}

.robot { display: flex; gap: 22px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 10px 0; }
.ctrl { width: min(92vw, 400px); }
.program span { width: 36px; height: 36px; font-size: 22px; }

/* ---------------------------------------------------------------- groups (the Year 3 trial: one iPad per group) */
.animals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-width: 720px; margin: 14px auto; }
.animal { background: var(--mint); color: var(--ink); border-radius: 20px; padding: 14px 6px 12px; font-size: 18px; font-weight: 700;
          box-shadow: 0 5px 0 #A9CDBC; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.animal span { font-size: 46px; line-height: 1.1; }
.animal.taken { background: #24443A; color: #7C9A8E; box-shadow: none; opacity: .55; }
.animal[disabled] { pointer-events: none; }
.groups { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.gchip { font-size: 18px; font-weight: 600; padding: 8px 14px; border-radius: 999px; background: #0C1914; color: #9DB3A9; border: 2px solid #2B5446; }
.gchip.ok { background: var(--gold); color: var(--ink); border-color: var(--gold); }

/* ---------------------------------------------------------------- pairs (16 animals) and the teacher's iPad (9 Nov 2026) */
.animal small { font-size: 12px; font-weight: 600; min-height: 14px; }
.animal.taken { opacity: .5; }
.teacher .t-clue { text-align: center; }
.t-count { font-size: 22px; margin: 6px 0 10px; color: #CFE3DA; }
.t-count b { color: var(--gold); }
.t-count .bad { color: #FF9B91; font-weight: 600; }
.t-pairs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; max-width: 900px; margin: 0 auto 8px; }
.tp { border-radius: 16px; padding: 10px 12px; background: #0C1914; border: 2px solid #2B5446; display: flex; flex-direction: column;
      align-items: flex-start; text-align: left; }
.tp b { font-size: 18px; } .tp span { font-size: 14px; color: var(--grey); font-weight: 600; }
.tp.done { background: var(--green); border-color: var(--green); } .tp.done span { color: #E3F2EA; }
.tp.out { background: var(--gold); border-color: var(--gold); color: var(--ink); } .tp.out span { color: #4A3B0B; }
.tp.quiet { opacity: .45; border-style: dashed; }
.btn.big { font-size: 26px; padding: 18px 40px; display: inline-flex; flex-direction: column; align-items: center; line-height: 1.2; }
.btn.big small { font-size: 15px; font-weight: 600; opacity: .8; }
#g-list.animals { gap: 10px; margin: 10px auto; }
#g-list .animal { padding: 8px 6px 6px; font-size: 17px; }
#g-list .animal span { font-size: 34px; }
