/* Glass Roll - frosted glass UI. Colours: edit the :root variables. Text and buttons never use transform/filter, so they stay crisp. */
@font-face {
    font-family: "Outfit";
    src: url(../assets/fonts/outfit.woff2) format("woff2");
    font-weight: 100 900;
    font-display: swap;
}
:root {
    --s1: #6fe3cf;
    --s2: #bff5e6;
    --s3: #f6fffc;
    --acc: #14b88a;
    --ink: #17315c;
    --ink2: #4a6590;
    --glass: rgba(255, 255, 255, 0.68);
    --glassB: rgba(255, 255, 255, 0.95);
    --line: rgba(255, 255, 255, 0.9);
    --sh: 0 10px 30px rgba(30, 60, 120, 0.18);
    --u: min(1vw, 1.7vh); /* scale unit */
    --sat: env(safe-area-inset-top, 0px);
    --sab: env(safe-area-inset-bottom, 0px);
    --sal: env(safe-area-inset-left, 0px);
    --sar: env(safe-area-inset-right, 0px);
}
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    margin: 0;
    padding: 0;
}
html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--s2);
    overscroll-behavior: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
body {
    font-family:
        "Outfit",
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    color: var(--ink);
    font-weight: 600;
    position: fixed;
    inset: 0;
}
button {
    font: inherit;
    color: inherit;
    border: 0;
    background: none;
    cursor: pointer;
}
img {
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}
.dim {
    color: var(--ink2);
    font-weight: 500;
}

/* ---------- sky ---------- */
#sky {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(180deg, var(--s1) 0%, var(--s2) 52%, var(--s3) 100%);
    transition: background 1s;
}
.aur {
    position: absolute;
    width: 90vmax;
    height: 38vmax;
    border-radius: 50%;
    opacity: 0.5;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
}
.a1 {
    left: -25vmax;
    top: -12vmax;
    animation: drift 22s ease-in-out infinite alternate;
}
.a2 {
    right: -30vmax;
    top: 18vh;
    opacity: 0.35;
    background: radial-gradient(closest-side, var(--s1), rgba(255, 255, 255, 0));
    animation: drift 28s ease-in-out infinite alternate-reverse;
}
.a3 {
    left: -10vmax;
    bottom: -22vmax;
    opacity: 0.5;
    animation: drift 25s ease-in-out infinite alternate;
}
@keyframes drift {
    to {
        margin-left: 8vmax;
        margin-top: 3vmax;
    }
}
.bk {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.35) 55%, rgba(255, 255, 255, 0.1));
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
    animation: floaty 9s ease-in-out infinite alternate;
}
.k1 {
    width: 9vmin;
    height: 9vmin;
    left: 8%;
    top: 14%;
}
.k2 {
    width: 5vmin;
    height: 5vmin;
    left: 82%;
    top: 10%;
    animation-delay: -2s;
}
.k3 {
    width: 13vmin;
    height: 13vmin;
    left: 88%;
    top: 52%;
    animation-delay: -4s;
}
.k4 {
    width: 6vmin;
    height: 6vmin;
    left: 5%;
    top: 58%;
    animation-delay: -1s;
}
.k5 {
    width: 10vmin;
    height: 10vmin;
    left: 18%;
    top: 84%;
    animation-delay: -5s;
}
.k6 {
    width: 4vmin;
    height: 4vmin;
    left: 60%;
    top: 6%;
    animation-delay: -3s;
}
.k7 {
    width: 7vmin;
    height: 7vmin;
    left: 72%;
    top: 86%;
    animation-delay: -6s;
}
.k8 {
    width: 3.4vmin;
    height: 3.4vmin;
    left: 40%;
    top: 92%;
    animation-delay: -7s;
}
@keyframes floaty {
    to {
        margin-top: -3vmin;
    }
}
#c {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    display: block;
}
#pad {
    position: fixed;
    inset: 0;
    z-index: 2;
}
#ring {
    position: absolute;
    width: 17vmin;
    height: 17vmin;
    max-width: 150px;
    max-height: 150px;
    margin: -8.5vmin 0 0 -8.5vmin;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 14px rgba(20, 50, 110, 0.2);
    opacity: 0;
    pointer-events: none;
}
#ring.on {
    opacity: 1;
}
#dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 38%;
    height: 38%;
    margin: -19% 0 0 -19%;
    border-radius: 50%;
    background: var(--acc);
    box-shadow:
        0 3px 8px rgba(20, 50, 110, 0.3),
        inset 0 2px 3px rgba(255, 255, 255, 0.6);
}

