/* Rucksack – minispel. Alla klasser börjar med .mg-
   Pappers-/resedagbokskänsla: tunna bläckkonturer, varma färger, handstil. */

.mg-root {
  --mg-c0: #c8452b; --mg-c1: #4f9a4a; --mg-c2: #e0a93a; --mg-c3: #3d6a99;
  position: relative;
  display: flex; flex-direction: column; gap: .45rem;
  max-width: 560px; margin: 0 auto;
  font-family: 'Fraunces', Georgia, serif;
  color: var(--ink, #3a2e22);
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.mg-root *, .mg-root *::before, .mg-root *::after { box-sizing: border-box; }
.mg-root b { font-weight: 700; }
.mg-root em { font-style: normal; color: var(--accent, #c8452b); font-weight: 700; }

/* ---------- huvud, förlopp, instruktion ---------- */
.mg-head { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.mg-title { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.6rem; line-height: 1; color: var(--accent, #c8452b); }
.mg-prog { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.35rem; color: var(--ink-soft, #6b5a46); white-space: nowrap; }
.mg-bar {
  height: 9px; border: 1.5px solid var(--ink, #3a2e22); border-radius: 8px 5px 8px 6px;
  background: var(--paper-2, #efe0bd); overflow: hidden;
}
.mg-bar > i { display: block; height: 100%; width: 0; background: var(--accent-2, #2f6f6a); transition: width .3s ease-out; }
.mg-instr {
  min-height: 1.6em; text-align: center;
  font-family: 'Caveat', cursive; font-weight: 500; font-size: 1.3rem; line-height: 1.15;
  color: var(--ink-soft, #6b5a46);
  transition: opacity .5s, transform .5s;
}
.mg-instr.mg-gone { opacity: 0; transform: translateY(-5px); }

.mg-stage {
  position: relative; overflow: hidden;
  min-height: 300px; padding: .65rem;
  border: 2px solid var(--ink, #3a2e22);
  border-radius: 16px 11px 15px 9px / 10px 15px 10px 14px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 255, 255, .22), transparent 60%),
    var(--paper-2, #efe0bd);
  box-shadow: 0 2px 0 rgba(58, 46, 34, .25);
  touch-action: manipulation;
}
.mg-stage.mg-flush { padding: 0; height: 330px; touch-action: none; }
.mg-stage.mg-edge { padding: 0; }
.mg-stage::after { /* färgblink vid rätt/fel */
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0; z-index: 4;
}
.mg-stage.mg-flash-good::after { animation: mg-flash .5s ease-out; background: var(--good, #3f7d3a); }
.mg-stage.mg-flash-bad::after { animation: mg-flash .5s ease-out; background: var(--bad, #a62f2f); }
@keyframes mg-flash { 0% { opacity: .28; } 100% { opacity: 0; } }

/* ---------- gemensamma byggdelar ---------- */
.mg-s { stroke: var(--ink, #3a2e22); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mg-scene { display: block; width: 100%; height: auto; max-height: 300px; margin: 0 auto; }

.mg-btn, .mg-opt, .mg-ltile, .mg-ing-btn {
  font: inherit; color: inherit; cursor: pointer;
  background: var(--paper, #f6ecd6);
  border: 2px solid var(--ink, #3a2e22);
  border-radius: 12px 9px 12px 8px / 9px 12px 8px 12px;
  box-shadow: 0 3px 0 var(--ink, #3a2e22);
  transition: transform .08s, box-shadow .08s, background .15s;
  touch-action: manipulation;
}
.mg-btn:hover:not(:disabled), .mg-opt:hover:not(:disabled), .mg-ltile:hover:not(:disabled), .mg-ing-btn:hover:not(:disabled) { background: #fff7e2; }
.mg-btn:active:not(:disabled), .mg-opt:active:not(:disabled), .mg-ltile:active:not(:disabled), .mg-ing-btn:active:not(:disabled) {
  transform: translateY(3px); box-shadow: 0 0 0 var(--ink, #3a2e22);
}
.mg-btn { padding: .5rem 1.2rem; font-weight: 700; font-size: 1.05rem; }
.mg-btn:focus-visible, .mg-opt:focus-visible, .mg-ltile:focus-visible, .mg-ing-btn:focus-visible { outline: 3px solid var(--accent-2, #2f6f6a); outline-offset: 2px; }
.mg-root kbd {
  font: 600 .68rem/1 'Fraunces', serif; color: var(--ink-soft, #6b5a46);
  border: 1px solid currentColor; border-radius: 4px; padding: 1px 4px; opacity: .75;
}
@media (hover: none) { .mg-root kbd { display: none; } }

.mg-timer { height: 7px; border: 1.5px solid var(--ink, #3a2e22); border-radius: 6px; overflow: hidden; background: var(--paper, #f6ecd6); }
.mg-timer > i { display: block; height: 100%; width: 100%; background: var(--accent-2, #2f6f6a); }
.mg-timer > i.mg-low { background: var(--bad, #a62f2f); }

/* flytande poäng */
.mg-float {
  position: absolute; z-index: 6; pointer-events: none; white-space: nowrap;
  transform: translate(-50%, 0);
  font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.9rem; line-height: 1;
  color: var(--ink, #3a2e22);
  text-shadow: 0 0 6px var(--paper, #f6ecd6), 0 0 2px var(--paper, #f6ecd6), 0 0 10px var(--paper, #f6ecd6);
  animation: mg-float 1.1s ease-out forwards;
}
.mg-float.mg-good { color: var(--good, #3f7d3a); }
.mg-float.mg-bad { color: var(--bad, #a62f2f); }
.mg-float.mg-ok { color: var(--accent-2, #2f6f6a); font-size: 1.5rem; }
@keyframes mg-float {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.15); }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(1); }
}
.mg-shake { animation: mg-shake .42s; }
@keyframes mg-shake {
  0%, 100% { translate: 0 0; }
  15% { translate: -7px 0; } 30% { translate: 6px 0; } 45% { translate: -5px 0; } 60% { translate: 4px 0; } 80% { translate: -2px 0; }
}
.mg-pop { animation: mg-pop .35s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes mg-pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------- slutskylt ---------- */
.mg-over .mg-stage { filter: saturate(.7) brightness(.96); }
.mg-end {
  position: absolute; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center;
  background: rgba(246, 236, 214, .72); backdrop-filter: blur(2px); cursor: pointer;
  border-radius: 14px; animation: mg-fadein .25s both;
}
@media (prefers-color-scheme: dark) { .mg-end { background: rgba(42, 33, 24, .72); } }
@keyframes mg-fadein { from { opacity: 0; } to { opacity: 1; } }
.mg-endcard {
  width: min(88%, 340px); padding: 1rem 1.1rem 1.1rem; text-align: center;
  background: var(--paper, #f6ecd6); border: 2px solid var(--ink, #3a2e22);
  border-radius: 18px 12px 16px 10px / 12px 16px 11px 15px;
  box-shadow: 0 4px 0 var(--ink, #3a2e22); transform: rotate(-1deg);
  animation: mg-endpop .45s cubic-bezier(.3, 1.5, .5, 1) both;
}
@keyframes mg-endpop { from { transform: rotate(-4deg) scale(.6); opacity: 0; } to { transform: rotate(-1deg) scale(1); opacity: 1; } }
.mg-stars { font-size: 2.6rem; line-height: 1; letter-spacing: .1em; }
.mg-stars span { display: inline-block; color: var(--paper-2, #efe0bd); -webkit-text-stroke: 1.5px var(--ink, #3a2e22); opacity: .9; }
.mg-stars span.mg-on { color: #e8b02f; animation: mg-star .5s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes mg-star { from { transform: scale(0) rotate(-60deg); } to { transform: scale(1) rotate(0); } }
.mg-endtext { margin: .35rem 0 .15rem; font-size: 1.02rem; line-height: 1.35; }
.mg-endscore { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.7rem; color: var(--accent, #c8452b); }
.mg-done { margin-top: .3rem; background: var(--accent-2, #2f6f6a); color: #fff; }
.mg-done:hover:not(:disabled) { background: var(--accent-2, #2f6f6a) !important; filter: brightness(1.1); }

/* ---------- frågespel ---------- */
.mg-quiz { display: flex; flex-direction: column; gap: .6rem; min-height: 280px; }
.mg-prompt { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5rem; text-align: center; }
.mg-q { font-size: 1.12rem; line-height: 1.35; }
.mg-sum { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.45rem; color: var(--accent-2, #2f6f6a); animation: mg-pop .3s both; }
.mg-customer { display: flex; align-items: center; gap: .7rem; justify-content: center; }
.mg-face { width: 72px; height: 72px; flex: none; animation: mg-pop .35s both; }
.mg-bubble {
  position: relative; padding: .5rem .8rem; text-align: left; line-height: 1.3;
  background: var(--paper, #f6ecd6); border: 2px solid var(--ink, #3a2e22);
  border-radius: 14px 12px 14px 4px / 12px 14px 12px 4px; animation: mg-pop .35s .1s both;
}

.mg-opts { display: grid; gap: .55rem; }
.mg-opts-row { grid-auto-flow: column; grid-auto-columns: 1fr; }
.mg-opts-col { grid-template-columns: 1fr; }
.mg-opts-compass { grid-template-columns: repeat(3, 72px); grid-template-rows: repeat(3, 72px); justify-content: center; gap: .3rem .5rem; }
.mg-opt { position: relative; padding: .7rem .5rem; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; font-size: 1.1rem; }
.mg-opt small { font-size: .8rem; color: var(--ink-soft, #6b5a46); }
.mg-opt kbd { position: absolute; top: 4px; right: 5px; }
.mg-opts-col .mg-opt { flex-direction: row; justify-content: flex-start; gap: .6rem; padding-left: 1rem; min-height: 52px; }
.mg-coin { font-family: 'Caveat', cursive; font-weight: 700; font-size: 2.1rem; line-height: 1; display: flex; align-items: baseline; gap: .2rem; }
.mg-coin small { font-family: 'Fraunces', serif; font-size: .8rem; }
.mg-opts-compass .mg-opt { min-height: 0; width: 72px; height: 72px; border-radius: 50%; font-family: 'Caveat', cursive; font-size: 2.2rem; padding: 0; }
.mg-opt:disabled { cursor: default; }
.mg-opt.mg-right { background: #cfe6c6 !important; border-color: var(--good, #3f7d3a); box-shadow: 0 3px 0 var(--good, #3f7d3a); animation: mg-pop .3s both; }
.mg-opt.mg-wrong { background: #f0c9c4 !important; border-color: var(--bad, #a62f2f); box-shadow: 0 3px 0 var(--bad, #a62f2f); }
.mg-opt.mg-dim { opacity: .55; }
@media (prefers-color-scheme: dark) {
  .mg-opt.mg-right { background: #2e4a2b !important; }
  .mg-opt.mg-wrong { background: #5a2a2a !important; }
  .mg-btn:hover:not(:disabled), .mg-opt:hover:not(:disabled), .mg-ltile:hover:not(:disabled), .mg-ing-btn:hover:not(:disabled) { background: #43362a; }
}
.mg-dist { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.3rem; color: var(--accent, #c8452b); min-height: 1em; }

/* karta (Guide) */
.mg-map { width: 100%; max-width: 360px; height: auto; border: 1.5px solid var(--ink, #3a2e22); border-radius: 8px; background: var(--sea, #bfdad6); }
.mg-grid { stroke: var(--ink, #3a2e22); stroke-width: .6; opacity: .22; }
.mg-dot-here { fill: var(--accent, #c8452b); stroke: var(--ink, #3a2e22); stroke-width: 1.5; animation: mg-pulse 1.4s infinite; }
@keyframes mg-pulse { 50% { r: 7; opacity: .7; } }
.mg-dot { fill: var(--paper, #f6ecd6); stroke: var(--ink, #3a2e22); stroke-width: 1.5; }
.mg-dot.mg-r-ok { fill: var(--good, #3f7d3a); }
.mg-maplbl { font: 700 10px 'Fraunces', serif; fill: var(--ink, #3a2e22); paint-order: stroke; stroke: var(--paper, #f6ecd6); stroke-width: 3px; }
.mg-route { stroke: var(--ink, #3a2e22); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .55; }
.mg-route.mg-r-ok { stroke: var(--good, #3f7d3a); opacity: 1; stroke-width: 2; }

/* passstämpel */
.mg-stamp {
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
  padding: .35rem .9rem; border: 3px double var(--accent, #c8452b); color: var(--accent, #c8452b);
  border-radius: 10px; transform: rotate(-4deg); font-family: 'Caveat', cursive; font-size: 1.1rem; opacity: .9;
  animation: mg-pop .35s both;
}
.mg-stamp b { font-size: 1.8rem; }

/* kompass */
.mg-compass { display: flex; flex-direction: column; align-items: center; justify-content: center; animation: mg-pop .3s both; }
.mg-compass svg { width: 68px; height: 68px; }
.mg-compass small { font: 700 .72rem 'Fraunces', serif; margin-top: -3px; }
.mg-needle { transform-origin: 0 0; animation: mg-needle .8s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes mg-needle { from { rotate: -200deg; } to { rotate: 0deg; } }

/* ---------- Kock ---------- */
.mg-recipe { display: flex; flex-direction: column; gap: .7rem; align-items: center; min-height: 280px; justify-content: center; }
.mg-card {
  width: 100%; padding: .7rem; text-align: center;
  background: var(--paper, #f6ecd6); border: 2px solid var(--ink, #3a2e22); border-radius: 6px 12px 8px 12px;
  background-image: repeating-linear-gradient(transparent 0 25px, rgba(107, 90, 70, .18) 25px 26px);
  transform: rotate(-.6deg);
}
.mg-card-h { font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.4rem; color: var(--accent, #c8452b); margin-bottom: .3rem; }
.mg-ings, .mg-tiles, .mg-slots { display: flex; flex-wrap: wrap; gap: .45rem; justify-content: center; width: 100%; }
.mg-ing {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 68px; height: 74px; padding: 2px; border-radius: 12px; line-height: 1.1;
}
div.mg-ing { background: var(--paper-2, #efe0bd); border: 1.5px solid var(--ink, #3a2e22); }
.mg-ing-e { font-size: 1.9rem; line-height: 1.1; }
.mg-ing-n { font-size: .7rem; font-weight: 700; color: var(--ink-soft, #6b5a46); }
.mg-ing-num {
  position: absolute; top: -7px; left: -7px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent, #c8452b); color: var(--on-accent, #fff); font: 700 .75rem/20px 'Fraunces', serif; text-align: center;
}
.mg-ing-btn.mg-used { opacity: .25; box-shadow: none; transform: translateY(3px); }
.mg-slot {
  position: relative; width: 52px; height: 58px; display: flex; align-items: center; justify-content: center;
  border: 2px dashed var(--ink-soft, #6b5a46); border-radius: 12px;
}
.mg-slot.mg-filled { border-style: solid; border-color: var(--good, #3f7d3a); background: rgba(63, 125, 58, .15); animation: mg-pop .3s both; }
.mg-slot.mg-miss { border-style: solid; border-color: var(--bad, #a62f2f); background: rgba(166, 47, 47, .12); }

.mg-order { text-align: center; font-family: 'Caveat', cursive; font-size: 1.6rem; line-height: 1.1; }
.mg-order b { color: var(--accent, #c8452b); font-size: 1.9rem; }
.mg-steak-svg { display: block; width: 100%; max-width: 330px; height: auto; margin: 0 auto; overflow: visible; }
.mg-steak, .mg-steak-g { transition: none; }
.mg-steak-g { transform-box: fill-box; transform-origin: center; }
.mg-steak-g.mg-flip { animation: mg-flipsteak .55s ease-in-out; }
.mg-steak-g.mg-slidein { animation: mg-slidein .5s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes mg-flipsteak { 0% { transform: scaleX(1); } 50% { transform: scaleX(-.05) translateY(-14px); } 100% { transform: scaleX(1); } }
@keyframes mg-slidein { from { transform: translateX(-120px) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
.mg-grill { stroke: #1b110b; stroke-width: 5; stroke-linecap: round; opacity: .28; fill: none; }
.mg-shine { stroke: #fff; stroke-width: 3; opacity: .28; fill: none; stroke-linecap: round; }
.mg-bub { fill: #fff; opacity: 0; stroke: none; animation: mg-bub 1.4s infinite; }
@keyframes mg-bub { 0% { opacity: .0; transform: translateY(4px); } 30% { opacity: .55; } 100% { opacity: 0; transform: translateY(-14px); } }
.mg-smoke { opacity: 0; fill: none; stroke: var(--ink-soft, #6b5a46); stroke-width: 4; stroke-linecap: round; transition: opacity .4s; }
.mg-smoke.mg-on { opacity: .7; animation: mg-steam 1.2s infinite; }
@keyframes mg-steam { 50% { transform: translateY(-6px); } }
.mg-chips { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: .3rem; }
.mg-chip { display: inline-flex; align-items: center; gap: .35rem; padding: .15rem .6rem .15rem .3rem; border: 1.5px solid var(--ink-soft, #6b5a46); border-radius: 999px; font-size: .85rem; opacity: .6; }
.mg-chip i { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--ink, #3a2e22); }
.mg-chip.mg-on { opacity: 1; border-color: var(--ink, #3a2e22); border-width: 2.5px; font-weight: 700; background: var(--paper, #f6ecd6); transform: scale(1.08); }
.mg-bigbtn { display: block; margin: .6rem auto 0; padding: .7rem 2.6rem; font-size: 1.3rem; background: var(--accent, #c8452b); color: var(--on-accent, #fff); }
.mg-bigbtn:hover:not(:disabled) { background: var(--accent, #c8452b); filter: brightness(1.08); }

/* ---------- Bärare ---------- */
.mg-crate-in { transform-box: fill-box; transform-origin: center bottom; }
.mg-crate.mg-dropin > .mg-crate-in { animation: mg-dropin .45s cubic-bezier(.4, 1.5, .6, 1); }
.mg-crate.mg-tumble > .mg-crate-in { animation: mg-tumble .7s ease-in forwards; }
@keyframes mg-dropin { from { transform: translateY(-60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes mg-tumble { to { transform: translate(60px, 160px) rotate(120deg); opacity: 0; } }
.mg-load { transition: none; }
.mg-balbar {
  position: relative; height: 34px; margin: .4rem .4rem 0;
  background: var(--paper, #f6ecd6); border: 2px solid var(--ink, #3a2e22); border-radius: 17px 12px 17px 12px;
}
.mg-zone {
  position: absolute; top: 3px; bottom: 3px; border-radius: 12px;
  background: repeating-linear-gradient(45deg, rgba(63, 125, 58, .55) 0 6px, rgba(63, 125, 58, .35) 6px 12px);
  border: 1.5px solid var(--good, #3f7d3a);
}
.mg-marker {
  position: absolute; top: -7px; bottom: -7px; width: 8px; margin-left: -4px; border-radius: 4px;
  background: var(--accent, #c8452b); border: 2px solid var(--ink, #3a2e22);
}
.mg-marker.mg-ok { background: var(--good, #3f7d3a); }
.mg-marker.mg-no { background: var(--bad, #a62f2f); }
.mg-stack { max-height: 310px; }
.mg-mover { stroke-width: 2; }
.mg-landed { animation: mg-landed .25s ease-out; transform-box: fill-box; transform-origin: center bottom; }
@keyframes mg-landed { 0% { transform: scaleY(1.2) scaleX(.96); } 100% { transform: none; } }
.mg-debris { transform-box: fill-box; transform-origin: center; animation: mg-fall .95s cubic-bezier(.5, 0, 1, .6) forwards; }
@keyframes mg-fall { to { transform: translate(24px, 320px) rotate(50deg); opacity: .2; } }

/* ---------- Musikant ---------- */
.mg-lives { position: absolute; top: .45rem; right: .7rem; font-size: 1.2rem; color: var(--accent, #c8452b); letter-spacing: .1em; }
.mg-status { text-align: center; font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.8rem; min-height: 2rem; color: var(--ink-soft, #6b5a46); margin-bottom: .3rem; }
.mg-status.mg-turn { color: var(--good, #3f7d3a); animation: mg-pop .3s both; }
.mg-pads { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; width: min(100%, 320px); margin: 0 auto; }
.mg-pad {
  position: relative; aspect-ratio: 1.25; border: 2.5px solid var(--ink, #3a2e22); cursor: pointer;
  border-radius: 24px 10px 14px 10px; box-shadow: 0 4px 0 var(--ink, #3a2e22);
  opacity: .72; transition: transform .08s, opacity .08s, filter .08s, box-shadow .08s;
  touch-action: manipulation; color: #fff;
}
.mg-pad1 { border-radius: 10px 24px 10px 14px; } .mg-pad2 { border-radius: 14px 10px 10px 24px; } .mg-pad3 { border-radius: 10px 14px 24px 10px; }
.mg-pad0 { background: var(--mg-c0); } .mg-pad1 { background: var(--mg-c1); } .mg-pad2 { background: var(--mg-c2); } .mg-pad3 { background: var(--mg-c3); }
.mg-pad kbd { position: absolute; left: 8px; bottom: 6px; color: rgba(255, 255, 255, .9); }
.mg-pad.mg-lit { opacity: 1; filter: brightness(1.3) saturate(1.2); transform: translateY(3px) scale(1.03); box-shadow: 0 0 0 var(--ink, #3a2e22), 0 0 26px 6px rgba(255, 240, 180, .85); }
.mg-pad.mg-wrongpad { animation: mg-shake .4s; outline: 4px solid var(--bad, #a62f2f); }

.mg-rhythm { position: relative; display: flex; height: 300px; margin: 0; background: linear-gradient(var(--paper-2, #efe0bd), var(--paper, #f6ecd6)); touch-action: none; }
.mg-lane { position: relative; flex: 1; overflow: hidden; border-left: 1.5px dashed rgba(107, 90, 70, .45); cursor: pointer; }
.mg-lane:first-of-type { border-left: 0; }
.mg-lane.mg-pressed { background: rgba(255, 255, 255, .22); }
.mg-lanepad {
  position: absolute; left: 5px; right: 5px; bottom: 4px; height: 44px; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ink, #3a2e22); border-radius: 12px; opacity: .55;
}
.mg-lane0 .mg-lanepad, .mg-note0 { background: var(--mg-c0); } .mg-lane1 .mg-lanepad, .mg-note1 { background: var(--mg-c1); }
.mg-lane2 .mg-lanepad, .mg-note2 { background: var(--mg-c2); } .mg-lane3 .mg-lanepad, .mg-note3 { background: var(--mg-c3); }
.mg-lane.mg-pressed .mg-lanepad { opacity: 1; transform: scale(1.06); box-shadow: 0 0 18px rgba(255, 240, 180, .9); }
.mg-lanepad kbd { color: #fff; border-color: rgba(255, 255, 255, .8); }
.mg-hitline { position: absolute; left: 0; right: 0; bottom: 25px; height: 0; border-top: 2px solid var(--ink, #3a2e22); opacity: .35; pointer-events: none; }
.mg-note {
  position: absolute; left: 9%; right: 9%; top: 0; height: 24px; border: 2px solid var(--ink, #3a2e22); border-radius: 12px;
  will-change: transform;
}
.mg-note.mg-hit { opacity: 0; transition: opacity .3s, filter .3s; filter: brightness(1.6); }
.mg-note.mg-missed { opacity: .25; filter: grayscale(1); }
.mg-combo { position: absolute; z-index: 3; top: 8px; left: 0; right: 0; text-align: center; pointer-events: none; font-family: 'Caveat', cursive; font-weight: 700; font-size: 1.7rem; color: var(--accent, #c8452b); text-shadow: 0 0 6px var(--paper, #f6ecd6); }

/* ---------- Fiskare ---------- */
.mg-water { fill: var(--sea, #bfdad6); opacity: .85; }
.mg-wave { animation: mg-wave 4s linear infinite; stroke-width: 1.6; }
.mg-wave2 { animation-duration: 6s; animation-direction: reverse; }
@keyframes mg-wave { to { transform: translateX(80px); } }
.mg-ripple { opacity: 0; }
.mg-ripple.mg-go { animation: mg-ripple 1s ease-out; }
.mg-ripple2.mg-go { animation-delay: .18s; }
@keyframes mg-ripple { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(3.2); } }
.mg-ripple { transform-box: fill-box; transform-origin: center; }
.mg-bang { font: 700 46px 'Caveat', cursive; fill: var(--accent, #c8452b); stroke: var(--ink, #3a2e22); stroke-width: 1.2; opacity: 0; paint-order: stroke; }
.mg-bang.mg-on { opacity: 1; animation: mg-bang .3s cubic-bezier(.3, 1.8, .5, 1); transform-box: fill-box; transform-origin: center; }
@keyframes mg-bang { from { transform: scale(.2) rotate(-20deg); } to { transform: none; } }
.mg-fishjump { opacity: 0; }
.mg-fishjump.mg-go { animation: mg-jump 1.3s ease-out forwards; }
@keyframes mg-jump {
  0% { opacity: 1; transform: translateY(0) rotate(0); } 40% { opacity: 1; transform: translateY(-86px) rotate(-25deg); }
  75% { opacity: 1; transform: translateY(-110px) rotate(-70deg); } 100% { opacity: 0; transform: translateY(-96px) rotate(-95deg); }
}
.mg-fish-svg { width: 100%; height: 100%; overflow: visible; }

.mg-reel { display: flex; justify-content: center; align-items: stretch; gap: 1rem; height: 290px; }
.mg-track {
  position: relative; width: 112px; overflow: hidden; border: 2px solid var(--ink, #3a2e22); border-radius: 12px 8px 12px 8px;
  background: linear-gradient(var(--sea, #bfdad6), #8fbcb6);
}
.mg-zone2 {
  position: absolute; left: 3px; right: 3px; bottom: 0; border-radius: 10px;
  border: 2.5px solid var(--ink, #3a2e22); background: rgba(246, 236, 214, .5);
  background-image: repeating-linear-gradient(0deg, rgba(58, 46, 34, .22) 0 1px, transparent 1px 9px), repeating-linear-gradient(90deg, rgba(58, 46, 34, .22) 0 1px, transparent 1px 9px);
  transition: background-color .12s, border-color .12s;
}
.mg-zone2.mg-on { background-color: rgba(120, 200, 110, .5); border-color: var(--good, #3f7d3a); }
.mg-zone2.mg-held { box-shadow: 0 0 0 3px rgba(255, 255, 255, .5); }
.mg-fish2 { position: absolute; left: 50%; width: 54px; height: 34px; margin-left: -27px; z-index: 2; }
.mg-fish2 .mg-fish-svg { transition: transform .35s; }
.mg-bub2 { position: absolute; bottom: -10px; width: 8px; height: 8px; border: 1.5px solid #fff; border-radius: 50%; opacity: .7; animation: mg-rise 3.5s linear infinite; }
@keyframes mg-rise { to { transform: translateY(-300px); opacity: 0; } }
.mg-meter { position: relative; width: 28px; border: 2px solid var(--ink, #3a2e22); border-radius: 14px 14px 10px 10px; background: var(--paper, #f6ecd6); overflow: hidden; }
.mg-meter > i { position: absolute; left: 0; right: 0; bottom: 0; height: 18%; background: var(--accent-2, #2f6f6a); transition: background .2s; }
.mg-meter > i.mg-full { background: var(--good, #3f7d3a); }
.mg-reel-side { display: flex; flex-direction: column; justify-content: space-between; align-items: center; min-width: 70px; padding: .2rem 0; }
.mg-timeleft { font-family: 'Caveat', cursive; font-weight: 700; font-size: 2rem; }
.mg-reel-hint { font-family: 'Caveat', cursive; font-size: 1.15rem; color: var(--ink-soft, #6b5a46); text-align: center; line-height: 1.1; }

/* ---------- Barista ---------- */
.mg-brew { display: flex; flex-direction: column; gap: .8rem; align-items: center; min-height: 280px; justify-content: center; }
.mg-brew .mg-timer { width: 100%; }
.mg-clue { display: flex; align-items: center; gap: .6rem; text-align: left; width: 100%; padding: .4rem .7rem; background: var(--paper, #f6ecd6); border: 2px solid var(--ink, #3a2e22); border-radius: 12px 8px 12px 8px; }
.mg-clue small { display: block; font-family: 'Caveat', cursive; font-size: 1.15rem; color: var(--ink-soft, #6b5a46); line-height: 1; }
.mg-cluetxt { font-size: 1.05rem; line-height: 1.3; font-weight: 600; }
.mg-cup { width: 58px; height: 54px; flex: none; }
.mg-steam { stroke: var(--ink-soft, #6b5a46); stroke-width: 2; stroke-linecap: round; animation: mg-steam 1.8s infinite; }
.mg-slots2, .mg-tiles2 { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.mg-lslot {
  width: 34px; height: 44px; display: flex; align-items: center; justify-content: center;
  border-bottom: 3px solid var(--ink, #3a2e22); font: 700 1.6rem 'Fraunces', serif;
}
.mg-lslot.mg-filled { color: var(--good, #3f7d3a); animation: mg-pop .25s both; }
.mg-lslot.mg-miss { color: var(--bad, #a62f2f); }
.mg-ltile { width: 44px; height: 50px; font: 700 1.5rem 'Fraunces', serif; padding: 0; }
.mg-ltile.mg-used { opacity: .2; box-shadow: none; transform: translateY(3px); }
.mg-ltile.mg-wrongtile { background: #f0c9c4 !important; border-color: var(--bad, #a62f2f); }

.mg-tgtline { stroke: var(--accent, #c8452b); stroke-width: 2.5; stroke-dasharray: 6 5; }
.mg-tgtarrow { fill: var(--accent, #c8452b); stroke: var(--ink, #3a2e22); stroke-width: 1.5; transform: translateX(-4px); }
.mg-stream { stroke: #fdf6e3; }
.mg-spill { stroke: #f4e6c8; stroke-width: 6; stroke-linecap: round; opacity: 0; }
.mg-spill.mg-go { animation: mg-spill 1s ease-out forwards; }
@keyframes mg-spill { 0% { opacity: 1; stroke-dasharray: 0 200; } 100% { opacity: 1; stroke-dasharray: 120 200; } }

/* ---------- Cykelbud ---------- */
.mg-bike-cv { display: block; width: 100%; height: 100%; touch-action: none; cursor: pointer; }

/* ---------- mindre skärmar ---------- */
@media (max-width: 420px) {
  .mg-stage { padding: .5rem; }
  .mg-stage.mg-flush { padding: 0; }
  .mg-title { font-size: 1.4rem; }
  .mg-instr { font-size: 1.15rem; }
  .mg-ing { width: 58px; height: 66px; }
  .mg-ing-e { font-size: 1.6rem; }
  .mg-slot { width: 44px; height: 52px; }
  .mg-ltile { width: 38px; height: 46px; font-size: 1.3rem; }
  .mg-lslot { width: 28px; }
  .mg-opts-compass { grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(3, 64px); }
  .mg-opts-compass .mg-opt { width: 64px; height: 64px; }
  .mg-compass svg { width: 60px; height: 60px; }
}

/* ---------- minskad rörelse ---------- */
@media (prefers-reduced-motion: reduce) {
  .mg-shake, .mg-pad.mg-wrongpad { animation: none; }
  .mg-wave, .mg-bub, .mg-bub2, .mg-steam, .mg-smoke.mg-on, .mg-dot-here, .mg-ripple.mg-go { animation: none; }
  .mg-float { animation: mg-fade 1.1s forwards; }
  .mg-pop, .mg-opt.mg-right, .mg-endcard, .mg-stars span.mg-on, .mg-steak-g.mg-flip, .mg-steak-g.mg-slidein, .mg-needle { animation-duration: .01s; }
  .mg-stage.mg-flash-good::after, .mg-stage.mg-flash-bad::after { animation-duration: .01s; }
}
@keyframes mg-fade { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
.mg-recipe .mg-timer { width: 100%; }

.mg-shadowfish { animation: mg-swim 9s ease-in-out infinite alternate; }
.mg-sf2 { animation-duration: 12s; animation-direction: alternate-reverse; }
@keyframes mg-swim { from { transform: translateX(-30px); } to { transform: translateX(50px); } }
.mg-cloud { animation: mg-swim 16s ease-in-out infinite alternate; }
@media (prefers-reduced-motion: reduce) { .mg-shadowfish, .mg-cloud { animation: none; } }
