/* =====================================================================
   THE MINIGAME KIT (src/mg.js) — one look for every minigame:
   a briefing, a slim rule card with the keys, pips / time / meter, stars.
   Dark sea glass, a gold hairline, foam turquoise. Phone first.
   Loaded after theme.css and social.css: it also dresses their widgets.
   ===================================================================== */
.mg-hud {
    --mg-top: 56px; --mg-gold: var(--gold, #f4c75e); --mg-gold-hi: var(--gold-hi, #fff1bd); --mg-frost: var(--frost, #5fe0dc);
    position: absolute; inset: 0; z-index: 6; pointer-events: none !important; user-select: none; -webkit-user-select: none;
    font-family: var(--font-ui, system-ui, sans-serif); color: #f3efe6;
}
.mg-hud * { pointer-events: none !important; }

/* ---------------------------------------------------------------- top */
.mg-top {
    position: absolute; left: 50%; top: var(--mg-top); transform: translate(-50%, -10px); opacity: 0;
    width: max-content; max-width: calc(100% - 24px);
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2, .9, .3, 1);
}
.mg-hud.is-live .mg-top { opacity: 1; transform: translate(-50%, 0); }
.mg-hud.is-over .mg-top { opacity: 0.35; }
.mg-card {
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 12px;
    padding: 8px 14px 8px 12px; border-radius: 16px; max-width: 100%;
    background: linear-gradient(180deg, rgba(10, 32, 43, 0.9), rgba(4, 15, 22, 0.9));
    border: 1px solid rgba(244, 199, 94, 0.42);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 241, 189, 0.16);
    transition: opacity 0.6s ease;
}
.mg-hud.is-dim .mg-card { opacity: 0.55; }
.mg-icon { font-size: 1.15rem; line-height: 1; filter: drop-shadow(0 0 6px rgba(255, 220, 140, 0.4)); }
.mg-how { font: 600 0.9rem/1.3 var(--font-ui, system-ui, sans-serif); letter-spacing: 0.01em; color: #f6f1e4; text-align: center; text-wrap: balance; max-width: 34em; }
.mg-keys { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.mg-keys:empty { display: none; }
.mg-chip { display: inline-flex; align-items: center; gap: 4px; }
.mg-chip.is-touch {
    padding: 3px 9px 3px 6px; border-radius: 999px; background: rgba(95, 224, 220, 0.12); border: 1px solid rgba(95, 224, 220, 0.5);
    color: #dffdf9; font: 700 0.74rem var(--font-ui, system-ui, sans-serif); letter-spacing: 0.04em; text-transform: uppercase;
}
.mg-chip.is-touch svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.mg-chip.is-touch b { font-weight: 700; }
.mg-or { font: italic 0.74rem var(--font-prose, Georgia, serif); color: rgba(243, 239, 230, 0.6); }
.mg-kbd {
    display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px;
    background: linear-gradient(180deg, #fbf3dc, #d9c797); color: #2a1c08; border: 1px solid #8a6a2a; border-bottom-width: 3px;
    font: 800 0.72rem var(--font-ui, system-ui, sans-serif); letter-spacing: 0.02em; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}
.mg-kbd.is-wide { padding: 0 12px; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.66rem; }
.mg-kbd + .mg-kbd { margin-left: 3px; }

.mg-track { display: flex; align-items: center; gap: 12px; min-height: 16px; }
.mg-pips { display: flex; gap: 7px; padding: 5px 10px; border-radius: 999px; background: rgba(4, 14, 20, 0.62); border: 1px solid rgba(255, 255, 255, 0.1); }
.mg-pips i {
    width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(243, 239, 230, 0.4); background: transparent;
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.25s cubic-bezier(.2, 1.6, .4, 1);
}
.mg-pips i.is-now { border-color: var(--mg-gold-hi); box-shadow: 0 0 10px rgba(244, 199, 94, 0.8); animation: mgNow 0.9s ease-in-out infinite; }
.mg-pips i.is-perfect { background: radial-gradient(circle at 35% 30%, #fff8dc, var(--mg-gold) 60%, #b97a1c); border-color: var(--mg-gold-hi); box-shadow: 0 0 12px rgba(244, 199, 94, 0.9); transform: scale(1.18); }
.mg-pips i.is-good { background: radial-gradient(circle at 35% 30%, #eafffb, var(--mg-frost) 65%, #1c8f95); border-color: #c9fbf5; box-shadow: 0 0 8px rgba(95, 224, 220, 0.6); }
.mg-pips i.is-miss { background: rgba(255, 130, 110, 0.25); border-color: rgba(255, 150, 130, 0.7); transform: scale(0.82); }
@keyframes mgNow { 50% { transform: scale(1.3); } }
.mg-time { width: min(190px, 44vw); height: 6px; border-radius: 6px; background: rgba(4, 14, 20, 0.7); border: 1px solid rgba(255, 255, 255, 0.14); overflow: hidden; }
.mg-time i { display: block; height: 100%; transform-origin: 0 50%; background: linear-gradient(90deg, var(--mg-frost), var(--mg-gold)); border-radius: 6px; }
.mg-meter { display: flex; align-items: center; gap: 5px; }
.mg-meter span { font-size: 0.82rem; color: #ff9ec7; text-shadow: 0 0 8px rgba(255, 120, 170, 0.7); transition: transform 0.25s cubic-bezier(.2, 1.6, .4, 1); }
.mg-meter b { display: block; width: min(96px, 24vw); height: 6px; border-radius: 6px; background: rgba(4, 14, 20, 0.7); border: 1px solid rgba(255, 255, 255, 0.14); overflow: hidden; }
.mg-meter b i { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #ff8fb0, #ffd2a8); transition: transform 0.2s linear; }
.mg-meter.is-hot span { transform: scale(1.35); }
.mg-count { font: 800 1.05rem var(--font-title, serif); color: var(--mg-gold-hi); text-shadow: 0 0 12px rgba(244, 199, 94, 0.8); min-width: 0; }
.mg-count:empty { display: none; }
.mg-count.is-bump { animation: mgBump 0.35s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes mgBump { 0% { transform: scale(1.6); } 100% { transform: scale(1); } }
.mg-slot { width: 100%; display: flex; justify-content: center; }
.mg-slot:empty { display: none; }

/* -------------------------------------------------------------- brief */
.mg-brief {
    position: absolute; left: 50%; top: 42%; width: min(430px, calc(100% - 36px));
    transform: translate(-50%, -50%) scale(0.86); opacity: 0; visibility: hidden;
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    padding: 18px 22px 16px; border-radius: 22px;
    background: linear-gradient(180deg, rgba(10, 32, 43, 0.94), rgba(3, 13, 20, 0.94));
    border: 1px solid rgba(244, 199, 94, 0.5);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6), 0 0 0 5px rgba(4, 16, 22, 0.55), 0 0 44px rgba(25, 184, 191, 0.16), inset 0 1px 0 rgba(255, 241, 189, 0.2);
    transition: opacity 0.25s ease, transform 0.4s cubic-bezier(.2, 1.2, .4, 1), visibility 0s linear 0.3s;
}
.mg-hud.is-brief .mg-brief { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); transition-delay: 0s; }
.mg-hud.is-live .mg-brief { transform: translate(-50%, -80%) scale(0.7); }
.mg-brief-in { position: relative; width: 74px; height: 74px; display: grid; place-items: center; }
.mg-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.mg-ring-bg { fill: rgba(4, 14, 20, 0.6); stroke: rgba(255, 255, 255, 0.12); stroke-width: 4; }
.mg-ring-fg { fill: none; stroke: var(--mg-gold); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 5px rgba(244, 199, 94, 0.8)); }
.mg-hud.is-brief .mg-ring-fg { animation: mgRing var(--mg-ms, 1600ms) linear forwards; }
@keyframes mgRing { to { stroke-dashoffset: 0; } }
.mg-brief-icon { position: relative; font-size: 2rem; line-height: 1; filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6)); }
.mg-brief-title { font: 700 1.05rem var(--font-title, serif); letter-spacing: 0.16em; text-transform: uppercase; color: var(--mg-gold-hi); }
.mg-brief-how { font: 500 1.02rem/1.38 var(--font-prose, Georgia, serif); color: #f6f1e4; text-wrap: balance; }
.mg-brief .mg-keys { margin-top: 2px; }
.mg-brief-go { font: italic 600 0.86rem var(--font-prose, Georgia, serif); color: var(--mg-frost); letter-spacing: 0.04em; margin-top: 2px; }
.mg-brief.is-go .mg-brief-go { font: 800 1.25rem var(--font-title, serif); font-style: normal; color: var(--mg-gold-hi); text-shadow: 0 0 16px rgba(244, 199, 94, 0.9); letter-spacing: 0.12em; animation: mgBump 0.3s cubic-bezier(.2, 1.6, .4, 1); }
.mg-brief.is-go .mg-ring-fg { stroke: #fff8dc; }

/* ------------------------------------------------------------- result */
.mg-result {
    position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(0.7); opacity: 0;
    display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 26px 12px; border-radius: 20px;
    background: radial-gradient(120% 140% at 50% 0%, rgba(20, 52, 64, 0.94), rgba(3, 13, 20, 0.94));
    border: 1px solid rgba(244, 199, 94, 0.55); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6), 0 0 36px rgba(244, 199, 94, 0.18);
    white-space: nowrap;
}
.mg-result.is-on { animation: mgRes 0.5s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes mgRes { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.mg-stars { display: flex; gap: 6px; }
.mg-stars i { font-style: normal; font-size: 2.1rem; line-height: 1; color: rgba(243, 239, 230, 0.16); text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5); }
.mg-stars i:nth-child(2) { transform: translateY(-5px) scale(1.14); }
.mg-stars i.is-on { color: var(--mg-gold); text-shadow: 0 0 18px rgba(244, 199, 94, 0.95), 0 2px 4px rgba(0, 0, 0, 0.5); animation: mgStar 0.5s cubic-bezier(.2, 1.8, .4, 1) both; animation-delay: calc(0.12s + var(--i, 0) * 0.14s); }
.mg-stars i.is-on:nth-child(2) { animation-name: mgStar2; }
@keyframes mgStar { from { transform: scale(0) rotate(-40deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes mgStar2 { from { transform: translateY(-5px) scale(0) rotate(-40deg); opacity: 0; } to { transform: translateY(-5px) scale(1.14) rotate(0); opacity: 1; } }
.mg-result b { font: 700 1.02rem var(--font-title, serif); letter-spacing: 0.14em; text-transform: uppercase; color: var(--mg-gold-hi); }
.mg-result.is-s0 b, .mg-result.is-s1 b { color: #d6e4ee; }
.mg-result.is-s3 { border-color: var(--mg-gold-hi); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6), 0 0 54px rgba(244, 199, 94, 0.42); }

/* the grade has the middle to itself: the last pop steps aside */
.so-stage:has(.mg-result.is-on) .so-pop, .so-card-wrap:has(.mg-result.is-on) .so-pop { opacity: 0 !important; animation: none; }

/* --------------------------------------------------------- where it sits */
.so-card-game .mg-hud, .mg-hud.is-compact { --mg-top: 8px; }
.mg-hud.is-compact .mg-card { padding: 5px 10px; border-radius: 12px; gap: 4px 8px; }
.mg-hud.is-compact .mg-how { font-size: 0.78rem; }
.mg-hud.is-compact .mg-icon { font-size: 0.95rem; }
.mg-hud.is-compact .mg-top { gap: 5px; }
.mg-hud.is-compact .mg-brief { padding: 12px 16px; gap: 5px; top: 50%; width: min(360px, calc(100% - 20px)); }
.mg-hud.is-compact .mg-brief-in { width: 52px; height: 52px; }
.mg-hud.is-compact .mg-brief-icon { font-size: 1.4rem; }
.mg-hud.is-compact .mg-brief-how { font-size: 0.9rem; }
.mg-hud.is-compact .mg-result { top: 50%; padding: 8px 18px; }
.mg-hud.is-compact .mg-stars i { font-size: 1.6rem; }
.ss-game .mg-hud { --mg-top: calc(7vh + 14px); }
/* the intro's own games keep taking their taps (the kit never does) */
.ss-game > .mg-hud { pointer-events: none !important; }

/* =====================================================================
   THE SOCIAL MOMENTS' GAMES, dressed (src/social.js)
   ===================================================================== */
.so-card-game { height: 280px; }
.so-card-wrap.is-playing .so-card-stage { min-height: 280px; }

/* on the card the props sit under the rule card */
.so-card-game .so-cg-clink { top: 60%; }
.so-card-game .so-cg-dancer { top: 60%; }
.so-card-game .so-cg-pair { top: 56%; }
.so-card-game .so-cg-glass { top: 30%; }
.so-card-game .so-gauge { height: 170px; top: 58%; }
.so-card-game .so-sway { bottom: 26px; }
.so-card-game .so-stroke { bottom: 26px; }
.so-card-game .so-holdbtn { bottom: 22px; }

/* the toast and the dance: a target with a notch, the ring that comes in */
.so-ring-target::before, .so-beat-target::before {
    content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 1px dashed rgba(255, 241, 189, 0.4);
}
.so-ring-target::after {
    content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%;
    background: var(--gold-hi, #fff1bd); box-shadow: 0 0 10px rgba(244, 199, 94, 0.9); opacity: 0.8;
}
.so-ring-moving { border-width: 3px; }
.so-beat-ring { border-width: 3px; }
.so-beat-ring.is-hit { animation: mgBurst 0.3s ease-out forwards; }
@keyframes mgBurst { to { opacity: 0; filter: brightness(2); } }

/* the pour: a proper measure, with the mark you are after named */
.so-gauge { width: 34px; border-radius: 17px; border: 2px solid rgba(244, 199, 94, 0.55); overflow: visible; background: rgba(4, 14, 20, 0.78); }
.so-gauge::before {
    content: ""; position: absolute; inset: 0; border-radius: 15px; pointer-events: none;
    background: repeating-linear-gradient(0deg, transparent 0 9.2%, rgba(255, 255, 255, 0.16) 9.2% 10%);
}
.so-gauge-fill { left: 4px; right: 4px; bottom: 4px; border-radius: 12px; max-height: calc(100% - 8px); box-shadow: 0 0 12px rgba(217, 130, 43, 0.5); }
.so-gauge-band { border-radius: 4px; left: -5px; right: -5px; }
.so-gauge-band::after {
    content: "◀"; position: absolute; left: calc(100% + 4px); top: 50%; transform: translateY(-50%); font-size: 0.8rem;
    color: var(--gold-hi, #fff1bd); text-shadow: 0 0 8px rgba(244, 199, 94, 0.9); animation: mgNudgeX 0.9s ease-in-out infinite;
}
@keyframes mgNudgeX { 50% { transform: translate(4px, -50%); } }
.so-gauge.is-in .so-gauge-fill { background: linear-gradient(0deg, #b9781c, #f4c75e 70%, #fff1bd); }
.so-holdbtn span, .so-stroke span { position: relative; }
.so-holdbtn::before, .ss-hold.is-anchor::before {
    content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px dashed rgba(244, 199, 94, 0.4); animation: mgSpin 9s linear infinite;
}
.so-holdbtn.is-down::before { border-color: rgba(255, 241, 189, 0.9); animation-duration: 1.6s; }
@keyframes mgSpin { to { transform: rotate(360deg); } }

/* the slow dance: a rail with ends, your mark and theirs */
.so-sway { height: 70px; }
.so-sway-arc { top: 29px; height: 6px; border-radius: 6px; background: rgba(4, 14, 20, 0.7); border: 1px solid rgba(244, 199, 94, 0.35); box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.6); }
.so-sway-arc::before, .so-sway-arc::after { content: ""; position: absolute; top: -5px; width: 2px; height: 14px; background: rgba(244, 199, 94, 0.55); border-radius: 2px; }
.so-sway-arc::before { left: 8%; } .so-sway-arc::after { right: 8%; }
.so-sway-theirs, .so-sway-mine { top: 32px; }
.so-sway-theirs { background: rgba(255, 158, 199, 0.14); }
.so-sway-theirs::after { content: "♥"; position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.9rem; color: rgba(255, 190, 215, 0.55); }
.so-sway.is-in .so-sway-theirs::after { color: #fff; text-shadow: 0 0 10px #ff9ec7; }
.so-sway-mine { width: 26px; height: 26px; margin: -13px 0 0 -13px; border: 2px solid #fff8dc; }

/* the massage: the word in the middle says what your hand does */
.so-breath-lbl {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
    font: 700 1.05rem var(--font-title, serif); letter-spacing: 0.1em; text-transform: uppercase; color: #fff4e2; white-space: nowrap;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 18px rgba(255, 190, 130, 0.6); transition: color 0.3s;
}
.so-breath-lbl small { display: block; margin-top: 4px; font: 700 0.84rem var(--font-ui, system-ui, sans-serif); letter-spacing: 0.06em; text-transform: none; color: var(--frost, #5fe0dc); }
.so-breath-lbl.is-off { color: #cfe0f0; }
.so-breath-lbl.is-off small { color: #ffc9b8; }
.so-breath-guide { border-width: 3px; }
.so-card-game .so-breath { width: 150px; height: 150px; top: 58%; }
.so-card-game .so-breath-lbl { top: 58%; font-size: 0.9rem; }

/* the race: two faces along the water to the rock */
.so-race, .mg-slot .so-race {
    position: relative; left: auto; top: auto; transform: none; width: min(440px, 86vw); height: 34px; border-radius: 17px;
    background: linear-gradient(180deg, rgba(25, 184, 191, 0.32), rgba(8, 60, 76, 0.5));
    border: 1px solid rgba(95, 224, 220, 0.5); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), inset 0 0 12px rgba(4, 30, 40, 0.8); overflow: visible;
}
.so-race::before {
    content: ""; position: absolute; left: 14px; right: 30px; top: 50%; height: 0; border-top: 2px dotted rgba(230, 255, 255, 0.35);
}
.so-race-me, .so-race-them {
    --c: #f4c75e; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 0; border-radius: 50%; border: 2px solid var(--c);
    background: #0a1a24 center / cover no-repeat; box-shadow: 0 0 10px color-mix(in srgb, var(--c) 70%, transparent); opacity: 1;
}
.so-race-them { margin-top: -15px; filter: saturate(0.9); z-index: 1; }
.so-race-me { z-index: 2; }
.so-race-flag { right: 2px; font-size: 1.15rem; }
.so-stroke { transition: transform 0.1s, box-shadow 0.15s, opacity 0.2s, border-color 0.2s; }
.so-stroke.is-next { border-color: #fff8dc; box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 30px rgba(244, 199, 94, 0.75); animation: mgBeat 0.5s ease-in-out infinite; }
.so-stroke:not(.is-next) { opacity: 0.62; }
@keyframes mgBeat { 50% { transform: scale(1.07); } }
.so-stroke kbd { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); }
@media (pointer: coarse) { .so-stroke kbd { display: none; } }
.so-card-game .so-stroke kbd { display: none; }

/* the old pill and corner counter give way to the kit */
.so-game .so-combo, .so-card-game .so-combo { display: none; }

/* phone: the name of the moment to the left, so the rule card has the width */
@media (max-width: 640px) {
    .mg-hud { --mg-top: 54px; }
    .mg-card .mg-icon { display: none; }
    .mg-how { font-size: 0.82rem; }
    .mg-card { padding: 6px 10px; border-radius: 13px; }
    .so-top { left: 10px; transform: none; max-width: calc(100% - 120px); overflow: hidden; animation-name: mgDropL; }
    .so-skip { top: 10px; right: 10px; }
    .mg-brief { top: 40%; }
    .mg-stars i { font-size: 1.8rem; }
    .ss-game .mg-hud { --mg-top: calc(5vh + 10px); }
}
@keyframes mgDropL { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@media (max-height: 460px) {
    .mg-brief { padding: 10px 16px; gap: 4px; }
    .mg-brief-in { width: 48px; height: 48px; }
    .mg-brief-icon { font-size: 1.3rem; }
}

/* =====================================================================
   THE INTRO'S GAMES (src/story-intro.js)
   ===================================================================== */
/* the hint pill of the helm games: the same glass as the kit */
.ss-hint {
    background: linear-gradient(180deg, rgba(10, 32, 43, 0.88), rgba(4, 15, 22, 0.88)); border: 1px solid rgba(244, 199, 94, 0.4);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 241, 189, 0.14);
}
/* cast off: the three lines, numbered, with a label that says what a tap does */
.ss-hot i { border-width: 3px; background: radial-gradient(circle, rgba(244, 199, 94, 0.22), transparent 70%); }
.ss-hot span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(4, 14, 20, 0.78); border: 1px solid rgba(255, 241, 189, 0.7); font-size: 0.9rem; }
.ss-hot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px dashed rgba(255, 241, 189, 0.45); animation: mgSpin 8s linear infinite; }
.ss-hot.is-done::after { opacity: 0; }

/* the line to the one in the water */
.ss-rope {
    height: 82px; border-radius: 41px; overflow: visible;
    background: linear-gradient(180deg, rgba(12, 58, 78, 0.9), rgba(3, 18, 28, 0.94));
    border: 1px solid rgba(244, 199, 94, 0.5); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), inset 0 0 22px rgba(2, 12, 20, 0.9);
}
.ss-rope::before {
    content: ""; position: absolute; left: 22px; right: 22px; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 3px; opacity: 0.5;
    background: repeating-linear-gradient(115deg, #e8d2a0 0 5px, #a8834a 5px 9px);
}
.ss-rope-zone {
    position: absolute; top: 7px; bottom: 7px; width: 17%; transform: translateX(-50%); border-radius: 30px; pointer-events: none;
    background: rgba(125, 255, 181, 0.16); border: 1px dashed rgba(125, 255, 181, 0.7); transition: left 0.45s ease, background 0.15s;
}
.ss-rope.is-over .ss-rope-zone { background: rgba(125, 255, 181, 0.36); border-style: solid; box-shadow: 0 0 22px rgba(125, 255, 181, 0.6); }
.ss-rope-target { width: 54px; height: 54px; margin: -27px 0 0 0; transition: left 0.45s ease; z-index: 1; }
.ss-rope-mark { top: -8px; bottom: -8px; width: 4px; margin-left: -2px; z-index: 2; background: linear-gradient(180deg, #fff1bd, #e9c47a); }
.ss-rope-mark::before {
    content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
    border: 6px solid #ff6a4a; box-shadow: 0 0 12px rgba(255, 120, 80, 0.8), inset 0 0 0 1px #fff; background: transparent;
    background-image: conic-gradient(#fff 0 12%, transparent 12% 25%, #fff 25% 37%, transparent 37% 50%, #fff 50% 62%, transparent 62% 75%, #fff 75% 87%, transparent 87%);
    -webkit-mask: radial-gradient(circle, transparent 8px, #000 9px); mask: radial-gradient(circle, transparent 8px, #000 9px);
}
.ss-rope-mark.is-hit::before { border-color: #7dffb5; box-shadow: 0 0 22px #7dffb5; }
.ss-rope-mark.is-miss::before { border-color: #8a3a2a; box-shadow: none; opacity: 0.7; }

/* the pump */
.ss-bail {
    position: absolute; left: 50%; bottom: calc(9vh + 20px); transform: translateX(-50%); display: flex; align-items: center; gap: 24px;
    pointer-events: auto; cursor: pointer; padding: 18px 84px 18px 28px; gap: 76px; border-radius: 22px; touch-action: none;
    background: linear-gradient(180deg, rgba(30, 14, 12, 0.82), rgba(10, 5, 6, 0.86)); border: 1px solid rgba(244, 199, 94, 0.5);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 241, 189, 0.14);
}
.ss-bail-water { position: relative; width: 30px; height: 124px; border-radius: 15px; border: 2px solid rgba(244, 199, 94, 0.7); overflow: hidden; background: rgba(0, 0, 0, 0.45); }
.ss-bail-water i { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transform-origin: 50% 100%; background: linear-gradient(#58d3e0, #0d4a5a); }
.ss-bail-water::after { content: ""; position: absolute; left: 0; right: 0; top: 22%; border-top: 2px dashed rgba(255, 120, 90, 0.9); }
.ss-bail-water.is-high { border-color: #ff8a6a; box-shadow: 0 0 16px rgba(255, 110, 80, 0.7); }
.ss-bail-ring {
    position: relative; width: 124px; height: 124px; border-radius: 50%; border: 4px solid var(--gold, #f4c75e); display: grid; place-items: center;
    box-shadow: 0 0 18px rgba(244, 199, 94, 0.4), inset 0 0 18px rgba(244, 199, 94, 0.3); transition: box-shadow 0.1s, border-color 0.1s;
}
.ss-bail-ring b { position: absolute; width: 124px; height: 124px; border-radius: 50%; border: 3px solid rgba(95, 224, 220, 0.95); box-shadow: 0 0 12px rgba(95, 224, 220, 0.6); }
.ss-bail-ring::after { content: "⇅"; font-size: 40px; color: #fbf3dc; text-shadow: 0 2px 8px #000; transition: transform 0.12s; }
.ss-bail-ring.is-hot { border-color: #fff8dc; box-shadow: 0 0 36px rgba(255, 230, 160, 0.95), inset 0 0 26px rgba(255, 230, 160, 0.5); }
.ss-bail-ring.is-pump::after { transform: translateY(8px) scale(0.9); }
.ss-bail-n { display: none; }
@media (max-width: 640px) {
    .ss-bail { gap: 58px; padding: 14px 64px 14px 20px; bottom: calc(6vh + 14px); }
    .ss-bail-ring, .ss-bail-ring b { width: 104px; height: 104px; }
    .ss-bail-water { height: 104px; }
}

/* =====================================================================
   THE ENGINE ROOM'S GAUGES (src/below.js)
   ===================================================================== */
.bl-gauges {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: auto; width: min(380px, calc(100% - 28px));
    padding: 16px 18px 14px; border-radius: 20px; text-align: center; color: #f3e6c4;
    background: linear-gradient(180deg, rgba(16, 26, 34, 0.94), rgba(6, 11, 16, 0.95)); border: 1px solid rgba(244, 199, 94, 0.5);
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.65), 0 0 0 5px rgba(4, 12, 18, 0.5), inset 0 1px 0 rgba(255, 241, 189, 0.16);
    font: 14px/1.4 var(--font-ui, system-ui, sans-serif); animation: mgIn 0.4s cubic-bezier(.2, 1.2, .4, 1) both;
}
@keyframes mgIn { from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); } }
.bl-g-head { display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 0.86rem var(--font-title, serif); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gold-hi, #fff1bd); }
.bl-gauges p { margin: 6px 0 10px; font: 500 0.95rem/1.4 var(--font-prose, Georgia, serif); color: #f3ecda; text-wrap: balance; }
.bl-g-time { height: 6px; border-radius: 6px; background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.14); overflow: hidden; margin: 0 6px 12px; }
.bl-g-time i { display: block; height: 100%; transform-origin: 0 50%; border-radius: 6px; background: linear-gradient(90deg, var(--frost, #5fe0dc), var(--gold, #f4c75e)); }
.bl-g-row { display: flex; gap: 26px; justify-content: center; margin: 4px 0 6px; }
.bl-g { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bl-g-dial {
    position: relative; width: 112px; height: 112px; border-radius: 50%; overflow: hidden;
    background: radial-gradient(circle at 50% 42%, #f8f2e2, #d4c9ab 78%, #b3a888); border: 5px solid #b58a3a;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55), inset 0 0 0 2px #6b4e18, inset 0 4px 10px rgba(0, 0, 0, 0.3); transition: box-shadow 0.15s;
}
.bl-g-dial::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: repeating-conic-gradient(from -120deg, #4a3f2c 0 1.2deg, transparent 1.2deg 20deg); -webkit-mask: radial-gradient(circle, transparent 37px, #000 38px); mask: radial-gradient(circle, transparent 37px, #000 38px); opacity: 0.75; }
.bl-g-dial::after { content: ""; position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f1d48a, #7a5a1c); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.bl-g-red { position: absolute; inset: 0; background: conic-gradient(from 76deg, rgba(220, 40, 30, 0.8) 0 44deg, transparent 44deg); -webkit-mask: radial-gradient(circle, transparent 30px, #000 31px); mask: radial-gradient(circle, transparent 30px, #000 31px); }
.bl-g-n { position: absolute; left: 50%; bottom: 50%; width: 3px; height: 44px; margin-left: -1.5px; background: linear-gradient(#b01e12, #5a0e08); border-radius: 2px; transform-origin: 50% 100%; }
.bl-g.is-hot .bl-g-dial { box-shadow: 0 0 26px rgba(255, 70, 50, 0.9), inset 0 0 0 2px #6b4e18; animation: mgShake 0.18s linear infinite; }
@keyframes mgShake { 25% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 1px); } }
.bl-gauges .bl-g-v {
    position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; cursor: pointer; touch-action: manipulation;
    background: linear-gradient(180deg, #fff5cf, #fbd977 30%, #eab347 62%, #c88a26); color: #2a1a06; border: 0;
    font: 700 0.84rem var(--font-ui, system-ui, sans-serif); letter-spacing: 0.04em; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); transition: transform 0.08s;
}
.bl-gauges .bl-g-v:active, .bl-gauges .bl-g-v.is-hit { transform: scale(0.93); filter: brightness(1.12); }
.bl-g.is-hot .bl-g-v { animation: mgBeat 0.4s ease-in-out infinite; }
@media (pointer: coarse) { .bl-g-v .mg-kbd { display: none; } }
.bl-ui.is-gauges .bl-map, .bl-ui.is-gauges .bl-room, .bl-ui.is-gauges .bl-hots { opacity: 0; pointer-events: none; transition: opacity .3s; }
.bl-g3 { position: absolute; inset: 0; z-index: 30; pointer-events: auto; touch-action: none; cursor: pointer; }
.bl-g3-msg { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); width: min(560px, 86vw); margin: 0; padding: 12px 18px; border-radius: 14px;
  background: rgba(6, 16, 22, 0.86); border: 1px solid rgba(244, 199, 94, 0.4); text-align: center; font: 500 0.98rem/1.45 var(--font-prose, Georgia, serif); color: #f3ecda; }
.bl-g-end { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bl-g-end .mg-result { position: static; transform: none; opacity: 1; animation: none; background: none; border: 0; box-shadow: none; padding: 2px 0 6px; }

html[data-motion="none"] .mg-hud *, html[data-motion="none"] .bl-gauges * { animation: none !important; transition: none !important; }
html[data-motion="none"] .mg-stars i.is-on { opacity: 1; }
/* --------------------------------------------------------------- skip */
/* every minigame can be skipped: a quiet pill top left (the scene's own
   "skip" sits top right), the one thing on the HUD that takes a touch */
.mg-skip {
    position: absolute; left: 12px; top: var(--mg-top, 56px); z-index: 8;
    pointer-events: auto !important; cursor: pointer;
    padding: 6px 13px; border-radius: 999px;
    background: rgba(4, 15, 22, 0.62); color: rgba(243, 239, 230, 0.78);
    border: 1px solid rgba(244, 199, 94, 0.32);
    font-family: var(--font-title, inherit); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase;
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
    transition: opacity 0.3s ease, color 0.2s ease, border-color 0.2s ease;
    touch-action: manipulation;
}
.mg-hud .mg-skip { pointer-events: auto !important; }
.mg-skip:hover, .mg-skip:focus-visible { color: #fff; border-color: var(--gold, #f4c75e); outline: none; }
.mg-skip.is-used, .mg-hud.is-over .mg-skip { opacity: 0; pointer-events: none !important; }
@media (max-width: 640px) { .mg-skip { left: 8px; top: 10px; font-size: 0.64rem; padding: 5px 11px; } }

@media (prefers-reduced-motion: reduce) {
    .mg-pips i.is-now, .so-holdbtn::before, .ss-hot::after, .so-stroke.is-next, .so-gauge-band::after { animation: none; }
}