/* ---------- screens ---------- */
#ui {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}
.screen {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    padding: calc(var(--sat) + 1.4vh) calc(var(--sar) + 14px) calc(var(--sab) + 1.4vh) calc(var(--sal) + 14px);
    pointer-events: none;
}
.screen > * {
    pointer-events: auto;
}
body[data-screen="menu"] #menu,
body[data-screen="levels"] #levels,
body[data-screen="play"] #hud {
    display: flex;
}
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(28, 60, 120, 0.34);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.18s,
        visibility 0.18s;
    pointer-events: none;
}
.modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.modal > .card {
    max-height: 100%;
    overflow: hidden;
}

/* ---------- chips, cards ---------- */
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    background: var(--glassB);
    box-shadow:
        var(--sh),
        inset 0 0 0 2px #fff;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
}
.chip img {
    width: 22px;
    height: 22px;
    filter: none;
}
.chip.title {
    flex-direction: column;
    justify-content: center;
    gap: 0;
    line-height: 1.05;
    padding: 0 16px;
}
.chip.title b {
    font-size: 16px;
}
.chip.title span {
    font-size: 12px;
    color: var(--ink2);
    font-weight: 600;
}
.gemI {
    width: 16px;
    height: 20px;
    background: linear-gradient(135deg, #ff9bc9, #ff4f9d);
    clip-path: polygon(50% 0, 100% 40%, 50% 100%, 0 40%);
}
.card {
    width: min(560px, 100%);
    background: var(--glassB);
    border-radius: 28px;
    padding: 20px 22px;
    box-shadow:
        0 18px 50px rgba(25, 55, 120, 0.28),
        inset 0 0 0 3px #fff;
}
.card.narrow {
    width: min(380px, 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: center;
}
.card h2 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.2px;
}
.cHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

/* ---------- buttons (round glossy, press = shift down) ---------- */
.gbtn {
    --c: #3ad6e0;
    --d: #1597a6;
    position: relative;
    top: 0;
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 55%);
    box-shadow:
        0 6px 0 var(--d),
        0 12px 18px rgba(20, 50, 110, 0.25),
        inset 0 0 0 2px rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition:
        top 0.06s,
        box-shadow 0.06s;
}
.gbtn:active {
    top: 5px;
    box-shadow:
        0 1px 0 var(--d),
        0 4px 8px rgba(20, 50, 110, 0.25),
        inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}
.gbtn img {
    width: 52%;
    height: 52%;
    object-fit: contain;
}
.gbtn em {
    display: none;
    font-style: normal;
}
.gbtn.sm {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    box-shadow:
        0 5px 0 var(--d),
        0 9px 14px rgba(20, 50, 110, 0.22),
        inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}
