/* Mini-games: the overlay, the shared top bar and bottom card, the entry card, the hub tab and the result screen.
   Colours, radii and shadows follow design/minigames/mockups (same as the main interface). */
:root {
  --mg-ink: #2b1d10;
  --mg-dark: #3b2614;
  --mg-cream: #f6eedd;
  --mg-paper: #e9e1d1;
  --mg-sand: #e3d6bb;
  --mg-green: #3a6b1e;
  --mg-leaf: #8fc46a;
  --mg-orange: #c4531c;
  --mg-gold: #f2c94c;
  --mg-muted: #5e4a36;
  --mg-red: #a8301e;
}
.mg {
  position: fixed;
  inset: 0;
  z-index: 60;
  font-family: 'Rubik', system-ui, sans-serif;
  color: var(--mg-ink);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.mg[hidden] {
  display: none;
}
.mg.scene {
  background: #2b1d10;
}
.mg .mg-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
/* the world: 390 x 844 design units (the mockups' coordinates), scaled to cover the stage */
.mg .mg-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 844px;
  transform-origin: 0 0;
}
.mg .mg-world > img.mg-bg {
  position: absolute;
  left: 0;
  top: 0;
  width: 390px;
  height: 844px;
  pointer-events: none;
}
.mg .mg-fill {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(14px) brightness(0.55);
  transform: scale(1.1);
}
/* top bar: cross, title card, counter */
.mg-top {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(14px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}
.mg-x {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--mg-dark);
  border: 2px solid #1f150b;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
}
.mg-x svg {
  width: 18px;
  height: 18px;
}
.mg-title {
  flex: 1;
  min-width: 0;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px 18px 12px 16px;
  box-shadow: 0 3px 0 var(--mg-dark);
  padding: 5px 12px;
}
.mg-kick {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-green);
}
.mg-kick.ev {
  color: var(--mg-orange);
}
.mg-kick.cr {
  color: #6a3fb0;
}
.mg-name {
  font-family: 'Rubik Dirt', 'Rubik', sans-serif;
  font-size: 19px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mg-count {
  height: 48px;
  flex: none;
  min-width: 48px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--mg-dark);
  color: var(--mg-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
  font-size: 20px;
  box-sizing: border-box;
}
.mg-count.warn {
  background: var(--mg-red);
}
.mg-count small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.mg-count .col {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}
/* bottom card (phone) / side panel (desktop) */
.mg-card {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 16px 20px 14px 18px;
  box-shadow: 0 4px 0 var(--mg-dark);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 5;
  max-height: 46vh;
  overflow-y: auto;
  touch-action: pan-y;
}
.mg-card h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.mg-card h4 small {
  font-size: 12px;
  font-weight: 500;
  color: var(--mg-muted);
}
.mg-rules {
  font-size: 13px;
  line-height: 1.35;
}
.mg-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  text-align: center;
}
.mg-stats > div > div:first-child {
  font-size: 12px;
  color: var(--mg-muted);
}
.mg-stats > div > div:last-child {
  font-weight: 800;
  font-size: 22px;
}
.mg-stats .hot {
  color: #a8461a;
}
.mg-row {
  display: flex;
  gap: 10px;
}
.mg-btn {
  flex: 1;
  min-height: 46px;
  border-radius: 12px;
  border: 3px solid var(--mg-dark);
  background: var(--mg-paper);
  font: 700 15px 'Rubik', sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
  padding: 0 10px;
}
.mg-btn.go {
  background: var(--mg-orange);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 var(--mg-dark);
}
.mg-btn:disabled {
  opacity: 0.5;
}
.mg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dcebc9;
  color: var(--mg-green);
}
.mg-chip.bad {
  background: #f6d6cc;
  color: var(--mg-red);
}
.mg-legend {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
}
.mg-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mg-legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}
.mg-bar {
  height: 14px;
  border-radius: 7px;
  background: var(--mg-sand);
  border: 2px solid var(--mg-dark);
  overflow: hidden;
  position: relative;
}
.mg-bar > i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--mg-green);
}
.mg-float {
  position: absolute;
  pointer-events: none;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 0 var(--mg-dark), 0 0 6px var(--mg-dark);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  animation: mgfloat 1s ease-out forwards;
  z-index: 4;
}
.mg-float.big {
  font-family: 'Rubik Dirt', 'Rubik', sans-serif;
  font-size: 26px;
  color: var(--mg-gold);
}
@keyframes mgfloat {
  from {
    opacity: 1;
    margin-top: 0;
  }
  to {
    opacity: 0;
    margin-top: -36px;
  }
}
.mg-say {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(76px + env(safe-area-inset-top, 0px));
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}
.mg-say .pt {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--mg-dark);
  background: var(--mg-sand);
}
.mg-say .pt img,
.mg-pt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mg-say .bub {
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 13px;
  line-height: 1.3;
  max-width: 230px;
}
.mg-dark {
  background: rgba(43, 29, 16, 0.9);
  color: var(--mg-cream);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
}
/* desktop: the scene stays portrait on the left, rules and score sit in a panel on the right */
.mg.desk .mg-card {
  left: auto;
  right: 16px;
  top: 16px;
  bottom: 16px;
  width: 360px;
  max-height: none;
  box-sizing: border-box;
  padding: 104px 18px 18px;
  gap: 14px;
  border-radius: 20px 24px 18px 22px;
  box-shadow: 0 5px 0 var(--mg-dark);
}
/* desktop: the title and the counter head the side panel (InspectionDesktop.html), the cross stays top left */
.mg.desk .mg-top {
  left: auto;
  right: 34px;
  top: 34px;
  width: 324px;
  z-index: 6;
}
.mg.desk .mg-top .mg-x {
  position: fixed;
  left: 16px;
  top: 16px;
}
.mg.desk .mg-title {
  background: none;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.mg.desk .mg-kick {
  font-size: 11px;
}
.mg.desk .mg-name {
  font-size: 28px;
  line-height: 1.05;
  white-space: normal;
}
.mg.desk .mg-count {
  height: 52px;
  font-size: 24px;
}
.mg.desk .mg-say {
  right: 376px;
}
.mg.desk .mg-card .mg-spacer {
  flex: 1;
}

/* entry card for event mini-games (Main.html) */
.mgEntry {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--cmdH, 100px) + 12px);
  z-index: 40;
  max-width: 420px;
  margin: 0 auto;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 16px 20px 14px 18px;
  box-shadow: 0 4px 0 var(--mg-dark);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-family: 'Rubik', sans-serif;
  color: var(--mg-ink);
}
.mgEntry[hidden] {
  display: none;
}
.mgEntry .head {
  display: flex;
  gap: 10px;
}
.mgEntry .mg-pt {
  width: 72px;
  height: 72px;
  flex: none;
  border-radius: 14px;
  background: var(--mg-sand);
  border: 3px solid var(--mg-dark);
  overflow: hidden;
}
.mgEntry .t1 {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-green);
}
.mgEntry .t2 {
  font-family: 'Rubik Dirt', 'Rubik', sans-serif;
  font-size: 21px;
  line-height: 1.1;
  margin-top: 2px;
}
.mgEntry .t3 {
  font-size: 13px;
  line-height: 1.35;
  margin-top: 4px;
}
.mgEntry .chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#qbub .mgb {
  padding: 0;
  overflow: hidden;
  background: var(--mg-gold);
  box-shadow: 0 0 0 5px rgba(242, 201, 76, 0.45);
}
#qbub .mgb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* hub tab in the Quests sheet (Hub.html) */
.qtabs {
  display: flex;
  gap: 8px;
  padding: 0 14px 6px;
}
.qtab {
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 2px solid #cfc3ac;
  background: var(--mg-paper);
  font: 700 13px 'Rubik', sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
}
.qtab[aria-selected='true'] {
  border-color: var(--mg-dark);
  background: var(--mg-dark);
  color: var(--mg-cream);
}
.mgHub p.lead {
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 4px;
}
.mgHub .row {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fbf6ea;
  border: 2px solid #cfc3ac;
  border-radius: 14px;
  padding: 8px 10px;
}
.mgHub .row.hot {
  border: 3px solid var(--mg-dark);
  box-shadow: 0 0 0 3px var(--mg-gold);
}
.mgHub .row.off {
  border-style: dashed;
  opacity: 0.72;
}
.mgHub .ico {
  display: block;
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--mg-dark);
  background: var(--mg-sand);
}
.mgHub .ico img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.mgHub .tx {
  flex: 1;
  min-width: 0;
}
.mgHub .tx b {
  display: block;
  font-size: 15px;
}
.mgHub .tx small {
  font-size: 12px;
  color: var(--mg-muted);
}
.mgHub .row button {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 2px solid var(--mg-dark);
  background: var(--mg-paper);
  font: 800 14px 'Rubik', sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
  flex: none;
}
.mgHub .row.hot button {
  background: var(--mg-orange);
  color: #fff;
}
.mgHub h5 {
  margin: 10px 0 2px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-muted);
}

