.hellochild-dev-runner__game {
    position: relative;
    min-height: 0;
    overflow: hidden;
    background: #111a30;
}

.hellochild-dev-runner__game::after {
    position: absolute;
    z-index: 4;
    inset: 0;
    background: rgba(217, 246, 242, 0.48);
    content: "";
    opacity: 0;
    pointer-events: none;
}

.hellochild-dev-runner__game.is-damaged::after {
    animation: dev-runner-damage 420ms steps(2, end);
}

.hellochild-dev-runner__canvas {
    display: block;
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    image-rendering: auto;
    touch-action: manipulation;
}

.hellochild-dev-runner__overlay {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 13px;
    padding: 24px;
    border: 0;
    background: transparent !important;
    color: var(--runner-text);
    font-family: var(--runner-font);
    text-align: center;
    cursor: pointer;
    transition: opacity 120ms steps(2, end), visibility 120ms steps(2, end);
}

.hellochild-dev-runner__overlay:hover,
.hellochild-dev-runner__overlay:focus,
.hellochild-dev-runner__overlay:focus-visible,
.hellochild-dev-runner__overlay:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    transform: none !important;
}

.hellochild-dev-runner__overlay::before,
.hellochild-dev-runner__overlay::after {
    display: none !important;
    content: none !important;
}

.hellochild-dev-runner__overlay:focus-visible .hellochild-dev-runner__play-icon {
    outline: 3px solid #91ddea;
    outline-offset: 5px;
}

.hellochild-dev-runner__overlay:disabled {
    cursor: wait;
}

.hellochild-dev-runner__overlay.is-game-over:disabled {
    cursor: default;
}

.hellochild-dev-runner__overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.hellochild-dev-runner__overlay-copy {
    display: grid;
    justify-items: center;
    gap: 7px;
}

.hellochild-dev-runner__overlay.is-loading {
    z-index: 6;
    background: transparent !important;
}

.hellochild-dev-runner__play-icon {
    position: relative;
    width: clamp(48px, min(10vw, 16vh), 96px);
    height: clamp(48px, min(10vw, 16vh), 96px);
    margin: 0 auto 4px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: none;
}

.hellochild-dev-runner__play-icon::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-top: clamp(8px, min(1.3vw, 2.1vh), 12px) solid transparent;
    border-bottom: clamp(8px, min(1.3vw, 2.1vh), 12px) solid transparent;
    border-left: clamp(14px, min(2.2vw, 3.6vh), 21px) solid #172542;
    content: "";
    transform: translate(-38%, -50%);
}

.hellochild-dev-runner__overlay.is-loading .hellochild-dev-runner__play-icon,
.hellochild-dev-runner__overlay.is-loading .hellochild-dev-runner__overlay-copy {
    display: none;
}

.hellochild-dev-runner__overlay:not(.is-loading):not(.is-game-over):not(.is-error) .hellochild-dev-runner__overlay-copy,
.hellochild-dev-runner__overlay.is-error .hellochild-dev-runner__play-icon {
    display: none;
}

.hellochild-dev-runner__overlay.is-error {
    background: rgba(3, 8, 20, 0.88) !important;
}

