:root {
    --ink: #44230d;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    overflow: hidden;
    overscroll-behavior: none;
}

body {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 50% 40%, rgba(45, 83, 162, 0.42), transparent 42%),
        #040a20;
    font-family: "Montserrat", Arial, sans-serif;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.external-browser-overlay {
    position: fixed;
    z-index: 9999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(2, 10, 34, 0.88);
}

.external-browser-overlay[hidden] {
    display: none;
}

.external-browser-card {
    width: min(100%, 390px);
    padding: 32px 24px 25px;
    border: 4px solid #fff2b2;
    border-radius: 28px;
    color: var(--ink);
    background: linear-gradient(#fffbea, #ffd669);
    box-shadow: 0 12px 0 #c56b14, 0 22px 45px rgba(0, 0, 0, 0.5);
    text-align: center;
}

.external-browser-card h2 {
    margin: 0;
    color: #df4e26;
    font-size: 25px;
}

.external-browser-card > p {
    margin: 13px 0 21px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
}

.external-browser-button,
.external-copy-button {
    display: block;
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 999px;
    font: 900 15px "Montserrat", Arial, sans-serif;
    cursor: pointer;
}

.external-browser-button {
    color: #fff;
    background: #df4e26;
    box-shadow: 0 5px 0 #9e3219;
}

.external-copy-button {
    margin-top: 13px;
    color: #713408;
    background: #fff3b0;
    box-shadow: inset 0 0 0 2px #dc9a32;
}

.external-browser-card .external-browser-hint {
    margin: 18px 4px 0;
    color: #71411c;
    font-size: 12px;
}

button {
    font: inherit;
}

.game-shell {
    position: relative;
    width: min(100vw, 600px);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    isolation: isolate;
    container-type: inline-size;
    background: #0d3c88;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.65);
}

.screen {
    position: absolute;
    inset: 0;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 420ms ease, visibility 420ms;
}

.screen.is-active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.start-screen {
    z-index: 5;
    overflow: hidden;
    background: url("../images/maybi-trungthu-start-screen.png") center / 100% 100% no-repeat;
}

.start-lantern,
.start-rabbit {
    position: absolute;
    overflow: hidden;
    pointer-events: none;
    animation-play-state: paused;
}

.start-screen.is-active .start-lantern,
.start-screen.is-active .start-rabbit {
    animation-play-state: running;
    will-change: transform;
}

.start-lantern {
    z-index: 1;
    aspect-ratio: 297 / 338;
    transform-origin: 50% 18%;
    animation: start-lantern-float var(--float-duration, 3.8s) ease-in-out infinite;
    animation-delay: var(--float-delay, 0s);
}

.start-lantern img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    pointer-events: none;
}

.start-lantern--top-left {
    top: 18%;
    left: 3%;
    width: 8.5%;
    --lantern-rotate: -8deg;
    --float-x: 7%;
    --float-y: -10%;
    --float-duration: 3.4s;
    --float-delay: -1.1s;
}

.start-lantern--top-right {
    top: 8%;
    right: 8%;
    width: 8.5%;
    --lantern-rotate: 7deg;
    --float-x: -6%;
    --float-y: -12%;
    --float-duration: 3.9s;
    --float-delay: -2.6s;
}

.start-lantern--middle-left {
    top: 55%;
    left: -2%;
    width: 18%;
    --lantern-rotate: -7deg;
    --float-x: 5%;
    --float-y: -7%;
    --float-duration: 4.3s;
    --float-delay: -2s;
}

.start-lantern--middle-right {
    top: 54%;
    right: -1%;
    width: 16%;
    --lantern-rotate: 8deg;
    --float-x: -5%;
    --float-y: -8%;
    --float-duration: 3.7s;
    --float-delay: -0.7s;
}

@keyframes start-lantern-float {
    0%, 100% {
        transform: translate3d(0, 0, 0) rotate(var(--lantern-rotate, 0deg));
    }
    50% {
        transform: translate3d(var(--float-x, 0), var(--float-y, -8%), 0) rotate(calc(var(--lantern-rotate, 0deg) + 2deg));
    }
}

.start-rabbit {
    z-index: 2;
    top: 49%;
    left: 50%;
    width: 70%;
    aspect-ratio: 850 / 965;
    transform: translate3d(-50%, 0, 0);
    animation: start-rabbit-float 4.2s ease-in-out -1.4s infinite;
}

