/* Paper Ball Fight! - ink navy, school-bus yellow, eraser pink, chalk green */
:root { --night: #16202E; --moon: #FFF9EE; --itch: #FFC233; --sheet: #FF5C8A; --coil: #42D392; --bite: #FF3B3B; }

/* Screens: ruled notebook paper */
.screen { background:
  linear-gradient(90deg, transparent 54px, rgba(255,92,138,.18) 54px 57px, transparent 57px),
  repeating-linear-gradient(transparent 0 30px, rgba(85,184,255,.08) 30px 32px),
  radial-gradient(circle at 50% 30%, #2a3a52 0%, var(--night) 72%); }
.screen.dim { background: radial-gradient(circle at 50% 40%, rgba(42,58,82,.94) 0%, rgba(22,32,46,.97) 70%); }
.mascot svg { animation: windup 1s ease-in-out infinite; }
@keyframes windup { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(5deg) translateY(-4px); } }
.menu-grid a.ghost { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; font-size: 18px; text-decoration: none; }
.logo { font-size: clamp(40px, 9vw, 90px); }
.page.boss { background: var(--sheet); }
.page .room small { font-size: 12px; opacity: .75; }
canvas { cursor: crosshair; }

/* ---------- HUD ---------- */
.hud-top { align-items: center; }
.hud-left { flex-direction: row; gap: 6px; flex-wrap: wrap; }
.meters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.maamrow { display: flex; justify-content: center; margin-top: 8px; }
.maam { font-size: 16px; padding: 4px 16px; transition: background .2s, transform .2s; }
.maam.write { background: rgba(66,211,146,.9); color: var(--night); border-color: var(--night); }
.maam.warn { background: var(--itch); color: var(--night); border-color: var(--night); animation: shake .15s infinite; }
.maam.watch { background: var(--bite); transform: scale(1.12); animation: pulse .5s infinite; }
@keyframes shake { 50% { transform: translateX(3px) rotate(2deg); } }
@keyframes pulse { 50% { transform: scale(1.18); } }
#superBtn { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(110px, calc(env(safe-area-inset-bottom) + 96px)); width: 76px; height: 76px; border-radius: 50%;
  border: 4px solid var(--night); font-size: 30px; line-height: 1; cursor: pointer; pointer-events: auto; touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--sheet) var(--p, 0%), rgba(255,249,238,.6) 0); box-shadow: 0 5px 0 var(--night); opacity: .75; }
#superBtn small { font-family: var(--display); font-size: 12px; color: var(--night); }
#superBtn.ready { opacity: 1; background: var(--itch); animation: pulse .6s infinite; }
#hint { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%); width: max-content; max-width: 88vw; background: rgba(22,32,46,.92);
  border: 3px dashed var(--moon); border-radius: 16px; padding: 10px 18px; font-weight: 700; font-size: 16px; line-height: 1.4; text-align: center; pointer-events: none; }
#hint b { font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--itch); }
#hint small { font-size: 13px; opacity: .8; }

@media (max-width: 560px) {
  .hud-top { flex-wrap: wrap; }
  .meters { order: 3; width: 100%; }
  #hint { font-size: 14px; }
  .maam { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { .mascot svg, .maam.warn, .maam.watch, #superBtn.ready { animation: none; } }