.aqua {
    --c: #3ad6e0;
    --d: #1597a6;
}
.violet {
    --c: #9a73ff;
    --d: #5b36c4;
}
.gold {
    --c: #ffc93a;
    --d: #c78600;
}
.pink {
    --c: #ff6fae;
    --d: #c93578;
}
.slate {
    --c: #6f8fc0;
    --d: #3f5c92;
}
.red {
    --c: #ff6a6a;
    --d: #bf3030;
}
.pbtn.aqua {
    --c: #3ad6e0;
    --d: #1597a6;
}
.pbtn.violet {
    --c: #9a73ff;
    --d: #5b36c4;
}
.pbtn.gold {
    --c: #ffc93a;
    --d: #c78600;
}
.pbtn.pink {
    --c: #ff6fae;
    --d: #c93578;
}
.pbtn.slate {
    --c: #6f8fc0;
    --d: #3f5c92;
}
.pbtn.red {
    --c: #ff6a6a;
    --d: #bf3030;
}
.gbtn.on {
    outline: 3px solid #fff;
}
.pbtn {
    --c: #3ad6e0;
    --d: #1597a6;
    position: relative;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 54px;
    padding: 0 20px;
    border-radius: 18px;
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.18);
    background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%);
    box-shadow:
        0 6px 0 var(--d),
        0 12px 18px rgba(20, 50, 110, 0.22),
        inset 0 0 0 2px rgba(255, 255, 255, 0.7);
    transition:
        top 0.06s,
        box-shadow 0.06s;
    margin-bottom: 6px;
}
.pbtn:active {
    top: 5px;
    box-shadow:
        0 1px 0 var(--d),
        inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}
.pbtn img {
    width: 26px;
    height: 26px;
}
.pbtn.small {
    height: 44px;
    font-size: 16px;
    margin: 6px auto 0;
}
.pbtn[disabled] {
    opacity: 0.5;
}
.pbtn.route {
    height: 48px;
    padding: 0 16px;
    font-size: 18px;
    color: #5a3a00;
    text-shadow: none;
}
.pbtn.route b {
    background: #fff;
    color: var(--ink);
    min-width: 24px;
    height: 24px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}
.pbtn.route img {
    width: 24px;
    height: 24px;
}
.hBot .pbtn {
    margin-bottom: 0;
}

/* ---------- loader ---------- */
#loader {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #6fe3cf, #bff5e6 55%, #f6fffc);
    transition:
        opacity 0.35s,
        visibility 0.35s;
}
#loader.hide {
    opacity: 0;
    visibility: hidden;
}
.lCard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(340px, 86vw);
    text-align: center;
}
.lMarble {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #fff 0 9%, #7fe0ff 12%, #27b9e8 55%, #1a7fc4);
    box-shadow:
        0 14px 0 -4px rgba(20, 60, 120, 0.18),
        inset 0 0 0 3px rgba(255, 255, 255, 0.8);
    animation: bob 1s ease-in-out infinite alternate;
    position: relative;
}
@keyframes bob {
    to {
        top: -12px;
    }
}
.lTitle {
    font-size: 44px;
    font-weight: 900;
    color: var(--ink);
    line-height: 1;
    margin-top: 8px;
}
.lSub {
    color: var(--ink2);
    font-size: 16px;
}
.lBar {
    width: 100%;
    height: 14px;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow:
        inset 0 0 0 2px #fff,
        0 4px 10px rgba(20, 60, 120, 0.15);
    overflow: hidden;
    margin-top: 10px;
}
#lFill {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 7px;
    background: linear-gradient(90deg, #3ad6e0, #14b88a);
    transition: width 0.2s;
}
.lTip {
    font-size: 14px;
    color: var(--ink2);
    font-weight: 500;
    min-height: 40px;
}

/* ---------- menu ---------- */
#menu {
    align-items: center;
}
#menu .topRow {
    align-self: flex-end;
}
.plaque {
    margin-top: 2px;
    padding: 8px 34px 10px;
    text-align: center;
    border-radius: 26px;
    background: var(--glassB);
    box-shadow:
        var(--sh),
        inset 0 0 0 3px #fff;
}
.plaque h1 {
    font-size: clamp(36px, 9vmin, 64px);
    font-weight: 900;
    line-height: 1;
    color: var(--ink);
    letter-spacing: 0.5px;
}
.plaque h1::after {
    content: "";
    display: block;
    height: 5px;
    margin: 6px auto 0;
    width: 56%;
    border-radius: 3px;
    background: linear-gradient(90deg, #14b88a, #3ad6e0, #ff6fae, #ffc93a);
}
.plaque p {
    font-size: 15px;
    color: var(--ink2);
    margin-top: 6px;
    font-weight: 600;
}
.space {
    flex: 1;
    width: 100%;
    min-height: 120px;
    pointer-events: none !important;
}
.dock {
    display: flex;
    align-items: flex-end;
    gap: clamp(8px, 2.2vmin, 18px);
    padding: 12px 16px 14px;
    border-radius: 34px;
    background: var(--glass);
    box-shadow:
        var(--sh),
        inset 0 0 0 3px #fff;
}
.dock .gbtn {
    width: clamp(52px, 11vmin, 76px);
    height: clamp(52px, 11vmin, 76px);
}
.dock .gbtn.play {
    width: clamp(84px, 19vmin, 124px);
    height: clamp(84px, 19vmin, 124px);
    border-radius: 50%;
    margin: -22px 2px 0;
}
.dock .gbtn.play img {
    width: 46%;
    height: 46%;
    margin-left: 5%;
}
.dock .gbtn em {
    display: block;
    position: absolute;
    bottom: -22px;
    left: 50%;
    transform: none;
    margin-left: -40px;
    width: 80px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink);
}
.dock {
    padding-bottom: 30px;
}

