/* Mini Golf 3D - styles. All sizes are rem/em from #app, so the layout scales with the screen. */
@font-face {
    font-family: "PP Display";
    src: url(../assets/fonts/baloo-2-latin-800-normal.woff2) format("woff2");
    font-weight: 800;
    font-display: swap;
}
@font-face {
    font-family: "PP Display";
    src: url(../assets/fonts/baloo-2-latin-700-normal.woff2) format("woff2");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "PP Text";
    src: url(../assets/fonts/nunito-latin-700-normal.woff2) format("woff2");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "PP Text";
    src: url(../assets/fonts/nunito-latin-800-normal.woff2) format("woff2");
    font-weight: 800;
    font-display: swap;
}

:root {
    --ink: #16405f;
    --paper: #ffffff;
    --sky1: #b9e6ff;
    --sky2: #eaf9ff;
    --soft: rgba(22, 64, 95, 0.16);
    --green: #3fc760;
    --wc: #4cc86a;
}
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}
html,
body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: var(--sky1);
    overscroll-behavior: none;
}
body {
    font-family: "PP Text", "Trebuchet MS", system-ui, sans-serif;
    font-weight: 700;
    color: var(--ink);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
}
button:disabled {
    cursor: default;
}
img {
    -webkit-user-drag: none;
}
#app {
    position: fixed;
    inset: 0;
    overflow: hidden;
    font-size: clamp(12px, calc(1.9vmin + 8px), 30px);
}
.screen {
    position: absolute;
    inset: 0;
    display: none;
    overflow: hidden;
    background: linear-gradient(180deg, #a9e0ff 0%, #d9f3ff 55%, #f1fbff 100%);
}
.screen.active {
    display: block;
    animation: scr 0.3s ease-out;
}
@keyframes scr {
    from {
        opacity: 0;
    }
}
b {
    font-weight: 800;
}

/* ---------- glossy sport buttons ---------- */
.c-green {
    --b1: #6bea86;
    --b2: #2fb554;
    --bd: #1c7c39;
}
.c-blue {
    --b1: #6ec6ff;
    --b2: #2f8fe8;
    --bd: #1b62ab;
}
.c-orange {
    --b1: #ffbd5c;
    --b2: #f58a1c;
    --bd: #b25a07;
}
.c-pink {
    --b1: #ff9ad2;
    --b2: #f0489e;
    --bd: #a8286f;
}
.c-teal {
    --b1: #5fe0d2;
    --b2: #12a99c;
    --bd: #0a6f66;
}
.c-purple {
    --b1: #b394ff;
    --b2: #7a45e8;
    --bd: #4c24a6;
}
.c-coral {
    --b1: #ff8a98;
    --b2: #f23f57;
    --bd: #a8212f;
}
.c-yellow {
    --b1: #ffe27a;
    --b2: #ffb61a;
    --bd: #b27a00;
}
.btn,
.rb,
.nb,
.tl,
.playb {
    background: linear-gradient(180deg, var(--b1), var(--b2));
    border: 0.16rem solid #fff;
    box-shadow:
        0 0.26rem 0 var(--bd),
        0 0.5rem 0.8rem rgba(22, 64, 95, 0.16);
    transition:
        transform 0.08s,
        box-shadow 0.08s,
        filter 0.12s;
}
.btn:active,
.rb:active,
.nb:active,
.tl:active,
.playb:active {
    transform: translateY(0.22rem);
    box-shadow:
        0 0.04rem 0 var(--bd),
        0 0.15rem 0.3rem rgba(22, 64, 95, 0.16);
}
.btn {
    display: inline-block;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.2rem;
    color: #fff;
    padding: 0.35em 1.1em 0.45em;
    border-radius: 1.2em;
    min-width: 5.4rem;
    text-align: center;
    line-height: 1.2;
}
.btn.small {
    font-size: 0.95rem;
    padding: 0.25em 0.8em 0.35em;
    min-width: 0;
}
.rb {
    width: 3.1rem;
    height: 3.1rem;
    border-radius: 50%;
    padding: 0;
    display: grid;
    place-items: center;
    flex: none;
}
.rb img {
    width: 56%;
    height: 56%;
}
.star {
    width: 1.1em;
    height: 1.1em;
}
.star.on {
    fill: #ffd23f;
    stroke: #e69a00;
    stroke-width: 1.4;
    stroke-linejoin: round;
}
.star.off {
    fill: #dcebf5;
    stroke: #bcd3e3;
    stroke-width: 1.2;
    stroke-linejoin: round;
}
button:focus-visible {
    outline: 0.2rem solid var(--ink);
    outline-offset: 0.15rem;
}
@media (hover: hover) {
    .btn:hover,
    .rb:hover,
    .nb:hover,
    .tl:hover:not(:disabled),
    .playb:hover {
        filter: brightness(1.07);
    }
}

/* ---------- loading ---------- */
.loading.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
}
.load-ball {
    width: 5.5rem;
    height: 5.5rem;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #fff 0 20%, #eef1fb 55%, #c3c9e6 100%);
    box-shadow: 0 0.4rem 0 var(--soft);
    animation: bounce 0.7s ease-in-out infinite alternate;
    position: relative;
}
.load-ball i {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle, #c3c9e6 0 0.16rem, transparent 0.2rem) 0 0 / 1.1rem 1.1rem;
    opacity: 0.8;
}
@keyframes bounce {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-1.8rem);
    }
}
.load-title {
    font-family: "PP Display";
    font-weight: 800;
    font-size: 2.2rem;
}
.load-title b {
    color: #f0489e;
}
.load-bar {
    width: min(60vw, 16rem);
    height: 0.9rem;
    border-radius: 1rem;
    background: rgba(22, 64, 95, 0.14);
    overflow: hidden;
}
.load-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6bea86, #2fb554);
    border-radius: 1rem;
    transition: width 0.2s;
}

