/* style.css — one classroom, drawn with boxes and border-radius.
   Stacking is deliberate and spelled out, because "something invisible is
   covering the buttons" is the bug that keeps coming back:
     room and pupils .... 1
     bubbles ............ 20
     hud / noise ........ 50
     floating points .... 100
     end-of-round card .. 300                                              */

:root {
  --wall: #eef3f8;
  --wall2: #dde7f0;
  --chalk: #1d3a5c;
  --wood: #6f8aa6;
  --wood2: #56708a;
  --ink: #2a2a33;
  --good: #34a05a;
  --bad: #d8453f;
  --gold: #f0b429;
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; height: 100%; overflow: hidden;
  font-family: "Baloo 2", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wall);
  background-image:
    radial-gradient(1200px 700px at 50% -20%, #ffffff, transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 78px, rgba(0,0,0,.022) 78px 80px);
  user-select: none;
}
body { display: flex; flex-direction: column; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

/* ------------------------------------------------------------- the menu -- */
#menu {
  position: fixed; inset: 0; z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(160deg, #2a5c8a, #1d3a5c 60%, #12253c);
}
#menu[hidden] { display: none; }
.menu-box {
  width: min(560px, 100%); text-align: center; color: #f3f7f2;
  background: rgba(0,0,0,.22); border: 3px solid rgba(255,255,255,.16);
  border-radius: 26px; padding: clamp(22px, 5vw, 42px);
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
}
.logo {
  font-size: clamp(44px, 13vw, 84px); font-weight: 800; letter-spacing: -1px; line-height: 1;
  color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.25);
}
.tagline { font-size: clamp(15px, 3.6vw, 18px); line-height: 1.6; opacity: .92; margin: 16px 0 8px; }
.note { font-size: 15px; opacity: .8; margin-bottom: 10px; }
.best { margin-top: 14px; font-size: 15px; opacity: .85; }
.linky { margin-top: 12px; font-size: 14px; opacity: .7; text-decoration: underline; }

.big {
  display: inline-block; margin-top: 12px;
  background: var(--gold); color: #3a2a00; font-weight: 800;
  font-size: clamp(19px, 4.6vw, 24px); padding: 16px 34px; border-radius: 999px;
  box-shadow: 0 6px 0 #c8920f; transition: transform .08s, box-shadow .08s;
}
.big:active { transform: translateY(4px); box-shadow: 0 2px 0 #c8920f; }

/* ------------------------------------------------------------ the scene -- */
.scene {
  position: relative; flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: max(8px, env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));
  gap: 8px;
}
.scene[hidden] { display: none; }