/* result screen (Result.html) */
.mgRes {
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(43, 29, 16, 0.94);
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}
.mgRes .box {
  width: min(360px, 100%);
  background: var(--mg-cream);
  border-radius: 22px;
  padding: 18px 18px 18px;
  position: relative;
  margin-top: 40px;
  box-sizing: border-box;
}
.mgRes .stars {
  position: absolute;
  left: 0;
  right: 0;
  top: -46px;
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 64px;
  line-height: 1;
}
.mgRes .stars span {
  color: #d6ccb9;
  -webkit-text-stroke: 3px var(--mg-dark);
}
.mgRes .stars span.on {
  color: var(--mg-gold);
}
.mgRes .stars span:nth-child(2) {
  font-size: 76px;
  margin-top: -10px;
}
.mgRes .art {
  height: 80px;
  display: grid;
  place-items: center;
  margin-top: 14px;
}
.mgRes .art img {
  max-height: 80px;
}
.mgRes .kind {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-green);
}
.mgRes h3 {
  text-align: center;
  margin: 6px 0 12px;
  font-size: 28px;
  font-weight: 500;
}
.mgRes .tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.mgRes .tiles div {
  background: var(--mg-paper);
  border-radius: 12px;
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  color: var(--mg-muted);
}
.mgRes .tiles b {
  display: block;
  font-size: 24px;
  color: var(--mg-ink);
}
.mgRes .tiles .rec {
  background: #fdf0c2;
  box-shadow: inset 0 0 0 2px var(--mg-gold);
}
.mgRes h6 {
  margin: 14px 0 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mg-muted);
}
.mgRes .rw {
  display: flex;
  gap: 8px;
  align-items: center;
  border: 2px solid #d6ccb9;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
  background: #fbf6ea;
}
.mgRes .rw i {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-style: normal;
  background: #f0b98f;
  flex: none;
}
.mgRes .rw.ok i {
  background: var(--mg-leaf);
}
.mgRes .rw.bad i {
  background: #f0a090;
}
.mgRes .quote {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
  font-size: 13px;
  color: var(--mg-muted);
  line-height: 1.35;
}
.mgRes .quote .mg-pt {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  border: 2px solid var(--mg-dark);
}
.mg-float.warn {
  color: #fff;
  font-size: 15px;
  text-shadow:
    0 2px 0 var(--mg-dark),
    0 0 6px var(--mg-dark);
}