/* ---------- menu ---------- */
.menu.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem 1rem;
}
.m-corner {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    display: flex;
    gap: 0.6rem;
    z-index: 3;
}
.m-hero {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
    max-width: 40rem;
}
.hero-stage {
    position: absolute;
    inset: 0;
}
.hero-stage canvas,
.stage canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
}
.m-info {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    z-index: 2;
    flex: none;
}
.logo {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-family: "PP Display";
    font-weight: 800;
    line-height: 1;
}
.logo .l1 {
    font-size: clamp(2.8rem, 10vmin + 0.8rem, 5.6rem);
    color: #ffd23f;
    -webkit-text-stroke: 0.1em #16405f;
    paint-order: stroke fill;
    text-shadow: 0 0.06em 0 #16405f;
    letter-spacing: 0.01em;
    padding: 0 0.08em;
}
.logo .l2 {
    margin-top: 0.35rem;
    padding: 0.12em 1em 0.2em;
    background: linear-gradient(180deg, #6bea86, #2fb554);
    border: 0.14rem solid #fff;
    border-radius: 2rem;
    box-shadow: 0 0.2rem 0 #1c7c39;
    font-size: clamp(1.4rem, 4.6vmin + 0.3rem, 2.6rem);
    color: #fff;
    letter-spacing: 0.12em;
    padding-left: 1.3em;
    padding-right: 1.3em;
    text-transform: uppercase;
}
.logo .l2 b {
    color: #ffd23f;
}
.playb {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.4rem 1.8rem 0.4rem 0.45rem;
    border-radius: 4rem;
    --b1: #6bea86;
    --b2: #2fb554;
    --bd: #1c7c39;
    min-width: 14.5rem;
    animation: pulse 2s ease-in-out infinite;
}
.playb .pl-ic {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #1c7c39;
    display: grid;
    place-items: center;
    flex: none;
}
.playb .pl-ic img {
    width: 52%;
    margin-left: 8%;
}
.playb .pl-t {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1;
}
.playb .pl-t b {
    font-family: "PP Display";
    font-weight: 800;
    font-size: 2.1rem;
    color: #fff;
}
.playb .pl-t small {
    font-size: 0.95rem;
    color: #eaffef;
    font-weight: 800;
}
@keyframes pulse {
    50% {
        transform: scale(1.04);
    }
}
.playb:active {
    animation: none;
}
.m-row {
    display: flex;
    gap: 0.8rem;
}
.nb {
    position: relative;
    width: 5.4rem;
    height: 5rem;
    border-radius: 1.3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    padding: 0;
}
.nb img {
    width: 2.1rem;
    height: 2.1rem;
}
.nb span {
    font-weight: 800;
    font-size: 0.92rem;
    color: #fff;
}
.nb .dot {
    position: absolute;
    top: -0.3rem;
    right: -0.3rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: #ff3b52;
    border: 0.15rem solid #fff;
    display: none;
}
.nb .dot.on {
    display: block;
    animation: pulse 1.4s infinite;
}
.m-prog {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 2rem;
    padding: 0.35rem 0.95rem;
    font-size: 0.9rem;
    box-shadow: 0 0.15rem 0 var(--soft);
    white-space: nowrap;
}
.m-prog .bar {
    width: 5rem;
    height: 0.6rem;
    border-radius: 0.6rem;
    background: rgba(22, 64, 95, 0.15);
    overflow: hidden;
}
.m-prog .bar i {
    display: block;
    height: 100%;
    width: 0;
    background: var(--green);
    border-radius: 0.6rem;
}
.m-prog .star {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}

/* ---------- shared header (levels, shop) ---------- */
.levels.active,
.shop.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem 0.8rem 0.7rem;
    gap: 0.55rem;
}
.lv-head {
    width: 100%;
    max-width: 46rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.station {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border-radius: 1.2rem;
    box-shadow: 0 0.24rem 0 var(--soft);
    padding: 0.3rem 0.4rem;
    min-height: 3.1rem;
}
.station .st-t {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-align: center;
    line-height: 1.1;
}
.station h2 {
    margin: 0;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--wc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.shop .station h2 {
    color: #f0489e;
}
.station small {
    display: block;
    font-size: 0.8rem;
    opacity: 0.75;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.arr {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    border: 0;
    background: var(--wc);
    padding: 0;
    display: grid;
    place-items: center;
    flex: none;
}
.arr img {
    width: 52%;
}
.arr:disabled {
    opacity: 0.28;
}
.pill {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #fff;
    border-radius: 2rem;
    padding: 0.3rem 0.8rem;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.25rem;
    box-shadow: 0 0.24rem 0 var(--soft);
}
.pill .star {
    width: 1.3rem;
    height: 1.3rem;
}
.v-dots {
    display: flex;
    gap: 0.55rem;
}
.v-dots button {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    border: 0;
    background: rgba(22, 64, 95, 0.2);
    padding: 0;
    transition:
        width 0.2s,
        background 0.2s;
}
.v-dots button.on {
    background: var(--wc);
    width: 1.6rem;
    border-radius: 1rem;
}
.wall {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 46rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lv-sub {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ---------- hole picker ---------- */
.hole-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 1fr;
    gap: 0.9rem;
    width: 100%;
    height: 100%;
    max-height: 40rem;
    padding: 0.3rem 0.2rem;
    align-content: center;
}
.hc {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 0;
    min-width: 0;
    background: #fff;
    border: 0;
    border-radius: 1.2rem;
    padding: 0.5rem 0.5rem 0.35rem;
    box-shadow:
        0 0.26rem 0 var(--soft),
        0 0.6rem 1rem rgba(22, 64, 95, 0.09);
    transition: transform 0.15s;
}
.hc .map-w {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.8rem;
    background: linear-gradient(180deg, #8ee06b, #6cc752);
    padding: 0.35rem;
    overflow: hidden;
}
.hc .map {
    width: 100%;
    height: 100%;
    display: block;
}
.hc .no {
    position: absolute;
    left: -0.35rem;
    top: -0.35rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: var(--wc);
    border: 0.14rem solid #fff;
    color: #fff;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.15rem;
    display: grid;
    place-items: center;
    box-shadow: 0 0.14rem 0 rgba(22, 64, 95, 0.25);
}
.hc .fst {
    display: flex;
    height: 1.4rem;
    margin-top: 0.2rem;
}
.hc .fst .star {
    width: 1.4rem;
    height: 1.4rem;
}
.hc .par {
    position: absolute;
    right: 0.9rem;
    top: 0.9rem;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 1rem;
    padding: 0.05rem 0.5rem;
    font-size: 0.78rem;
}
.hc.locked .map-w {
    background: #cfd9e3;
}
.hc.locked {
    opacity: 0.85;
}
.lockbox {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}
.lockbox img {
    width: 2.4rem;
    opacity: 0.8;
    filter: brightness(0.7) saturate(0) opacity(0.7);
}
.hc.current {
    animation: hop 1.1s ease-in-out infinite;
}
.hc:active {
    transform: scale(0.96);
}
@keyframes hop {
    50% {
        transform: translateY(-0.3rem);
    }
}
@media (hover: hover) {
    .hc:not(.locked):hover {
        transform: translateY(-0.2rem);
    }
}

/* ---------- ball shop ---------- */
.shop-body {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 46rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
}
.shop-show {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    flex: none;
}
.shop-show img {
    width: 6.2rem;
    height: 6.2rem;
    filter: drop-shadow(0 0.5rem 0.2rem rgba(22, 64, 95, 0.18));
    animation: float 1.6s ease-in-out infinite alternate;
}
@keyframes float {
    to {
        transform: translateY(-0.35rem);
    }
}
.shop-show b {
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.5rem;
}
.shop-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.7rem;
    width: 100%;
    padding: 0.3rem;
    align-content: start;
}
.bs {
    position: relative;
    aspect-ratio: 1;
    padding: 0.5rem;
    border: 0;
    border-radius: 1.1rem;
    background: #fff;
    box-shadow: 0 0.22rem 0 var(--soft);
    transition: transform 0.12s;
}
.bs .bimg {
    width: 100%;
    height: 100%;
    display: block;
}
.bs.on {
    box-shadow:
        0 0 0 0.22rem #3fc760,
        0 0.22rem 0 0.22rem rgba(22, 64, 95, 0.16);
}
.bs.locked .bimg {
    filter: grayscale(0.9) opacity(0.45);
}
.bs .tick {
    position: absolute;
    right: -0.3rem;
    top: -0.3rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: #3fc760;
    border: 0.13rem solid #fff;
    display: grid;
    place-items: center;
}
.bs .tick img {
    width: 62%;
}
.bs .cost {
    position: absolute;
    left: 50%;
    bottom: 0.2rem;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.15rem;
    background: #fff;
    border-radius: 1rem;
    padding: 0 0.5rem;
    font-size: 0.85rem;
    box-shadow: 0 0.1rem 0 var(--soft);
    font-weight: 800;
}
.bs .cost .star {
    width: 0.9rem;
    height: 0.9rem;
}
.bs:active {
    transform: scale(0.95);
}

/* ---------- game ---------- */
.game.active {
    display: flex;
    flex-direction: column;
    padding: 0.7rem 0.8rem 0.8rem;
    gap: 0.55rem;
}
.top {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.6rem;
    flex: none;
}
.ticket {
    min-width: 0;
    text-align: center;
    line-height: 1.05;
    background: #fff;
    border-radius: 1.1rem;
    padding: 0.35rem 0.5rem;
    box-shadow: 0 0.24rem 0 var(--soft);
}
.ticket b {
    display: block;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.4rem;
}
.ticket span {
    display: block;
    font-size: 0.8rem;
    color: var(--wc);
    filter: brightness(0.78);
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-r {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.info {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    align-items: center;
    flex: none;
}
.chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border-radius: 1rem;
    padding: 0.2rem 0.8rem;
    box-shadow: 0 0.2rem 0 var(--soft);
    white-space: nowrap;
}
.chip small {
    font-size: 0.85rem;
    line-height: 1.1;
}
.chip b {
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.1;
    min-width: 1.2ch;
    text-align: center;
}
.meter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fff;
    border-radius: 1rem;
    padding: 0.2rem 0.8rem;
    box-shadow: 0 0.2rem 0 var(--soft);
    flex: 1;
    max-width: 12rem;
    min-width: 0;
}
.meter small {
    font-size: 0.85rem;
}
.meter .bar {
    flex: 1;
    height: 0.85rem;
    border-radius: 1rem;
    background: rgba(22, 64, 95, 0.14);
    overflow: hidden;
    min-width: 3rem;
}
.meter .bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #6bea86, #ffd23f 60%, #ff5d73);
    background-size: 12rem 100%;
    border-radius: 1rem;
}
.meter.hot .bar i {
    background-position: right;
}
.play {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.stage {
    flex: 1;
    min-height: 0;
    min-width: 0;
    position: relative;
    border-radius: 1.4rem;
    overflow: hidden;
    border: 0.22rem solid #fff;
    box-shadow:
        0 0.3rem 0 var(--soft),
        0 0.8rem 1.4rem rgba(22, 64, 95, 0.14);
    background: linear-gradient(180deg, #a9e0ff, #eaf9ff);
}
.stage canvas {
    touch-action: none;
    cursor: grab;
}
.tools {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    flex: none;
}
.tl {
    width: 5.3rem;
    height: 4.7rem;
    border-radius: 1.2rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
}
.tl img {
    width: 2.2rem;
    height: 2.2rem;
}
.tl span {
    font-weight: 800;
    font-size: 0.9rem;
    color: #fff;
}
.tl:disabled {
    filter: grayscale(0.8);
    opacity: 0.55;
}

@media (min-aspect-ratio: 5/4) {
    .menu.active {
        flex-direction: row;
        gap: 2.5rem;
        padding: 1rem 2rem;
        justify-content: center;
    }
    .m-hero {
        flex: 0 1 34rem;
        height: min(100%, 38rem);
        max-width: 48vw;
    }
    .m-info {
        flex: none;
    }
    .game.active {
        padding: 0.7rem 1.2rem 0.9rem;
        gap: 0.6rem;
    }
    .top {
        grid-template-columns: 1fr auto 1fr;
    }
    .top-r {
        justify-self: end;
    }
    .top > .rb:first-child {
        justify-self: start;
    }
    .ticket {
        min-width: 13rem;
    }
    .play {
        flex-direction: row;
        align-items: stretch;
        gap: 1rem;
    }
    .tools {
        flex-direction: column;
        justify-content: center;
        gap: 0.8rem;
    }
    .hole-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .shop-body {
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
    }
    .shop-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 24rem;
    }
}
@media (min-aspect-ratio: 5/4) and (max-height: 460px) {
    .game.active {
        padding: 0.4rem 0.8rem 0.5rem;
        gap: 0.35rem;
    }
    .rb {
        width: 2.6rem;
        height: 2.6rem;
    }
    .ticket {
        min-width: 9rem;
        padding: 0.15rem 0.5rem;
    }
    .ticket b {
        font-size: 1.1rem;
    }
    .ticket span {
        font-size: 0.7rem;
    }
    .info {
        position: absolute;
        left: 4.4rem;
        top: 0.4rem;
    }
    .chip {
        padding: 0.1rem 0.6rem;
    }
    .chip b {
        font-size: 1.2rem;
    }
    .meter {
        display: none;
    }
    .tl {
        width: 4.2rem;
        height: 3.6rem;
        border-radius: 1rem;
    }
    .tl img {
        width: 1.7rem;
        height: 1.7rem;
    }
    .tl span {
        font-size: 0.72rem;
    }
    .tools {
        gap: 0.5rem;
    }
    .play {
        gap: 0.6rem;
    }
    .menu.active {
        gap: 1.5rem;
    }
    .logo .l1 {
        font-size: 2.6rem;
    }
    .logo .l2 {
        font-size: 0.95rem;
    }
    .playb {
        min-width: 0;
        padding: 0.3rem 1.2rem 0.3rem 0.4rem;
    }
    .playb .pl-ic {
        width: 2.6rem;
        height: 2.6rem;
    }
    .playb .pl-t b {
        font-size: 1.5rem;
    }
    .nb {
        width: 4.4rem;
        height: 3.7rem;
    }
    .nb img {
        width: 1.6rem;
        height: 1.6rem;
    }
    .nb span {
        font-size: 0.75rem;
    }
    .m-prog {
        display: none;
    }
    .m-info {
        gap: 0.6rem;
    }
    .levels.active,
    .shop.active {
        padding: 0.5rem 0.8rem 0.4rem;
        gap: 0.35rem;
    }
    .hole-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.5rem;
    }
    .hc .no {
        width: 1.7rem;
        height: 1.7rem;
        font-size: 0.95rem;
    }
    .hc .par {
        display: none;
    }
    .hc .fst .star {
        width: 1rem;
        height: 1rem;
    }
    .hc .fst {
        height: 1rem;
    }
    .v-dots,
    .lv-sub {
        display: none;
    }
    .shop-show img {
        width: 4.6rem;
        height: 4.6rem;
    }
    .shop-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 32rem;
        gap: 0.4rem;
    }
}
@media (max-width: 380px) {
    .logo .l1 {
        font-size: 2.6rem;
    }
    .station small {
        display: none;
    }
    .arr {
        display: none;
    }
    .station {
        justify-content: center;
    }
    .pill {
        padding: 0.25rem 0.6rem;
        font-size: 1.05rem;
    }
    .btn {
        min-width: 0;
        padding: 0.3em 0.9em 0.4em;
        font-size: 1.05rem;
    }
    .tl {
        width: 4.6rem;
        height: 4.3rem;
    }
    .tools {
        gap: 0.5rem;
    }
    .m-prog {
        font-size: 0.8rem;
        padding: 0.3rem 0.7rem;
    }
    .m-prog .bar {
        width: 3.2rem;
    }
    .nb {
        width: 4.9rem;
    }
}

/* ---------- modal / toast / confetti ---------- */
#modalRoot {
    position: absolute;
    inset: 0;
    z-index: 30;
    pointer-events: none;
}
.modal-back {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(22, 64, 95, 0.42);
    pointer-events: auto;
    animation: fade 0.2s;
    padding: 1rem;
}
.modal {
    width: min(92vw, 25rem);
    max-height: 94%;
    overflow: auto;
    background: #fff;
    border-radius: 1.7rem;
    border: 0.2rem solid #fff;
    box-shadow:
        0 0.4rem 0 rgba(22, 64, 95, 0.22),
        0 1.2rem 2.5rem rgba(22, 64, 95, 0.3);
    padding: 1.1rem 1.2rem 1.2rem;
    text-align: center;
    animation: pop 0.3s cubic-bezier(0.3, 1.5, 0.5, 1);
}
.modal h2 {
    margin: 0 0 0.5rem;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.9rem;
    color: #2fb554;
    line-height: 1.1;
}
.modal-btns {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.about {
    margin: 0.7rem 0 0;
    font-size: 0.75rem;
    opacity: 0.6;
}
.lesson-t {
    margin: 0.3rem 0;
    font-size: 1.02rem;
    line-height: 1.35;
}
.row-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    padding: 0.5rem 0;
    border-bottom: 0.1rem dashed rgba(22, 64, 95, 0.2);
    font-size: 1.05rem;
    text-align: left;
}
.row-toggle > span {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.ic {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: #7a45e8;
    display: grid;
    place-items: center;
    flex: none;
}
.ic img {
    width: 66%;
    height: 66%;
}
.switch {
    width: 3.3rem;
    height: 1.9rem;
    border-radius: 2rem;
    border: 0;
    background: #cfd9e3;
    position: relative;
    padding: 0;
    transition: background 0.15s;
    flex: none;
}
.switch::after {
    content: "";
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0.1rem 0 rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}
.switch[aria-checked="true"] {
    background: var(--green);
}
.switch[aria-checked="true"]::after {
    transform: translateX(1.4rem);
}
.how {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    text-align: left;
}
.how li {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 1rem;
    line-height: 1.25;
}
.chip-i {
    flex: none;
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 0.9rem;
    background: #7a45e8;
    display: grid;
    place-items: center;
}
.how li:nth-child(2) .chip-i {
    background: #2f8fe8;
}
.how li:nth-child(3) .chip-i {
    background: #2fb554;
}
.how li:nth-child(4) .chip-i {
    background: #f58a1c;
}
.chip-i img {
    width: 62%;
    height: 62%;
}
.tips {
    font-size: 0.92rem;
    margin-top: 0.7rem;
}
.d-date {
    margin: 0 0 0.5rem;
    opacity: 0.8;
}
.d-pic,
.win-pic {
    width: 9.5rem;
    height: 9.5rem;
    margin: 0 auto 0.5rem;
    background: #fff;
    padding: 0.5rem;
    border-radius: 1rem;
    background: linear-gradient(180deg, #8ee06b, #6cc752);
    box-shadow: 0 0.22rem 0 var(--soft);
    animation: pop 0.5s 0.1s both;
}
.d-pic .map,
.win-pic .map {
    width: 100%;
    height: 100%;
    display: block;
}
.d-row {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin: 0.4rem 0;
}
.chip2 {
    background: #eaf6ff;
    border-radius: 1rem;
    padding: 0.1rem 0.8rem;
    font-size: 0.95rem;
}
.chip2 b {
    font-family: "PP Display";
    font-size: 1.3rem;
    margin-left: 0.2rem;
}
.win-stars {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin: 0.2rem 0 0.3rem;
}
.win-stars .star.big {
    width: 3.4rem;
    height: 3.4rem;
}
.win-stars .star.big.on {
    animation: starin 0.5s cubic-bezier(0.3, 1.8, 0.5, 1) both;
}
.win-stars .star.big.s2 {
    animation-delay: 0.25s;
}
.win-stars .star.big.s3 {
    animation-delay: 0.5s;
}
.win-stars .star.big:nth-child(2) {
    margin-top: -0.5rem;
}
.win-stars .star.mid {
    width: 2.2rem;
    height: 2.2rem;
}
@keyframes starin {
    0% {
        transform: scale(0) rotate(-90deg);
    }
    100% {
        transform: scale(1);
    }
}
.newbest {
    margin: 0.2rem 0;
    color: #f0489e;
    font-family: "PP Display";
    font-weight: 800;
    font-size: 1.2rem;
}
.newball {
    margin: 0.3rem 0;
    background: #fff6d6;
    border-radius: 1rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.95rem;
}
@keyframes fade {
    from {
        opacity: 0;
    }
}
@keyframes pop {
    from {
        transform: scale(0.7);
        opacity: 0;
    }
}
#toast {
    position: absolute;
    left: 50%;
    top: 5.2rem;
    transform: translate(-50%, -1rem);
    background: var(--ink);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border-radius: 1.5rem;
    font-size: 1rem;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.2s,
        transform 0.2s;
    z-index: 40;
    max-width: 88vw;
    text-align: center;
}
#toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}
.confetti {
    position: absolute;
    top: -20px;
    z-index: 35;
    pointer-events: none;
    animation: fall linear forwards;
}
@keyframes fall {
    to {
        transform: translateY(105vh) rotate(var(--rot));
    }
}
@media (prefers-reduced-motion: reduce) {
    .playb,
    .hc.current,
    .load-ball,
    .shop-show img,
    .nb .dot {
        animation: none !important;
    }
}

/* v1.0.1: soften the edges of the menu 3D scene so clouds never look cut off */
.hero-stage canvas {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
        linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(to right, transparent, #000 6%, #000 94%, transparent),
        linear-gradient(to bottom, transparent, #000 6%, #000 94%, transparent);
    mask-composite: intersect;
}
/* v1.0.1: landscape phones show the holes in 2 rows of 3, so each course picture is big enough to read */
@media (min-aspect-ratio: 5/4) and (max-height: 460px) {
    .hole-grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 1fr;
        max-height: none;
    }
    .hc {
        flex-direction: row;
        gap: 0.5rem;
        padding: 0.4rem;
    }
    .hc .map-w {
        flex: 1 1 auto;
        height: 100%;
    }
    .hc .fst {
        flex-direction: column;
        justify-content: center;
        height: auto;
        margin: 0;
    }
}