.hellochild-dev-runner__overlay-text {
    font-size: clamp(16px, min(4vw, 6vh), 38px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hellochild-dev-runner__overlay-subtext {
    color: var(--runner-muted);
    font-size: clamp(8px, min(1.4vw, 2.2vh), 13px);
    letter-spacing: 0.04em;
}

.hellochild-dev-runner__death-emblem,
.hellochild-dev-runner__death-kicker,
.hellochild-dev-runner__death-stats,
.hellochild-dev-runner__death-action {
    display: none;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__play-icon {
    display: none;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__overlay-copy {
    display: flex;
    box-sizing: border-box;
    width: 100%;
    max-width: 620px;
    max-height: 100%;
    min-width: 0;
    flex: 0 1 620px;
    flex-direction: column;
    align-items: center;
    padding: clamp(8px, min(2vw, 3vh), 22px);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__overlay-copy > * {
    flex-shrink: 0;
}

.hellochild-dev-runner__overlay.is-game-over {
    z-index: 6;
    display: flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    padding: clamp(6px, min(2vw, 3vh), 20px);
    background:
        radial-gradient(circle at 50% 38%, rgba(134, 57, 89, 0.28), transparent 42%),
        rgba(3, 8, 20, 0.86) !important;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__death-emblem {
    display: grid;
    width: clamp(38px, min(8vw, 12vh), 72px);
    aspect-ratio: 1;
    place-items: center;
    margin-bottom: 2px;
    border-radius: 18px 5px 18px 5px;
    background: linear-gradient(145deg, #f48391, #b9436d);
    box-shadow: 0 6px 0 rgba(2, 7, 18, 0.62);
    transform: rotate(-3deg);
}

.hellochild-dev-runner__death-emblem svg {
    width: 68%;
    height: 68%;
    fill: none;
    stroke: #fff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__death-kicker {
    display: block;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f28c9a;
    font-size: clamp(7px, min(1.2vw, 1.9vh), 11px);
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__overlay-text {
    width: 100%;
    min-width: 0;
    max-width: 590px;
    font-size: clamp(13px, min(3.4vw, 5.2vh), 34px);
    font-style: italic;
    font-weight: 700;
    letter-spacing: 0.025em;
    line-height: 1.08;
    text-transform: none;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__overlay-subtext {
    width: 100%;
    min-width: 0;
    max-width: 520px;
    margin-top: 3px;
    color: var(--runner-muted);
    font-size: clamp(8px, min(1.4vw, 2.2vh), 13px);
    overflow-wrap: anywhere;
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__death-stats {
    display: flex;
    width: min(380px, 100%);
    min-width: 0;
    flex-wrap: wrap;
    justify-content: center;
    margin: clamp(3px, 1.3vh, 12px) 0 clamp(3px, 1vh, 8px);
    border: 0;
}

.hellochild-dev-runner__death-stats > span {
    display: grid;
    min-width: 0;
    flex: 1 1 110px;
    gap: 2px;
    padding: clamp(3px, 1vh, 7px) clamp(10px, 1.9vw, 18px);
}

.hellochild-dev-runner__death-stats > span + span {
    position: relative;
}

.hellochild-dev-runner__death-stats > span + span::before {
    position: absolute;
    top: 18%;
    bottom: 18%;
    left: 0;
    width: 1px;
    background: rgba(142, 176, 211, 0.24);
    content: "";
}

.hellochild-dev-runner__death-stats small {
    color: var(--runner-muted);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hellochild-dev-runner__death-stats strong {
    color: #fff;
    font-size: clamp(13px, min(2.4vw, 3.8vh), 23px);
}

.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__death-action {
    display: inline-flex;
    min-height: clamp(30px, min(4.4vw, 7vh), 42px);
    align-items: center;
    gap: 8px;
    padding: 0 clamp(10px, 2.3vw, 22px);
    max-width: 100%;
    border: 0;
    border-radius: 13px 4px 13px 4px;
    background: #fff;
    color: #102847;
    font-size: clamp(8px, min(1.2vw, 1.9vh), 11px);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: normal;
    box-shadow: 0 5px 0 rgba(2, 7, 18, 0.72);
    transition: background 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.hellochild-dev-runner__overlay.is-game-over:hover .hellochild-dev-runner__death-action,
.hellochild-dev-runner__overlay.is-game-over:focus-visible .hellochild-dev-runner__death-action {
    background: #dff8fb;
    box-shadow: 0 2px 0 rgba(3, 9, 24, 0.72);
    transform: translateY(2px);
}

.hellochild-dev-runner__death-action svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.hellochild-dev-runner__hud {
    position: absolute;
    z-index: 2;
    top: 12px;
    right: 12px;
    left: 12px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    pointer-events: none;
}

.hellochild-dev-runner__stat {
    min-width: 0;
    padding: 8px 6px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--runner-text);
    font-family: var(--runner-font);
    text-shadow: none;
    box-shadow: none;
}

.hellochild-dev-runner__stat:nth-child(2) {
    text-align: center;
}

.hellochild-dev-runner__stat:nth-child(3) {
    text-align: center;
}

.hellochild-dev-runner__stat--cups {
    text-align: center;
}

.hellochild-dev-runner__stat--cups strong {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.hellochild-dev-runner__stat--cups strong::before {
    display: inline-block;
    width: 11px;
    height: 9px;
    border: 2px solid #dffaff;
    border-radius: 2px 2px 4px 4px;
    background: #795248;
    content: "";
}

.hellochild-dev-runner__stat--cups strong::after {
    position: absolute;
    top: 4px;
    left: 10px;
    width: 5px;
    height: 5px;
    border: 2px solid #dffaff;
    border-left: 0;
    border-radius: 0 5px 5px 0;
    content: "";
}

.hellochild-dev-runner__stat--lives {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.hellochild-dev-runner__stat:last-child {
    text-align: right;
}

.hellochild-dev-runner__label {
    display: block;
    margin-bottom: 2px;
    color: var(--runner-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hellochild-dev-runner__stat strong {
    font-size: 19px;
    line-height: 1;
}

.hellochild-dev-runner__lives {
    display: inline-flex;
    gap: 5px;
    color: #ed2939;
    letter-spacing: 0;
}

.hellochild-dev-runner__life-icon {
    display: inline-block;
    color: #ed2939;
    font-family: "Trebuchet MS", sans-serif;
    font-size: 22px;
    line-height: 0.8;
}

.hellochild-dev-runner__life-icon.is-empty {
    opacity: 0.2;
}

@keyframes dev-runner-damage {
    0%,
    100% {
        opacity: 0;
    }

    25%,
    65% {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hellochild-dev-runner__overlay,
    .hellochild-dev-runner__play-icon,
    .hellochild-dev-runner__game::after {
        transition: none;
        animation: none;
    }

}


/* Splash, HUD tiles and feedback */
.hellochild-dev-runner__game {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: auto;
    border-radius: clamp(10px, 1.7cqi, 18px);
}
body .hellochild-dev-runner__overlay:not(.is-game-over):not(.is-error) {
    place-content: end center;
    padding: clamp(14px, 3.5cqi, 34px);
    background: linear-gradient(180deg, rgba(4, 12, 38, 0.05) 38%, rgba(4, 10, 30, 0.82) 100%), url("../assets/backgrounds/dev-runner-splash-v1.png") center/cover no-repeat !important;
}
.hellochild-dev-runner__splash-brand {
    position: absolute;
    top: clamp(18px, 5cqi, 52px);
    left: 50%;
    display: grid;
    justify-items: center;
    width: min(72%, 620px);
    color: #fff;
    filter: drop-shadow(0 5px 0 rgba(9, 18, 55, 0.78));
    transform: translateX(-50%) rotate(-1.5deg);
}
.hellochild-dev-runner__splash-brand small,
.hellochild-dev-runner__splash-brand em {
    padding: 0.35em 0.8em;
    border-radius: 999px;
    background: rgba(8, 20, 62, 0.78);
    font-size: clamp(8px, 1.6cqi, 15px);
    font-style: normal;
    font-weight: 900;
    letter-spacing: 0.16em;
    line-height: 1.1;
    text-transform: uppercase;
}
.hellochild-dev-runner__splash-brand strong {
    margin: 0.08em 0;
    color: #fff;
    font-size: clamp(28px, 7.2cqi, 72px);
    font-style: italic;
    font-weight: 1000;
    letter-spacing: -0.055em;
    line-height: 0.9;
    text-shadow: 0 0.08em 0 #4058cb, 0 0.14em 0 #172357;
}
.hellochild-dev-runner__splash-brand em {
    background: linear-gradient(90deg, #7347d8, #375dd0);
    color: #fff4ae;
    letter-spacing: 0.05em;
    text-transform: none;
}
.hellochild-dev-runner__overlay.is-loading .hellochild-dev-runner__splash-brand,
.hellochild-dev-runner__overlay.is-game-over .hellochild-dev-runner__splash-brand,
.hellochild-dev-runner__overlay.is-error .hellochild-dev-runner__splash-brand { display: none; }
.hellochild-dev-runner__play-icon {
    width: clamp(64px, 9cqi, 98px);
    height: clamp(64px, 9cqi, 98px);
    border: clamp(4px, 0.6cqi, 7px) solid #fff !important;
    background: linear-gradient(145deg, #55e889, #18af70) !important;
    box-shadow: 0 8px 0 #08704c, 0 12px 24px rgba(2, 14, 35, 0.48) !important;
    animation: dev-runner-play-bob 1.25s ease-in-out infinite;
}
.hellochild-dev-runner__play-icon::before { border-left-color: #fff; }
.hellochild-dev-runner__overlay:not(.is-hidden) ~ .hellochild-dev-runner__hud { opacity: 0; }
.hellochild-dev-runner__hud {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: clamp(4px, 0.85cqi, 9px);
    transition: opacity 180ms ease;
}
.hellochild-dev-runner__stat {
    padding: clamp(5px, 0.9cqi, 9px);
    border: 2px solid rgba(188, 227, 255, 0.34);
    border-radius: clamp(8px, 1.2cqi, 13px);
    background: linear-gradient(145deg, rgba(33, 65, 129, 0.92), rgba(15, 31, 75, 0.92));
    box-shadow: 0 clamp(2px, 0.45cqi, 5px) 0 rgba(4, 10, 35, 0.8);
    text-align: center !important;
    backdrop-filter: blur(4px);
}
.hellochild-dev-runner__label { font-size: clamp(6px, 1cqi, 10px); }
.hellochild-dev-runner__stat strong { font-size: clamp(11px, 1.9cqi, 19px); white-space: nowrap; }
.hellochild-dev-runner__hud-value {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: clamp(3px, 0.55cqi, 7px);
}
.hellochild-dev-runner__hud-tile,
.hellochild-dev-runner__life-icon {
    display: inline-grid;
    width: clamp(16px, 2.6cqi, 26px);
    height: clamp(16px, 2.6cqi, 26px);
    place-items: center;
    border: 2px solid rgba(255,255,255,.66);
    border-radius: 7px;
    box-shadow: 0 3px 0 rgba(4, 10, 35, .62);
}
.hellochild-dev-runner__life-icon {
    background: linear-gradient(145deg, #ff6f86, #d82f5b);
    color: #fff;
    font-size: clamp(10px, 1.8cqi, 18px);
    line-height: 1;
}
.hellochild-dev-runner__life-icon.is-empty { filter: grayscale(1); opacity: .36; }
.hellochild-dev-runner__stat--cups strong::before,
.hellochild-dev-runner__stat--cups strong::after { display: none; }
.hellochild-dev-runner__hud-tile--cup { background: linear-gradient(145deg, #ffb24b, #da652b); }
.hellochild-dev-runner__hud-tile--cup svg {
    width: 78%;
    fill: none;
    stroke: #fff;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.hellochild-dev-runner__hud-tile--ruby,
.hellochild-dev-runner__control-ruby { position: relative; background: linear-gradient(145deg, #db7cff, #7b32df); }
.hellochild-dev-runner__hud-tile--ruby::before,
.hellochild-dev-runner__control-ruby::before {
    width: 46%;
    height: 62%;
    background: #fff;
    clip-path: polygon(50% 0, 100% 32%, 78% 82%, 50% 100%, 22% 82%, 0 32%);
    content: "";
    opacity: .92;
}
.hellochild-dev-runner__game.is-damaged { animation: dev-runner-hit-nudge 360ms ease; }
@keyframes dev-runner-play-bob { 50% { transform: translateY(-6px) scale(1.04); } }
@keyframes dev-runner-hit-nudge {
    25% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
}


/* Generated HUD tile sprites */
.hellochild-dev-runner__hud-tile,
.hellochild-dev-runner__life-icon,
.hellochild-dev-runner__hud-tile--cup,
.hellochild-dev-runner__hud-tile--ruby {
    border: 0;
    background: transparent !important;
    box-shadow: none;
}
.hellochild-dev-runner__hud-tile canvas,
.hellochild-dev-runner__life-icon canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.hellochild-dev-runner__hud-tile--ruby::before { display: none; }
.hellochild-dev-runner__life-icon.is-empty { filter: none; opacity: .78; }