/* ---------- Grill master ---------- */
.gr-go {
  position: absolute;
  width: 92px;
  height: 30px;
  border-radius: 15px;
  border: 2px solid var(--mg-dark);
  background: var(--mg-green);
  color: #fff;
  font: 800 14px/1 inherit;
  font-family: inherit;
  box-shadow: 0 3px 0 var(--mg-dark);
  z-index: 5;
  cursor: pointer;
  animation: grGo 0.7s ease-in-out infinite alternate;
}
.gr-go[hidden] {
  display: none;
}
@keyframes grGo {
  to {
    transform: translateY(-3px);
  }
}
.gr-sk {
  position: absolute;
  left: 0;
  width: 390px;
  height: 75.5px;
  pointer-events: none;
  transition: opacity 0.2s;
}
.gr-bar {
  position: absolute;
  width: 84px;
  height: 22px;
  border-radius: 11px;
  background: var(--mg-sand);
  border: 2px solid var(--mg-dark);
  box-sizing: border-box;
  overflow: hidden;
}
.gr-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
}
.gr-bar .f {
  left: 0;
  background: var(--mg-orange);
  z-index: 1;
  opacity: 0.9;
}
.gr-bar .z {
  background: var(--mg-leaf);
  z-index: 2;
  mix-blend-mode: multiply;
}
.gr-bar .u {
  width: 3px;
  margin-left: -1px;
  background: var(--mg-dark);
  z-index: 3;
}
.gr-bar.green .f {
  background: var(--mg-green);
}
.gr-bar.ready {
  border: 3px solid var(--mg-green);
  box-shadow: 0 0 0 3px #dcebc9;
}
.gr-bar.ready .f {
  background: var(--mg-green);
}
.gr-bar.coal {
  background: var(--mg-ink);
  border: 3px solid var(--mg-red);
}
.gr-bar.coal i {
  display: none;
}
.gr-orders {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(80px + env(safe-area-inset-top, 0px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  z-index: 5;
}
.mg.desk .gr-orders {
  left: calc(var(--wl) + 12px);
  width: calc(var(--ww) - 24px);
  right: auto;
}
.gr-o {
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  box-shadow: 0 3px 0 var(--mg-dark);
  font-size: 11px;
  line-height: 1.2;
  min-width: 0;
  animation: mgpop 0.25s ease-out;
}
.gr-o b {
  font-size: 14px;
}
.gr-o .mg-pt {
  width: 44px;
  height: 44px;
}
@keyframes mgpop {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}
.gr-o .mg-pt,
.mg-pt {
  border-radius: 50%;
  overflow: hidden;
  background: var(--mg-sand);
  flex: none;
}
.qbody[hidden] {
  display: none !important;
}
.mgHub .ico.bg {
  background: var(--ib, var(--mg-sand));
}

/* ---------- Inspection (live park) ---------- */
.mg:not(.scene) {
  background: none;
}
.ins-marks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.ins-m {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  box-sizing: border-box;
}
.ins-m i {
  display: none;
}
/* a soft white glint over a spot still to be found: easy to see through a crowd, not a giveaway */
.ins-m:not(.ok)::before {
  content: '';
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.25) 45%, rgba(255, 255, 255, 0) 70%);
  animation: insGlint 2.4s ease-in-out infinite;
}
.ins-m:nth-child(2n)::before {
  animation-delay: -0.8s;
}
.ins-m:nth-child(3n)::before {
  animation-delay: -1.6s;
}
@keyframes insGlint {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.7);
  }
  50% {
    opacity: 0.8;
    transform: scale(1);
  }
}
.ins-m.ok {
  border: 5px solid #e0672b;
  box-shadow: 0 0 0 4px rgba(255, 248, 232, 0.8);
}
.ins-m.ok i {
  display: grid;
  place-items: center;
  position: absolute;
  right: -6px;
  top: -6px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--mg-green);
  border: 3px solid #fff8e8;
  color: #fff;
  font-style: normal;
  font-weight: 800;
  font-size: 15px;
  box-sizing: border-box;
}
.ins-m.hint {
  border: 4px dashed var(--mg-gold);
  animation: mgpulse 0.6s ease-in-out infinite alternate;
}
@keyframes mgpulse {
  to {
    transform-origin: center;
    opacity: 0.4;
  }
}
.ins-miss {
  position: absolute;
  width: 60px;
  height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  border: 3px dashed #c2412d;
  pointer-events: none;
  z-index: 4;
}
.ins-miss b {
  position: absolute;
  left: 4px;
  top: -26px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  white-space: nowrap;
  text-shadow:
    0 2px 0 var(--mg-dark),
    0 0 6px var(--mg-dark);
}
.ins-chips {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.ins-chips > div {
  height: 52px;
  border-radius: 10px;
  border: 2px dashed #a8987c;
  background: var(--mg-paper);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 18px;
  color: var(--mg-muted);
}
.ins-chips > div.on {
  border: 2px solid var(--mg-green);
  background: #dcebc9;
  color: var(--mg-ink);
  font-size: 11px;
  align-content: center;
  gap: 2px;
}
.mg.desk .ins-chips {
  grid-template-columns: 1fr;
  gap: 8px;
}
.mg.desk .ins-chips > div {
  height: auto;
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 12px;
  font-size: 15px;
}
.mg.desk .mg-say {
  position: static;
  pointer-events: auto;
}
.mg.desk .mg-say .pt {
  width: 92px;
  height: 92px;
  border-radius: 16px;
}
.mg.desk .mg-say .bub {
  background: #fff8e8;
  border-width: 2px;
  border-radius: 4px 14px 14px 14px;
  font-size: 14px;
}
/* while a mini-game runs, the park interface steps aside (the canvas stays for live games) */
body.mgon #app > :not(canvas) {
  visibility: hidden;
}
.ins-paused {
  position: absolute;
  left: 72px;
  top: 20px;
  z-index: 5;
}
.ins-m s {
  position: absolute;
  left: 38%;
  top: 44%;
  width: 24%;
  height: 12%;
  border-radius: 50%;
  background: #7a5a3a;
  box-shadow:
    8px -4px 0 -2px #b7874e,
    -6px 3px 0 -3px #5e4128;
}