.start-rabbit img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    pointer-events: none;
}

@keyframes start-rabbit-float {
    0%, 100% {
        transform: translate3d(-50%, 0, 0) rotate(-0.8deg);
    }
    50% {
        transform: translate3d(-50%, -2.5%, 0) rotate(0.8deg);
    }
}

.start-screen:not(.is-active) .start-lantern,
.start-screen:not(.is-active) .start-rabbit {
    animation-play-state: paused;
    will-change: auto;
}

.how-to-overlay {
    position: absolute;
    z-index: 10;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(2, 20, 67, 0.68);
    backdrop-filter: blur(4px);
    transition: opacity 300ms ease, visibility 300ms;
}

.how-to-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

.how-to-card {
    width: 90%;
    min-width: 0;
    max-height: 94%;
    padding: 7% 6%;
    overflow-y: auto;
    border: 5px solid #fff2b2;
    border-radius: 30px;
    color: var(--ink);
    background: linear-gradient(#fffbea, #ffd669);
    box-shadow: 0 12px 0 #c56b14, 0 22px 45px rgba(0, 20, 67, 0.48);
    text-align: center;
    touch-action: pan-y;
}

.how-to-card h2 {
    margin: 0;
    color: #df4e26;
    font-size: clamp(27px, 8cqw, 44px);
    line-height: 1;
}

.how-to-lead {
    margin: 4% 1% 5%;
    font-size: clamp(12px, 3.5cqw, 18px);
    font-weight: 700;
    line-height: 1.45;
}

.item-guide {
    display: grid;
    gap: 9px;
}

.item-guide-card {
    display: grid;
    grid-template-columns: 27% 1fr;
    align-items: center;
    min-height: 76px;
    padding: 8px 12px;
    border: 2px solid rgba(197, 107, 20, 0.45);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
    text-align: left;
}

.item-guide-card > img {
    width: 62%;
    max-height: 64px;
    margin: auto;
    object-fit: contain;
}

.item-guide-card strong,
.item-guide-card span {
    display: block;
}

.item-guide-card strong {
    color: #a43a0a;
    font-size: clamp(12px, 3.5cqw, 17px);
}

.item-guide-card span {
    margin-top: 3px;
    font-size: clamp(10px, 2.8cqw, 14px);
    font-weight: 600;
    line-height: 1.35;
}

.obstacle-guide-images {
    position: relative;
    height: 60px;
}

.obstacle-guide-images img {
    position: absolute;
    right: 0;
    bottom: 2px;
    left: 0;
    width: 58%;
    max-height: 56px;
    margin: auto;
    object-fit: contain;
}

.reward-guide {
    margin: 4% 0;
    padding: 3% 4%;
    border-radius: 16px;
    color: #6f370d;
    background: rgba(255, 244, 177, 0.75);
    font-size: clamp(10px, 2.9cqw, 14px);
    line-height: 1.4;
    text-align: left;
}

.reward-guide p {
    margin: 3px 0;
}

.popup-button {
    min-height: 48px;
    padding: 11px 15px;
    border: 0;
    border-radius: 999px;
    font-weight: 900;
    letter-spacing: 0.025em;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 120ms ease, filter 120ms ease;
}

.popup-button--primary {
    color: #fff;
    background: #df4e26;
    box-shadow: 0 5px 0 #9e3219;
}

.popup-button--secondary {
    color: #713408;
    background: #fff3b0;
    box-shadow: inset 0 0 0 2px #dc9a32, 0 5px 0 #bf7b20;
}

.popup-button:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.popup-button:active {
    transform: translateY(3px);
}

.popup-button:focus-visible,
.carousel-nav:focus-visible {
    outline: 4px solid #fff;
    outline-offset: 3px;
}

#closeHowToButton {
    width: 72%;
    font-size: clamp(13px, 3.8cqw, 19px);
}

.image-button {
    position: relative;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    color: #7b3406;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    filter: drop-shadow(0 7px 9px rgba(0, 0, 0, 0.3));
    transition: transform 120ms ease, filter 120ms ease;
}

.image-button img {
    display: block;
    grid-area: 1 / 1;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.image-button span {
    z-index: 1;
    grid-area: 1 / 1;
    padding-bottom: 1.5%;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.image-button:hover {
    transform: translateY(-2px) scale(1.025);
    filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.34)) brightness(1.04);
}