/* ---------- level select ---------- */
#levels {
    align-items: center;
}
.bar {
    width: min(760px, 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.bar h2 {
    font-size: 24px;
    font-weight: 900;
}
.wideCard {
    width: min(760px, 100%);
    flex: 1;
    min-height: 0;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
}
.tabs {
    display: flex;
    gap: 8px;
}
.tab {
    position: relative;
    top: 0;
    flex: 1;
    height: 44px;
    border-radius: 14px;
    background: #e6eefb;
    font-weight: 800;
    font-size: 18px;
    color: var(--ink2);
    box-shadow: 0 4px 0 #c3d1ea;
    transition: top 0.06s;
}
.tab.on {
    background: var(--tc, #14b88a);
    color: #fff;
    box-shadow: 0 4px 0 color-mix(in srgb, var(--tc, #14b88a) 60%, #000);
}
.tab:active {
    top: 3px;
}
.chHead {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 20px;
    padding: 0 4px;
}
.lgrid {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 10px;
}
.lv {
    position: relative;
    top: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow:
        0 5px 0 #c3d1ea,
        inset 0 0 0 2px #dfe8f7;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 6px 4px 6px;
    min-height: 0;
    min-width: 0;
    transition: top 0.06s;
}
.lv:active {
    top: 4px;
}
.lv canvas {
    flex: 1;
    min-height: 0;
    width: 100%;
    object-fit: contain;
}
.lv .n {
    position: absolute;
    left: 8px;
    top: 4px;
    font-size: 16px;
    font-weight: 900;
    color: var(--ink);
}
.lv .st {
    display: flex;
    gap: 1px;
}
.lv .st img {
    width: 16px;
    height: 16px;
}
.lv.lock {
    background: #eef2fa;
    box-shadow: 0 5px 0 #d3dcee;
}
.lv.lock canvas {
    opacity: 0.18;
}
.lv.lock .lk {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lv.lock .lk img {
    width: 34%;
    max-width: 34px;
    opacity: 0.6;
}

/* ---------- HUD ---------- */
.hud {
    justify-content: space-between;
}
.hTop,
.hBot {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.hTop > *,
.hBot > * {
    pointer-events: auto;
}
.hBot {
    justify-content: space-between;
}
.grow {
    flex: 1;
    pointer-events: none !important;
}
.hint {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--sab) + 84px);
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    pointer-events: none !important;
    transition: opacity 0.4s;
}
.hint span {
    display: inline-block;
    background: var(--glassB);
    padding: 6px 16px;
    border-radius: 16px;
    box-shadow: var(--sh);
}
.hint.off {
    opacity: 0;
}
.pop {
    position: absolute;
    left: 0;
    right: 0;
    top: 34%;
    text-align: center;
    font-size: 34px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 3px 0 rgba(20, 50, 110, 0.35);
    pointer-events: none !important;
    opacity: 0;
}
.pop.show {
    animation: pop 1.1s ease-out;
}
@keyframes pop {
    0% {
        opacity: 0;
        top: 40%;
    }
    15% {
        opacity: 1;
        top: 34%;
    }
    70% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        top: 28%;
    }
}

/* ---------- modal content ---------- */
.steps {
    list-style: none;
    counter-reset: s;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.steps li {
    counter-increment: s;
    position: relative;
    padding-left: 40px;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.3;
}
.steps li::before {
    content: counter(s);
    position: absolute;
    left: 0;
    top: -1px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--acc);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.steps b {
    font-weight: 800;
}
.legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 14px;
}
.legend div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}
.legend img {
    width: 38px;
    height: 38px;
    flex: none;
}
.rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 4px;
}
.row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 46px;
}
.row b {
    display: block;
    font-size: 17px;
    font-weight: 800;
}
.row small {
    display: block;
    font-size: 12px;
    color: var(--ink2);
    font-weight: 500;
}
.row.wide {
    flex-wrap: wrap;
}
.sw {
    position: relative;
    flex: none;
    width: 58px;
    height: 32px;
    border-radius: 16px;
    background: #cdd8ec;
    box-shadow: inset 0 2px 4px rgba(20, 50, 110, 0.2);
    transition: background 0.15s;
}
.sw::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 4px rgba(20, 50, 110, 0.3);
    transition: left 0.15s;
}
.sw.on {
    background: var(--acc);
}
.sw.on::after {
    left: 29px;
}
.seg {
    display: flex;
    flex: none;
    background: #e3ebf8;
    border-radius: 14px;
    padding: 3px;
    gap: 2px;
}
.seg button {
    height: 34px;
    padding: 0 14px;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 800;
    color: var(--ink2);
}
.seg button.on {
    background: var(--acc);
    color: #fff;
}
.skins {
    display: flex;
    gap: 8px;
}
.skin {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    box-shadow:
        inset 0 0 0 3px #fff,
        0 3px 6px rgba(20, 50, 110, 0.25);
}
.skin.on {
    outline: 3px solid var(--acc);
    outline-offset: 2px;
}
.skin.lock {
    opacity: 0.45;
}
.skin.lock::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url(../assets/lock.png) center/50% no-repeat;
}
#win .winSub {
    color: var(--ink2);
    font-size: 15px;
}
#win h2 {
    font-size: 30px;
}
.bigStars {
    display: flex;
    justify-content: center;
    gap: 6px;
    height: 64px;
}
.bigStars img {
    width: 60px;
    height: 60px;
}
.bigStars img:nth-child(2) {
    margin-top: -10px;
}
.stats {
    display: flex;
    justify-content: center;
    gap: 8px;
}
.stats div {
    flex: 1;
    background: #eef3fc;
    border-radius: 14px;
    padding: 6px 4px;
}
.stats b {
    display: block;
    font-size: 22px;
    font-weight: 900;
}
.stats span {
    font-size: 12px;
    color: var(--ink2);
    font-weight: 600;
}
.best {
    font-size: 14px;
    color: var(--ink2);
    min-height: 18px;
    font-weight: 600;
}
.trio {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 2px;
}