/* ---------- Ticket booth (live park) ---------- */
.gt-promo {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  background: var(--mg-orange);
  color: #fff;
  border: 3px solid var(--mg-dark);
  border-radius: 12px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  box-shadow: 0 3px 0 var(--mg-dark);
  z-index: 5;
}
.mg.desk .gt-promo {
  right: 392px;
  left: 72px;
  top: 16px;
}
.gt-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 80px;
  height: 96px;
  border-radius: 40px;
  border: 4px solid var(--mg-gold);
  box-shadow: 0 0 0 3px rgba(59, 38, 20, 0.6);
  pointer-events: none;
  z-index: 3;
}
.gt-fam {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--mg-dark);
  padding: 8px 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  line-height: 1.25;
  z-index: 4;
  max-width: 190px;
  overflow: hidden;
}
.gt-fam[hidden] {
  display: none;
}
.gt-fam b {
  font-size: 14px;
}
.gt-pts {
  display: flex;
}
.gt-pts .mg-pt {
  width: 34px;
  height: 34px;
  border: 2px solid var(--mg-dark);
  margin-right: -10px;
}
.gt-pts .mg-pt:last-child {
  margin-right: 0;
}
.gt-t {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  background: var(--mg-orange);
}
.gt-cp {
  font-style: normal;
  font-weight: 800;
  color: var(--mg-orange);
}
.gt-ws {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.gt-w {
  height: 92px;
  border-radius: 14px;
  border: 3px solid var(--mg-dark);
  background: var(--mg-paper);
  font: 700 13px 'Rubik', sans-serif;
  color: var(--mg-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 4px;
  cursor: pointer;
  line-height: 1.1;
  text-align: center;
}
.gt-w.pr {
  background: #fff1c2;
  box-shadow: 0 0 0 3px var(--mg-gold);
}
.gt-w .mg-pt {
  width: 40px;
  height: 40px;
}
.gt-w b {
  font-size: 15px;
}
.gt-w:active {
  transform: translateY(2px);
}
.mg.desk .gt-ws {
  grid-template-columns: 1fr;
}
.mg.desk .gt-w {
  height: 64px;
  flex-direction: row;
  gap: 10px;
  justify-content: flex-start;
  padding: 0 12px;
}
.mg.desk .gt-w b {
  margin-left: auto;
}
.gt-life {
  width: 20px;
  height: 20px;
  fill: #6b5a48;
}
.gt-life.on {
  fill: var(--mg-gold);
}
.gt-tm {
  font-size: 15px;
  margin-left: 4px;
}

/* ---------- Dino feeding ---------- */
.df-lane {
  position: absolute;
  top: 128px;
  width: 100px;
  height: 236px;
  border-radius: 50px;
  background: rgba(43, 29, 16, 0.32);
  border: 2px solid rgba(255, 248, 232, 0.55);
  box-sizing: border-box;
}
.df-ring {
  position: absolute;
  top: 290px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 5px solid #fff8e8;
  box-sizing: border-box;
}
.df-ring.on {
  animation: dfring 0.25s ease-out;
}
@keyframes dfring {
  from {
    border-color: var(--mg-gold);
    box-shadow: 0 0 0 8px rgba(242, 201, 76, 0.45);
  }
}
.df-notes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.df-n {
  position: absolute;
  left: 0;
  top: 0;
}
.df-n.l0 {
  width: 40px;
  height: 66px;
}
.df-n.l1 {
  width: 64px;
  height: 31px;
}
.df-full {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.df-full .mg-bar {
  flex: 1;
}
.df-full b {
  font-size: 13px;
  font-weight: 800;
}
.df-btns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.df-b {
  height: 76px;
  border-radius: 18px;
  border: 3px solid var(--mg-dark);
  box-shadow: 0 4px 0 var(--mg-dark);
  font: 800 18px 'Rubik', sans-serif;
  color: var(--mg-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  touch-action: manipulation;
}
.df-b:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--mg-dark);
}
.df-b.g {
  background: #b9dc8a;
}
.df-b.m {
  background: #f3b39a;
}
.df-b.g img {
  width: 30px;
  height: 50px;
}
.df-b.m img {
  width: 58px;
  height: 28px;
}
.mg.desk .mg-spacer + .df-btns,
.mg.desk .df-btns {
  margin-top: auto;
}

/* ---------- Volcano bombs (live park) ---------- */
.vb-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.vb-b {
  position: absolute;
  left: 0;
  top: 0;
  filter: drop-shadow(0 0 6px rgba(255, 106, 26, 0.8));
}
.vb-ring {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 4px dashed #ff6a3a;
  box-sizing: border-box;
}
.vb-ring[hidden] {
  display: none;
}
.vb-ring span {
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 4px;
  background: var(--mg-red);
  color: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid var(--mg-ink);
  white-space: nowrap;
}
.vb-oi {
  width: 24px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -1px;
}
.vb-h {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}
.vb-rides {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 4px;
}
.vb-rides i {
  height: 10px;
  border-radius: 5px;
  background: var(--mg-green);
}
.vb-rides i.bad {
  background: var(--mg-red);
}
.vb-rides i.gone {
  background: var(--mg-ink);
}

/* ---------- Mammoth stampede (live park) ---------- */
.st-verdict {
  font-size: 13px;
  line-height: 1.3;
  min-height: 1.3em;
}
.st-verdict b.bad {
  color: var(--mg-red);
}
.st-verdict b.ok {
  color: var(--mg-green);
}
.st-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.st-line {
  fill: none;
  stroke: #e0402b;
  stroke-width: 5;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
  filter: drop-shadow(0 1px 0 rgba(43, 29, 16, 0.6));
}
.st-line.safe {
  stroke: #6fbf3a;
}
.st-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.st-danger {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 4px dashed #ff6a3a;
  box-sizing: border-box;
}
.st-danger.hit {
  border-style: solid;
  border-color: var(--mg-red);
  background: rgba(168, 48, 30, 0.25);
}
.st-tag {
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(43, 29, 16, 0.85);
  color: #fff8e8;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 800;
  z-index: 4;
  pointer-events: none;
}
.st-tag[hidden] {
  display: none;
}
.st-m {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 3;
  pointer-events: none;
}
.mg-name.long {
  font-size: 15.5px;
}
.mg.desk .mg-name.long {
  font-size: 24px;
}

/* ---------- Thief chase (live park) ---------- */
.th-bag {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  z-index: 5;
  line-height: 1.3;
  border: 2px solid #1f150b;
}
.th-bag b {
  color: var(--mg-gold);
}
.mg.desk .th-bag {
  left: 72px;
  right: 392px;
  top: 16px;
}
.th-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.th-e {
  stroke: rgba(255, 248, 232, 0.85);
  stroke-width: 5;
  stroke-linecap: round;
}
.th-e.red {
  stroke: #e0402b;
  stroke-width: 6;
  stroke-dasharray: 8 7;
}
.th-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}
.th-n {
  position: absolute;
  left: -13px;
  top: -13px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff8e8;
  border: 3px solid var(--mg-dark);
  box-sizing: border-box;
}
.th-n.exit {
  background: var(--mg-red);
}
.th-n.g {
  left: -22px;
  top: -22px;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: var(--mg-sand);
  border-color: var(--mg-green);
}
.th-n.g img,
.th-t img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.th-t {
  position: absolute;
  left: -24px;
  top: -40px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--mg-red);
  background: var(--mg-sand);
  transition: transform 0.35s;
}
.th-tag {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% 0;
  background: var(--mg-red);
  color: #fff;
  border: 2px solid var(--mg-dark);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 800;
}

