* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #2a1d14; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; touch-action: manipulation; }
#game { position: fixed; inset: 0; background: #2a1d14; }
.stage { position: absolute; inset: 0; overflow: hidden; }
.scene { position: absolute; inset: 0; transform-origin: 50% 22%; }
.art { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; pointer-events: none; }
.teacher-clip {
  position: absolute;
  left: 22%;
  top: 3.5%;
  width: 56%;
  height: 38%;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  transform-origin: 50% 78%;
  border-radius: 46% 46% 18% 18%;
  -webkit-mask-image: radial-gradient(ellipse at 50% 42%, #000 58%, transparent 74%);
  mask-image: radial-gradient(ellipse at 50% 42%, #000 58%, transparent 74%);
}
.teacher-art {
  position: absolute;
  width: 178.6%;
  height: 263%;
  left: -39.3%;
  top: -9.2%;
  object-fit: cover;
  object-position: center top;
  transform-origin: 50% 34%;
  pointer-events: none;
}
.teacher-shade {
  position: absolute;
  left: 24%;
  top: 6%;
  width: 52%;
  height: 32%;
  z-index: 2;
  pointer-events: none;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, rgba(18, 10, 6, .55), transparent 68%);
  opacity: 0;
}
.stage.back .scene { animation: room-idle 2.4s ease-in-out infinite; }
.stage.back .teacher-clip { animation: shoulder 1.15s ease-in-out infinite; }
.stage.back .teacher-art { animation: write-board 1.15s ease-in-out infinite; filter: brightness(.82) saturate(.9); }
.stage.back .teacher-shade { opacity: .72; animation: shade-breathe 1.15s ease-in-out infinite; }
.stage.warn .scene { animation: room-lean .7s ease-in-out infinite alternate; }
.stage.warn .teacher-clip { animation: head-peek .35s ease-in-out infinite alternate; }
.stage.warn .teacher-art { animation: face-peek .35s ease-in-out infinite alternate; filter: brightness(.95); }
.stage.warn .teacher-shade { opacity: .28; }
.stage.look .scene { animation: room-scan .7s ease-in-out infinite alternate; }
.stage.look .teacher-clip { animation: body-scan .7s ease-in-out infinite alternate; }
.stage.look .teacher-art { animation: face-scan .7s ease-in-out infinite alternate; filter: brightness(1.08) saturate(1.08); }
.stage.look .teacher-shade { opacity: 0; }
.stage.look.spot .teacher-clip { animation: busted-nod .22s ease-in-out infinite alternate; }
.stage.look.spot .teacher-art { animation: busted-face .22s ease-in-out infinite alternate; filter: saturate(1.25) contrast(1.05); }
.stage.look.spot .scene { animation: room-shake .18s linear infinite; }
@keyframes room-idle { 50% { transform: translateY(.35%); } }
@keyframes room-lean { to { transform: rotate(-.6deg) translateX(-1.2%); } }
@keyframes room-scan { from { transform: rotate(-.35deg); } to { transform: rotate(.55deg) scale(1.015); } }
@keyframes room-shake { 25% { transform: translateX(-1.1%); } 75% { transform: translateX(1.1%); } }
@keyframes shoulder { 50% { transform: translateY(1.6%) rotate(-1.2deg); } }
@keyframes write-board { 50% { transform: translateX(-3.2%) rotate(-2.4deg) scale(1.03); } }
@keyframes shade-breathe { 50% { opacity: .48; transform: translateX(-4%); } }
@keyframes head-peek { to { transform: rotate(-9deg) translateX(-7%) translateY(1%); } }
@keyframes face-peek { to { transform: rotateY(-28deg) translateX(-7%) scale(1.06); } }
@keyframes body-scan { from { transform: rotate(-4deg) translateX(-2%); } to { transform: rotate(6deg) translateX(3%) translateY(1%); } }
@keyframes face-scan { from { transform: rotateY(-14deg) translateX(-3%); } to { transform: rotateY(16deg) translateX(4%) scale(1.04); } }
@keyframes busted-nod { to { transform: translateY(3%) scale(1.04); } }
@keyframes busted-face { to { transform: scale(1.08) translateY(2%); } }
.hud-score { position: absolute; left: 6%; top: 2.2%; min-width: 18%; padding: 2px 8px; border-radius: 10px; background: rgba(42, 24, 12, .72); color: #fff7e3; font-weight: 900; font-size: 5.2vw; text-align: center; z-index: 3; }
.hud-alert { position: absolute; left: 28%; top: 3.1%; width: 44%; height: 2.4%; border-radius: 99px; background: rgba(42, 24, 12, .55); overflow: hidden; z-index: 3; }
#alertFill { height: 100%; width: 0%; background: linear-gradient(90deg, #ffd25a, #ff3b2f); }
.hud-lvl { position: absolute; right: 4%; top: 2.2%; padding: 3px 10px; border-radius: 99px; background: rgba(42, 24, 12, .72); color: #ffd66b; font-weight: 800; font-size: 3.6vw; z-index: 3; }
.gaze { position: absolute; left: 18%; top: 8%; width: 64%; height: 30%; border-radius: 18px; background: rgba(255, 40, 40, .0); box-shadow: inset 0 0 0 0 rgba(255, 60, 40, 0); transition: background .15s; pointer-events: none; z-index: 2; }
.gaze.on { background: rgba(255, 40, 40, .16); box-shadow: inset 0 0 0 4px rgba(255, 80, 40, .75); animation: gaze-pulse .45s ease-in-out infinite alternate; }
@keyframes gaze-pulse { to { background: rgba(255, 40, 40, .28); } }
.hand { position: absolute; left: 34%; top: 58%; width: 32%; height: 12%; border-radius: 16px; background: rgba(255, 138, 61, 0); pointer-events: none; z-index: 2; }
.hand.on { background: rgba(255, 210, 90, .35); animation: chew .22s ease-in-out infinite alternate; }
@keyframes chew { to { transform: translateY(-6px) scale(1.04); } }
.tip { position: absolute; left: 8%; right: 8%; top: 42%; text-align: center; font-weight: 900; font-size: 5vw; color: #fff; text-shadow: 0 2px 4px #000; pointer-events: none; z-index: 3; min-height: 1.2em; }
.hot { position: absolute; z-index: 4; display: grid; place-items: center; padding: 2px 4px; border: 2px solid #fff1c9; border-radius: 14px; background: #30251c; color: #fff7e3; font: 800 0.95rem/1.15 inherit; text-align: center; cursor: pointer; touch-action: none; }
.hide { left: 74%; top: 67%; width: 20%; height: 10%; }
.hide.active { box-shadow: 0 0 0 3px #5be37a; }
.snacks { position: absolute; left: 4%; right: 4%; top: 78%; height: 8%; display: flex; gap: 6px; z-index: 4; }
.snack { flex: 1; border-radius: 12px; border: 2px solid transparent; background: rgba(255, 247, 227, .82); color: #5a3517; font-weight: 800; font-size: 3.2vw; text-align: center; line-height: 1.15; padding-top: 1.2vw; }
.snack.sel { border-color: #ff8a3d; background: #ffe2b8; }
.snack.lock { opacity: .45; }
.snack span { display: block; font-size: 2.6vw; font-weight: 600; }
.low { left: 4%; top: 87.2%; width: 22%; height: 8.5%; }
.eat { left: 28%; top: 87.2%; width: 44%; height: 8.5%; background: #24563d; }
.item { left: 74%; top: 87.2%; width: 22%; height: 8.5%; background: #304e71; }
.hot:active, .hot.on { background: #71502c; }
.hot.eat:active, .hot.eat.on { background: #347653; }
.hot:focus-visible, .go:focus-visible, .snack:focus-visible { outline: 3px solid #79e6c2; outline-offset: 2px; }
.eatbar { position: absolute; left: 18%; right: 18%; bottom: 2.2%; height: 1.4%; border-radius: 99px; background: rgba(90, 53, 23, .55); overflow: hidden; z-index: 4; }
#eatFill { height: 100%; width: 0%; background: #5be37a; }
.overlay { position: absolute; inset: 0; z-index: 8; background: rgba(42, 24, 12, .55); display: flex; align-items: center; justify-content: center; }
.overlay[hidden] { display: none !important; }
.overlay.ready { background: rgba(42, 24, 12, .28); }
.card { width: 78%; max-width: 360px; border-radius: 18px; background: #fff7e3; border: 4px solid #ff8a3d; padding: 22px 16px 18px; text-align: center; }
.card-title { font-size: 6.4vw; font-weight: 900; color: #5a3517; }
.card-sub { margin-top: 8px; font-size: 4.4vw; color: #7a4a22; font-weight: 700; }
.card-sub b { color: #e05a12; }
.go { display: block; width: 220px; min-height: 56px; height: 56px; margin: 0 auto; padding: 0 18px; border-radius: 99px; border: 3px solid #5a3517; background: linear-gradient(#ffd25a, #ff8a3d); color: #5a3517; font-size: 20px; font-weight: 900; pointer-events: auto; }
.card .go { width: 80%; margin-top: 16px; }