.image-button:active {
    transform: translateY(2px) scale(0.98);
}

.image-button:focus-visible {
    outline: 4px solid #fff;
    outline-offset: 5px;
    border-radius: 999px;
}

.start-button {
    position: absolute;
    z-index: 4;
    right: 19%;
    bottom: max(3.5%, env(safe-area-inset-bottom));
    left: 19%;
    width: 62%;
    margin: auto;
    font-size: clamp(16px, 6cqw, 27px);
    animation: start-button-float 2.1s ease-in-out infinite;
    will-change: translate;
}

@keyframes start-button-float {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -10px; }
}

.countdown-screen {
    z-index: 4;
    display: grid;
    place-items: center;
    background: #082c5d url("../images/GameBG1.jpg") center bottom / cover no-repeat;
    transition: none;
}

.countdown-image {
    display: block;
    width: 31%;
    max-height: 43%;
    object-fit: contain;
    background: transparent;
}

.countdown-image.is-go {
    width: 62%;
}

.countdown-image.is-popping {
    animation: countdown-pop 720ms cubic-bezier(.18, .86, .25, 1.2) both;
}

@keyframes countdown-pop {
    0% { opacity: 0; transform: scale(0.45) rotate(-7deg); }
    55% { opacity: 1; transform: scale(1.13) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

.play-screen {
    z-index: 2;
    overflow: hidden;
    background: #082c5d url("../images/GameBG2.jpg") center / 100% 100% no-repeat;
}

.scrolling-background {
    position: absolute;
    z-index: 0;
    inset: -100% 0 auto;
    height: 200%;
    will-change: transform;
    animation: sky-scroll 3s linear infinite;
    animation-play-state: paused;
}

.play-screen.is-game-running .scrolling-background {
    animation-play-state: running;
}

.scrolling-background::before,
.scrolling-background::after {
    content: "";
    position: absolute;
    right: 0;
    left: 0;
    height: 50%;
    background: url("../images/GameBG2.jpg") center / 100% 100% no-repeat;
}

.scrolling-background::before { top: 0; }
.scrolling-background::after { top: 50%; }

@keyframes sky-scroll {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, 50%, 0); }
}

.stage-background {
    position: absolute;
    z-index: 1;
    inset: 0;
    pointer-events: none;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transform: translate3d(0, -101%, 0);
    will-change: auto;
}

.stage-background.is-starting {
    background-image: url("../images/GameBG1.jpg");
    animation: start-gate-pass 5s linear forwards;
}

.stage-background.is-finishing {
    background-image: url("../images/GameBG3.jpg");
    background-position: center top;
    background-size: cover;
    transform: translate3d(0, 0, 0);
    animation: finish-line-arrive 500ms ease-out forwards;
}

@keyframes start-gate-pass {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(0, 101%, 0); }
}

@keyframes finish-line-arrive {
    from { opacity: 0; }
    to { opacity: 1; }
}

.play-screen.is-game-running .stage-background.is-starting {
    will-change: transform;
}

.play-screen.is-game-running .stage-background.is-finishing {
    will-change: opacity;
}

.play-screen:not(.is-game-running) .stage-background {
    animation-play-state: paused;
    will-change: auto;
}

.play-screen.is-finishing-game .stage-background.is-finishing {
    animation-play-state: running;
    will-change: opacity;
}

.game-hud {
    position: absolute;
    z-index: 5;
    top: max(2.4%, env(safe-area-inset-top));
    right: 4%;
    left: 4%;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.hud-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24%;
    min-height: 42px;
    padding: 5px 14px;
    border: 3px solid rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    color: var(--ink);
    background: rgba(255, 244, 177, 0.91);
    box-shadow: 0 4px 0 rgba(119, 64, 21, 0.32), 0 7px 14px rgba(0, 52, 119, 0.2);
    font-size: clamp(17px, 5cqw, 26px);
}

.score-box img {
    width: 31px;
    margin-right: 8px;
}

.score-box small {
    margin-left: 3px;
    font-size: 0.55em;
    font-weight: 700;
    opacity: 0.68;
}

.life-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 28%;
    height: 47px;
}