/* ---------- Hunt ---------- */
.hu-prey,
.hu-spear {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}
.hu-spear {
  width: 80px;
  height: 80px;
}
.hu-tag {
  position: absolute;
  left: 0;
  top: 0;
  background: rgba(43, 29, 16, 0.85);
  color: #fff8e8;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}
.hu-svg {
  position: absolute;
  inset: 0;
  width: 390px;
  height: 844px;
  pointer-events: none;
}
.hu-dash {
  fill: none;
  stroke: #fff8e8;
  stroke-width: 4;
  stroke-dasharray: 3 9;
  stroke-linecap: round;
}
.hu-aim {
  fill: none;
  stroke: var(--mg-gold);
  stroke-width: 4;
}
.hu-hand {
  position: absolute;
  left: 184px;
  top: 430px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid #fff8e8;
  background: rgba(232, 113, 42, 0.85);
  box-shadow: 0 2px 0 rgba(43, 29, 16, 0.6), 0 0 0 4px rgba(255, 248, 232, 0.35);
  pointer-events: none;
  animation: huPulse 1.2s ease-in-out infinite;
}
.hu-hand span {
  position: absolute;
  left: 50%;
  top: 100%;
  margin-top: 4px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: rgba(43, 29, 16, 0.85);
  color: #fff8e8;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
}
.hu-hand.on {
  animation: none;
}
.hu-hand.on span {
  display: none;
}
@keyframes huPulse {
  50% {
    box-shadow: 0 2px 0 rgba(43, 29, 16, 0.6), 0 0 0 10px rgba(255, 248, 232, 0.15);
  }
}
.hu-band {
  fill: none;
  stroke: #fff8e8;
  stroke-width: 3;
  opacity: 0.8;
}
.hu-spears {
  position: absolute;
  left: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 5;
}
.hu-spears img {
  width: 36px;
  height: 36px;
}
.hu-spears img.off {
  opacity: 0.25;
}
.mg.desk .hu-spears {
  left: calc(var(--wl) + 12px);
}
.hu-rw {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff8e8;
  border: 2px solid var(--mg-dark);
  border-radius: 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
}
.hu-rw img {
  width: 44px;
  height: 22px;
}
.hu-wind {
  font-size: 18px;
}

/* ---------- Fishing ---------- */
.fi-meter {
  position: absolute;
  right: 14px;
  top: calc(132px + env(safe-area-inset-top, 0px));
  width: 62px;
  height: 300px;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--mg-dark);
  padding: 6px;
  box-sizing: border-box;
  z-index: 5;
}
.mg.desk .fi-meter,
.mg.desk .fi-ring {
  right: auto;
  left: calc(var(--wl) + var(--ww) - 80px);
}
.fi-meter .in {
  position: relative;
  width: 100%;
  height: 100%;
  background: #2f6e9a;
  border-radius: 12px;
  overflow: hidden;
}
.fi-meter .z {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 76px;
  background: rgba(143, 196, 106, 0.6);
  border-top: 3px solid var(--mg-green);
  border-bottom: 3px solid var(--mg-green);
  box-sizing: border-box;
}
.fi-meter .z.on {
  background: rgba(143, 196, 106, 0.92);
}
.fi-meter .f {
  position: absolute;
  left: 4px;
  top: 0;
  width: 42px;
  height: 24px;
  transition: opacity 0.3s;
}
.fi-ring {
  position: absolute;
  right: 18px;
  top: calc(442px + env(safe-area-inset-top, 0px));
  width: 54px;
  height: 54px;
  z-index: 5;
  transform: rotate(-90deg);
}
.fi-ring circle {
  fill: none;
  stroke-width: 7;
}
.fi-ring .bg {
  stroke: rgba(246, 238, 221, 0.85);
}
.fi-ring .fg {
  stroke: var(--mg-gold);
  stroke-linecap: round;
}
.fi-bob {
  position: absolute;
  left: 216px;
  top: 324px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 4px solid transparent;
  pointer-events: none;
}
.fi-bob.bite {
  border-color: var(--mg-gold);
  box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.35);
  animation: mgpulse 0.4s ease-in-out infinite alternate;
}
.fi-kinds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.fi-kinds > div {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff8e8;
  border: 2px solid #cfc3ac;
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.2;
}
.fi-kinds > div.gold {
  background: #fff1c2;
  border-color: var(--mg-gold);
}
.fi-kinds img {
  width: 46px;
  height: 27px;
  flex: none;
}
.fi-hold {
  height: 56px;
  font-size: 18px;
}
.fi-hold.on {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--mg-dark);
}

/* ---------- Shearing ---------- */
.sh-fur img {
  position: absolute;
  width: 34px;
  height: 30px;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
}
.sh-fur img.cut {
  opacity: 0;
  transform: translateY(-30px) scale(0.6) !important;
}
.sh-svg {
  position: absolute;
  inset: 0;
  width: 390px;
  height: 844px;
  pointer-events: none;
}
.sh-tr {
  fill: none;
  stroke: var(--mg-gold);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.9;
}
.sh-pat {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: 0 3px 0 var(--mg-dark);
  z-index: 5;
}
.sh-pat .mg-pt {
  width: 44px;
  height: 44px;
}
.sh-pat .vb-h > span:last-child {
  color: #a8461a;
}
.mg.desk .sh-pat {
  left: calc(var(--wl) + 12px);
  right: auto;
  width: calc(var(--ww) - 24px);
  box-sizing: border-box;
}
.sh-ci {
  width: 28px;
  height: 24px;
}

