/* Camp drills, played (src/minigames/). The whole screen: the field, the
   HUD along the top, the stick bottom-left, the A/B/X/Y diamond
   bottom-right (the game's own colours), a meter bottom-centre, and the
   cards (instructions, results) over the middle. Landscape phone first. */
html.mg-on, html.mg-on body { overflow: hidden; overscroll-behavior: none; }
.mg-root {
  position: fixed; inset: 0; z-index: 9000; background: #0d1b2a; color: #fff;
  --mg-f: var(--sn-sans, system-ui, -apple-system, "Segoe UI", sans-serif); font-family: var(--mg-f);
  user-select: none; -webkit-user-select: none; touch-action: none; overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.mg-view { position: absolute; inset: 0; }
.mg-cv { position: absolute; left: 0; top: 0; display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.mg-tags { position: absolute; inset: 0; pointer-events: none; }
.mg-tag {
  position: absolute; left: 0; top: 0; padding: 2px 7px 3px; border-radius: 8px; white-space: nowrap;
  font: 900 12px/1.1 var(--mg-f); background: rgba(13,27,42,.82); color: #fff; border: 2px solid rgba(255,255,255,.7);
}
.mg-tag.hot { background: #f2c14e; color: #0d1b2a; border-color: #0d1b2a; }
.mg-tag.bad { background: #e8312f; border-color: #fff; }
.mg-tag.good { background: #5dc21e; border-color: #0d1b2a; }
.mg-tag.a, .mg-tag.b, .mg-tag.x, .mg-tag.y { width: 26px; height: 26px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-size: 15px; border: 2px solid #0d1b2a; }
.mg-tag.a { background: #5dc21e; } .mg-tag.b { background: #e8312f; } .mg-tag.x { background: #1a8cff; } .mg-tag.y { background: #ffb400; color: #0d1b2a; }
.mg-tag.dim { opacity: .45; filter: grayscale(.7); }

.mg-hud { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); pointer-events: none; }
.mg-x { pointer-events: auto; width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: rgba(13,27,42,.7); color: #fff; font: 900 20px/1 var(--mg-f); padding: 0; }
.mg-title { display: flex; flex-direction: column; background: rgba(13,27,42,.72); padding: 4px 10px 5px; border-radius: 10px; min-width: 0; }
.mg-title b { font-size: 13px; font-weight: 900; letter-spacing: .02em; text-transform: uppercase; }
.mg-title span { font-size: 11px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 42vw; }
.mg-stat { margin-left: auto; display: flex; gap: 6px; }
.mg-stat span { background: rgba(13,27,42,.72); border-radius: 10px; padding: 5px 10px; font: 900 18px/1 var(--mg-f); font-variant-numeric: tabular-nums; }
.mg-clock.low { background: #e8312f; }
.mg-pts { color: #f2c14e; }

.mg-cue { position: absolute; left: 50%; top: 34%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none;
  font: 900 44px/1 var(--mg-f); color: #fff; text-shadow: 0 3px 0 #0d1b2a, 0 0 18px rgba(13,27,42,.6); letter-spacing: .02em; white-space: nowrap; }
.mg-cue.on { animation: mgCue .9s ease-out forwards; }
@keyframes mgCue { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 30% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.mg-pops { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
.mg-pop { font: 900 20px/1 var(--mg-f); padding: 4px 12px 5px; border-radius: 10px; background: rgba(13,27,42,.78); animation: mgPop 1.1s ease-out forwards; white-space: nowrap; }
.mg-pop.good { color: #7ee05a; } .mg-pop.bad { color: #ff6b5f; }
@keyframes mgPop { 0% { transform: translateY(8px) scale(.8); opacity: 0; } 15% { transform: none; opacity: 1; } 75% { opacity: 1; } 100% { transform: translateY(-18px); opacity: 0; } }

.mg-meter { position: absolute; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); width: min(40vw, 320px); height: 22px; transform: translateX(-50%);
  background: rgba(13,27,42,.8); border: 3px solid #fff; border-radius: 12px; overflow: visible; pointer-events: none; }
.mg-meter .mg-mz { position: absolute; inset: 0; border-radius: 9px; overflow: hidden; }
.mg-meter .mg-mz s { position: absolute; top: 0; bottom: 0; text-decoration: none; background: rgba(93,194,30,.75); }
.mg-meter .mg-mz s.perfect { background: #f2c14e; }
.mg-meter .mg-mz s.bad { background: rgba(232,49,47,.75); }
.mg-meter .mg-mz s.ok { background: rgba(26,140,255,.7); }
.mg-meter u { position: absolute; top: -7px; bottom: -7px; width: 5px; margin-left: -2.5px; background: #fff; border: 1px solid #0d1b2a; border-radius: 3px; }
.mg-meter em { position: absolute; bottom: 100%; left: 50%; transform: translate(-50%, -4px); font: 900 11px/1 var(--mg-f); font-style: normal; text-transform: uppercase; letter-spacing: .05em; background: rgba(13,27,42,.8); padding: 3px 7px; border-radius: 6px; white-space: nowrap; }
.mg-meter em:empty { display: none; }

/* the stick: see-through, jumps under your thumb (the field's) */
.mg-stickzone { position: absolute; left: 0; bottom: 0; width: 42%; height: 64%; touch-action: none; }
.mg-stickzone[hidden] { display: none; }
.mg-stick { position: absolute; left: max(90px, calc(env(safe-area-inset-left) + 74px)); bottom: 30px; width: 110px; height: 110px; transform: translate(-50%, 0); border-radius: 50%;
  border: 3px solid rgba(255,255,255,.42); background: rgba(255,255,255,.10); opacity: .6; display: grid; place-items: center; pointer-events: none; }
.mg-stick.on { bottom: auto; transform: translate(-50%, -50%); opacity: 1; background: rgba(255,255,255,.16); }
.mg-stick i { width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.55); }

.mg-pad { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: 16px; width: 200px; height: 186px; pointer-events: none; }
.mg-xb { position: absolute; pointer-events: auto; touch-action: none; width: 62px; height: 62px; border-radius: 50%; padding: 0;
  border: 3px solid rgba(13,27,42,.85); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(13,27,42,.85); opacity: .93; }
.mg-xb[hidden] { display: none; }
.mg-xb b { font: 900 24px/1 var(--mg-f); text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.mg-xb span { position: absolute; top: 100%; left: 50%; transform: translate(-50%, 3px); white-space: nowrap; font: 900 10px/1 var(--mg-f); text-transform: uppercase; letter-spacing: .03em; background: rgba(13,27,42,.82); padding: 2px 6px 3px; border-radius: 6px; }
.mg-xb.on { transform: translateY(3px); box-shadow: 0 1px 0 rgba(13,27,42,.85); filter: brightness(1.15); }
.mg-xb-a { background: #5dc21e; left: 69px; top: 108px; width: 70px; height: 70px; margin: -4px 0 0 -4px; }
.mg-xb-b { background: #e8312f; left: 134px; top: 54px; }
.mg-xb-x { background: #1a8cff; left: 4px; top: 54px; }
.mg-xb-y { background: #ffb400; left: 69px; top: 0; color: #0d1b2a; }
.mg-xb-y b { text-shadow: none; }

/* the cards */
.mg-card { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(13,27,42,.55); padding: 12px; z-index: 3; }
.mg-card[hidden] { display: none; }
.mg-card > div { width: min(560px, 92vw); max-height: calc(100vh - 24px); overflow: auto; background: #f7f3e8; color: #0d1b2a; border: 3px solid #0d1b2a; border-radius: 14px; box-shadow: 0 6px 0 #0d1b2a; padding: 14px 18px 16px; }
.mg-load { text-align: center; }
.mg-card h2 { margin: 4px 0 2px; font: 900 24px/1.05 var(--mg-f); text-transform: uppercase; letter-spacing: .01em; }
.mg-kick { display: flex; gap: 8px; align-items: center; font: 800 12px/1 var(--mg-f); text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
.mg-lv { padding: 3px 8px; border-radius: 6px; color: #fff; }
.mg-lv.lv-easy { background: #2f9e44; } .mg-lv.lv-medium { background: #1a6fd6; } .mg-lv.lv-hard { background: #c92a2a; }
.mg-prac { background: #0d1b2a; color: #fff; padding: 3px 8px; border-radius: 6px; }
.mg-who { margin: 2px 0 6px; font-size: 13px; }
.mg-card ol { margin: 6px 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.35; }
.mg-card li { margin: 2px 0; }
.mg-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font: 800 12px/1 var(--mg-f); margin: 4px 0 6px; }
.mg-legend span { display: flex; align-items: center; gap: 5px; }
.mg-kb { position: static; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 900 12px/1 var(--mg-f); font-style: normal; color: #fff; border: 2px solid #0d1b2a; box-shadow: none; margin: 0; }
.mg-ls { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #0d1b2a; background: radial-gradient(circle, #0d1b2a 35%, transparent 38%); }
.mg-note { font-size: 12px; opacity: .8; margin: 6px 0 0; }
.mg-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 12px; }
.mg-btns button { font: 900 16px/1 var(--mg-f); text-transform: uppercase; padding: 12px 18px; border-radius: 12px; border: 3px solid #0d1b2a; box-shadow: 0 4px 0 #0d1b2a; cursor: pointer; }
.mg-go { background: #5dc21e; color: #0d1b2a; }
.mg-again { background: #fff; color: #0d1b2a; }
.mg-btns button:active { transform: translateY(3px); box-shadow: 0 1px 0 #0d1b2a; }
.mg-res { text-align: center; }
.mg-res .mg-kick { justify-content: center; }
.mg-medal { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 10px 0 6px; }
.mg-medal i { width: 64px; height: 64px; border-radius: 50%; border: 4px solid #0d1b2a; background: #c9ced6; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); }
.mg-medal b { font: 900 26px/1 var(--mg-f); text-transform: uppercase; }
.m-gold .mg-medal i { background: #f2c14e; } .m-silver .mg-medal i { background: #dfe4ea; } .m-bronze .mg-medal i { background: #cd7f32; }
.m-none .mg-medal i { background: #8a939e; opacity: .6; }
.mg-res.m-gold .mg-medal i { animation: mgShine 1.2s ease-out; }
@keyframes mgShine { 0% { transform: scale(.4) rotate(-40deg); } 60% { transform: scale(1.15); } 100% { transform: none; } }
.mg-nums { display: flex; gap: 22px; justify-content: center; font-size: 12px; }
.mg-nums span { display: flex; flex-direction: column; align-items: center; }
.mg-nums b { font: 900 26px/1 var(--mg-f); }
.mg-res .mg-btns { justify-content: center; }

@media (max-height: 440px) {
  .mg-card > div { padding: 10px 14px 12px; }
  .mg-card h2 { font-size: 20px; }
  .mg-card ol { font-size: 13px; margin: 4px 0 4px; }
  .mg-btns { margin-top: 8px; }
  .mg-btns button { padding: 9px 16px; }
  .mg-pad { transform: scale(.82); transform-origin: 100% 100%; }
  .mg-stick { width: 96px; height: 96px; left: max(76px, calc(env(safe-area-inset-left) + 64px)); bottom: 20px; }
  .mg-medal { margin: 4px 0; } .mg-medal i { width: 48px; height: 48px; }
  .mg-cue { font-size: 38px; }
}
@media (orientation: portrait) and (max-width: 600px) {
  .mg-pad { transform: scale(.78); transform-origin: 100% 100%; }
  .mg-meter { bottom: 200px; width: 70vw; }
}

/* the drills screen: Sim / Play and the three levels */
.dr-run .dr-modes { display: flex; gap: 8px; }
.dr-run .dr-modes > button { flex: 1; }
.dr-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 8px; }
.dr-lv { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 8px 9px; border-radius: 10px; border: 2px solid #0d1b2a; background: #fff; color: #0d1b2a; cursor: pointer; font: inherit; }
.dr-lv b { font-weight: 900; font-size: 13px; text-transform: uppercase; }
.dr-lv span { font-size: 12px; font-weight: 700; line-height: 1.15; }
.dr-lv em { font-size: 10px; font-style: normal; opacity: .75; text-transform: uppercase; letter-spacing: .03em; }
.dr-lv.lv-easy b { color: #2f9e44; } .dr-lv.lv-medium b { color: #1a6fd6; } .dr-lv.lv-hard b { color: #c92a2a; }
.dr-lv:hover { background: #fff7dc; }
.dr-row .lvtag { font-size: 10px; font-weight: 900; text-transform: uppercase; margin-left: 4px; opacity: .75; }