/* ------------------------------------------------------------- the hud --- */
.hud {
  position: relative; z-index: 50; flex: none;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 2px solid #cfdce8; border-radius: 16px;
  padding: 8px 12px; box-shadow: 0 3px 0 rgba(0,0,0,.06);
}
.hud-title { font-weight: 800; font-size: clamp(15px, 3.4vw, 19px); }
.hud-stats { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.stat {
  display: flex; align-items: center; gap: 5px;
  background: #eef3f8; border-radius: 10px; padding: 4px 9px; font-size: 14px;
}
.stat b { font-size: 17px; }
.stat .lbl { opacity: .6; font-size: 12px; }
.stat.pop { animation: pop .35s ease; }
@keyframes pop { 0%{transform:scale(1)} 45%{transform:scale(1.22)} 100%{transform:scale(1)} }

.clock { position: relative; width: 100%; height: 12px; background: #dde7f0; border-radius: 999px; overflow: hidden; }
.clock-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #57b979, #8fd35f); transition: width .1s linear; }
.clock.low .clock-fill { background: linear-gradient(90deg, #e8664f, #f0a03c); }
.clock-num {
  position: absolute; right: 8px; top: -20px; font-size: 13px; font-weight: 800; opacity: .65;
}

/* ------------------------------------------------------ floaty bits ------ */
.say {
  position: absolute; z-index: 100; left: 50%; top: 64px; transform: translateX(-50%);
  background: rgba(28,28,34,.9); color: #fff; font-weight: 700;
  font-size: clamp(14px, 3.4vw, 17px); padding: 9px 18px; border-radius: 999px;
  animation: sayin .28s ease; pointer-events: none; max-width: 92%; text-align: center;
}
.say.good { background: rgba(36,132,74,.94); }
.say.bad { background: rgba(190,53,47,.94); }
.say.out { opacity: 0; transform: translate(-50%, -10px); transition: .3s; }
@keyframes sayin { from { opacity: 0; transform: translate(-50%, 10px) } }

.float {
  position: absolute; z-index: 100; transform: translate(-50%, -50%);
  font-weight: 800; font-size: clamp(16px, 4vw, 22px); pointer-events: none;
  animation: floaty .9s ease-out forwards; text-shadow: 0 2px 0 rgba(255,255,255,.7);
}
.float.good { color: #1c8a4a; } .float.bad { color: #c8342e; }
@keyframes floaty { to { transform: translate(-50%, -220%); opacity: 0 } }

/* --------------------------------------------------------- round card ---- */
.card-screen {
  position: absolute; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(22,30,26,.72); backdrop-filter: blur(3px);
  animation: sayin .22s ease;
}
.card-box {
  width: min(480px, 100%); text-align: center; color: #23231f;
  background: #ffffff; border: 4px solid #cfdce8; border-radius: 24px;
  padding: clamp(22px, 5vw, 36px); box-shadow: 0 20px 50px rgba(0,0,0,.3);
}
.card-screen.bad .card-box { border-color: #eec0bc; }
.card-box h2 { margin: 0 0 12px; font-size: clamp(23px, 6vw, 32px); }
.card-box p { margin: 7px 0; font-size: clamp(14px, 3.6vw, 17px); line-height: 1.55; }
.stars { font-size: clamp(22px, 6vw, 30px); letter-spacing: 3px; }

/* on anything wide the carpet sits them six across instead of four */
@media (min-width: 680px) { .carpetarea { grid-template-columns: repeat(6, 1fr); } }

/* --------------------------------------------------------------- juice --- */
.bit {
  position: absolute; z-index: 110; width: 9px; height: 9px; border-radius: 2px;
  transform: translate(-50%, -50%); pointer-events: none;
  animation: bitfly .68s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes bitfly {
  to { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(220deg); opacity: 0; }
}
@keyframes shakesm { 0%,100%{transform:translate(0,0)} 25%{transform:translate(-5px,2px)} 75%{transform:translate(5px,-2px)} }
@keyframes shakelg { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-11px,4px)} 60%{transform:translate(11px,-4px)} 85%{transform:translate(-5px,2px)} }
.shake-sm { animation: shakesm .28s ease; }
.shake-lg { animation: shakelg .42s ease; }

.combo {
  position: absolute; z-index: 105; left: 50%; top: 96px; transform: translateX(-50%);
  font-weight: 800; font-size: clamp(15px, 3.8vw, 21px); color: #b4700c;
  background: #fff6dd; border: 3px solid #f0b429; border-radius: 999px;
  padding: 5px 16px; pointer-events: none; white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0,0,0,.1);
}
.combo[hidden] { display: none; }
.combo.hot { color: #fff; background: linear-gradient(90deg, #f0803e, #e8534a); border-color: #c33a34; }
.combo.bump { animation: bump .3s ease; }
@keyframes bump { 0%{transform:translateX(-50%) scale(1)} 45%{transform:translateX(-50%) scale(1.2)} 100%{transform:translateX(-50%) scale(1)} }

/* --------------------------------------------------------- playground --- */
.yard { }
.yardarea {
  position: relative; flex: 1; min-height: 0; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #9dc9e8 0 26%, #8fbf6a 26% 34%, #b9b2a6 34%);
  border: 4px solid #cbb287;
}
.yardarea .markings {
  position: absolute; left: 50%; top: 58%; transform: translate(-50%,-50%);
  width: min(230px, 46%); aspect-ratio: 1; border: 5px solid rgba(255,255,255,.5); border-radius: 50%;
}
.yardarea .fence {
  position: absolute; left: 0; right: 0; top: 26%; height: 8%;
  background: repeating-linear-gradient(90deg, #7b8a99 0 4px, transparent 4px 16px);
}
.pupil.roam {
  position: absolute; width: auto; max-width: none; transform: translate(-50%,-50%);
  transition: left 1.3s ease-in-out, top 1.3s ease-in-out;
  padding: 10px 14px;              /* a bigger target than the child is drawn */
}
/* Once they are in trouble they stop dead. Chasing a child who is still
   sliding across the playground is not a fair thing to ask of a thumb. */
.pupil.roam.trouble {
  transition: none; animation: jiggle .35s ease-in-out infinite; z-index: 10;
}
@keyframes jiggle { 0%,100%{transform:translate(-50%,-50%) rotate(-6deg)} 50%{transform:translate(-50%,-50%) rotate(6deg)} }

/* -------------------------------------------------------- dinner hall --- */
.hallarea {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  justify-content: space-between; gap: 10px;
  background: linear-gradient(180deg, #f4e7cd, #e6d2ab);
  border: 4px solid #cbb287; border-radius: 16px; padding: 12px 10px;
}
.tables {
  position: absolute; left: 0; right: 0; top: 8%;
  display: flex; justify-content: space-around; font-size: clamp(18px, 4.5vw, 30px); opacity: .28;
}
.tables::before, .tables::after {
  content: ''; position: absolute; left: 4%; right: 4%; height: 10px;
  background: #c49a63; border-radius: 4px; opacity: .5;
}
.tables::before { top: -14px; } .tables::after { top: 46px; }
.queue {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(4px, 1.6vw, 16px); flex: 1; min-height: 0; padding-bottom: 4px;
}
.pupil.queuer {
  /* the padding is the point: it makes the drop target far bigger than the
     child is drawn, which on a phone is the difference between 29px and 50px
     of something to aim a finger at */
  position: relative; width: auto; max-width: none; flex: none;
  padding: 6px 12px; min-width: 58px;
  opacity: .8; transform: scale(.85); transform-origin: bottom center;
  transition: transform .22s ease, opacity .22s ease;
  animation: joinq .28s ease;
}
/* The one you are actually serving: full size, full colour, and lit up. */
.pupil.queuer.front {
  opacity: 1; transform: scale(1.12);
  filter: drop-shadow(0 0 0 rgba(0,0,0,0));
}
.pupil.queuer.front::before {
  content: ''; position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%);
  width: 108%; height: 16px; border-radius: 50%;
  background: radial-gradient(ellipse, rgba(240,180,41,.75), transparent 70%);
}
.pupil.queuer .bubble { top: -46%; font-size: clamp(15px, 3.6vw, 22px); }
.pupil.queuer.front .bubble {
  top: -86%; font-size: clamp(24px, 6.5vw, 40px); padding: 5px 12px;
  border-color: #f0b429; border-width: 3px;
}
.pupil.queuer.front .tag::after { content: ''; }
/* while you are carrying something, everyone who could take it lights up */
.queue.taking .pupil.queuer { outline: 4px dashed rgba(240,180,41,.85); outline-offset: 3px; border-radius: 14px; }
@keyframes joinq { from { opacity: 0; transform: translateX(40px) scale(.6) } }
.pupil.queuer.going { opacity: 0; transform: translateY(-16px) scale(.7); transition: .26s; }
.pupil.queuer.impatient .kid { animation: jiggle .3s ease-in-out infinite; }
.patience {
  display: block; width: 80%; height: 8px; margin: 6px auto 0;
  background: #d9c8a5; border-radius: 999px; overflow: hidden;
}
.pupil.queuer.front .patience { height: 11px; box-shadow: 0 0 0 2px rgba(240,180,41,.4); }
.patience i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg,#57b979,#e8c34f); }
.pupil.queuer.impatient .patience i { background: linear-gradient(90deg,#f0803e,#e0453f); }

.hatch { flex: none; background: #ffffff; border: 3px solid #d8c39a; border-radius: 14px; padding: 8px; }
.hatchtop { text-align: center; font-size: 13px; font-weight: 800; opacity: .6; margin-bottom: 6px; }
.trays { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(6px, 2vw, 14px); }
.tray {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #eef3f8; border: 3px solid #d8c39a; border-radius: 14px;
  padding: 7px clamp(9px, 3vw, 20px); box-shadow: 0 4px 0 rgba(0,0,0,.1);
}
.tray-ic { font-size: clamp(23px, 6vw, 36px); line-height: 1; }
.tray-lbl { font-size: clamp(10px, 2.4vw, 12.5px); font-weight: 700; opacity: .65; }
.tray:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.1); }

/* ---------------------------------------------- dragging and holding ----- */
.ghost {
  position: fixed; z-index: 500; transform: translate(-50%,-50%);
  font-size: clamp(30px, 8vw, 50px); pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); animation: lift .14s ease;
}
@keyframes lift { from { transform: translate(-50%,-50%) scale(.7) } }
.lifted { opacity: .45; }
.droptarget { outline: 4px dashed #f0b429; outline-offset: 4px; border-radius: 14px; }

.holdring {
  position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%);
  width: clamp(46px, 12vw, 74px); aspect-ratio: 1; border-radius: 50%;
  background: conic-gradient(#f0b429 calc(var(--k) * 360deg), rgba(255,255,255,.35) 0);
  pointer-events: none; opacity: 0; transition: opacity .12s;
  -webkit-mask: radial-gradient(circle, transparent 56%, #000 58%);
  mask: radial-gradient(circle, transparent 56%, #000 58%);
}
.holding .holdring, .pupil[data-k]:not([data-k="0"]) .holdring { opacity: 1; }

.trail {
  position: absolute; z-index: 108; height: 7px; border-radius: 999px;
  transform-origin: left center; pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), #fff);
  animation: fadetrail .3s ease forwards;
}
@keyframes fadetrail { to { opacity: 0 } }

/* --------------------------------------------------------- story time --- */
.carpetarea {
  position: relative; flex: 1; min-height: 0; border-radius: 16px;
  border: 4px solid #cbb287; padding: 10px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  align-content: center; justify-items: center; gap: clamp(4px, 1.4vw, 12px);
  background:
    radial-gradient(ellipse at 50% 60%, #d98fa6 0 32%, #c2607a 32% 56%, #a94f66 56%),
    #f4e7cd;
}
.pupil.sitter { max-width: 110px; touch-action: none; }
.pupil.sitter.fidgeting .kid { animation: jiggle .3s ease-in-out infinite; }
.pupil.sitter.holding .kid { animation: none; }
.pupil.sitter .holdring { z-index: 22; }

/* ---------------------------------------------------------------- PE ---- */
.court {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  border: 4px solid #cbb287; border-radius: 16px; touch-action: none;
  background: linear-gradient(180deg, #f0e2c4, #dcc79f);
}
.court .net {
  position: absolute; left: 0; right: 0; top: 62%; height: 10%;
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.75) 0 3px, transparent 3px 12px);
  border-top: 4px solid rgba(255,255,255,.85);
}
.court .line {
  position: absolute; left: 8%; right: 8%; bottom: 12%; height: 5px;
  background: rgba(255,255,255,.7); border-radius: 3px;
}
.flier {
  position: absolute; transform: translate(-50%,-50%);
  font-size: clamp(30px, 8vw, 50px); line-height: 1; pointer-events: none;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,.28));
}
.flier.notball { filter: drop-shadow(0 3px 4px rgba(0,0,0,.28)) saturate(1.3); }
.flier.whacked { animation: whacked .3s ease forwards; }
@keyframes whacked { to { transform: translate(-50%,-50%) scale(1.9) rotate(90deg); opacity: 0 } }
.flier.fouled { animation: fouled .3s ease forwards; }
@keyframes fouled { to { transform: translate(-50%,-50%) scale(.4); opacity: 0 } }


/* ------------------------------------------------------------- people --- */
.person {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 6px 12px; transition: transform .12s;
}
.who { position: relative; display: flex; flex-direction: column; align-items: center; }
.head {
  position: relative; width: clamp(34px, 8vw, 54px); aspect-ratio: 1 / 1.06;
  border-radius: 42% 42% 46% 46% / 40% 40% 52% 52%;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.08);
}
.hair { position: absolute; left: -6%; right: -6%; top: -12%; height: 46%; border-radius: 50% 50% 20% 20%; }
.hair.h1 { height: 34%; border-radius: 50% 50% 6% 6%; }
.hair.h2 { height: 54%; left: -12%; right: -12%; border-radius: 50% 50% 38% 38%; }
.eye {
  position: absolute; top: 46%; width: 22%; aspect-ratio: 1; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12);
}
.eye.left { left: 18%; } .eye.right { right: 18%; }
.eye i { width: 52%; height: 52%; background: #22222c; border-radius: 50%; transition: transform .16s; }
.mouth {
  position: absolute; left: 50%; top: 72%; transform: translateX(-50%);
  width: 30%; height: 9%; background: #7d4436; border-radius: 0 0 999px 999px;
}
.person[data-mood="happy"] .mouth { height: 16%; }
.person[data-mood="cross"] .mouth { border-radius: 999px 999px 0 0; }
.body { width: clamp(38px, 9vw, 62px); height: clamp(22px, 5vw, 36px); margin-top: -4px; border-radius: 40% 40% 14% 14%; }
.bubble {
  position: absolute; z-index: 20; left: 50%; top: -40%; transform: translate(-50%,6px) scale(.5); opacity: 0;
  font-size: clamp(17px, 4.2vw, 26px); line-height: 1; background: #fff;
  border: 2px solid #cfdce8; border-radius: 999px; padding: 3px 7px;
  box-shadow: 0 3px 8px rgba(0,0,0,.14); transition: .16s; pointer-events: none;
}
.bubble.on { opacity: 1; transform: translate(-50%,0) scale(1); }
.pname { font-size: clamp(10px, 2.4vw, 13px); font-weight: 700; opacity: .72; margin-top: 3px; }
.case {
  display: block; width: clamp(52px, 10vw, 64px); height: clamp(38px, 7.5vw, 46px);
  margin-top: 5px; border-radius: 7px; border: 3px solid #6b5535;
  background: linear-gradient(180deg, #a4834f, #8b6f42);
  position: relative; box-shadow: 0 3px 0 rgba(0,0,0,.16); cursor: grab; touch-action: none;
}
.case .tag {
  position: absolute; inset: auto 0 3px; text-align: center;
  font-size: clamp(11px, 2.7vw, 14px); font-weight: 800; letter-spacing: 1px;
  color: #2a2118; background: #f4ead2; border-radius: 3px; margin: 0 6px; padding: 1px 0;
}
.chute.problem { background: #6b7280 !important; }
.case::before {
  content: ''; position: absolute; left: 50%; top: -7px; transform: translateX(-50%);
  width: 42%; height: 8px; border: 3px solid rgba(0,0,0,.22); border-bottom: 0; border-radius: 6px 6px 0 0;
}
.patience { display: block; width: 80%; height: 8px; margin: 6px auto 0; background: #cfdce8; border-radius: 999px; overflow: hidden; }
.patience i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg,#57b979,#e8c34f); }
.impatient .patience i { background: linear-gradient(90deg,#f0803e,#e0453f); }
.impatient .who { animation: jiggle .3s ease-in-out infinite; }
@keyframes jiggle { 0%,100%{transform:rotate(-5deg)} 50%{transform:rotate(5deg)} }
.going { opacity: 0; transform: translateY(-16px); transition: .26s; }

/* -------------------------------------------------------- passports --- */
.deskarea {
  position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; padding: 8px;
  border: 4px solid #cfdce8; border-radius: 16px;
  background: linear-gradient(180deg, #dfeaf4, #c9d9e8);
}
.row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(5px, 1.6vw, 12px);
  width: 100%; align-content: center; justify-items: center; overflow: hidden;
}
@media (min-width: 700px) { .row { grid-template-columns: repeat(4, 1fr); } }

.trav {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: #fff; border: 3px solid #cfdce8; border-radius: 14px;
  padding: 7px 6px; width: 100%; max-width: 210px;
  box-shadow: 0 4px 0 rgba(0,0,0,.09); transition: transform .12s, opacity .2s;
}
.trav:active { transform: scale(.97); }
.realface { transform: scale(1.05); }
.says {
  font-weight: 800; font-size: clamp(11px, 2.7vw, 14px);
  background: #eef3f8; border-radius: 999px; padding: 2px 10px; white-space: nowrap;
}
.idcard {
  display: flex; gap: 6px; align-items: center; width: 100%;
  background: #1f3a63; border-radius: 8px; padding: 5px; margin-top: 2px;
}
.idphoto {
  flex: none; width: clamp(38px, 10vw, 52px); aspect-ratio: 3/4;
  background: #dbe6f2; border: 2px solid #93a8c2; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.facepic { display: flex; align-items: center; justify-content: center; }
.facepic .head { display: block; width: clamp(34px, 9vw, 48px); }
.idphoto .facepic .head { width: clamp(26px, 7vw, 36px); }
.idrows { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.idrow {
  display: flex; align-items: baseline; gap: 4px; background: #f4f7fc;
  border-radius: 4px; padding: 2px 5px; min-width: 0;
}
.idrow > span {
  font-size: clamp(7px, 1.8vw, 9px); text-transform: uppercase; letter-spacing: .6px;
  opacity: .55; flex: none;
}
.idrow b {
  font-size: clamp(12px, 3.2vw, 16px); color: #1d2a3d;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.today { text-align: center; font-size: 12px; font-weight: 800; opacity: .72; letter-spacing: .04em; }
.verdict {
  font-size: clamp(9px, 2.2vw, 11px); font-weight: 800; min-height: 13px; color: #b4401c;
}

.trav.pulled { background: #dff3e4; border-color: #34a05a; }
.trav.pulled::after {
  content: '🚫'; position: absolute; right: 5px; top: 5px; font-size: 20px;
}
.trav.badcall { animation: shakesm .3s ease; border-color: #d8453f; background: #fbe0de; }
.trav.slipped { background: #fbe0de; border-color: #d8453f; opacity: .95; }
.trav.slipped::after { content: '😬'; position: absolute; right: 5px; top: 5px; font-size: 20px; }

.clearall {
  flex: none; background: #34a05a; color: #fff; font-weight: 800;
  font-size: clamp(14px, 3.6vw, 18px); padding: 11px 26px; border-radius: 999px;
  box-shadow: 0 5px 0 #267943;
}
.clearall:active { transform: translateY(3px); box-shadow: 0 2px 0 #267943; }
.clearall:disabled { opacity: .45; box-shadow: 0 5px 0 #267943; }

/* ---------------------------------------------------------- security --- */
.beltarea {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  border: 4px solid #cfdce8; border-radius: 16px;
  background: linear-gradient(180deg, #e6eef6 0 52%, #cdd9e4 52%);
}
.scanner {
  position: absolute; left: 34%; top: 8%; width: 32%; bottom: 18%;
  background: linear-gradient(180deg, #2b3f55, #1d2c3d);
  border: 5px solid #56708a; border-radius: 14px; overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,.5);
}
.scanline { position: absolute; left: 0; right: 0; height: 4px; background: #59e0a8; box-shadow: 0 0 16px #59e0a8; animation: scan 1.6s linear infinite; }
@keyframes scan { 0%{top:0} 100%{top:100%} }
.scanlabel { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; color: #7fd4ff; font-size: 11px; font-weight: 800; letter-spacing: 2px; }
.beltline {
  position: absolute; left: 0; right: 0; top: 62%; height: 16px;
  background: repeating-linear-gradient(90deg,#7b93aa 0 16px,#6a8299 16px 32px);
}
.bags { position: absolute; inset: 0; }
.bag { position: absolute; top: 46%; transform: translate(-50%,-50%); transition: none; }
.bagbody {
  width: clamp(104px, 26vw, 156px); min-height: clamp(66px, 16vw, 96px);
  background: #9b7b52; border: 4px solid #7d6140; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; padding: 6px;
  box-shadow: 0 5px 0 rgba(0,0,0,.18);
}
.handle { position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 34%; height: 14px; border: 4px solid #7d6140; border-bottom: 0; border-radius: 8px 8px 0 0; }
.items { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; opacity: 0; transition: opacity .18s; }
/* only visible while the bag is inside the machine */
.bag.inside .bagbody { background: rgba(20,40,60,.92); border-color: #59e0a8; }
.bag.inside .items { opacity: 1; }
.bag.inside .handle { border-color: #59e0a8; }
.item {
  font-size: clamp(26px, 6.5vw, 34px); line-height: 1; padding: 6px;
  filter: drop-shadow(0 0 7px rgba(90,224,168,.75)) brightness(1.12);
  border-radius: 8px;
}
.item.taken { opacity: .2; }
.item.nope { animation: shakesm .3s ease; }

/* -------------------------------------------------------------- gate --- */
.gatesign {
  flex: none; text-align: center; color: #eaf4ff; background: #12253c;
  border: 4px solid #56708a; border-radius: 12px; padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
}
.gnow { font-size: 11px; letter-spacing: 3px; opacity: .7; font-weight: 800; }
.gdest { font-size: clamp(20px, 5.5vw, 30px); font-weight: 800; }
.gcode { font-size: clamp(11px, 2.6vw, 14px); opacity: .75; }
.gatestage {
  position: relative; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: space-between;
  border: 4px solid #cfdce8; border-radius: 16px; overflow: hidden; padding: 6px;
  background: linear-gradient(180deg, #e6eef6, #d3e0ec);
}
.lane {
  width: 22%; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: clamp(24px, 6vw, 38px); opacity: .35; transition: .18s;
  border-radius: 14px; padding: 10px 4px;
}
.lane span { font-size: clamp(10px, 2.4vw, 13px); font-weight: 800; }
.lane.no { background: rgba(224,69,63,.14); } .lane.yes { background: rgba(52,160,90,.14); }
.gatestage.lean-no .lane.no, .gatestage.lean-yes .lane.yes { opacity: 1; transform: scale(1.1); }
.here { flex: 1; display: flex; align-items: center; justify-content: center; }
.person.atgate { touch-action: none; cursor: grab; }
.pass {
  display: block; margin-top: 6px; background: #fff; border: 3px dashed #8aa4bd;
  border-radius: 8px; padding: 4px 12px; text-align: center; line-height: 1.15;
}
.pass b { display: block; font-size: clamp(15px, 4vw, 21px); letter-spacing: 1px; }
.pass span { font-size: clamp(9px, 2.2vw, 12px); opacity: .65; }
.flyoff-yes { animation: offright .3s ease forwards; }
.flyoff-no { animation: offleft .3s ease forwards; }
@keyframes offright { to { transform: translateX(60vw) rotate(20deg); opacity: 0 } }
@keyframes offleft { to { transform: translateX(-60vw) rotate(-20deg); opacity: 0 } }

/* ----------------------------------------------------------- take-off --- */
.runwayarea {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  border: 4px solid #cfdce8; border-radius: 16px;
}
.runwayarea .sky { position: absolute; inset: 0 0 45% 0; background: linear-gradient(180deg,#8fc4ea,#cfe4f5); }
.tarmac { position: absolute; inset: 55% 0 0 0; background: #55606b; }
.centreline { position: absolute; left: 0; right: 0; top: 42%; height: 7px; background: repeating-linear-gradient(90deg,#f2f2f2 0 40px, transparent 40px 80px); }
.plane { position: absolute; top: 40%; left: 6%; font-size: clamp(34px, 9vw, 56px); transition: left .08s linear; }
.plane.flew { animation: flew .8s ease forwards; }
@keyframes flew { to { left: 105%; top: -20%; transform: rotate(-18deg) } }
.plane.stalled { animation: stall .5s ease; }
@keyframes stall { 0%,100%{transform:rotate(0)} 30%{transform:rotate(-9deg) translateY(6px)} 70%{transform:rotate(6deg)} }
.thrustbox {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94); border-top: 3px solid #cfdce8;
  display: flex; flex-direction: column; gap: 7px; align-items: center;
}
.thrustlabel { font-size: clamp(11px, 2.7vw, 14px); font-weight: 700; opacity: .7; text-align: center; }
.gauge { position: relative; width: 100%; height: 26px; background: #dde7f0; border-radius: 999px; overflow: hidden; border: 3px solid #cfdce8; }
.green { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg,#7fd6a0,#46b374); }
.needle { position: absolute; top: -4px; bottom: -4px; width: 6px; background: #1d3a5c; border-radius: 3px; box-shadow: 0 0 0 2px rgba(255,255,255,.8); }
.throttle {
  background: #f0b429; color: #3a2a00; font-weight: 800; font-size: clamp(17px, 4.4vw, 22px);
  padding: 14px 44px; border-radius: 999px; box-shadow: 0 6px 0 #c8920f; touch-action: none;
}
.throttle.down { transform: translateY(4px); box-shadow: 0 2px 0 #c8920f; background: #f5c94f; }

/* On a narrow screen the queue was scaled down to 85%, which quietly shrank
   the suitcase you have to grab to 39x31 — under a fingertip. Keep them full
   size when there is no room to spare. */
@media (max-width: 560px) {
  .person.waiting { transform: scale(1); }
  .person.waiting.front { transform: scale(1.04); }
  .checkarea .queue { gap: 2px; }
}

/* The instruction toast sat at the top and landed squarely on the chutes —
   the one thing you need to read at the start of check-in. Down at the bottom
   in every round except take-off, where the throttle lives. */
.say { top: auto; bottom: 16px; }
.runway .say { bottom: 150px; }
/* the toast rides in the gap the layout already leaves, whatever the height */
.idc .say { position: static; transform: none; margin: 0 auto; align-self: center; }
.idc .deskarea { justify-content: space-evenly; }

/* the few seconds you get for each row of travellers */
.rowclock {
  flex: none; width: 100%; max-width: 620px; height: 12px;
  background: #cfdce8; border-radius: 999px; overflow: hidden;
}
.rowclock i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #57b979, #8fd35f);
}
.rowclock.low i { background: linear-gradient(90deg, #e8664f, #f0a03c); }
.rowclock.low { animation: buzzrow .3s ease-in-out infinite; }
@keyframes buzzrow { 0%,100%{transform:translateX(0)} 50%{transform:translateX(2px)} }

/* the lift meter — how close this plane is to actually leaving the ground */
.liftwrap {
  position: absolute; left: 10px; right: 10px; top: 8px;
  display: flex; align-items: center; gap: 8px;
}
.liftlabel { font-size: 11px; font-weight: 800; letter-spacing: 2px; color: #12253c; opacity: .7; }
.liftbar { flex: 1; height: 14px; background: rgba(255,255,255,.65); border-radius: 999px; overflow: hidden; border: 2px solid rgba(0,0,0,.12); }
.liftbar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#57b979,#8fd35f); transition: width .05s linear; }
.liftwrap.full .liftbar i { background: linear-gradient(90deg,#f0b429,#f5d76e); }
.liftwrap.full { animation: buzzrow .3s ease-in-out infinite; }
/* the gauge lights up while you are actually in the green */
.gauge.hot { box-shadow: 0 0 0 3px rgba(70,179,116,.55); }
.gauge.hot .needle { background: #2f9c5a; }