/* ---------- Flint knapping ---------- */
.fl-svg {
  position: absolute;
  inset: 0;
  width: 390px;
  height: 844px;
  pointer-events: none;
}
.fl-shape {
  fill: rgba(255, 248, 232, 0.14);
  stroke: #fff8e8;
  stroke-width: 3;
  stroke-dasharray: 7 6;
  stroke-linejoin: round;
}
.fl-pts circle {
  fill: rgba(255, 248, 232, 0.9);
  stroke: var(--mg-dark);
  stroke-width: 2.5;
}
.fl-pts circle.done {
  fill: var(--mg-green);
  stroke: #fff8e8;
}
.fl-pts circle.cur {
  fill: var(--mg-gold);
}
.fl-pts text {
  font: 800 12px Rubik, sans-serif;
  text-anchor: middle;
  fill: var(--mg-ink);
}
.fl-ring {
  fill: none;
  stroke: var(--mg-gold);
  stroke-width: 3;
}
.fl-goal {
  position: absolute;
  left: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px;
  padding: 8px 12px;
  box-shadow: 0 3px 0 var(--mg-dark);
  font-size: 12px;
  line-height: 1.25;
  z-index: 5;
}
.fl-goal b {
  font-size: 14px;
}
.fl-goal img {
  width: 26px;
  height: 39px;
  object-fit: contain;
}
.mg.desk .fl-goal {
  left: calc(var(--wl) + 12px);
}
.fl-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  text-align: center;
  font-size: 12px;
}
.fl-tiers > div {
  background: var(--mg-paper);
  border-radius: 10px;
  padding: 6px;
}
.fl-tiers b {
  font-size: 16px;
}

/* ---------- Haggling ---------- */
.hg-say {
  position: absolute;
  left: 150px;
  top: 168px;
  width: 224px;
  background: #fff8e8;
  border: 3px solid var(--mg-dark);
  border-radius: 16px 16px 4px 16px;
  padding: 9px 12px;
  box-shadow: 0 3px 0 var(--mg-dark);
  font-size: 14px;
  line-height: 1.3;
  box-sizing: border-box;
}
.hg-goods {
  position: absolute;
  left: 92px;
  top: 384px;
  background: rgba(43, 29, 16, 0.88);
  color: #fff8e8;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}
.hg-goods img {
  width: 22px;
  height: 19px;
  object-fit: contain;
}
.hg-nom {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px;
  padding: 6px 10px;
  box-shadow: 0 3px 0 var(--mg-dark);
  z-index: 5;
  font-size: 14px;
}
.mg.desk .hg-nom {
  left: calc(var(--wl) + 12px);
  right: auto;
  width: calc(var(--ww) - 24px);
  box-sizing: border-box;
}
.hg-nom .mg-pt {
  width: 48px;
  height: 48px;
}
.hg-mood {
  display: flex;
  gap: 4px;
  margin-top: 4px;
  align-items: center;
  font-size: 12px;
}
.hg-mood i {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mg-sand);
  border: 2px solid #a8987c;
  box-sizing: border-box;
}
.hg-mood i.m2 {
  background: var(--mg-green);
  border-color: var(--mg-dark);
}
.hg-mood i.m1 {
  background: #e0a43a;
  border-color: var(--mg-dark);
}
.hg-mood i.m0 {
  background: var(--mg-red);
  border-color: var(--mg-dark);
}
.hg-mood i.on {
  box-shadow: 0 0 0 2px var(--mg-gold);
}
.hg-mood b {
  margin-left: 4px;
}
.hg-v {
  font-size: 22px;
  color: #a8461a;
}
.hg-sl {
  position: relative;
  height: 44px;
  touch-action: none;
  cursor: pointer;
}
.hg-sl i {
  position: absolute;
  top: 13px;
  height: 8px;
}
.hg-sl .tr {
  left: 0;
  right: 0;
  border-radius: 4px;
  background: var(--mg-sand);
}
.hg-sl .z {
  background: var(--mg-leaf);
  filter: blur(1.5px);
}
.hg-sl .k {
  top: 2px;
  width: 30px;
  height: 30px;
  margin-left: -15px;
  border-radius: 50%;
  background: var(--mg-orange);
  border: 3px solid var(--mg-dark);
  box-sizing: border-box;
}
.hg-sl span {
  position: absolute;
  top: 32px;
  font-size: 11px;
  color: var(--mg-muted);
}
.hg-sl span:last-child {
  right: 0;
}

/* ---------- Cave painting ---------- */
.cp-cv {
  position: absolute;
  left: 25px;
  top: 196px;
  width: 340px;
  height: 340px;
  touch-action: none;
  cursor: crosshair;
  border-radius: 8px;
  outline: 2px dashed rgba(255, 248, 232, 0.25);
}
.cp-cv.dk {
  left: calc(50% - 160px);
  top: 50%;
  width: min(62vh, calc(100vw - 640px));
  height: min(62vh, calc(100vw - 640px));
  transform: translate(-50%, -50%);
  z-index: 2;
}
.cp-undo {
  width: 100%;
  height: 100%;
  background: none;
  border: 0;
  color: var(--mg-cream);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
}
.cp-pigs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.cp-p {
  height: 62px;
  border-radius: 14px;
  border: 3px solid var(--mg-dark);
  background: var(--mg-paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font: 700 11px 'Rubik', sans-serif;
  color: var(--mg-ink);
  padding: 0;
  cursor: pointer;
}
.cp-p i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid var(--mg-dark);
  box-sizing: border-box;
}
.cp-p.on {
  background: #fff1c2;
  box-shadow: 0 0 0 3px var(--mg-gold);
}
.cp-p.empty {
  opacity: 0.45;
}
.cp-brs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}
.cp-brs span {
  margin-left: auto;
  color: var(--mg-muted);
}
.cp-b {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid #cfc3ac;
  background: var(--mg-paper);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 18px;
  cursor: pointer;
}
.cp-b i {
  border-radius: 50%;
  background: var(--mg-ink);
}
.cp-b.on {
  border: 3px solid var(--mg-dark);
  background: #fff1c2;
}
/* desktop */
.cp-x {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 6;
}
.cp-title {
  position: absolute;
  left: 76px;
  top: 16px;
  z-index: 6;
  flex: none;
  padding: 6px 16px !important;
  background: var(--mg-cream) !important;
  border: 3px solid var(--mg-dark) !important;
}
.cp-tools {
  position: absolute;
  left: 16px;
  top: 110px;
  width: 92px;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--mg-dark);
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 5;
}
.cp-tools h6 {
  margin: 0;
  font-size: 11px;
}
.cp-tools hr {
  width: 100%;
  border: 0;
  border-top: 2px solid #cfc3ac;
  margin: 2px 0;
}
.cp-tools .cp-p {
  width: 56px;
  height: 56px;
}
.cp-tools .cp-b {
  width: 56px;
  height: 40px;
}
.mg.desk .mg-card.cp-side {
  padding-top: 18px;
  bottom: auto;
}
.cp-prev {
  background: #6aa33a;
  border: 3px solid var(--mg-dark);
  border-radius: 12px;
  height: 170px;
  display: grid;
  place-items: center;
}
.cp-prev canvas {
  width: 120px;
  height: 120px;
  background: #8a8378;
  border: 3px solid #5e574e;
  border-radius: 28px 28px 6px 6px;
}
.cp-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.cp-name input {
  height: 42px;
  border-radius: 10px;
  border: 2px solid var(--mg-dark);
  background: #fff8e8;
  padding: 0 12px;
  font: 500 14px 'Rubik', sans-serif;
  user-select: text;
  -webkit-user-select: text;
}
.cp-left {
  text-align: center;
  font-size: 12px;
  color: var(--mg-muted);
}