/* ---------- small / short screens ---------- */
@media (max-height: 520px) {
    .screen {
        padding-top: calc(var(--sat) + 6px);
        padding-bottom: calc(var(--sab) + 6px);
    }
    .plaque {
        padding: 4px 22px 6px;
    }
    .plaque h1 {
        font-size: 30px;
    }
    .plaque p {
        display: none;
    }
    .plaque h1::after {
        height: 4px;
        margin-top: 3px;
    }
    #menu {
        flex-direction: row;
        flex-wrap: wrap;
        align-content: flex-start;
    }
    .card {
        padding: 12px 16px;
    }
    .card h2 {
        font-size: 22px;
    }
    .cHead {
        margin-bottom: 6px;
    }
    .steps li {
        font-size: 14px;
    }
    .legend img {
        width: 28px;
        height: 28px;
    }
    .legend div {
        font-size: 12px;
    }
    .row {
        min-height: 38px;
    }
    .lgrid {
        gap: 6px;
    }
    .tab {
        height: 34px;
        font-size: 15px;
    }
    .chip {
        height: 34px;
        font-size: 16px;
    }
    .bigStars {
        height: 44px;
    }
    .bigStars img {
        width: 44px;
        height: 44px;
    }
    .stats b {
        font-size: 18px;
    }
    .dock {
        padding-bottom: 26px;
    }
    .dock .gbtn.play {
        margin-top: -14px;
    }
    .hint {
        bottom: calc(var(--sab) + 64px);
    }
}
@media (max-height: 520px) and (orientation: landscape) {
    #menu {
        display: none;
    }
    body[data-screen="menu"] #menu {
        display: grid;
        grid-template-columns: 1fr minmax(0, 1.2fr) auto;
        grid-template-rows: auto 1fr;
        align-items: center;
        gap: 8px 14px;
    }
    #menu .topRow {
        grid-column: 3;
        grid-row: 1;
    }
    .plaque {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: center;
    }
    .space {
        grid-column: 2;
        grid-row: 1 / 3;
        height: 100%;
    }
    .dock {
        grid-column: 3;
        grid-row: 2;
        align-self: center;
        flex-direction: column;
        align-items: center;
        padding: 10px 14px 12px;
        border-radius: 26px;
    }
    .dock .gbtn.play {
        order: -1;
        margin: 0 0 4px;
    }
    .dock {
        gap: 10px;
        padding-bottom: 14px;
    }
    .dock .gbtn em {
        display: none;
    }
    .dock .gbtn {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }
    .dock .gbtn.play {
        width: 64px;
        height: 64px;
        border-radius: 50%;
    }
}
@media (max-width: 380px) {
    .chip {
        padding: 0 10px;
        font-size: 16px;
    }
    .lgrid {
        gap: 6px;
    }
    .tab {
        font-size: 15px;
    }
    .legend {
        gap: 4px 8px;
    }
    .legend div {
        font-size: 12px;
    }
    .seg button {
        padding: 0 9px;
    }
}
@media (max-width: 600px) and (orientation: portrait) {
    .lgrid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, 1fr);
    }
    .lv .n {
        font-size: 16px !important;
    }
    .lv .st img {
        width: 16px !important;
        height: 16px !important;
    }
}
@media (max-width: 480px) {
    .lv .n {
        font-size: 13px;
        left: 5px;
    }
    .lv .st img {
        width: 11px;
        height: 11px;
    }
    .card {
        padding: 16px;
    }
}
@media (min-width: 900px) and (min-height: 700px) {
    .chip {
        height: 46px;
        font-size: 20px;
    }
    .gbtn.sm {
        width: 54px;
        height: 54px;
    }
    .dock .gbtn.play {
        width: 130px;
        height: 130px;
    }
}
@media (max-width: 380px) {
    .dock {
        gap: 6px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .dock .gbtn {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }
    .dock .gbtn.play {
        width: 72px;
        height: 72px;
        margin: -20px 0 0;
    }
    .dock .gbtn em {
        font-size: 12px;
    }
}
@media (max-height: 520px) {
    #settings .rows {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 22px;
    }
    #settings .row.wide {
        grid-column: auto;
    }
    .row small {
        display: none;
    }
    .row b {
        font-size: 15px;
    }
    .skin {
        width: 30px;
        height: 30px;
    }
    .skins {
        gap: 6px;
    }
    .seg button {
        height: 30px;
        padding: 0 10px;
        font-size: 13px;
    }
    .sw {
        width: 50px;
        height: 28px;
    }
    .sw::after {
        width: 22px;
        height: 22px;
    }
    .sw.on::after {
        left: 25px;
    }
    .row {
        min-height: 34px;
    }
    #settings .pbtn.small {
        height: 38px;
        margin-top: 2px;
    }
    .card.narrow {
        gap: 6px;
    }
    .pbtn {
        height: 46px;
        font-size: 18px;
    }
}

.ver {
    margin: 10px 0 0;
    text-align: center;
    font-size: 13px;
}