.heart {
    color: #ff3954;
    font-family: Arial, sans-serif;
    font-size: clamp(24px, 7cqw, 37px);
    line-height: 1;
    -webkit-text-stroke: 2px #fff4c7;
    paint-order: stroke fill;
    filter: drop-shadow(0 4px 0 #9e2333) drop-shadow(0 6px 5px rgba(0, 0, 0, 0.25));
    transition: opacity 220ms ease, scale 220ms ease, filter 220ms ease;
}

.heart.is-lost {
    opacity: 0.2;
    scale: 0.7;
    filter: grayscale(1);
}

.timer-box {
    display: none;
}

.timer-box span {
    margin-right: 7px;
    font-size: 0.85em;
}

.playfield {
    position: absolute;
    z-index: 2;
    inset: 0;
    overflow: hidden;
    cursor: none;
    contain: layout paint style;
}

.falling-layer {
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    will-change: transform;
    contain: layout style;
}

.character {
    position: absolute;
    z-index: 3;
    bottom: 4.5%;
    left: 50%;
    width: 25%;
    --character-shift: 0px;
    transform: translate3d(var(--character-shift), 0, 0) translateX(-50%);
    transform-origin: 50% 75%;
    will-change: transform;
    filter: drop-shadow(0 9px 7px rgba(23, 72, 129, 0.3));
}

.character.is-moving {
    animation: character-bob 260ms ease-in-out infinite alternate;
}

.character.is-hit {
    animation: character-hit 120ms steps(2, end) 8;
}

.character img {
    display: block;
    width: 100%;
    pointer-events: none;
    transform: rotate(-22deg);
    transform-origin: 50% 58%;
}

@keyframes character-bob {
    from { transform: translate3d(var(--character-shift), 0, 0) translateX(-50%) rotate(-2deg) translateY(0); }
    to { transform: translate3d(var(--character-shift), 0, 0) translateX(-50%) rotate(2deg) translateY(-5px); }
}

@keyframes character-hit {
    0%, 100% { opacity: 1; transform: translate3d(var(--character-shift), 0, 0) translateX(-50%); }
    50% { opacity: 0.16; transform: translate3d(var(--character-shift), 0, 0) translateX(-50%) scale(0.94); }
}

.coin {
    position: absolute;
    z-index: 2;
    top: 0;
    width: 11%;
    aspect-ratio: 812 / 839;
    pointer-events: none;
    filter: drop-shadow(0 5px 5px rgba(54, 67, 110, 0.26));
    contain: layout paint;
}

.coin img {
    display: block;
    width: 100%;
}

.obstacle {
    position: absolute;
    z-index: 2;
    top: 0;
    left: 0;
    width: 18%;
    pointer-events: none;
    filter: drop-shadow(0 7px 6px rgba(0, 0, 0, 0.3));
    contain: layout paint;
}

.obstacle img {
    display: block;
    width: 100%;
}

.obstacle.is-hit {
    animation: obstacle-hit 260ms ease-out forwards;
}

@keyframes obstacle-hit {
    to { opacity: 0; scale: 1.35; rotate: 18deg; }
}

.score-pop {
    position: absolute;
    z-index: 6;
    color: #fff7a7;
    font-size: clamp(18px, 5.5cqw, 30px);
    font-weight: 900;
    text-shadow: 0 2px 0 #a34f05, 0 3px 8px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    animation: score-float 650ms ease-out forwards;
}

@keyframes score-float {
    to { opacity: 0; transform: translateY(-55px) scale(1.25); }
}

.control-hint {
    position: absolute;
    z-index: 5;
    bottom: 1.5%;
    left: 50%;
    margin: 0;
    padding: 5px 13px;
    border-radius: 999px;
    color: white;
    background: rgba(8, 70, 137, 0.52);
    font-size: clamp(11px, 3.2cqw, 16px);
    transform: translateX(-50%);
    transition: opacity 500ms;
    pointer-events: none;
    white-space: nowrap;
}

.control-hint.is-hidden {
    opacity: 0;
}

.result-overlay,
.reward-overlay,
.phone-overlay,
.action-overlay {
    position: absolute;
    z-index: 20;
    inset: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: center;
    padding: 0;
    visibility: hidden;
    opacity: 0;
    background: rgba(2, 20, 67, 0.58);
    backdrop-filter: blur(4px);
    transition: opacity 300ms ease, visibility 300ms;
}

.result-overlay.is-visible,
.reward-overlay.is-visible,
.phone-overlay.is-visible,
.action-overlay.is-visible {
    visibility: visible;
    opacity: 1;
}

.result-card {
    width: 84%;
    padding: 9% 8% 7%;
    border: 5px solid #fff2b2;
    border-radius: 32px;
    color: var(--ink);
    background: linear-gradient(#fffbea, #ffd669);
    box-shadow: 0 14px 0 #c56b14, 0 24px 50px rgba(0, 20, 67, 0.48);
    text-align: center;
    transform: translateY(15px) scale(0.92);
    transition: transform 350ms cubic-bezier(.2, .9, .25, 1.25);
}

.result-overlay.is-visible .result-card {
    transform: translateY(0) scale(1);
}

.result-card h2 {
    margin: 0;
    color: #df4e26;
    font-size: clamp(32px, 10cqw, 54px);
    line-height: 1;
}

.result-card > img {
    width: 25%;
    margin: 7% auto 2%;
    filter: drop-shadow(0 6px 4px rgba(135, 70, 0, 0.25));
}

.result-card > p {
    margin: 2% 0 0;
    font-size: clamp(14px, 4cqw, 21px);
}

.final-score {
    display: block;
    margin: 1% 0 7%;
    color: #a43a0a;
    font-size: clamp(27px, 8cqw, 43px);
}

.replay-button {
    width: 78%;
    margin: 0 auto;
    font-size: clamp(15px, 4.6cqw, 25px);
}

.claim-button {
    width: 78%;
    margin: 3% auto 0;
    font-size: clamp(15px, 4.6cqw, 25px);
}

.image-button[hidden] {
    display: none;
}

.phone-overlay {
    z-index: 24;
}

.action-overlay {
    z-index: 26;
}

.reward-overlay {
    z-index: 22;
}

.reward-card {
    width: 84%;
    min-width: 0;
    max-height: 92%;
    padding: 8% 7%;
    overflow-y: auto;
    border: 5px solid #fff2b2;
    border-radius: 32px;
    color: var(--ink);
    background: linear-gradient(#fffbea, #ffd669);
    box-shadow: 0 14px 0 #c56b14, 0 24px 50px rgba(0, 20, 67, 0.48);
    text-align: center;
    touch-action: pan-y;
    transform: translateY(15px) scale(0.92);
    transition: transform 350ms cubic-bezier(.2, .9, .25, 1.25);
}

.reward-overlay.is-visible .reward-card {
    transform: translateY(0) scale(1);
}

.reward-card h2 {
    margin: 0;
    color: #df4e26;
    font-size: clamp(26px, 7.5cqw, 42px);
    line-height: 1.05;
}

.voucher-card > p {
    margin: 5% 0;
    font-size: clamp(13px, 3.6cqw, 18px);
    line-height: 1.4;
}

.voucher-code {
    padding: 5% 3%;
    border: 3px dashed #df4e26;
    border-radius: 18px;
    color: #a43a0a;
    background: #fffef5;
    font-size: clamp(27px, 8cqw, 43px);
    font-weight: 900;
    letter-spacing: 0.08em;
}

.voucher-card .copy-status {
    min-height: 20px;
    margin: 3% 0 5%;
    color: #71411c;
    font-size: clamp(10px, 2.8cqw, 14px);
    font-weight: 700;
}

.reward-actions {
    display: grid;
    gap: 12px;
}

.reward-actions--split {
    grid-template-columns: 1fr 1fr;
}

.reward-actions .popup-button,
.select-product-button {
    width: 100%;
    font-size: clamp(12px, 3.3cqw, 17px);
}

.product-card {
    padding-top: 7%;
    padding-bottom: 6%;
}

.product-carousel {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 7px;
    margin-top: 5%;
}

.product-slide {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 3px solid rgba(197, 107, 20, 0.45);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.product-slide img {
    display: block;
    width: 100%;
    height: min(50cqw, 34dvh);
    min-height: 190px;
    padding: 8px;
    object-fit: contain;
}

.product-slide figcaption {
    min-height: 42px;
    padding: 10px 8px;
    color: #793a0d;
    background: rgba(255, 244, 177, 0.92);
    font-size: clamp(10px, 3cqw, 15px);
    font-weight: 900;
    line-height: 1.35;
}

.carousel-nav {
    display: grid;
    place-items: center;
    width: 42px;
    height: 56px;
    padding: 0 0 5px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: #df4e26;
    box-shadow: 0 5px 0 #9e3219;
    font: 900 43px/1 Arial, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
}

.carousel-nav:active {
    transform: translateY(3px);
}

.product-counter {
    margin: 3% 0;
    color: #71411c;
    font-size: clamp(11px, 3cqw, 15px);
    font-weight: 800;
}

.phone-card {
    position: relative;
    width: 84%;
    padding: 11% 8% 8%;
    border: 5px solid #fff2b2;
    border-radius: 32px;
    color: var(--ink);
    background: linear-gradient(#fffbea, #ffd669);
    box-shadow: 0 14px 0 #c56b14, 0 24px 50px rgba(0, 20, 67, 0.48);
    text-align: center;
    transform: translateY(15px) scale(0.92);
    transition: transform 350ms cubic-bezier(.2, .9, .25, 1.25);
}

.phone-overlay.is-visible .phone-card {
    transform: translateY(0) scale(1);
}

.phone-card h2 {
    margin: 0;
    color: #df4e26;
    font-size: clamp(28px, 8cqw, 44px);
}

.phone-card > p {
    margin: 4% auto 7%;
    font-size: clamp(13px, 3.8cqw, 19px);
    line-height: 1.45;
}

.phone-close {
    position: absolute;
    top: 10px;
    right: 13px;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #a43a0a;
    background: rgba(255, 255, 255, 0.65);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.phone-card form {
    text-align: left;
}

.phone-card label {
    display: block;
    margin: 0 0 7px 3px;
    font-size: clamp(13px, 3.7cqw, 18px);
    font-weight: 800;
}

.phone-card input {
    width: 100%;
    padding: 14px 16px;
    border: 3px solid #eaa434;
    border-radius: 15px;
    outline: 0;
    color: #44230d;
    background: #fffef5;
    font: 700 clamp(15px, 4.3cqw, 21px) "Montserrat", Arial, sans-serif;
    box-shadow: inset 0 2px 4px rgba(92, 48, 5, 0.12);
}

.phone-card input:focus {
    border-color: #df4e26;
    box-shadow: 0 0 0 4px rgba(223, 78, 38, 0.16);
}

.phone-card input:disabled {
    opacity: 0.68;
}

.form-message {
    min-height: 21px;
    margin: 7px 3px 9px;
    color: #b62e20;
    font-size: clamp(11px, 3.2cqw, 15px);
    font-weight: 700;
    line-height: 1.35;
}

.form-message.is-success {
    color: #277329;
}

.submit-phone-button {
    width: 82%;
    margin: 0 auto;
    font-size: clamp(13px, 4cqw, 21px);
}

.submit-phone-button:disabled {
    cursor: wait;
    filter: grayscale(0.35) opacity(0.75);
}

.action-card {
    width: 84%;
    padding: 12% 8% 9%;
    border: 5px solid #fff2b2;
    border-radius: 32px;
    color: var(--ink);
    background: linear-gradient(#fffbea, #ffd669);
    box-shadow: 0 14px 0 #c56b14, 0 24px 50px rgba(0, 20, 67, 0.48);
    text-align: center;
    transform: translateY(15px) scale(0.92);
    transition: transform 350ms cubic-bezier(.2, .9, .25, 1.25);
}

.action-overlay.is-visible .action-card {
    transform: translateY(0) scale(1);
}

.action-card h2 {
    margin: 0;
    color: #df4e26;
    font-size: clamp(28px, 8cqw, 44px);
}

.action-card p {
    margin: 4% 0 8%;
    font-size: clamp(14px, 4cqw, 20px);
    line-height: 1.45;
}

.action-button {
    width: 82%;
    margin: 0 auto;
    font-size: clamp(14px, 4.2cqw, 22px);
}

.shop-button {
    margin-top: 4%;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-height: 560px) {
    .hud-pill { min-height: 34px; padding-block: 3px; }
    .control-hint { display: none; }
}

@media (hover: none), (pointer: coarse) {
    .scrolling-background {
        display: none;
        animation: none;
        will-change: auto;
    }

    .coin,
    .obstacle,
    .character {
        filter: none;
    }

    .coin,
    .obstacle {
        will-change: auto;
    }

    .character.is-moving {
        animation: none;
    }

}

@media (min-width: 768px) {
    .game-shell {
        width: min(430px, 56.28dvh);
        height: auto;
        aspect-ratio: 941 / 1672;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}