/* ---------- Drum show ---------- */
.dr-track {
  position: relative;
  height: 30px;
  background: var(--mg-dark);
  border-radius: 15px;
  overflow: hidden;
}
.dr-track .win {
  position: absolute;
  left: calc(6% - 12px);
  top: 0;
  bottom: 0;
  width: 24px;
  border-left: 2px solid #fff8e8;
  border-right: 2px solid #fff8e8;
  box-sizing: border-box;
}
.dr-notes {
  position: absolute;
  inset: 0;
}
.dr-n {
  position: absolute;
  top: 7px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
}
.dr-n.d0 {
  background: #e98a6c;
}
.dr-n.d1 {
  top: 5px;
  width: 20px;
  height: 20px;
  margin-left: -10px;
  background: var(--mg-gold);
}
.dr-n.d2 {
  background: #9cc3e0;
}
.dr-bs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.dr-b {
  height: 112px;
  border-radius: 18px;
  border: 3px solid var(--mg-dark);
  box-shadow: 0 4px 0 var(--mg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font: 800 13px 'Rubik', sans-serif;
  color: var(--mg-ink);
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.dr-b img {
  height: auto;
  pointer-events: none;
}
.dr-b.on {
  animation: drpress 0.18s ease-out;
}
@keyframes drpress {
  50% {
    transform: translateY(4px) scale(0.97);
    box-shadow: 0 0 0 var(--mg-dark);
  }
}
@media (max-height: 700px) {
  .dr-b {
    height: 86px;
  }
  .dr-b img {
    width: 52px !important;
  }
}

/* ---------- Mammoth races ---------- */
.rc-m {
  position: absolute;
  left: 0;
  top: 0;
  width: 36px;
  pointer-events: none;
}
.rc-n {
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  border: 2px solid var(--mg-dark);
  font-weight: 800;
  font-size: 13px;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  z-index: 900;
}
.rc-n.nap::after {
  content: 'z';
  position: absolute;
  right: -12px;
  top: -10px;
  color: #fff;
  text-shadow: 0 1px 0 var(--mg-dark);
}
.rc-rs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.mg.desk .rc-rs {
  grid-template-columns: 1fr;
}
.rc-r {
  border-radius: 14px;
  border: 3px solid var(--mg-dark);
  background: var(--mg-paper);
  padding: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  text-align: left;
  font: 500 11px 'Rubik', sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
  line-height: 1.25;
}
.rc-r b {
  font-size: 13px;
}
.rc-r.on {
  background: #fff1c2;
  box-shadow: 0 0 0 3px var(--mg-gold);
}
.rc-r .mg-pt {
  width: 40px;
  height: 40px;
}
.rc-st {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
}
.rc-st button {
  height: 40px;
  flex: 1;
  border-radius: 999px;
  border: 2px solid #cfc3ac;
  background: var(--mg-paper);
  font: 700 14px 'Rubik', sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
}
.rc-st button.on {
  border: 3px solid var(--mg-dark);
  background: #fff1c2;
  font-weight: 800;
}
.rc-fair {
  font-size: 11px;
  color: var(--mg-muted);
  text-align: center;
}
.rc-order {
  display: grid;
  gap: 6px;
}
.rc-order span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}
.rc-order b {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid var(--mg-dark);
  font-size: 12px;
}

/* ---------- The Shaman's dream ---------- */
.sd-say {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(78px + env(safe-area-inset-top, 0px));
  background: rgba(43, 29, 60, 0.85);
  color: #f6eedd;
  border: 2px solid #8a6ac8;
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.35;
  z-index: 5;
}
.sd-cards {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  z-index: 5;
  align-items: end;
}
.sd-c {
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--mg-dark);
  padding: 8px 6px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  font: 500 11px/1.3 'Rubik', sans-serif;
  color: var(--mg-ink);
  cursor: pointer;
  min-height: 230px;
}
.sd-c.on {
  transform: translateY(-12px);
  box-shadow:
    0 0 0 4px var(--mg-gold),
    0 4px 0 var(--mg-dark);
}
.sd-c .pic {
  width: 100%;
  aspect-ratio: 1.1;
  border-radius: 10px;
  background: #9cc7e0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.sd-c .pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sd-c .pic svg {
  width: 70%;
  height: 70%;
}
.sd-c b {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.15;
}
.sd-c .m {
  color: var(--mg-red);
}
.sd-go {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  height: 56px;
  font-size: 16px;
  z-index: 5;
}
.sd-skip {
  position: absolute;
  right: 18px;
  top: calc(160px + env(safe-area-inset-top, 0px));
  z-index: 5;
  background: none;
  border: 0;
  color: #cfc3e8;
  font: 700 13px 'Rubik', sans-serif;
  text-decoration: underline;
  cursor: pointer;
}
.mg.desk.sd .sd-cards,
.mg.desk.sd .sd-go,
.mg.desk.sd .sd-say {
  left: calc(var(--wl) + 12px);
  right: auto;
  width: calc(var(--ww) - 24px);
}
.mg.desk.sd .mg-top {
  left: calc(var(--wl) + 12px);
  right: auto;
  width: calc(var(--ww) - 24px);
  top: 14px;
}
.mg.desk.sd .mg-top .mg-x {
  position: static;
}
.mg.desk.sd .mg-title {
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  padding: 5px 12px;
}
.mg.desk.sd .mg-name {
  font-size: 19px;
}
.mg.desk.sd .sd-skip {
  right: auto;
  left: calc(var(--wl) + var(--ww) - 90px);
}

