/* Mini Golf Quest - canvases (backdrop, course, fx) + floating HUD + menus / screens. Everything scales with rem / clamp from phones to 4K. */
:root { --mg-acc: #4DE39A; --mg-vio: #9B7BFF; --mg-gold: #FFD23F; --mg-ink: #0F0C22; --mg-glass: rgba(15, 12, 34, .62); }
html { font-size: clamp(14px, calc(9px + .45vw), 26px); height: 100%; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; background: #0F0C22; overscroll-behavior: none; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
button, a { -webkit-tap-highlight-color: transparent; }

.mg { position: fixed; inset: 0; height: 100vh; height: 100dvh; overflow: hidden; background: #0F0C22; --safe-t: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-bottom, 0px); --safe-l: env(safe-area-inset-left, 0px); --back: none; }
.mg-bg, .mg-fx { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.mg-bg { z-index: 0; }
.mg-fx { z-index: 30; }
.mg-probe { position: fixed; left: 0; top: 0; width: 0; height: 0; visibility: hidden; pointer-events: none; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }


/* ---------- top bar ---------- */
.mg-top { position: absolute; z-index: 45; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; padding: max(12px, var(--safe-t)) max(14px, var(--safe-r)) 0 max(14px, var(--safe-l)); pointer-events: none; }
.mg-top > * { pointer-events: auto; }
.mg-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 14px 6px 6px; border-radius: 14px; background: rgba(15, 12, 34, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; transition: background .15s, transform .12s; }
.mg-brand:hover { background: rgba(15, 12, 34, .8); transform: translateY(-1px); }
.mg-brand img { width: 34px; height: 34px; }
.mg-brand b { font-family: var(--font-d); font-size: .95rem; font-weight: 400; letter-spacing: .02em; line-height: 1; }
.mg-brand b i { font-style: normal; color: var(--lime); }
.mg.is-play .mg-brand, .mg.is-pause .mg-brand, .mg.is-over .mg-brand { display: none; }
.mg-tools { display: flex; gap: 8px; margin-left: auto; }
.mg.is-play .mg-tools, .mg.is-pause .mg-tools, .mg.is-over .mg-tools { margin-left: 0; width: 100%; justify-content: flex-start; }
.mg-tool { width: 46px; height: 46px; border: 0; padding: 0; display: grid; place-items: center; border-radius: 13px; background: rgba(15, 12, 34, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; transition: background .15s, transform .12s; text-decoration: none; color: #fff; flex: none; }
.mg-tool:hover { background: rgba(15, 12, 34, .85); transform: translateY(-1px); }
.mg-tool svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mg.is-menu .mg-tool--home, .mg.is-menu #bPause, .mg.is-over #bPause { display: none; }
.mg-tool--r { margin-left: auto; }
@media (pointer: coarse) { .mg-tool { width: 48px; height: 48px; } .mg-tool--full { display: none; } }

/* ---------- HUD ---------- */
.mg-hud { position: absolute; inset: 0; z-index: 12; pointer-events: none; color: #fff; font-size: 1rem; }
.mg-hud[hidden] { display: none; }
.mg-stats { position: absolute; left: 50%; transform: translateX(-50%); top: max(12px, var(--safe-t)); display: flex; gap: .5rem; align-items: stretch; justify-content: center; max-width: calc(100vw - 230px); flex-wrap: wrap; width: max-content; }
.mg-pill { display: grid; align-content: center; justify-items: center; gap: .1em; min-width: 4.4rem; padding: .32em .9em .36em; border-radius: 14px; background: rgba(15, 12, 34, .66); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; line-height: 1; text-align: center; }
.mg-pill small { font-size: .56rem; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; color: #CFC9F5; }
.mg-pill b { font-family: var(--font-d); font-weight: 400; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.mg-pill b em { font-style: normal; font-size: .6em; color: #B7B0E8; margin-left: .15em; }
.mg-pill.bump { animation: mgbump .26s var(--ease, ease); }
.mg-pill.hot b { color: var(--mg-gold); }
.mg-pill.low b { color: #FF6B6B; animation: mgblink .5s steps(2) infinite; }
.mg-pill[hidden] { display: none; }
@keyframes mgbump { 0% { transform: scale(1.2); } 100% { transform: none; } }
@keyframes mgblink { 50% { opacity: .45; } }
.mg-pill--stars { grid-auto-flow: column; gap: .15em; align-items: center; padding: .3em .7em; min-width: 0; }
.mg-pill--stars svg { width: 1.45rem; height: 1.45rem; fill: rgba(255, 255, 255, .16); stroke: rgba(255, 255, 255, .35); stroke-width: 1.4; transition: fill .25s, transform .25s; }
.mg-pill--stars svg.on { fill: #FFD23F; stroke: #B67A00; transform: scale(1.06); filter: drop-shadow(0 0 5px rgba(255, 210, 63, .7)); }
.mg-pill--combo { position: absolute; left: 50%; margin-left: -2.2rem; top: calc(100% + 8px); min-width: 4.4rem; background: linear-gradient(135deg, #FF6FB5, #9B7BFF); box-shadow: 0 .3em 1em rgba(0, 0, 0, .3), 0 0 0 1.5px rgba(255, 255, 255, .25) inset; }
.mg-pill--combo small { color: #fff; }
.mg-pill--shuf { background: rgba(255, 170, 40, .22); box-shadow: 0 0 0 1.5px rgba(255, 190, 60, .6) inset; }
.mg-pill--shuf b { color: #FFD66B; font-size: 1.1rem; }
.mg-pill--shuf.warn { background: rgba(255, 150, 20, .7); animation: mgblink .45s steps(2) infinite; }
.mg-pill--shuf.warn b { color: #fff; }
.mg-bar { position: relative; width: 5.4rem; height: .42rem; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; margin-top: .25em; }
.mg-bar i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: linear-gradient(90deg, #6BE0FF, #FF6FB5); }
.mg-bar.red i { background: linear-gradient(90deg, #FF9A3C, #FF4545); }
.mg-foot { position: absolute; left: 50%; transform: translateX(-50%); bottom: max(12px, var(--safe-b)); display: flex; gap: .7rem; pointer-events: none; }
.mg-boost { pointer-events: auto; position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .55em; min-width: 7.4rem; height: 3.6rem; padding: 0 1rem 0 .6rem; border: 0; border-radius: 18px; color: #fff; background: linear-gradient(180deg, #5B49C8, #3A2C96); box-shadow: 0 .22em 0 #1D1560, 0 0 0 2px rgba(255, 255, 255, .16) inset; font-family: var(--font-d); font-size: .9rem; text-transform: uppercase; text-align: left; transition: transform .12s var(--ease, ease), filter .2s; }
.mg-boost:hover { transform: translateY(-2px); filter: brightness(1.1); }
.mg-boost:active { transform: translateY(3px); box-shadow: 0 0 0 #1D1560, 0 0 0 2px rgba(255, 255, 255, .16) inset; }
.mg-boost--hint { background: linear-gradient(180deg, #E8A21C, #B76A00); box-shadow: 0 .22em 0 #6B3A00, 0 0 0 2px rgba(255, 255, 255, .2) inset; }
.mg-boost svg { width: 1.9rem; height: 1.9rem; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mg-boost small { display: block; font-family: var(--font-b); font-weight: 800; font-size: .58rem; letter-spacing: .08em; color: rgba(255, 255, 255, .75); margin-top: .2em; }
.mg-boost b { position: absolute; top: -.55rem; right: -.35rem; min-width: 1.6rem; height: 1.6rem; display: grid; place-items: center; padding: 0 .3em; border-radius: 99px; background: #FF3D8B; color: #fff; font-weight: 400; font-size: .85rem; box-shadow: 0 0 0 2px #fff; }
.mg-boost[disabled] { filter: grayscale(.8) brightness(.7); cursor: default; pointer-events: none; }
.mg-boost[disabled] b { background: #6C6694; }
.mg-boost[hidden] { display: none; }
.mg-boost .k { display: none; position: absolute; right: .7em; bottom: .3em; }
@media (hover: hover) and (pointer: fine) { .mg-boost .k { display: inline-block; padding: .05em .45em; border-radius: 6px; background: rgba(0, 0, 0, .3); font-family: var(--font-b); font-size: .6rem; letter-spacing: 0; } }

/* ---------- banner / toast / countdown ---------- */
.mg-banner { --bc: #FF6FB5; position: absolute; z-index: 20; left: 50%; top: 38%; width: min(92vw, 40em); transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; }
.mg-banner small { display: block; font-weight: 800; letter-spacing: .24em; text-transform: uppercase; font-size: clamp(.7rem, .6rem + .5vw, 1rem); color: #fff; text-shadow: 0 2px 8px rgba(0, 0, 0, .75); }
.mg-banner h2 { margin: .1em 0 .12em; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .95; font-size: clamp(2rem, 1rem + 4.6vw, 5rem); color: var(--bc); text-shadow: 0 .05em 0 rgba(20, 10, 50, .7), 0 0 .5em color-mix(in srgb, var(--bc) 55%, transparent), 0 .1em .4em rgba(0, 0, 0, .5); -webkit-text-stroke: .03em rgba(20, 10, 50, .6); paint-order: stroke fill; }
.mg-banner p { display: inline-block; margin: .2em 0 0; padding: .35em 1.1em; border-radius: 99px; background: rgba(15, 12, 34, .7); font-weight: 800; font-size: clamp(.8rem, .6rem + .6vw, 1.15rem); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; }
.mg-banner.show { animation: mgbanner 2.6s var(--ease, ease) forwards; }
.mg-banner.quick.show { animation-duration: 1.9s; }
@keyframes mgbanner { 0% { opacity: 0; transform: translate(-50%, 24px) scale(.82); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.05); } 20% { transform: translate(-50%, 0) scale(1); } 76% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -26px) scale(1); } }
.mg-toast { position: absolute; z-index: 22; left: 50%; bottom: max(96px, calc(var(--safe-b) + 90px)); transform: translate(-50%, 12px); max-width: min(92vw, 34em); padding: .6em 1.3em; border-radius: 99px; text-align: center; font-weight: 800; font-size: clamp(.85rem, .6rem + .6vw, 1.2rem); background: rgba(15, 12, 34, .88); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .16) inset; pointer-events: none; opacity: 0; transition: opacity .3s, transform .3s var(--ease, ease); }
.mg-toast.show { opacity: 1; transform: translate(-50%, 0); }
.mg-toast.new { box-shadow: 0 0 0 2px var(--mg-gold) inset, 0 0 1.4em rgba(255, 210, 63, .35); }
.mg-toast.warn { box-shadow: 0 0 0 2px #FFAA33 inset, 0 0 1.4em rgba(255, 170, 40, .4); }
.mg-count { position: absolute; z-index: 30; inset: 0; display: grid; place-items: center; pointer-events: none; }
.mg-count[hidden] { display: none; }
.mg-count b { font-family: var(--font-d); font-weight: 400; font-size: clamp(5rem, 3rem + 10vw, 11rem); color: #fff; text-shadow: 0 .06em 0 rgba(20, 10, 50, .7), 0 0 .5em rgba(255, 111, 181, .6); -webkit-text-stroke: .04em rgba(20, 10, 50, .7); paint-order: stroke fill; animation: mgcount .8s var(--ease, ease); }
@keyframes mgcount { 0% { transform: scale(2); opacity: 0; } 25% { opacity: 1; } 100% { transform: scale(.9); opacity: .9; } }

/* ---------- overlays ---------- */
.mg-ov { position: absolute; inset: 0; z-index: 40; display: none; overflow: auto; scrollbar-width: none; overscroll-behavior: contain; touch-action: pan-y; }
.mg-ov::-webkit-scrollbar { display: none; }
.mg-ov.show { display: block; animation: mgfade .3s ease; }
.mg-ov--screen.show { background: rgba(10, 8, 28, .74); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); }
.mg-ov--center.show { background: rgba(15, 12, 34, .5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.mg-ov--menu.show { background: linear-gradient(90deg, rgba(15, 12, 34, .82) 0%, rgba(15, 12, 34, .55) 36%, rgba(15, 12, 34, .06) 62%, rgba(15, 12, 34, 0) 72%), linear-gradient(0deg, rgba(15, 12, 34, .5), rgba(15, 12, 34, 0) 26%); overflow: hidden; }
@keyframes mgfade { from { opacity: 0; } }
@keyframes mgpop2 { from { opacity: 0; transform: translateY(16px) scale(.96); } }
.mg-fade { position: absolute; inset: 0; z-index: 60; background: #0F0C22; opacity: 0; pointer-events: none; transition: opacity .3s; }
.mg-fade.on { opacity: 1; }

/* ---------- menu ---------- */
.mg-menu { position: absolute; inset: 0; display: flex; align-items: center; padding: clamp(64px, 9vh, 120px) clamp(20px, 5vw, 110px) clamp(16px, 3vh, 40px) max(clamp(20px, 5vw, 110px), var(--safe-l)); }
.mg-menu__l { animation: mgpop2 .5s var(--ease, ease); max-width: min(46em, 100%, 56vw); min-width: 0; position: relative; z-index: 3; }
.mg-kicker { display: inline-flex; align-items: center; gap: .6em; flex-wrap: wrap; font-weight: 800; font-size: clamp(.7rem, .55vw + .45rem, 1rem); letter-spacing: .16em; text-transform: uppercase; color: var(--mg-acc); }
.mg-kicker::before { content: ""; width: 28px; height: 3px; border-radius: 3px; background: currentColor; }
.mg-kicker span { color: #CFC9F5; letter-spacing: .1em; padding: .15em .7em; border-radius: 99px; background: rgba(255, 255, 255, .09); }
.mg-title { margin: .08em 0 .14em; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; line-height: .86; font-size: clamp(3.2rem, min(8vw, 15vh), 10.5rem); letter-spacing: .005em; display: grid; justify-items: start; }
.mg-title b { font-weight: 400; display: block; background: linear-gradient(100deg, #FFF3B0 0%, #C6FF3D 26%, #4DE39A 52%, #2FD6FF 78%, #FFF3B0 100%); background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; animation: mgslide2 7s linear infinite; filter: drop-shadow(0 .05em 0 rgba(30, 10, 60, .6)) drop-shadow(0 0 .45em rgba(77, 227, 154, .35)); }
.mg-title b.b2 { margin-left: .35em; animation-delay: -1.2s; }
@keyframes mgslide2 { to { background-position: -220% 0; } }
.mg-tag { margin: 0 0 clamp(14px, 2.4vh, 28px); font-size: clamp(.95rem, .5vw + .75rem, 1.35rem); font-weight: 600; color: #DCD7FF; max-width: 28em; line-height: 1.45; }
.mg-cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: clamp(6px, 1.6vh, 20px); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.f { fill: currentColor; stroke: none; }
.mg-cta .btn, .mg-sub .btn, .mg-acts .btn { gap: .55em; }
.mg-cta .btn--big { font-size: clamp(1rem, .35vw + .85rem, 1.45rem); padding: .75em 1.25em; }
.mg-cta .btn small { display: block; font-family: var(--font-b); font-size: .55em; font-weight: 800; letter-spacing: .06em; opacity: .8; text-transform: none; margin-top: .2em; }
.mg-cta .btn > span { text-align: left; line-height: 1; }
.btn--pink { --bg: #FF5CA8; --fg: #fff; --sh: #A81E66; }
.btn--vio { --bg: #6B4FE8; --fg: #fff; --sh: #30208F; }
.btn--teal { --bg: #17B6C8; --fg: #fff; --sh: #0A6070; }
.mg-sub { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; }
.mg-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: clamp(14px, 2.4vh, 28px); }
.mg-chip { padding: .5em 1em; border-radius: 14px; background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; line-height: 1.05; text-align: left; }
.mg-chip small { display: block; font-size: .6rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--mute); }
.mg-chip b { font-family: var(--font-d); font-weight: 400; font-size: 1.3rem; }
.mg-chip b i { font-style: normal; font-size: .62em; color: var(--mute); }

/* ---------- screens (levels, cards, how, settings) ---------- */
.mg-screen { position: relative; min-height: 100%; padding: max(72px, calc(var(--safe-t) + 64px)) max(16px, var(--safe-r)) max(30px, var(--safe-b)) max(16px, var(--safe-l)); }
.mg-screen--center { display: grid; place-items: center; padding-top: max(24px, var(--safe-t)); }
.mg-head { position: sticky; top: 0; z-index: 5; padding: .5rem 0 .8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: min(64em, 100%); margin: 0 auto .4rem; }
.mg-head h2 { margin: 0; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: clamp(1.4rem, 1rem + 1.8vw, 3rem); text-shadow: 0 4px 0 rgba(0, 0, 0, .4); }
.mg-bank { display: inline-flex; align-items: center; gap: .45em; padding: .4em 1em .4em .6em; border-radius: 99px; background: rgba(15, 12, 34, .7); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .12) inset; font-family: var(--font-d); font-size: 1.05rem; }
.mg-bank svg { width: 1.4em; height: 1.4em; fill: #FFD23F; stroke: #B67A00; stroke-width: 1.4; }
.mg-panel { padding: 1.2rem 1.3rem; border-radius: 22px; background: linear-gradient(180deg, #2A2260, #1B1540); box-shadow: 0 0 0 2px rgba(255, 255, 255, .1) inset, 0 20px 60px rgba(0, 0, 0, .4); }
.mg-panel h3 { margin: 0 0 .8rem; font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: 1.05rem; color: var(--mg-acc); }
.mg-wrap { width: min(64em, 100%); margin: 0 auto; display: grid; gap: 1rem; }
.mg-tabs { display: flex; gap: .5rem; overflow-x: auto; padding: .2rem .1rem .6rem; scrollbar-width: none; touch-action: pan-x; }
.mg-tabs::-webkit-scrollbar { display: none; }
.mg-tab { --c: #fff; flex: none; display: grid; gap: .1em; justify-items: start; min-width: 8.6em; padding: .55em .95em; border: 0; border-radius: 16px; color: #fff; text-align: left; background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; transition: transform .12s, background .15s; }
.mg-tab b { font-family: var(--font-d); font-weight: 400; font-size: .85rem; text-transform: uppercase; display: flex; align-items: center; gap: .45em; } .mg-tab b i { width: .8em; height: .8em; border-radius: 50%; background: var(--c); box-shadow: 0 0 .7em var(--c); }
.mg-tab small { font-weight: 800; font-size: .66rem; letter-spacing: .06em; color: var(--mute); }
.mg-tab.on { background: color-mix(in srgb, var(--c) 28%, #1B1540); box-shadow: 0 0 0 2.5px var(--c) inset, 0 0 1.2em color-mix(in srgb, var(--c) 40%, transparent); }
.mg-tab.lock { opacity: .5; }
.mg-world { --c: #FF6FB5; }
.mg-world__h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .9rem; }
.mg-world__h h3 { margin: 0; color: var(--c); font-size: 1.3rem; } .mg-world__h p { margin: .1rem 0 0; color: #CFC9F5; font-weight: 600; font-size: .9rem; }
.mg-nodes { display: grid; grid-template-columns: repeat(5, 1fr); gap: .7rem; }
.mg-node { --c: #FF6FB5; position: relative; display: grid; justify-items: center; gap: .25em; padding: .7em .3em .6em; min-height: 5.6rem; border: 0; border-radius: 18px; color: #fff; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 34%, #2A2260), color-mix(in srgb, var(--c) 12%, #1B1540)); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset, 0 .3em 0 rgba(0, 0, 0, .35); transition: transform .14s var(--ease, ease); }
.mg-node:hover { transform: translateY(-3px); }
.mg-node b { font-family: var(--font-d); font-weight: 400; font-size: 1.6rem; line-height: 1; text-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.mg-node small { font-weight: 800; font-size: .62rem; letter-spacing: .06em; color: rgba(255, 255, 255, .72); }
.mg-node .st { display: flex; gap: .1em; } .mg-node .st svg { width: 1.05rem; height: 1.05rem; fill: rgba(255, 255, 255, .18); stroke: rgba(255, 255, 255, .3); stroke-width: 1.4; } .mg-node .st svg.on { fill: #FFD23F; stroke: #B67A00; }
.mg-node.cur { box-shadow: 0 0 0 3px var(--mg-gold) inset, 0 .3em 0 rgba(0, 0, 0, .35), 0 0 1.4em rgba(255, 210, 63, .4); animation: mgbeat 1.6s ease-in-out infinite; }
@keyframes mgbeat { 50% { transform: scale(1.04); } }
.mg-node.lock { filter: grayscale(.8) brightness(.6); pointer-events: none; }
.mg-node .lk { position: absolute; right: .4rem; top: .4rem; width: 1.1rem; height: 1.1rem; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mg-node .tr { position: absolute; left: .35rem; top: .35rem; width: .95rem; height: .95rem; fill: none; stroke: #FFB84A; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mg-backs { display: grid; grid-template-columns: repeat(6, 1fr); gap: .8rem; }
.mg-bk2 { position: relative; display: grid; justify-items: center; gap: .3em; padding: .5rem .4rem .6rem; border: 0; border-radius: 16px; color: #fff; background: rgba(255, 255, 255, .06); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; transition: transform .14s; }
.mg-bk2:hover { transform: translateY(-3px); } .mg-bk2 canvas { width: 100%; aspect-ratio: .84; border-radius: .6rem; display: block; box-shadow: 0 .25em .5em rgba(0, 0, 0, .35); }
.mg-bk2 b { font-family: var(--font-d); font-weight: 400; font-size: .8rem; text-transform: uppercase; } .mg-bk2 small { font-weight: 800; font-size: .62rem; letter-spacing: .06em; color: var(--mute); }
.mg-bk2.sel { box-shadow: 0 0 0 3px var(--mg-gold) inset, 0 0 1.2em rgba(255, 210, 63, .35); } .mg-bk2.lock canvas { filter: grayscale(.9) brightness(.4); } .mg-bk2.lock { pointer-events: none; }

/* ---------- cards ---------- */
.mg-card2 { width: min(34em, 100%); text-align: center; padding: 1.7rem 1.8rem 1.5rem; border-radius: 28px; background: linear-gradient(180deg, #2A2260, #1B1540); box-shadow: 0 0 0 2px rgba(255, 255, 255, .12) inset, 0 30px 80px rgba(0, 0, 0, .55); animation: mgpop2 .4s var(--ease, ease); margin: auto; }
.mg-card2 h2 { font-family: var(--font-d); font-weight: 400; font-size: clamp(1.7rem, 1.1rem + 1.7vw, 3rem); line-height: 1; margin: .1em 0 .3em; text-transform: uppercase; text-shadow: 0 4px 0 rgba(0, 0, 0, .35); }
.mg-card2 h3 { font-family: var(--font-d); font-weight: 400; text-transform: uppercase; font-size: 1rem; color: var(--mg-acc); margin: 1.1em 0 .5em; text-align: left; }
.mg-k { display: block; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; font-size: .72rem; color: var(--mg-acc); }
.mg-sub2 { margin: 0 0 1rem; color: #CFC9F5; font-weight: 600; }
.mg-note { margin: .8rem 0 0; font-size: .82rem; color: var(--mute); font-weight: 600; }
.mg-acts { display: grid; gap: .65rem; margin-top: 1.1rem; } .mg-acts .row { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; } .mg-acts .btn { width: 100%; }
.mg-stats2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(5.6em, 1fr)); gap: .6rem; margin: 1rem 0 .4rem; } .mg-stats2 .mg-chip { text-align: center; padding: .6em .4em; }
.mg-big { font-family: var(--font-d); font-size: clamp(3.2rem, 2rem + 4.5vw, 5.2rem); line-height: 1; color: #fff; text-shadow: 0 5px 0 rgba(0, 0, 0, .4); -webkit-text-stroke: .04em rgba(20, 10, 50, .5); paint-order: stroke fill; }
.mg-biglab { font-size: .7rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); margin-top: 2px; }
.mg-rec { display: inline-block; margin: .6rem 0 0; padding: .35em 1em; border-radius: 99px; background: var(--mg-gold); color: var(--mg-ink); font-family: var(--font-d); font-size: .9rem; transform: rotate(-3deg); box-shadow: 0 3px 0 #B68A00; animation: mgpop2 .5s .3s both var(--ease, ease); }
.mg-starsbig { display: flex; justify-content: center; gap: .3rem; margin: .2rem 0 .4rem; }
.mg-starsbig svg { width: 4.6rem; height: 4.6rem; fill: rgba(255, 255, 255, .12); stroke: rgba(255, 255, 255, .25); stroke-width: 1.2; transform: scale(.9); }
.mg-starsbig svg.on { fill: #FFD23F; stroke: #C98A00; filter: drop-shadow(0 0 .5rem rgba(255, 210, 63, .8)); animation: mgstar .6s both cubic-bezier(.3, 1.8, .5, 1); animation-delay: var(--d); }
.mg-starsbig svg:nth-child(2) { transform: translateY(-.5rem) scale(1.05); }
@keyframes mgstar { 0% { transform: scale(0) rotate(-120deg); } 100% { transform: scale(1.05) rotate(0); } }
.mg-reward { display: inline-flex; align-items: center; gap: .5em; margin: .3rem .2rem 0; padding: .3em .9em; border-radius: 99px; background: rgba(255, 255, 255, .1); font-weight: 800; font-size: .8rem; animation: mgpop2 .5s .5s both var(--ease, ease); }
.mg-reward svg { width: 1.3em; height: 1.3em; fill: none; stroke: #8CF4FF; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.mg-card2--final { width: min(36em, 100%); box-shadow: 0 0 0 3px #FFC23D inset, 0 30px 80px rgba(0, 0, 0, .55), 0 0 100px rgba(255, 111, 181, .35); }
.mg-card2--how { text-align: left; width: min(44em, 100%); } .mg-card2--how h2 { text-align: center; }
.mg-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.mg-steps li { display: grid; grid-template-columns: 2.2em 1fr; gap: .8rem; align-items: center; } .mg-steps li b { width: 2em; height: 2em; border-radius: 50%; display: grid; place-items: center; background: var(--mg-acc); color: var(--mg-ink); font-family: var(--font-d); font-weight: 400; }
.mg-steps p { margin: 0; font-weight: 600; color: #E2DEFF; font-size: .95rem; line-height: 1.35; }
.mg-opt { text-align: left; margin: .7rem 0; display: grid; gap: .35rem; } .mg-opt small { font-size: .66rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.mg-seg { display: flex; gap: 6px; flex-wrap: wrap; } .mg-seg button { flex: 1; min-width: 4.4em; min-height: 44px; padding: .55em .9em; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .08); font-weight: 800; font-size: .9rem; color: #D6D1FA; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; transition: background .15s, transform .1s; }
.mg-seg button:hover { background: rgba(255, 255, 255, .14); transform: translateY(-1px); } .mg-seg button.on { background: var(--mg-acc); color: var(--mg-ink); box-shadow: none; }
.mg-seg button.danger.on, .mg-seg button.danger:hover { background: #FF5B4A; color: #fff; }
.mg-shake { animation: mgshake .35s; }
@keyframes mgshake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

/* ---------- responsive ---------- */
@media (max-width: 760px) { .mg-stats { top: calc(max(12px, var(--safe-t)) + 54px); max-width: calc(100vw - 16px); } .mg-pill { min-width: 3.8rem; padding: .28em .6em .32em; } .mg-pill b { font-size: 1.15rem; } .mg-bar { width: 4.4rem; } }
@media (max-aspect-ratio: 1/1) {
  .mg-ov--menu.show { background: linear-gradient(0deg, rgba(15, 12, 34, .96) 0%, rgba(15, 12, 34, .84) 44%, rgba(15, 12, 34, .3) 62%, rgba(15, 12, 34, 0) 74%), linear-gradient(180deg, rgba(15, 12, 34, .7), rgba(15, 12, 34, .3) 30%, rgba(15, 12, 34, 0) 50%); }
  .mg-tag { text-shadow: 0 1px 6px rgba(0, 0, 0, .8); }
  .mg-menu { padding: max(70px, calc(var(--safe-t) + 60px)) max(18px, var(--safe-r)) max(20px, var(--safe-b)) max(18px, var(--safe-l)); text-align: center; }
  .mg-menu__l { display: flex; flex-direction: column; align-items: center; height: 100%; width: 100%; max-width: 30em; margin: 0 auto; }
  .mg-title { justify-items: center; font-size: clamp(3.2rem, 17vw, 6.4rem); } .mg-title b.b2 { margin-left: 0; }
  .mg-kicker { justify-content: center; } .mg-kicker span { display: none; }
  .mg-tag { font-size: .92rem; margin-bottom: 0; display: none; }
  .mg-cta { margin-top: auto; flex-direction: column; width: 100%; gap: .6rem; } .mg-cta .btn { width: 100%; }
  .mg-sub { justify-content: center; margin-top: .8rem; } .mg-chips { justify-content: center; margin-top: .8rem; }

  .mg-brand b { display: none; } .mg-brand { padding: 6px; }
  .mg-nodes { grid-template-columns: repeat(5, 1fr); gap: .45rem; } .mg-node { min-height: 4.8rem; padding: .55em .2em .5em; } .mg-node b { font-size: 1.3rem; }
  .mg-backs { grid-template-columns: repeat(3, 1fr); }
  .mg-toast { bottom: max(100px, calc(var(--safe-b) + 92px)); }
}
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .mg-menu { padding-top: 56px; align-items: center; } .mg-tag, .mg-chips, .mg-kicker span { display: none; } .mg-title { font-size: clamp(2.4rem, 17vh, 4.6rem); } .mg-sub { margin-top: .6rem; }
  .mg-cta .btn--big { font-size: .95rem; padding: .55em 1.1em; } .mg-cta { gap: .5rem; }
  .mg-menu__l { max-width: min(36em, 58vw); }

  .mg-top { padding-top: max(6px, var(--safe-t)); } .mg-tool { width: 40px; height: 40px; } .mg-tool svg { width: 18px; height: 18px; }
  .mg-stats { top: max(6px, var(--safe-t)); } .mg-pill { padding: .22em .7em .26em; min-width: 3.6rem; } .mg-pill b { font-size: 1.1rem; } .mg-pill small { font-size: .5rem; } .mg-pill--stars svg { width: 1.2rem; height: 1.2rem; } .mg-bar { height: .3rem; }
  .mg-foot { left: auto; right: max(8px, var(--safe-r)); bottom: 50%; transform: translateY(50%); flex-direction: column; gap: .8rem; }
  .mg-boost { min-width: 0; width: 3.8rem; height: 3.8rem; padding: 0; justify-content: center; grid-template-columns: 1fr; justify-items: center; border-radius: 50%; } .mg-boost span { display: none; } .mg-boost svg { width: 2rem; height: 2rem; }
  .mg-card2 { padding: .8rem 1.1rem; border-radius: 22px; } .mg-card2.mg-res { width: min(44em, 100%); display: grid; grid-template-columns: 1.5fr 1fr; gap: .8rem 1.2rem; align-items: center; } .mg-res .mg-acts { margin-top: 0; } .mg-res .mg-acts .btn { padding: .6em .8em; } .mg-res .mg-rec { margin-top: .2rem; } .mg-res .mg-k { font-size: .6rem; } .mg-acts { margin-top: .6rem; } .mg-stats2 { margin: .5rem 0 .2rem; } .mg-big { font-size: 2.6rem; } .mg-card2 h2 { margin-bottom: .1em; } .mg-sub2 { margin-bottom: .4rem; font-size: .85rem; } .mg-starsbig svg { width: 3rem; height: 3rem; }
  .mg-screen { padding-top: 60px; } .mg-banner { top: 30%; } .mg-toast { bottom: 12px; }
}
@media (max-height: 720px) and (max-aspect-ratio: 1/1) {

  .mg-screen--center { padding-top: 64px; padding-bottom: 20px; align-items: start; }
  .mg-card2 { padding: 1.1rem 1.2rem 1rem; border-radius: 24px; } .mg-big { font-size: 3rem; } .mg-stats2 { margin: .6rem 0 .3rem; } .mg-acts { margin-top: .7rem; } .mg-card2 h2 { font-size: 1.8rem; } .mg-starsbig svg { width: 3.6rem; height: 3.6rem; }
}
@media (prefers-reduced-motion: reduce) { .mg-title b, .mg-card, .mg-show .mg-card, .mg-node.cur { animation: none !important; } .mg-in { transition-duration: .2s; } }


/* ========== Mini Golf Quest specifics ========== */
.mg-stage { cursor: crosshair; }
.mg-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.mg.is-menu .mg-stage, .mg.is-over .mg-stage, .mg.is-pause .mg-stage { pointer-events: none; }
.btn--green { --bg: #28C779; --fg: #07220F; --sh: #0C6B3A; }
.mg-pill--hole { min-width: 7.6rem; } .mg-pill--hole small { color: var(--c, #7BE06B); }
.mg-pill--hole b { font-size: 1.05rem; }
.mg-pill.over b { color: #FFB84A; } .mg-pill.low b { color: #FF6B6B; animation: mgblink .5s steps(2) infinite; }
.mg-tip { position: absolute; left: 50%; bottom: max(76px, calc(var(--safe-b) + 70px)); transform: translate(-50%, 6px); max-width: min(94vw, 40em); min-height: 2.1em; padding: .42em 1.2em; border-radius: 99px; text-align: center; font-weight: 800; font-size: clamp(.78rem, .5rem + .5vw, 1.05rem); background: rgba(15, 12, 34, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset; pointer-events: none; opacity: 0; transition: opacity .25s, transform .25s var(--ease, ease); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-tip.show { opacity: 1; transform: translate(-50%, 0); }
.mg-tip.big { font-size: clamp(.9rem, .6rem + .6vw, 1.2rem); box-shadow: 0 0 0 2px var(--mg-gold) inset, 0 0 1.4em rgba(255, 210, 63, .3); }
.mg-tip.pow { color: #CFFFE4; }
.mg-foot { left: max(14px, var(--safe-l)); transform: none; bottom: max(12px, var(--safe-b)); }
@media (max-height: 560px) and (min-aspect-ratio: 1/1) { .mg-foot { left: auto; right: max(10px, var(--safe-r)); bottom: max(10px, var(--safe-b)); transform: none; flex-direction: column; gap: .7rem; } }
.mg-boost { min-width: 0; height: 3.1rem; padding: 0 1.1rem 0 .6rem; }
.mg-boost--hint { background: linear-gradient(180deg, #19B672, #0F7F52); box-shadow: 0 .22em 0 #064A2E, 0 0 0 2px rgba(255, 255, 255, .2) inset; }
.mg-boost:not(.mg-boost--hint) { background: linear-gradient(180deg, #5B49C8, #3A2C96); }
.mg-boost svg { width: 1.6rem; height: 1.6rem; }
.mg-fire { position: absolute; z-index: 14; pointer-events: auto; }
.mg-fire[hidden] { display: none; } .mg-fire:hover { transform: translateX(-50%) translateY(-2px); } .mg-fire:active { transform: translateX(-50%) translateY(4px); }
.mg-stats { max-width: calc(100vw - 230px); }
@media (pointer: coarse) { .mg-boost .k { display: none; } }
.mg-holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.mg-hole { --c: #7BE06B; position: relative; display: grid; gap: .35rem; padding: .5rem .5rem .6rem; border: 0; border-radius: 18px; color: #fff; text-align: left; background: linear-gradient(180deg, #2E2668, #1B1540); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .14) inset, 0 .3em 0 rgba(0, 0, 0, .35); transition: transform .14s var(--ease, ease); }
.mg-hole:hover { transform: translateY(-3px); }
.mg-hole canvas { width: 100%; aspect-ratio: 240 / 130; display: block; border-radius: 12px; background: #14102E; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; }
.mg-hole__t { display: flex; align-items: baseline; gap: .5rem; padding: 0 .2rem; } .mg-hole__t b { font-family: var(--font-d); font-weight: 400; font-size: 1.15rem; color: var(--mg-gold); } .mg-hole__t span { font-weight: 800; font-size: .95rem; }
.mg-hole__m { display: flex; justify-content: space-between; align-items: center; padding: 0 .2rem; } .mg-hole__m small { font-weight: 800; font-size: .7rem; letter-spacing: .05em; color: var(--mute); }
.mg-hole .st { display: flex; gap: .1em; } .mg-hole .st svg { width: 1.15rem; height: 1.15rem; fill: rgba(255, 255, 255, .18); stroke: rgba(255, 255, 255, .3); stroke-width: 1.4; } .mg-hole .st svg.on { fill: #FFD23F; stroke: #B67A00; }
.mg-hole.cur { box-shadow: 0 0 0 3px var(--mg-gold) inset, 0 .3em 0 rgba(0, 0, 0, .35), 0 0 1.4em rgba(255, 210, 63, .4); animation: mgbeat 1.6s ease-in-out infinite; }
.mg-hole.lock { filter: grayscale(.8) brightness(.55); pointer-events: none; }
.mg-hole .lk { position: absolute; right: .9rem; top: .9rem; width: 1.5rem; height: 1.5rem; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.mg-backs { grid-template-columns: repeat(4, 1fr); }
.mg-score { margin: .8rem 0 .2rem; padding: .6rem .8rem; border-radius: 16px; background: rgba(255, 255, 255, .07); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .1) inset; text-align: left; }
.mg-score__h { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); } .mg-score__h b { font-family: var(--font-d); font-weight: 400; font-size: 1.2rem; color: #fff; letter-spacing: 0; } .mg-score__h b i { font-style: normal; font-size: .6em; color: var(--mute); }
.mg-score__rows { display: grid; grid-template-columns: repeat(6, 1fr); gap: .35rem; margin-top: .5rem; }
.mg-score__r { display: grid; justify-items: center; gap: .05em; padding: .3em .1em; border-radius: 10px; background: rgba(255, 255, 255, .06); line-height: 1.1; } .mg-score__r b { font-size: .65rem; color: var(--mute); } .mg-score__r span:not(.st) { font-family: var(--font-d); font-size: 1.15rem; } .mg-score__r small { font-size: .55rem; font-weight: 800; color: var(--mute); }
.mg-score__r .st { display: flex; } .mg-score__r .st svg { width: .6rem; height: .6rem; fill: rgba(255, 255, 255, .18); stroke: none; } .mg-score__r .st svg.on { fill: #FFD23F; } .mg-score__r.cur { box-shadow: 0 0 0 2px var(--mg-gold) inset; }
.mg-res--card { width: min(44em, 100%); }
@media (max-width: 760px) { .mg-stats { top: calc(max(12px, var(--safe-t)) + 54px); max-width: calc(100vw - 16px); } .mg-holes { gap: .55rem; } .mg-hole__t span { font-size: .8rem; } .mg-backs { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) and (max-aspect-ratio: 1/1) { .mg-holes { grid-template-columns: repeat(2, 1fr); } .mg-tip { bottom: max(80px, calc(var(--safe-b) + 74px)); white-space: normal; border-radius: 16px; } .mg-fire { bottom: max(140px, calc(var(--safe-b) + 134px)); } .mg-boost span small { display: none; } .mg-boost { height: 3rem; } }
@media (max-height: 560px) and (min-aspect-ratio: 1/1) {
  .mg-tip { bottom: max(8px, var(--safe-b)); max-width: 52vw; font-size: .8rem; min-height: 0; padding: .3em 1em; }
  .mg-fire { bottom: max(64px, calc(var(--safe-b) + 58px)); padding: .5em 1.1em; font-size: 1rem; }
  .mg-holes { grid-template-columns: repeat(3, 1fr); } .mg-hole canvas { aspect-ratio: 240 / 110; }
  .mg-score__rows { gap: .25rem; }
}
@media (prefers-reduced-motion: reduce) { .mg-fire, .mg-hole.cur { animation: none !important; } }

.mg-boost small { display: none; } .mg-boost span { line-height: 1; }
.mg-boost .k { right: .55em; bottom: auto; top: 50%; transform: translateY(-50%); }
.mg-pill b em { font-size: .62em; }

.mg-boost { padding-right: 2rem; }
.mg-pill b em { font-family: var(--font-b); font-weight: 800; font-size: .66em; }

.mg-toast { bottom: max(130px, calc(var(--safe-b) + 124px)); }
.mg-fire { left: auto; right: max(14px, var(--safe-r)); bottom: max(12px, var(--safe-b)); transform: none; }
.mg-fire:hover { transform: translateY(-2px); } .mg-fire:active { transform: translateY(4px); }
@media (max-width: 760px) and (max-aspect-ratio: 1/1) { .mg-toast { bottom: max(136px, calc(var(--safe-b) + 130px)); } .mg-fire { bottom: max(12px, var(--safe-b)); font-size: 1rem; padding: .7em 1.1em; } }
@media (max-height: 560px) and (min-aspect-ratio: 1/1) { .mg-toast { bottom: max(52px, calc(var(--safe-b) + 46px)); } .mg-fire { right: calc(max(10px, var(--safe-r)) + 4.6rem); bottom: max(10px, var(--safe-b)); } }
@media (max-aspect-ratio: 1/1) { .mg-ov--menu.show { background: linear-gradient(0deg, rgba(15, 12, 34, .94) 0%, rgba(15, 12, 34, .86) 24%, rgba(15, 12, 34, 0) 38%), linear-gradient(180deg, rgba(15, 12, 34, .55), rgba(15, 12, 34, 0) 24%); } }
.mg-bk2 canvas { width: 5.6rem; max-width: 80%; aspect-ratio: 1; border-radius: 50%; box-shadow: 0 .35em .6em rgba(0, 0, 0, .4); margin: .3rem 0; }
.mg-bk2.lock canvas { filter: grayscale(.9) brightness(.45); }