/* ---------- Guest cards (album sheet) ---------- */
.mg.gc {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.gc-sheet {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100% - 60px);
  overflow-y: auto;
  touch-action: pan-y;
  background: #6b4a2c;
  color: #f6eedd;
  border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.mg.desk .gc-sheet {
  align-self: center;
  border-radius: 24px;
  max-height: calc(100% - 40px);
}
.gc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.gc-head h2 {
  margin: 0;
  font: 500 26px 'Rubik', sans-serif;
}
.gc-head small {
  color: #e3d6bb;
  font-size: 13px;
}
.gc-x {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--mg-cream);
  border: 3px solid var(--mg-dark);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.gc-x svg {
  width: 18px;
  height: 18px;
}
.gc-hero {
  display: flex;
  gap: 12px;
  margin: 14px 0;
  background: #fff1c2;
  color: var(--mg-ink);
  border: 3px solid var(--mg-dark);
  border-radius: 18px;
  padding: 12px;
  box-shadow: 0 0 0 3px var(--mg-gold);
  font-size: 13px;
  line-height: 1.35;
}
.gc-hero.empty {
  box-shadow: none;
  background: var(--mg-cream);
}
.gc-hero .pt {
  position: relative;
  width: 110px;
  height: 130px;
  flex: none;
  border-radius: 14px;
  border: 3px solid var(--mg-dark);
  overflow: hidden;
  background: #8a6ac8;
}
.gc-hero .pt img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gc-hero .pt i {
  position: absolute;
  left: 6px;
  top: 6px;
  background: #6a3fb0;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font: 800 10px 'Rubik', sans-serif;
}
.gc-hero .k {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a3fb0;
}
.gc-hero h3 {
  margin: 2px 0 4px;
  font: 500 20px 'Rubik', sans-serif;
}
.gc-hero p {
  margin: 0 0 6px;
}
.gc-sh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.gc-sh small {
  text-transform: none;
  letter-spacing: 0;
  color: #e3d6bb;
  font-weight: 500;
}
.gc-sh .mg-btn {
  margin-left: auto;
  height: 34px;
  font-size: 12px;
  padding: 0 10px;
  flex: none;
}
.gc-sh .ok {
  margin-left: auto;
  color: var(--mg-leaf);
  font-size: 18px;
}
.gc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.gc-c {
  position: relative;
  aspect-ratio: 0.82;
  border-radius: 12px;
  border: 3px solid var(--mg-dark);
  background: #f3c9a8;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}
.gc-c img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gc-c span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(43, 29, 16, 0.82);
  color: #fff;
  font: 700 10px 'Rubik', sans-serif;
  padding: 3px 2px;
  text-align: center;
}
.gc-c.on {
  box-shadow: 0 0 0 3px var(--mg-gold);
}
.gc-c.off {
  background: #3b2614;
  border: 3px dashed #a8987c;
  cursor: default;
  display: grid;
  place-items: center;
}
.gc-c.off span {
  position: static;
  background: none;
  font-size: 18px;
  color: #e3d6bb;
}
.gc-foot {
  font-size: 13px;
  color: #e3d6bb;
  line-height: 1.4;
}
/* Little Bo's portrait is framed low (a small child): zoom in on his face wherever a round or square crop shows it */
img[src$='pt_bo.webp'] {
  transform: scale(1.55);
  transform-origin: 50% 88%;
}
/* the entry card of an event game waits behind any open sheet (its portrait stays on the right) */
body.qopen .mgEntry,
body.popen .mgEntry,
body.bopen:not(.bmini) .mgEntry,
body.peek .mgEntry,
body.placing .mgEntry,
body.tracking .mgEntry {
  display: none;
}
/* a white-hot bomb cannot be tapped yet: a hot halo pulses around it */
.vb-b.hot {
  animation: vbHot 0.25s ease-in-out infinite alternate;
}
@keyframes vbHot {
  to {
    opacity: 0.85;
  }
}

/* ---- v33: must-play events (modal entry card, pause instead of exit) ---- */
.mgMust,
.mg-pause {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: rgba(20, 12, 4, 0.62);
  padding: 16px;
}
.mgMust[hidden] {
  display: none;
}
.mgMustCard {
  width: min(360px, 100%);
  background: var(--cream, #fbf3e2);
  color: var(--ink);
  border: 3px solid var(--bark, #4a2d16);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 6px 0 rgba(36, 21, 9, 0.35);
}
.mgMustCard h3 {
  margin: 6px 0;
  font: 400 20px/1.1 var(--display);
}
.mgMustCard p {
  margin: 4px 0 8px;
}
.mgMustCard .mg-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}
.mgMustCard .mg-btn.go {
  min-width: 160px;
  min-height: 44px;
}
.mgFirst {
  background: rgba(79, 138, 43, 0.12);
  border-radius: 10px;
  padding: 6px 8px;
}

/* v33: the lava bomb is a lumpy rock drawn in code (its colour is the heat) */
.vb-b.rock {
  border-radius: 46% 54% 42% 58% / 52% 44% 56% 48%;
  border: 2px solid rgba(30, 16, 8, 0.75);
  filter: none;
}
