/* Lilita One (SIL Open Font License) - se assets/unity/fonts/licenses */
@font-face {
    font-family: 'Bert Display';
    src: url('assets/unity/fonts/bert-display.woff2') format('woff2');
    font-display: swap;
}

/* Nunito (SIL Open Font License) - se assets/unity/fonts/licenses */
@font-face {
    font-family: 'Bert Rounded';
    src: url('assets/unity/fonts/bert-rounded.woff2') format('woff2');
    font-weight: 200 1000;
    font-display: swap;
}

:root {
    --sky: #62cae0;
    --sky-deep: #2e9fc2;
    --ink: #152b38;
    --panel: rgba(8, 26, 37, 0.88);
    --panel-edge: rgba(255, 255, 255, 0.24);
    --lime: #bafa12;
    --orange: #ff9d2e;
    --red: #c30e38;
    --yellow: #ffd333;
    --white: #fffdf4;
}

* { box-sizing: border-box; }

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #153b50;
}

body {
    position: fixed;
    inset: 0;
    color: var(--white);
    font-family: 'Bert Rounded', 'Trebuchet MS', sans-serif;
    overscroll-behavior: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

button { font: inherit; }
button:focus-visible { outline: 4px solid var(--yellow); outline-offset: 4px; }
.hidden { display: none !important; }
.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;
}

#game-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    background: linear-gradient(180deg, #baf1f8 0%, #4fc1db 48%, #d7b965 100%);
}

#game-shell::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    box-shadow: inset 0 0 88px rgba(1, 23, 39, 0.26);
}

#gameCanvas {
    position: relative;
    z-index: 1;
    display: block;
    max-width: 100%;
    max-height: 100%;
    background: var(--sky);
    cursor: crosshair;
    box-shadow: 0 0 64px rgba(3, 32, 49, 0.38);
}

.hud {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

.hud-strip {
    position: absolute;
    left: 50%;
    top: max(10px, env(safe-area-inset-top));
    display: flex;
    gap: clamp(22px, 4vw, 58px);
    min-width: 350px;
    padding: 8px 26px 9px;
    transform: translateX(-50%);
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 47, 60, 0.9), rgba(5, 25, 37, 0.9));
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.hud-stat {
    display: grid;
    min-width: 70px;
    place-items: center;
    line-height: 1;
}

.hud-stat span {
    margin-bottom: 2px;
    color: #b9d5dc;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hud-stat strong {
    color: var(--white);
    font-family: 'Bert Display', 'Bert Rounded', sans-serif;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 400;
    text-shadow: 0 3px 0 #000, 0 0 12px rgba(255, 211, 51, 0.28);
}

.hud-streak { position: relative; }
.hud-stat .streak-guard {
    position: absolute;
    top: 8px;
    right: -30px;
    display: inline-flex;
    align-items: center;
    gap: 1px;
    padding: 1px 4px 1px 1px;
    border: 1px solid #f9d661;
    border-radius: 12px;
    background: #493814;
    color: #fff4bb;
    font-size: 11px;
    letter-spacing: 0;
    margin-bottom: 0;
    pointer-events: none;
}
.streak-guard img { width: 17px; height: 17px; object-fit: contain; }

.hud-level {
    position: absolute;
    top: max(76px, calc(env(safe-area-inset-top) + 68px));
    left: 50%;
    padding: 5px 14px 6px;
    transform: translateX(-50%);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    background: rgba(8, 28, 41, 0.72);
    color: #d9f8ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
}

.hud-menu {
    position: absolute;
    top: max(14px, env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 13px;
    pointer-events: auto;
    border: 2px solid rgba(255, 255, 255, 0.42);
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(27, 56, 69, 0.9), rgba(6, 25, 36, 0.9));
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.26);
    color: #fff;
    cursor: pointer;
}

.hud-menu span {
    color: var(--lime);
    font-size: 12px;
    letter-spacing: 2px;
}

.hud-menu strong { font-size: 12px; letter-spacing: 0.1em; }

.tap-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: min(520px, calc(100vw - 48px));
    padding: 15px 26px 17px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(20, 47, 60, 0.92), rgba(5, 24, 36, 0.92));
    box-shadow: 0 6px 0 rgba(0, 0, 0, 0.28), 0 16px 35px rgba(0, 0, 0, 0.24);
    color: var(--lime);
    font-family: 'Bert Rounded', 'Trebuchet MS', sans-serif;
    font-size: clamp(17px, 2.4vw, 28px);
    font-weight: 900;
    letter-spacing: 0.03em;
    text-align: center;
    text-shadow: 0 3px 0 #000;
    animation: hint-breathe 1.4s ease-in-out infinite;
}

.powerup {
    position: absolute;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: 50%;
    display: none;
    padding: 8px 15px;
    transform: translateX(-50%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 999px;
    background: rgba(31, 15, 56, 0.9);
    color: #fff3a1;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.11em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

.powerup.active { display: block; }

.main-menu {
    position: absolute;
    inset: 0;
    z-index: 5;
    overflow: hidden;
}

.main-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 28%, rgba(255, 252, 194, 0.72), transparent 22%),
        linear-gradient(90deg, rgba(9, 41, 57, 0.06), transparent 32% 70%, rgba(9, 41, 57, 0.12));
    pointer-events: none;
}

.game-title {
    position: absolute;
    z-index: 3;
    top: clamp(22px, 5vh, 54px);
    left: 50%;
    width: min(610px, 53vw);
    max-height: 22vh;
    transform: translateX(-50%);
    object-fit: contain;
    filter: drop-shadow(0 7px 0 rgba(26, 7, 12, 0.34)) drop-shadow(0 14px 18px rgba(21, 42, 54, 0.22));
}

.menu-bird {
    position: absolute;
    z-index: 3;
    left: clamp(-20px, 3vw, 70px);
    bottom: clamp(-48px, -5vh, -12px);
    width: min(47vw, 560px);
    max-height: 69vh;
    object-fit: contain;
    filter: drop-shadow(0 18px 16px rgba(25, 45, 48, 0.28));
    animation: menu-hover 3.6s ease-in-out infinite;
}

.menu-bird[data-hero]:not([data-hero="bert"]) {
    left: -2.5%;
    bottom: -10%;
    width: min(42%, 500px);
    max-height: 68%;
    object-position: center bottom;
    filter: drop-shadow(10px 18px 0 rgba(12,39,48,.12)) drop-shadow(0 22px 20px rgba(15,31,38,.32));
    animation: menu-hero-hover 3.8s ease-in-out infinite;
}

.menu-actions {
    position: absolute;
    z-index: 4;
    top: 36%;
    left: 50%;
    display: grid;
    width: min(330px, 35vw);
    justify-items: center;
    transform: translateX(-16%);
}

.edition-label {
    margin: 0 0 12px;
    color: #173d4c;
    font-size: clamp(9px, 1.2vw, 12px);
    font-weight: 900;
    letter-spacing: 0.2em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.unity-button {
    display: grid;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    filter: drop-shadow(0 7px 0 rgba(26, 35, 9, 0.34)) drop-shadow(0 12px 13px rgba(12, 41, 51, 0.22));
    transition: transform 140ms cubic-bezier(.2, .8, .2, 1), filter 140ms ease;
}

.unity-button img { display: block; max-width: 100%; pointer-events: none; }
.unity-button:hover { transform: translateY(-4px) scale(1.035); filter: drop-shadow(0 10px 0 rgba(26, 35, 9, 0.3)) drop-shadow(0 15px 15px rgba(12, 41, 51, 0.24)); }
.unity-button:active { transform: translateY(5px) scale(0.97); filter: drop-shadow(0 2px 0 rgba(26, 35, 9, 0.34)); }
.play-button { width: clamp(148px, 17vw, 220px); padding: 16px 26px 14px; border: 3px solid rgba(255,255,255,.7); border-radius: 24px; background: linear-gradient(180deg, #395664, #102a39); box-shadow: inset 0 2px 0 rgba(255,255,255,.22); }
.play-button img { width: 100%; }


/* Knaptekster som rigtig tekst i stedet for Unity-billeder */
.ui-word, .ui-house { display: block; width: 100%; text-align: center; line-height: 1; white-space: nowrap; pointer-events: none; }
.ui-word { font-family: 'Bert Rounded', 'Trebuchet MS', sans-serif; font-weight: 900; letter-spacing: .01em; -webkit-text-stroke: .05em #0b1a24; paint-order: stroke fill; text-shadow: 0 .09em 0 #0b1a24, 0 .14em .12em rgba(0,0,0,.35); }
.ui-house { font-family: 'Bert Display', sans-serif; font-weight: 400; letter-spacing: .02em; -webkit-text-stroke: .035em #0b1a24; paint-order: stroke fill; text-shadow: 0 .09em 0 #0b1a24, 0 .14em .12em rgba(0,0,0,.35); }
.ui-lime { color: var(--lime); }
.ui-orange { color: var(--orange); }
.ui-blue { color: #6fd3ff; }
.ui-white { color: #fff; }
.play-button .ui-play { font-size: clamp(34px, 7.4cqh, 58px); padding: .04em 0 .08em; }
.quick-play-button .ui-house { font-size: clamp(20px, 4.6cqh, 34px); }
.round-menu-button .ui-word { width: auto; padding: 0 4px; font-size: clamp(11px, 2.2cqh, 16px); letter-spacing: .03em; }
.leaderboard-button .ui-word { font-size: clamp(14px, 3.2cqh, 24px); }
.level-back-button .ui-back { font-size: clamp(16px, 3.4cqh, 24px); }
.ui-board-scope { width: auto; font-size: clamp(18px, 3.6cqh, 28px); }

.install-button {
    display: flex;
    min-width: 220px;
    margin-top: 20px;
    padding: 9px 18px 9px 12px;
    align-items: center;
    gap: 11px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(31, 68, 82, 0.92), rgba(9, 37, 51, 0.94));
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
    text-align: left;
    transition: transform 140ms ease, filter 140ms ease;
}

.install-button:hover { filter: brightness(1.08); transform: translateY(-2px); }
.install-button:active { transform: translateY(3px); }
.install-button strong { display: block; color: var(--lime); font-size: 13px; letter-spacing: 0.1em; }
.install-button small { display: block; margin-top: 1px; color: #c8e0e7; font-size: 12px; }
.install-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: var(--lime);
    color: #18333e;
    font-family: 'Bert Display', sans-serif;
    font-size: 25px;
    font-weight: 900;
}

.menu-controls {
    max-width: 310px;
    margin: 17px 0 0;
    color: #315764;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-align: center;
}

.menu-record {
    position: absolute;
    z-index: 4;
    right: max(22px, calc(env(safe-area-inset-right) + 16px));
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 16px));
    display: grid;
    grid-template-columns: 62px minmax(120px, 1fr) 42px;
    min-width: 270px;
    padding: 12px 14px 11px;
    align-items: center;
    gap: 10px;
    border: 3px solid rgba(255, 255, 255, 0.26);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(27, 54, 67, 0.94), rgba(7, 28, 40, 0.95));
    box-shadow: 0 7px 0 rgba(0, 0, 0, 0.26), 0 16px 28px rgba(4, 28, 41, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.menu-record > img:first-child { width: 62px; filter: drop-shadow(0 4px 4px rgba(0,0,0,.35)); }
.menu-record .record-star { width: 40px; opacity: 0.9; }
.menu-record div { display: grid; }
.menu-record span { color: #d3e9ee; font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.menu-record strong { color: var(--yellow); font-family: 'Bert Display', sans-serif; font-size: 38px; font-weight: 400; line-height: .95; text-shadow: 0 3px 0 #000; }
.menu-record small { color: #91bdc8; font-size: 11px; }

.level-menu {
    position: absolute;
    z-index: 6;
    top: 50%;
    left: 50%;
    width: min(1080px, calc(100vw - 42px));
    max-height: calc(100dvh - 38px);
    padding: clamp(18px, 3vw, 34px);
    transform: translate(-50%, -50%);
    overflow: auto;
    border: 3px solid rgba(255,255,255,.4);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(17, 52, 67, .94), rgba(5, 27, 39, .96));
    box-shadow: 0 9px 0 rgba(0,0,0,.26), 0 28px 64px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.16);
    scrollbar-width: none;
}

.level-menu::-webkit-scrollbar { display: none; }
.level-header { display: flex; align-items: center; justify-content: center; gap: clamp(36px, 5vw, 70px); }
.level-header img { width: min(310px, 31vw); filter: drop-shadow(0 5px 0 rgba(0,0,0,.25)); }
.level-header p { margin: 0 0 4px; color: #83cbd8; font-size: 11px; font-weight: 900; letter-spacing: .16em; }
.level-header h2,
.install-card h2,
.rotate-overlay h2 {
    margin: 0;
    color: #fff;
    font-family: 'Bert Rounded', 'Trebuchet MS', sans-serif;
    font-size: clamp(30px, 4vw, 48px);
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 4px 0 #000;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    gap: 14px;
    margin: 24px 0 20px;
    contain: layout paint;
}

.level-card {
    position: relative;
    min-width: 0;
    aspect-ratio: 398 / 221;
    padding: 0;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,.62);
    border-radius: 17px;
    background: #3b7388;
    box-shadow: 0 6px 0 rgba(0,0,0,.3), 0 12px 20px rgba(0,0,0,.2);
    color: #fff;
    cursor: pointer;
    transition: transform 150ms cubic-bezier(.2,.8,.2,1), border-color 150ms ease, filter 150ms ease;
}

.level-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 34%, rgba(1,17,25,.14) 48%, rgba(1,17,25,.9) 100%);
    pointer-events: none;
}
.level-card:hover { transform: translateY(-6px) scale(1.025); border-color: var(--lime); filter: saturate(1.08); }
.level-card:active { transform: translateY(2px) scale(.98); }
.level-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.level-card-copy { position: absolute; z-index: 2; right: 10px; bottom: 9px; left: 10px; display: grid; grid-template-columns: 34px 1fr auto; align-items: end; gap: 8px; text-align: left; }
.level-id { display: grid; width: 34px; height: 34px; place-items: center; border: 2px solid rgba(255,255,255,.68); border-radius: 50%; background: var(--red); color: #fff; font-family: 'Bert Display', sans-serif; font-size: 24px; text-shadow: 0 2px 0 #000; }
.level-card-label { display: grid; min-width: 0; }
.level-card-title { overflow: hidden; color: #fff; font-family: 'Bert Display', sans-serif; font-size: clamp(17px, 2vw, 25px); line-height: .9; text-overflow: ellipsis; text-shadow: 0 3px 0 #000; white-space: nowrap; }
.level-card-mode { margin-top: 2px; color: #ccebf0; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.level-card-score { align-self: center; color: #d0e6ea; font-size: 11px; font-weight: 900; letter-spacing: .06em; text-align: right; }
.level-card-score strong { display: block; color: var(--yellow); font-family: 'Bert Display', sans-serif; font-size: 19px; font-weight: 400; text-shadow: 0 2px 0 #000; }
.level-card-lock {
    position: absolute;
    z-index: 3;
    top: 8px;
    right: 8px;
    max-width: calc(100% - 16px);
    padding: 4px 7px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.44);
    border-radius: 8px;
    background: rgba(5,24,34,.84);
    color: var(--lime);
    font-size: clamp(8px, 1.7cqh, 10px);
    font-weight: 900;
    letter-spacing: .06em;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.level-unlock-track { position: absolute; z-index: 4; right: 0; bottom: 0; left: 0; height: 4px; background: rgba(0,0,0,.46); }
.level-unlock-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, #82bd00, var(--lime)); transition: width 260ms ease; }
.level-card.locked { border-color: rgba(170,190,198,.42); cursor: help; filter: none; }
.level-card.locked .level-thumb { filter: grayscale(.72) brightness(.64); }
.level-card.locked::after { background: linear-gradient(180deg, rgba(3,16,24,.42), rgba(3,16,24,.92)); }
.level-card.locked .level-card-lock { color: #fff; background: rgba(8,20,28,.95); }
.level-card.locked:hover { transform: translateY(-3px); border-color: var(--orange); filter: none; }
.level-card.locked:hover .level-thumb { filter: grayscale(.55) brightness(.72); }
.level-6 .level-thumb { filter: hue-rotate(16deg) saturate(1.1); }
.level-7 .level-thumb { filter: hue-rotate(-18deg) saturate(1.18) contrast(1.04); }
.level-8 .level-thumb { filter: hue-rotate(18deg) saturate(1.22); }
.level-9 .level-thumb { filter: hue-rotate(56deg) saturate(1.32) brightness(.78); }

.text-button {
    min-height: 44px;
    padding: 10px 20px;
    border: 2px solid rgba(255,255,255,.34);
    border-radius: 13px;
    background: rgba(255,255,255,.08);
    color: var(--lime);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    transition: background 140ms ease, transform 140ms ease;
}
.text-button:hover { background: rgba(255,255,255,.15); transform: translateY(-2px); }

.game-over {
    position: absolute;
    z-index: 7;
    top: 50%;
    left: 50%;
    display: grid;
    width: min(760px, calc(100vw - 32px));
    padding: 12px;
    justify-items: center;
    transform: translate(-50%, -50%);
}

/* Resultattavle: rigtig tekst i stedet for det gamle Unity-billede */
.scoreboard {
    position: relative;
    display: grid;
    width: min(560px, 62vw, 92cqh);
    padding: clamp(8px, 1.8cqh, 14px) clamp(10px, 2cqw, 22px) clamp(8px, 1.6cqh, 12px);
    grid-template-columns: 1fr auto 1fr;
    column-gap: clamp(6px, 1.5cqw, 18px);
    border: 3px solid #0d1b24;
    border-radius: 16px;
    background: linear-gradient(#e3e7ea, #b4bcc2 60%, #a3abb1);
    box-shadow: 0 10px 0 rgba(0,0,0,.28), 0 20px 24px rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.7);
}
.score-col { display: grid; grid-template-rows: auto 1fr 1fr 1fr; justify-items: center; align-items: center; row-gap: clamp(2px, .8cqh, 6px); min-width: 0; }
.score-heading { margin: 0 0 clamp(2px, .6cqh, 6px); font-family: 'Bert Display', sans-serif; font-size: clamp(11px, 2.6cqh, 18px); font-weight: 400; letter-spacing: .04em; color: #fff; text-shadow: 0 2px 0 #000, 0 0 2px #000; white-space: nowrap; }
.score-value { font-family: 'Bert Display', sans-serif; font-weight: 400; line-height: .95; text-shadow: 0 4px 0 #000; white-space: nowrap; }
.score-personal .score-value { color: var(--yellow); }
.score-run .score-value { color: var(--lime); }
.score-row-score { font-size: clamp(24px, 7cqh, 54px); }
.score-row-time { font-size: clamp(17px, 4.6cqh, 36px); }
.score-row-streak { font-size: clamp(20px, 5.4cqh, 42px); }
.score-icons { grid-template-rows: auto 1fr 1fr 1fr; padding-top: clamp(14px, 3.4cqh, 26px); }
.score-icons::before { content: ''; }
.score-icons img { width: clamp(30px, 7cqh, 56px); height: clamp(30px, 7cqh, 56px); object-fit: contain; filter: drop-shadow(0 3px 2px rgba(0,0,0,.3)); }
.score-streak-label { font-family: 'Bert Display', sans-serif; font-size: clamp(13px, 3cqh, 22px); color: #fff; text-shadow: 0 2px 0 #000, 0 0 2px #000; }
.new-highscore { position: absolute; z-index: 3; top: -16px; right: -30px; padding: 5px 10px; border: 2px solid #fff; border-radius: 10px; background: linear-gradient(#ff5d6c, #c30e38); color: #fff; font-family: 'Bert Display', sans-serif; font-size: clamp(11px, 2.4cqh, 16px); letter-spacing: .04em; text-shadow: 0 2px 0 #000; transform: rotate(8deg); box-shadow: 0 4px 0 #5f0618, 0 6px 10px rgba(0,0,0,.35); animation: badge-pop .65s cubic-bezier(.2,1.5,.4,1) both; }

.result-actions { display: flex; width: min(568px, 90vw); margin-top: clamp(6px, 2vh, 16px); justify-content: center; gap: clamp(10px, 2.4cqw, 26px); }
.result-button { position: relative; min-width: 0; min-height: 44px; padding: clamp(6px, 1.4cqh, 10px) clamp(14px, 3cqw, 28px); border: 0; border-radius: 12px; background: transparent; cursor: pointer; font-family: 'Bert Display', sans-serif; font-size: clamp(22px, 6cqh, 44px); font-weight: 400; line-height: 1; letter-spacing: .02em; text-shadow: 0 3px 0 #1c2a05, 0 5px 0 rgba(0,0,0,.35); transition: transform .12s ease; }
.result-again { color: var(--lime); -webkit-text-stroke: 1px #3d5a00; }
.result-change { color: var(--orange); text-shadow: 0 3px 0 #5a2d00, 0 5px 0 rgba(0,0,0,.35); -webkit-text-stroke: 1px #6b3400; }
.result-button:hover { transform: translateY(-3px) scale(1.04); }
.result-button:active { transform: translateY(3px) scale(.97); }
.result-kicker { margin: 0 0 4px; color: var(--white); font-size: 12px; font-weight: 900; letter-spacing: .2em; text-shadow: 0 2px 0 #000; }
.change-level { width: 100%; }

.loading {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    padding: 24px;
    place-content: center;
    justify-items: center;
    gap: 18px;
    background: linear-gradient(180deg, #65cce0, #2b9ebf);
    color: #fff;
    text-align: center;
}
.loading > img { width: min(560px, 70vw); filter: drop-shadow(0 7px 0 rgba(0,0,0,.24)); }
.loading p { margin: 0; font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.loading-track { width: min(320px, 56vw); height: 14px; padding: 3px; overflow: hidden; border: 2px solid rgba(255,255,255,.8); border-radius: 999px; background: rgba(11,49,65,.55); }
.loading-track i { display: block; width: 36%; height: 100%; border-radius: inherit; background: var(--lime); box-shadow: 0 0 14px rgba(186,250,18,.7); animation: loading-run 1.1s ease-in-out infinite alternate; }

.touch-guide { position: absolute; inset: 0; display: none; pointer-events: none; }
.touch-zone { position: absolute; top: 0; display: flex; width: 50%; height: 100%; align-items: center; opacity: 0; transition: opacity 100ms ease, background 100ms ease; }
.touch-zone span {
    display: grid;
    min-width: 58px;
    min-height: 34px;
    padding: 6px 10px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.38);
    border-radius: 11px;
    background: rgba(6, 30, 42, 0.7);
    color: #fff;
    font-family: 'Bert Display', sans-serif;
    font-size: 17px;
    text-shadow: 0 2px 0 #000;
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
}
.touch-zone i { width: 0; height: 0; margin: 0 8px; border-right: 8px solid transparent; border-left: 8px solid transparent; }
.touch-up { left: 0; justify-content: flex-start; padding-left: max(18px, env(safe-area-inset-left)); background: linear-gradient(90deg, rgba(186,250,18,.14), transparent); }
.touch-up i { border-bottom: 12px solid var(--lime); }
.touch-down { right: 0; justify-content: flex-end; padding-right: max(18px, env(safe-area-inset-right)); background: linear-gradient(270deg, rgba(255,157,46,.14), transparent); }
.touch-down i { border-top: 12px solid var(--orange); }
.touch-zone.active { opacity: 0; }
body.is-prewarm .touch-zone { opacity: .4; }

.rotate-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    padding: 30px;
    place-content: center;
    justify-items: center;
    gap: 15px;
    background: linear-gradient(180deg, #6ed2e4, #2397bb);
    text-align: center;
}
.rotate-overlay img { width: min(78vw, 500px); filter: drop-shadow(0 6px 0 rgba(0,0,0,.24)); }
.rotate-overlay p { margin: 0; color: #eafaff; font-size: 14px; font-weight: 800; }
.phone-turn { position: relative; width: 86px; height: 124px; margin: 8px 0 12px; border: 7px solid #fff; border-radius: 17px; box-shadow: 0 7px 0 rgba(0,0,0,.22); animation: phone-turn 1.8s ease-in-out infinite; }
.phone-turn i { position: absolute; bottom: 7px; left: 50%; width: 10px; height: 10px; transform: translateX(-50%); border-radius: 50%; background: var(--lime); }

.modal-backdrop { position: absolute; inset: 0; z-index: 90; display: grid; padding: 22px; place-items: center; background: rgba(1, 17, 27, .76); backdrop-filter: blur(12px); }
.install-card { display: grid; grid-template-columns: 132px 1fr; width: min(600px, calc(100vw - 34px)); padding: 24px; align-items: center; gap: 24px; border: 3px solid rgba(255,255,255,.34); border-radius: 26px; background: linear-gradient(180deg, #1d4c5e, #092a3b); box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 28px 55px rgba(0,0,0,.35); }
.install-card > img { width: 132px; border: 4px solid rgba(255,255,255,.6); border-radius: 25%; box-shadow: 0 8px 18px rgba(0,0,0,.3); }
.install-card .edition-label { color: #9bd4dd; }
.install-card p:not(.edition-label) { color: #d8eef2; font-size: 14px; line-height: 1.55; text-wrap: pretty; }
.install-card .text-button { margin-top: 8px; }

.app-status { position: absolute; z-index: 100; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); padding: 10px 15px; transform: translateY(30px); border: 2px solid rgba(255,255,255,.4); border-radius: 12px; background: rgba(6,29,41,.93); color: #fff; font-size: 12px; font-weight: 900; opacity: 0; pointer-events: none; transition: opacity 180ms ease, transform 180ms ease; }
.app-status.visible { transform: translateY(0); opacity: 1; }

@keyframes hint-breathe { 50% { transform: translate(-50%, -50%) scale(1.045); } }
@keyframes menu-hover { 50% { transform: translateY(-10px) rotate(-1deg); } }
@keyframes menu-hero-hover {
    0%, 100% { transform: rotate(-8deg) translateY(0) scale(1.04); }
    50% { transform: rotate(-4deg) translateY(-10px) scale(1.08); }
}
@keyframes loading-run { to { transform: translateX(178%); } }
@keyframes badge-pop { from { opacity: 0; transform: rotate(-12deg) scale(.2); } to { opacity: 1; transform: rotate(8deg) scale(1); } }
@keyframes phone-turn { 0%, 20% { transform: rotate(0); } 65%, 100% { transform: rotate(90deg); } }

@media (pointer: coarse), (orientation: landscape) and (max-height: 600px) {
    body.is-prewarm .touch-guide { display: block; }
}

@media (orientation: portrait) {
    .rotate-overlay { display: grid; }
}

@media (max-width: 900px) {
    .game-title { width: min(560px, 64vw); }
    .menu-bird { left: -5vw; width: min(51vw, 470px); }
    .menu-actions { left: 51%; width: 38vw; }
    .menu-record { min-width: 230px; grid-template-columns: 48px 1fr 34px; }
    .menu-record > img:first-child { width: 48px; }
    .menu-record .record-star { width: 33px; }
    .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (orientation: landscape) and (max-height: 560px) {
    .game-title { top: 13px; width: min(430px, 47vw); max-height: 21vh; }
    .menu-bird { left: max(1vw, env(safe-area-inset-left)); bottom: -6vh; width: min(38vw, 360px); max-height: 70vh; }
    .menu-actions { top: 28%; left: 49%; width: min(280px, 32vw); }
    .edition-label { margin-bottom: 6px; font-size: 11px; }
    .play-button { width: clamp(120px, 15vw, 176px); padding: 10px 19px; border-radius: 18px; }
    .install-button { min-width: 195px; margin-top: 10px; padding-block: 7px; }
    .menu-controls { margin-top: 9px; font-size: 10px; }
    .menu-record { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); min-width: 205px; padding: 8px 10px; grid-template-columns: 38px 1fr 28px; border-radius: 15px; }
    .menu-record > img:first-child { width: 38px; }
    .menu-record .record-star { width: 28px; }
    .menu-record strong { font-size: 28px; }
    .level-menu { width: min(1020px, calc(100vw - 24px)); max-height: calc(100dvh - 20px); padding: 14px 18px; border-radius: 20px; }
    .level-header { gap: 18px; }
    .level-header img { width: min(235px, 27vw); }
    .level-header h2 { font-size: 32px; }
    .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 14px 0 12px; }
    .level-card { border-radius: 12px; }
    .level-card-copy { right: 6px; bottom: 5px; left: 6px; grid-template-columns: 27px 1fr auto; gap: 5px; }
    .level-id { width: 27px; height: 27px; font-size: 19px; }
    .level-card-title { font-size: 16px; }
    .level-card-mode { display: none; }
    .tap-hint { min-width: 390px; padding: 10px 18px 12px; font-size: 23px; }
    .hud-strip { top: max(5px, env(safe-area-inset-top)); min-width: 300px; padding-block: 5px; }
    .hud-stat strong { font-size: 24px; }
    .hud-level { top: max(60px, calc(env(safe-area-inset-top) + 54px)); }
    .result-actions { margin-top: 13px; }
}

@media (orientation: landscape) and (max-width: 720px) {
    .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .level-menu { max-height: calc(100dvh - 14px); padding: 8px 12px; }
    .level-header { gap: 12px; }
    .level-header img { width: min(165px, 26vw); }
    .level-header p { display: none; }
    .level-header h2 { font-size: 26px; }
    .level-grid { gap: 6px; margin: 8px 0; }
    .level-card { aspect-ratio: 2.08; }
    .level-card-title { font-size: 15px; }
    .text-button { min-height: 38px; padding: 7px 16px; }
    .menu-record { min-width: 185px; }
}

@supports (-webkit-touch-callout: none) {
    html,
    body { height: -webkit-fill-available; }
    #game-shell { height: -webkit-fill-available; }
    .level-menu {
        width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 20px);
    }
}

@media (max-width: 600px) {
    .install-card { grid-template-columns: 82px 1fr; gap: 15px; padding: 18px; }
    .install-card > img { width: 82px; border-radius: 22%; }
    .install-card h2 { font-size: 28px; }
    .install-card p:not(.edition-label) { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* Complete-pass stage and progression UI */
body {
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 35%, #346579, #071722 78%);
}

#game-shell {
    width: min(100vw, 177.7778dvh);
    height: min(100dvh, 56.25vw);
    aspect-ratio: 16 / 9;
    flex: none;
    border-radius: clamp(0px, 1.2vw, 18px);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255,255,255,.12);
}

#gameCanvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
}

.round-menu-button {
    position: absolute;
    z-index: 8;
    top: max(16px, env(safe-area-inset-top));
    right: max(18px, env(safe-area-inset-right));
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 2px solid rgba(255,255,255,.56);
    border-radius: 15px;
    background: linear-gradient(#31596b, #102c3a);
    box-shadow: 0 5px 0 rgba(0,0,0,.28);
    color: #fff;
    cursor: pointer;
    font-size: 23px;
}

.quick-play-button {
    width: clamp(128px, 15vw, 190px);
    margin-top: 8px;
}

.quick-play-button img { width: 100%; }

.record-total {
    display: grid !important;
    grid-template-columns: 24px auto;
    align-items: center;
    justify-content: end;
    gap: 4px;
}

.record-total img { width: 24px; }
.record-total strong { color: var(--yellow); font-size: 24px; }

.daily-card {
    position: absolute;
    z-index: 5;
    right: max(22px, calc(env(safe-area-inset-right) + 16px));
    top: 21%;
    display: grid;
    min-width: 225px;
    padding: 12px 16px;
    border: 2px solid rgba(255,255,255,.52);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(31,75,92,.96), rgba(8,32,46,.97));
    box-shadow: 0 6px 0 rgba(0,0,0,.25), inset 0 1px rgba(255,255,255,.18);
    color: #fff;
    cursor: pointer;
    text-align: left;
}

.daily-card:hover { transform: translateY(-3px); }
.daily-card .daily-kicker { color: #88cedb; font-size: 11px; font-weight: 900; letter-spacing: .17em; }
.daily-card strong { margin-top: 3px; color: var(--yellow); font-family: 'Bert Display', sans-serif; font-size: 25px; font-weight: 400; text-shadow: 0 2px #000; }
.daily-card small { color: #d8edf1; font-size: 11px; }
.daily-card b { position: absolute; right: 12px; bottom: 10px; color: var(--lime); font-size: 11px; letter-spacing: .12em; }
.daily-card.completed { border-color: var(--lime); }

.hero-selector {
    position: absolute;
    z-index: 5;
    left: max(18px, calc(env(safe-area-inset-left) + 12px));
    top: max(18px, calc(env(safe-area-inset-top) + 8px));
    display: grid;
    grid-template-columns: 70px 1fr;
    grid-template-rows: auto auto auto;
    align-items: center;
    width: 195px;
    min-height: 70px;
    gap: 0 8px;
    padding: 6px 10px 7px 7px;
    border: 2px solid rgba(255,255,255,.34);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(18,58,73,.94), rgba(5,29,42,.96));
    box-shadow: 0 6px 0 rgba(0,0,0,.23), inset 0 1px rgba(255,255,255,.16);
    color: #fff;
    cursor: pointer;
    text-align: left;
}

.hero-selector:hover { transform: translateY(-2px); }
.hero-selector > img { grid-row: 1 / 4; width: 66px; height: 58px; object-fit: contain; }
.hero-selector > span { color: #8ed1dd; font-size: 10px; font-weight: 900; letter-spacing: .16em; }
.hero-selector > strong { overflow: hidden; color: var(--lime); font-family: 'Bert Display', sans-serif; font-size: clamp(15px, 2.5cqw, 19px); font-weight: 400; line-height: 1; text-overflow: ellipsis; text-shadow: 0 2px #000; white-space: nowrap; }
.hero-selector:is([data-hero="block"], [data-hero="brain"], [data-hero="mecha"], [data-hero="noir"], [data-hero="vulture"], [data-hero="sugar"], [data-hero="prism"]) > strong { font-size: 12.5px; letter-spacing: -.015em; }
.hero-selector > small { color: #d8edf2; font-size: 9px; font-weight: 900; letter-spacing: .06em; white-space: nowrap; }

.hero-wardrobe-card {
    width: min(940px, 94vw);
    max-height: 92vh;
    padding: 12px 14px;
    border: 3px solid rgba(255,255,255,.42);
    border-radius: 24px;
    background: linear-gradient(155deg, rgba(29,77,95,.99), rgba(5,29,42,.995));
    box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 30px 70px rgba(0,0,0,.48);
}
.hero-wardrobe-card header { display: flex; align-items: center; justify-content: space-between; }
.hero-wardrobe-card header h2 { margin: 1px 0 0; font-family: 'Bert Display', sans-serif; font-size: 32px; font-weight: 400; line-height: .9; text-shadow: 0 3px #000; }
.hero-wardrobe-card header > button { width: 38px; height: 38px; border: 2px solid rgba(255,255,255,.4); border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; cursor: pointer; font-size: 24px; font-weight: 900; }
.hero-wardrobe-note { margin: 4px 0 8px; color: #b9dce4; font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.hero-grid { display: grid; grid-template-columns: repeat(6, minmax(72px, 1fr)); gap: 7px; max-height: min(45vh, 185px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.hero-option {
    display: grid;
    width: auto;
    min-height: 76px;
    padding: 3px 4px 5px;
    place-items: center;
    border: 2px solid transparent;
    border-radius: 13px;
    background: rgba(255,255,255,.07);
    color: #d8edf2;
    cursor: pointer;
}
.hero-option:hover { background: rgba(255,255,255,.13); transform: translateY(-2px); }
.hero-option img { width: 66px; height: 49px; object-fit: contain; }
.hero-option b { font-size: 11px; line-height: 1; letter-spacing: .04em; }
.hero-option small { color: #82b8c5; font-size: 9px; font-weight: 1000; letter-spacing: .06em; }
.hero-option.selected { border-color: var(--lime); background: rgba(186,250,18,.12); color: var(--lime); }
.hero-option.selected small { color: #dfff92; }
.hero-option.locked { border-color: rgba(245,209,119,.24); background: rgba(4,18,31,.42); }
.hero-option.locked img { opacity: .68; filter: saturate(.7); }
.hero-option.locked small { color: #ffdb86; }
.hero-option.inspected { border-color: #fbd66c; background: rgba(255,212,89,.13); }
.hero-wardrobe-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    margin-top: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(255,222,130,.35);
    border-radius: 12px;
    background: rgba(3,23,35,.67);
}
.hero-wardrobe-detail > div:first-child { display: grid; gap: 2px; min-width: 0; }
.hero-wardrobe-detail strong { color: #ffe08a; font-size: 12px; letter-spacing: .06em; }
.hero-wardrobe-detail span { color: #d2e9ee; font-size: 11px; line-height: 1.2; }
.hero-shop-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.hero-buy, .hero-cancel {
    min-height: 31px;
    padding: 3px 10px;
    border: 1px solid rgba(255,255,255,.45);
    border-radius: 9px;
    background: #a7d235;
    color: #102531;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
}
.hero-buy:disabled { background: #40525a; color: #c4d1d4; cursor: default; }
.hero-cancel { background: #324d5b; color: #f1f9fa; }
.hero-wardrobe-footer { display: flex; margin-top: 8px; align-items: center; justify-content: space-between; gap: 12px; }
.hero-wardrobe-footer > span { max-width: 72%; color: #a8ced8; font-size: 10px; font-weight: 800; line-height: 1.3; }
.hero-wallet { display: inline-flex; align-items: center; gap: 3px; }
.hero-wallet img { width: 17px; height: 17px; object-fit: contain; }
.hero-wallet b { color: #ffe08a; font-size: 12px; }
.hero-wardrobe-footer .primary-menu-button { min-height: 36px; padding: 6px 20px; }

.pause-card,
.settings-card {
    width: min(460px, 74vw);
    padding: 25px;
    border: 3px solid rgba(255,255,255,.4);
    border-radius: 26px;
    background: linear-gradient(180deg, #1d4d5f, #082839);
    box-shadow: 0 10px 0 rgba(0,0,0,.28), 0 30px 60px rgba(0,0,0,.38);
    text-align: center;
}
.pause-card h2,
.settings-card h2 { margin: 0 0 18px; font-family: 'Bert Display', sans-serif; font-size: 48px; font-weight: 400; text-shadow: 0 4px #000; }
.pause-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.pause-actions .primary-menu-button { grid-column: 1 / -1; }
.primary-menu-button {
    min-height: 48px;
    padding: 10px 22px;
    border: 3px solid rgba(255,255,255,.62);
    border-radius: 15px;
    background: linear-gradient(#c9ff3c, #81bd09);
    box-shadow: 0 5px 0 #3d6900;
    color: #153026;
    cursor: pointer;
    font-weight: 1000;
    letter-spacing: .1em;
}
.settings-card { display: grid; gap: 10px; }
.settings-card label { display: flex; min-height: 45px; padding: 8px 12px; align-items: center; justify-content: space-between; border-radius: 12px; background: rgba(255,255,255,.08); font-weight: 900; letter-spacing: .07em; }
.settings-card input { width: 42px; height: 24px; accent-color: var(--lime); }

.result-medal {
    position: absolute;
    z-index: 4;
    top: 47%;
    left: 50%;
    display: grid;
    width: 92px;
    height: 92px;
    transform: translate(-50%, -50%) rotate(-5deg);
    place-items: center;
    border: 5px solid #fff7cf;
    border-radius: 50%;
    box-shadow: 0 6px 0 rgba(0,0,0,.3), 0 0 25px rgba(255,211,51,.45);
    background: linear-gradient(145deg, #c9d7df, #698693);
    animation: badge-pop .65s cubic-bezier(.2,1.5,.4,1) both;
}
.result-medal span { font-size: 34px; line-height: .7; }
.result-medal strong { font-family: 'Bert Display', sans-serif; font-size: 15px; font-weight: 400; text-shadow: 0 2px #000; }
.result-medal.medal-bronze { background: linear-gradient(145deg, #f3b26d, #8d4d22); }
.result-medal.medal-silver { background: linear-gradient(145deg, #f5fbff, #78909c); }
.result-medal.medal-gold { background: linear-gradient(145deg, #fff38a, #e29a05); }
.result-progress { margin: 5px 0 0; color: #fff8ce; font-size: 12px; font-weight: 900; letter-spacing: .11em; text-shadow: 0 2px #000; }
.score-value.counting { animation: score-pop .22s ease-out; }

@keyframes score-pop { 50% { transform: scale(1.18); } }

@media (orientation: landscape) and (max-height: 560px) {
    #game-shell { border-radius: 0; box-shadow: none; }
    #settings-modal { padding: 8px; }
    #settings-modal .settings-card { max-height: 100%; padding: 10px 16px; gap: 5px; overflow-y: auto; scrollbar-width: none; }
    #settings-modal .settings-card h2 { margin-bottom: 3px; font-size: 29px; }
    #settings-modal .settings-card .edition-label { margin: 0; }
    #settings-modal .settings-card label { min-height: 32px; padding: 3px 9px; }
    #settings-modal .settings-card .primary-menu-button { min-height: 36px; padding: 5px 12px; }
    .quick-play-button { width: min(136px, 14vw); margin-top: 4px; }
    .daily-card { top: 20%; min-width: 180px; padding: 8px 11px; }
    .daily-card strong { font-size: 19px; }
    .hero-selector { top: 8px; transform: scale(.85); transform-origin: top left; }
    .round-menu-button { width: 40px; height: 40px; top: 8px; font-size: 19px; }
    .pause-card, .settings-card { width: min(420px, 70vw); padding: 15px 20px; }
    .pause-card h2, .settings-card h2 { margin-bottom: 11px; font-size: 36px; }
    .settings-card label { min-height: 36px; padding-block: 5px; }
    .result-medal { width: 72px; height: 72px; border-width: 4px; }
    .result-medal span { font-size: 26px; }
    .result-medal strong { font-size: 12px; }
}

@media (orientation: landscape) and (max-width: 720px) {
    .daily-card { display: none; }
    .hero-selector { gap: 3px; transform: scale(.72); }
    .round-menu-button { right: 8px; }
    .menu-record { bottom: 8px; }
}

/* Social, mission, and leaderboard layer */
.leaderboard-button,
.missions-button {
    position: absolute;
    z-index: 7;
    bottom: max(16px, env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    filter: drop-shadow(0 5px 3px rgba(0,0,0,.38));
}
.leaderboard-button { right: max(20px, env(safe-area-inset-right)); width: 155px; }
.leaderboard-button img { width: 100%; }
.missions-button { left: max(20px, env(safe-area-inset-left)); flex-direction: column; gap: 2px; z-index: 9; font-size: 11px; font-weight: 1000; letter-spacing: .11em; }
.missions-button img { width: 56px; max-height: 58px; object-fit: contain; }
.missions-button span { padding: 6px 9px; border-radius: 9px; background: rgba(6,32,43,.82); }

.name-setting input {
    width: 48%;
    padding: 7px 9px;
    border: 2px solid rgba(255,255,255,.38);
    border-radius: 9px;
    outline: none;
    background: rgba(0,0,0,.24);
    color: #fff;
    font: 900 14px 'Arial Rounded', sans-serif;
}

.challenge-button {
    margin-top: 8px;
    padding: 8px 18px;
    border: 2px solid rgba(255,255,255,.66);
    border-radius: 12px;
    background: linear-gradient(#27d7ef, #08768e);
    box-shadow: 0 4px 0 #064b5c;
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .13em;
}

.leaderboard-card,
.missions-card,
.challenge-card,
.qualification-card {
    box-sizing: border-box;
    width: min(740px, calc(100% - 36px));
    max-height: 88%;
    overflow: hidden;
    padding: 18px 22px;
    border: 3px solid rgba(255,255,255,.45);
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(27,76,94,.985), rgba(5,29,42,.99));
    box-shadow: 0 10px 0 rgba(0,0,0,.28), 0 30px 75px rgba(0,0,0,.45);
    color: #fff;
}
.leaderboard-card header,
.missions-card header { display: flex; align-items: center; gap: 13px; }
.leaderboard-card header > img,
.missions-card header > img { width: 70px; height: 58px; object-fit: contain; }
.leaderboard-card h2,
.missions-card h2,
.challenge-card h2 { margin: 0; font-family: 'Bert Display', sans-serif; font-size: 38px; font-weight: 400; text-shadow: 0 3px #000; }
.leaderboard-card header > button { margin-left: auto; border: 0; background: transparent; color: #fff; cursor: pointer; font-size: 32px; }
.leaderboard-scope { display: flex; gap: 7px; margin: 8px 0 0; }
.leaderboard-scope button { min-height: 32px; padding: 5px 12px; border: 2px solid rgba(255,255,255,.35); border-radius: 9px; background: rgba(255,255,255,.08); color: #e0eef2; font-size: 11px; font-weight: 900; cursor: pointer; }
.leaderboard-scope button[aria-pressed="true"] { border-color: var(--lime); background: rgba(195,246,48,.17); color: #fff; }
.leaderboard-scope button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.leaderboard-filters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.leaderboard-filters select {
    min-height: 37px;
    padding: 6px 30px 6px 11px;
    border: 2px solid rgba(255,255,255,.5);
    border-radius: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(180deg, #173f50, #082938);
    color: #fff;
    font-weight: 900;
}
.leaderboard-status { color: #9ad7e1; font-size: 11px; font-weight: 900; letter-spacing: .1em; }
.leaderboard-list { max-height: 228px; margin: 8px 0 0; padding: 0; overflow: auto; list-style: none; }
.leaderboard-list li { display: grid; grid-template-columns: 34px 1fr 86px 65px; gap: 8px; align-items: center; min-height: 38px; padding: 5px 11px; border-radius: 9px; background: rgba(255,255,255,.085); }
.leaderboard-list li:nth-child(even) { background: rgba(255,255,255,.14); }
.leaderboard-list .rank { color: var(--yellow); font-size: 18px; font-weight: 1000; }
.leaderboard-list .pilot { overflow: hidden; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-list .mode { color: #9ad7e1; font-size: 11px; text-transform: uppercase; }
.leaderboard-list .value { color: var(--lime); font-size: 18px; font-weight: 1000; text-align: right; }

.mission-list { display: grid; gap: 9px; margin: 14px 0; }
.mission-row { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(100px, 180px) 48px 84px; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 12px; background: rgba(255,255,255,.09); }
.mission-row strong { font-size: 12px; }
.mission-row .mission-track { height: 12px; overflow: hidden; border-radius: 9px; background: rgba(0,0,0,.35); }
.mission-row .mission-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8fc900, #eaff4e); }
.mission-row b { color: var(--yellow); font-size: 11px; text-align: right; }
.mission-row.complete { box-shadow: inset 0 0 0 2px var(--lime); }
.mission-row.claimed { opacity: .72; box-shadow: inset 0 0 0 1px rgba(255,255,255,.22); }
.mission-claim,
.rescue-upgrade button {
    min-height: 31px;
    padding: 5px 8px;
    border: 2px solid rgba(255,255,255,.55);
    border-radius: 9px;
    background: linear-gradient(#9eea22, #5d9700);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 1000;
    letter-spacing: .04em;
    text-shadow: 0 1px #315300;
}
.mission-claim:disabled,
.rescue-upgrade button:disabled { cursor: default; filter: grayscale(.9); opacity: .55; }
.mission-note { margin: 6px 0; color: #cce8ee; font-size: 11px; line-height: 1.45; }

.economy-loop {
    display: grid;
    margin: 7px 0 9px;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, .8fr) 18px minmax(0, 1.6fr);
    align-items: center;
    gap: 5px;
    color: #d9f0f4;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .06em;
    text-align: center;
}
.economy-loop span { display: flex; align-items: center; justify-content: center; gap: 5px; }
.economy-loop b { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; border-radius: 50%; background: var(--lime); color: #173304; font-size: 11px; }
.economy-loop i { height: 2px; background: linear-gradient(90deg, rgba(186,250,18,.15), var(--lime), rgba(186,250,18,.15)); }

.nest-economy {
    display: grid;
    margin: 10px 0 6px;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 9px;
}
.feather-wallet,
.rescue-upgrade {
    display: flex;
    min-height: 54px;
    align-items: center;
    border: 2px solid rgba(255,255,255,.25);
    border-radius: 12px;
    background: rgba(0,0,0,.24);
}
.feather-wallet { justify-content: center; gap: 7px; }
.feather-wallet img { width: 36px; height: 36px; object-fit: contain; }
.feather-wallet span,
.rescue-upgrade small { color: #a9dce5; font-size: 10px; font-weight: 900; letter-spacing: .11em; }
.feather-wallet strong { color: var(--yellow); font-size: 24px; }
.rescue-upgrade { justify-content: space-between; gap: 10px; padding: 7px 9px; }
.rescue-upgrade div { display: grid; gap: 3px; }
.rescue-upgrade strong { font-size: 12px; }

.hud-lives {
    position: absolute;
    z-index: 9;
    top: 14.2%;
    right: 2.5%;
    display: flex;
    min-width: 72px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 10px;
    border: 2px solid rgba(255,255,255,.45);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(27,76,94,.94), rgba(5,29,42,.96));
    color: #fff;
    font-size: 18px;
    font-weight: 1000;
    text-shadow: 0 2px #000;
}
.hud-lives.hidden { display: none; }
.hud-lives img { width: 28px; height: 25px; object-fit: contain; }

.challenge-card { max-width: 520px; text-align: center; }
.challenge-card > p:not(.edition-label) { margin: 12px auto 18px; max-width: 420px; color: #d9f0f4; font-size: 12px; line-height: 1.5; }
.challenge-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }

.rescue-wheel-card {
    display: grid;
    width: min(690px, calc(100% - 24px));
    max-height: 94%;
    padding: 15px 18px;
    grid-template-columns: minmax(210px, .9fr) minmax(280px, 1.1fr);
    align-items: center;
    gap: 25px;
    overflow: hidden;
    border: 3px solid rgba(255,255,255,.52);
    border-radius: 25px;
    background: radial-gradient(circle at 24% 45%, rgba(77,163,181,.28), transparent 38%), linear-gradient(180deg, rgba(24,76,94,.99), rgba(5,27,40,.995));
    box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 32px 80px rgba(0,0,0,.55), inset 0 1px rgba(255,255,255,.18);
}
.rescue-wheel-stage { position: relative; width: clamp(190px, 55cqh, 260px); aspect-ratio: 1; justify-self: center; }
.rescue-wheel {
    position: absolute;
    inset: 7px;
    overflow: hidden;
    border: 6px solid #e9f8f5;
    border-radius: 50%;
    background: conic-gradient(from -30deg, #78c71d 0 60deg, #159cc3 60deg 120deg, #e1ab18 120deg 180deg, #c63644 180deg 240deg, #794eb1 240deg 300deg, #2c63be 300deg 360deg);
    box-shadow: 0 7px 0 #173744, 0 14px 30px rgba(0,0,0,.42), inset 0 0 0 4px rgba(4,24,34,.36);
    transition: transform 3.35s cubic-bezier(.12,.68,.08,1);
    will-change: transform;
}
.rescue-wheel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; background: repeating-conic-gradient(from -30deg, rgba(255,255,255,.55) 0 1deg, transparent 1deg 60deg); }
.rescue-wheel span {
    position: absolute;
    z-index: 2;
    top: 50%;
    left: 50%;
    width: 84px;
    color: #fff;
    font-size: clamp(7px, 1.65cqh, 10px);
    font-weight: 1000;
    line-height: 1;
    text-align: center;
    text-shadow: 0 2px 1px rgba(0,0,0,.62);
    transform: translate(-50%,-50%) rotate(var(--angle)) translateY(calc(clamp(190px, 55cqh, 260px) * -.34)) rotate(var(--counter));
}
.rescue-wheel span:nth-child(1) { --angle: 0deg; --counter: 0deg; }
.rescue-wheel span:nth-child(2) { --angle: 60deg; --counter: -60deg; }
.rescue-wheel span:nth-child(3) { --angle: 120deg; --counter: -120deg; }
.rescue-wheel span:nth-child(4) { --angle: 180deg; --counter: -180deg; }
.rescue-wheel span:nth-child(5) { --angle: 240deg; --counter: -240deg; }
.rescue-wheel span:nth-child(6) { --angle: 300deg; --counter: -300deg; }
.rescue-pointer { position: absolute; z-index: 5; top: -2px; left: 50%; width: 0; height: 0; border-right: 15px solid transparent; border-left: 15px solid transparent; border-top: 30px solid var(--yellow); filter: drop-shadow(0 3px 1px rgba(0,0,0,.5)); transform: translateX(-50%); }
.rescue-wheel-bert { position: absolute; z-index: 4; top: 50%; left: 50%; width: 25%; height: 25%; padding: 8px; object-fit: contain; border: 4px solid rgba(255,255,255,.82); border-radius: 50%; background: #163e50; box-shadow: 0 4px 0 rgba(0,0,0,.32); transform: translate(-50%,-50%); }
.rescue-wheel-copy h2 { margin: 1px 0 9px; color: #fff; font-family: 'Bert Display', sans-serif; font-size: clamp(30px, 6cqh, 46px); font-weight: 400; line-height: .95; text-shadow: 0 3px #000; }
.rescue-wheel-copy > p:not(.edition-label) { margin: 0 0 10px; color: #d3edf2; font-size: 12px; font-weight: 800; line-height: 1.45; }
.rescue-wheel-wallet { display: flex; width: fit-content; min-width: 150px; padding: 5px 10px; align-items: center; gap: 7px; border: 2px solid rgba(255,255,255,.26); border-radius: 12px; background: rgba(0,0,0,.24); }
.rescue-wheel-wallet img { width: 31px; height: 27px; object-fit: contain; }
.rescue-wheel-wallet span { color: #a9dce5; font-size: 10px; font-weight: 900; letter-spacing: .1em; }
.rescue-wheel-wallet strong { margin-left: auto; color: var(--yellow); font-size: 23px; }
.rescue-wheel-result { display: block; min-height: 25px; margin: 9px 0 5px; color: var(--lime); font-size: 12px; letter-spacing: .08em; }
.rescue-wheel-actions { display: grid; grid-template-columns: 1.35fr .8fr; gap: 8px; }
.rescue-wheel-actions button { min-width: 0; padding-inline: 10px; }
.rescue-wheel-card.spinning .rescue-wheel-actions button { pointer-events: none; opacity: .6; }
.rescue-wheel-card.rescued { box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 0 55px rgba(186,250,18,.38); }
.rescue-wheel-card.lost { box-shadow: 0 10px 0 rgba(0,0,0,.3), 0 0 55px rgba(214,54,68,.38); }

.qualification-card {
    display: grid;
    max-width: 720px;
    grid-template-columns: minmax(210px, .86fr) minmax(280px, 1.14fr);
    align-items: center;
    gap: 22px;
}
.qualification-preview {
    position: relative;
    overflow: hidden;
    aspect-ratio: 398 / 221;
    border: 3px solid rgba(255,255,255,.44);
    border-radius: 18px;
    background: #071b26;
    box-shadow: 0 7px 0 rgba(0,0,0,.28);
}
.qualification-preview::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(3,16,24,.12), rgba(3,16,24,.82)); }
.qualification-preview img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(.68) brightness(.62); }
.qualification-preview span { position: absolute; z-index: 2; right: 12px; bottom: 10px; left: 12px; color: #fff; font-family: 'Bert Rounded', 'Trebuchet MS', sans-serif; font-size: clamp(22px, 3vw, 34px); font-weight: 900; text-align: center; text-shadow: 0 3px #000; }
.qualification-copy { min-width: 0; }
.qualification-copy .edition-label { margin-bottom: 4px; color: var(--lime); }
.qualification-copy h2 { margin: 0; color: #fff; font-family: 'Bert Rounded', 'Trebuchet MS', sans-serif; font-size: clamp(29px, 4vw, 44px); font-weight: 900; line-height: .95; text-shadow: 0 4px #000; }
.qualification-copy > p:not(.edition-label) { margin: 12px 0; color: #d9f0f4; font-size: 12px; font-weight: 800; line-height: 1.45; }
.qualification-progress { display: grid; gap: 6px; }
.qualification-progress > span { height: 13px; overflow: hidden; border: 2px solid rgba(255,255,255,.32); border-radius: 999px; background: rgba(0,0,0,.35); }
.qualification-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #7eb900, var(--lime)); box-shadow: 0 0 12px rgba(186,250,18,.5); transition: width 260ms ease; }
.qualification-progress strong { color: var(--yellow); font-size: 11px; letter-spacing: .1em; }
.qualification-actions { display: grid; margin-top: 13px; grid-template-columns: minmax(0, 1.7fr) minmax(90px, .7fr); gap: 9px; }
.qualification-actions .primary-menu-button,
.qualification-actions .text-button { min-width: 0; padding-inline: 10px; font-size: clamp(8px, 1.2vw, 11px); }

@media (orientation: landscape) and (max-height: 560px) {
    .leaderboard-button { width: 120px; bottom: 8px; }
    .missions-button { bottom: 8px; }
    .missions-button img { width: 45px; }
    .leaderboard-card, .missions-card, .challenge-card, .qualification-card { padding: 11px 16px; max-height: 94%; }
    .missions-card { display: grid; grid-template-rows: auto auto auto minmax(76px, 1fr) auto auto; overflow: hidden; }
    .leaderboard-card h2, .missions-card h2, .challenge-card h2, .qualification-copy h2 { font-size: 29px; }
    .leaderboard-card header > img, .missions-card header > img { width: 52px; height: 42px; }
    .leaderboard-list { max-height: 160px; }
    .leaderboard-scope button { min-height: 27px; padding: 3px 8px; font-size: 11px; }
    .mission-list { min-height: 76px; max-height: 108px; margin: 3px 0; padding-right: 3px; gap: 5px; overflow-y: auto; overscroll-behavior: contain; }
    .mission-row { min-height: 36px; grid-template-columns: minmax(110px, 1fr) minmax(80px, 130px) 40px 72px; gap: 6px; padding-block: 4px; }
    .nest-economy { margin-block: 6px 3px; }
    .economy-loop { margin-block: 4px 5px; }
    .feather-wallet, .rescue-upgrade { min-height: 44px; }
    .mission-note { margin: 3px 0; font-size: 10px; line-height: 1.22; }
    #close-missions { min-height: 29px; padding-block: 5px; }
    .hud-lives { top: 15.3%; min-width: 58px; min-height: 30px; padding: 3px 7px; font-size: 14px; }
    .hud-lives img { width: 22px; height: 20px; }
    .challenge-button { margin-top: 4px; padding-block: 5px; }
    .qualification-card { width: min(690px, calc(100% - 18px)); gap: 14px; }
    .qualification-copy > p:not(.edition-label) { margin: 7px 0; font-size: 12px; }
    .qualification-actions { margin-top: 8px; }
    .rescue-wheel-card { width: min(650px, calc(100% - 18px)); padding: 9px 13px; gap: 15px; grid-template-columns: minmax(180px, .85fr) minmax(270px, 1.15fr); }
    .rescue-wheel-stage { width: clamp(180px, 55cqh, 220px); }
    .rescue-wheel span { transform: translate(-50%,-50%) rotate(var(--angle)) translateY(calc(clamp(180px, 55cqh, 220px) * -.34)) rotate(var(--counter)); }
    .rescue-wheel-copy h2 { margin-bottom: 5px; }
    .rescue-wheel-copy > p:not(.edition-label) { margin-bottom: 6px; font-size: 11px; }
    .rescue-wheel-result { margin-block: 6px 3px; }
}

@media (orientation: landscape) and (max-width: 720px) {
    .missions-button span { display: none; }
    .leaderboard-button { width: 96px; }
    .leaderboard-list li { grid-template-columns: 28px 1fr 58px; }
    .leaderboard-list .mode { display: none; }
}

/* UI/mode refinement: stage-relative layout, iPhone full-height repair, and clean hierarchy */
html,
body {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
}

body {
    position: fixed;
    inset: 0;
}

#game-shell {
    container-type: size;
    width: min(100vw, calc(100dvh * 16 / 9));
    height: min(100dvh, calc(100vw * 9 / 16));
    max-width: 100vw;
    max-height: 100dvh;
}

@supports (-webkit-touch-callout: none) {
    html,
    body,
    #game-shell {
        height: 100dvh;
    }

    #game-shell {
        width: min(100vw, calc(100dvh * 16 / 9));
        max-height: 100dvh;
    }
}

.game-title {
    top: 2.8%;
    width: min(43%, 470px);
    max-height: 18%;
}

.menu-bird {
    left: 1.8%;
    bottom: -5.5%;
    width: min(40%, 500px);
    max-height: 66%;
}

.menu-actions {
    top: 31%;
    left: 58%;
    width: min(26%, 300px);
    transform: translateX(-50%);
}

.menu-actions .edition-label {
    width: 150%;
    margin-left: -25%;
    text-align: center;
}

.play-button {
    width: min(88%, 220px);
}

.quick-play-button {
    width: min(72%, 178px);
}

.install-button {
    min-width: 0;
    width: min(92%, 230px);
}

.hero-selector {
    top: 19%;
    left: 2%;
    width: min(25%, 210px);
    max-width: 210px;
    padding: 6px 8px;
}

.hero-option {
    width: auto;
    min-height: clamp(62px, 11cqh, 82px);
}

.hero-option img {
    width: min(66px, 8cqw);
    height: min(49px, 7cqh);
}

.daily-card {
    top: 19%;
    right: 2%;
    min-width: 0;
    width: min(25%, 250px);
    padding: 10px 13px;
}

.daily-card strong {
    padding-right: 28px;
    font-size: clamp(18px, 3.3cqh, 27px);
}

.round-menu-button {
    top: 2.8%;
    right: 2%;
    width: auto;
    max-width: 22%;
    height: auto;
    min-height: 38px;
    padding: 8px 10px;
    border-radius: 14px;
}

.round-menu-button img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

.menu-record {
    right: 2%;
    bottom: 3.5%;
    min-width: 0;
    width: min(28%, 300px);
    grid-template-columns: clamp(34px, 5cqw, 56px) minmax(0, 1fr) auto;
    padding: 9px 11px;
}

.menu-record > img:first-child {
    width: 100%;
}

.menu-record strong {
    font-size: clamp(25px, 5cqh, 38px);
}

.leaderboard-button {
    right: 3%;
    bottom: 26%;
    width: min(14%, 145px);
}

.missions-button {
    left: 2.5%;
    bottom: 3.5%;
}

.hud-strip {
    top: 2.2%;
    min-width: 0;
    width: min(46%, 430px);
    justify-content: space-between;
    gap: clamp(12px, 3cqw, 42px);
    padding: 7px clamp(14px, 2.4cqw, 24px) 8px;
}

.hud-stat {
    min-width: 0;
}

.hud-menu {
    top: 3%;
    left: 2%;
    min-width: 0;
    padding: 8px 11px;
}

.hud-level {
    top: calc(2.2% + 59px);
}

.level-menu {
    display: grid;
    width: min(96%, 1080px);
    max-height: 96%;
    padding: clamp(10px, 2cqh, 22px) clamp(12px, 2cqw, 26px);
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    overflow: hidden;
}

.edm-event-button {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 clamp(8px, 1.4cqw, 18px);
    width: 100%;
    min-height: clamp(43px, 8cqh, 60px);
    padding: 5px clamp(11px, 2cqw, 24px);
    overflow: hidden;
    border: 2px solid #79dfe3;
    border-radius: 13px;
    background: linear-gradient(90deg, rgba(7, 22, 45, .74), rgba(13, 28, 50, .87)),
        url('assets/edm/concert-stage.webp') center 75% / cover;
    color: #fff;
    box-shadow: inset 0 1px rgba(255,255,255,.25), 0 4px 0 rgba(0,0,0,.3);
    text-align: left;
    cursor: pointer;
}
.edm-event-kicker { grid-column: 1; color: #95e9ea; font-size: clamp(8px, 1.4cqh, 11px); font-weight: 900; letter-spacing: .12em; }
.edm-event-button strong { grid-column: 2; grid-row: 1 / 3; font-family: 'Bert Rounded', sans-serif; font-size: clamp(16px, 3.6cqh, 26px); line-height: 1; text-shadow: 0 2px 3px #000; }
.edm-event-button small { grid-column: 1; font-size: clamp(8px, 1.4cqh, 10px); color: #e1eaf4; }
.edm-event-button b { grid-column: 3; grid-row: 1 / 3; color: #ffe6a0; font-size: clamp(12px, 2.2cqh, 18px); white-space: nowrap; }
.edm-event-button:hover, .edm-event-button:focus-visible { border-color: #ffe6a0; outline-offset: 2px; }

.event-shelf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(5px, .85cqw, 11px); }
.event-shelf .edm-event-button {
    grid-template-columns: minmax(0, 1fr) auto;
    min-width: 0;
    min-height: clamp(51px, 9.4cqh, 68px);
    padding: 4px clamp(5px, .9cqw, 12px);
}
.event-shelf .edm-event-kicker { grid-column: 1; grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .04em; }
.event-shelf .edm-event-button strong { grid-column: 1; grid-row: 2; min-width: 0; font-size: clamp(13px, 2.65cqh, 22px); white-space: nowrap; }
.event-shelf .edm-event-button small { grid-column: 1; grid-row: 3; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.event-shelf .edm-event-button b { grid-column: 2; grid-row: 1 / 4; font-size: clamp(10px, 1.7cqh, 15px); }
.bird-run-event-button {
    border-color: #c8f4ff;
    background: linear-gradient(90deg, rgba(12, 74, 103, .82), rgba(20, 92, 117, .56)),
        url('assets/unity/levels/happy-sky/sky.webp') center / cover;
}
.bird-run-event-button .edm-event-kicker { color: #e0faff; }
.bird-run-event-button:hover, .bird-run-event-button:focus-visible { border-color: #fff2b1; }
.stormline-event-button {
    border-color: #87bbd5;
    background: linear-gradient(90deg, rgba(12, 40, 64, .82), rgba(14, 55, 80, .68)),
        url('assets/stormline/storm-sky.webp') center / cover;
}
.stormline-event-button .edm-event-kicker { color: #d6f5f7; }
.stormline-event-button:hover, .stormline-event-button:focus-visible { border-color: #ffe1aa; }
.sky-relay-event-button {
    border-color: #f5d98b;
    background: linear-gradient(90deg, rgba(25, 77, 111, .87), rgba(35, 100, 135, .71)),
        url('assets/unity/levels/happy-sky/sky.webp') center / cover;
}
.sky-relay-event-button .edm-event-kicker { color: #ffefbd; }
.sky-relay-event-button:hover, .sky-relay-event-button:focus-visible { border-color: #fff7d8; }
@media (max-width: 850px) {
    .event-shelf .edm-event-button { grid-template-columns: minmax(0, 1fr); padding-inline: 6px; }
    .event-shelf .edm-event-button b { display: none; }
    .event-shelf .edm-event-kicker { font-size: 11px; }
    .event-shelf .edm-event-button strong { font-size: clamp(13px, 2.7cqh, 17px); }
}

.level-header {
    justify-content: flex-start;
    gap: clamp(15px, 3cqw, 42px);
}

.level-header img {
    width: min(31%, 300px);
}

.level-header h2 {
    font-size: clamp(25px, 6cqh, 44px);
}

.mode-tabs {
    display: grid;
    margin: clamp(8px, 1.8cqh, 15px) 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(7px, 1.2cqw, 13px);
}

.mode-tab {
    position: relative;
    min-width: 0;
    min-height: clamp(48px, 10cqh, 68px);
    padding: 8px 13px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, .34);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(31, 70, 84, .92), rgba(7, 31, 43, .96));
    box-shadow: 0 4px 0 rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .13);
    color: #d8edf2;
    cursor: pointer;
    text-align: left;
    transition: transform 140ms ease, border-color 140ms ease, filter 140ms ease;
}

.mode-tab::after {
    content: '';
    position: absolute;
    right: -16px;
    bottom: -26px;
    width: 72px;
    height: 72px;
    border: 14px solid rgba(255, 255, 255, .05);
    border-radius: 50%;
}

.mode-tab strong,
.mode-tab small {
    position: relative;
    z-index: 1;
    display: block;
}

.mode-tab strong {
    color: #fff;
    font-family: 'Bert Display', sans-serif;
    font-size: clamp(18px, 3.6cqh, 28px);
    font-weight: 400;
    line-height: .95;
    text-shadow: 0 2px #000;
}

.mode-tab small {
    margin-top: 4px;
    color: #9bcbd5;
    font-size: clamp(7px, 1.35cqh, 10px);
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.mode-tab.selected {
    border-color: var(--lime);
    background: linear-gradient(180deg, rgba(61, 91, 56, .96), rgba(19, 48, 37, .98));
    box-shadow: 0 4px 0 #476900, inset 0 0 0 1px rgba(220, 255, 103, .28);
    filter: saturate(1.12);
}

.mode-tab.selected strong {
    color: var(--lime);
}

.mode-tab:hover {
    transform: translateY(-2px);
}

.mode-tab:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 2px;
}

.level-grid {
    min-height: 0;
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: center;
}

.level-card.mode-hidden,
.level-card[hidden] {
    display: none;
}

.level-grid[data-mode='flappy'],
.level-grid[data-mode='tunnel'] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.level-grid[data-mode='classic'] .level-card { --mode-accent: #ffd52f; }
.level-grid[data-mode='flappy'] .level-card { --mode-accent: #b9ff19; }
.level-grid[data-mode='tunnel'] .level-card { --mode-accent: #55e8ff; }
.level-grid .level-card { border-color: color-mix(in srgb, var(--mode-accent, #fff) 58%, white 42%); }
.level-grid .level-card.locked { border-color: rgba(170,190,198,.42); }
.level-grid .level-card:hover,
.level-grid .level-card:focus-visible { border-color: var(--mode-accent, var(--lime)); }
.level-grid .level-card.locked:hover,
.level-grid .level-card.locked:focus-visible { border-color: var(--orange); }
.level-card[data-variant='moving']::before,
.level-card[data-variant='star-stream']::before,
.level-card[data-variant='pulse']::before,
.level-card[data-variant='mixed']::before {
    position: absolute;
    z-index: 2;
    top: 8px;
    left: 8px;
    padding: 4px 7px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 7px;
    background: rgba(4,21,31,.78);
    color: #fff;
    font-size: clamp(6px, 1.15cqh, 9px);
    font-weight: 900;
    letter-spacing: .08em;
}
.level-card[data-variant='moving']::before { content: 'BEVÆGER SIG'; color: #63ecff; }
.level-card[data-variant='mixed']::before { content: 'MIX'; color: #ffe568; }
.level-card[data-variant='star-stream']::before { content: 'STJERNESTI'; color: #63ecff; }
.level-card[data-variant='pulse']::before { content: 'PULSERER'; color: #ef9cff; }

.level-back-button {
    justify-self: center;
    margin-top: clamp(7px, 1.5cqh, 13px);
    padding: 8px 16px;
}

.level-back-button img {
    display: block;
    width: min(155px, 20cqw);
    max-height: 27px;
    object-fit: contain;
}

.game-over {
    inset: 0;
    top: auto;
    left: auto;
    width: 100%;
    height: 100%;
    padding: 5.5% 4% 2.5%;
    grid-template-rows: auto auto auto auto auto;
    align-content: start;
    row-gap: 2px;
    transform: none;
}

.scoreboard {
    width: min(52%, 540px);
}

.result-summary {
    display: flex;
    min-height: 54px;
    margin-top: 5px;
    align-items: center;
    justify-content: center;
    gap: 13px;
}

.result-medal {
    position: static;
    width: clamp(54px, 10cqh, 76px);
    height: clamp(54px, 10cqh, 76px);
    grid-template-rows: auto auto;
    align-content: center;
    row-gap: 2px;
    transform: rotate(-5deg);
    flex: 0 0 auto;
}

.result-medal span {
    font-size: clamp(20px, 4.2cqh, 30px);
}

.result-medal img {
    width: 38%;
    height: 38%;
    margin-top: 6%;
    object-fit: contain;
    filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .28));
}

.result-medal strong {
    font-size: clamp(8px, 1.7cqh, 11px);
    line-height: .85;
    padding: 0 6px 8%;
    text-align: center;
}

.result-progress {
    max-width: 360px;
    margin: 0;
    text-align: left;
}

.result-progress.event-status {
    max-width: min(740px, 75vw);
    padding: 6px 12px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-radius: 11px;
    background: rgba(13, 52, 72, .93);
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 0 #071a27;
}

.result-actions {
    width: auto;
    margin-top: 6px;
}

.challenge-button {
    margin-top: 3px;
}

@media (orientation: landscape) and (max-height: 560px) {
    .game-title {
        top: 2.2%;
        width: min(39%, 390px);
        max-height: 17%;
    }

    .hero-selector {
        top: 20%;
        transform: none;
    }

    .hero-wardrobe-card { width: 95%; max-height: 96%; padding: 8px 10px; }
    .hero-wardrobe-card header h2 { font-size: 25px; }
    .hero-wardrobe-card header > button { width: 32px; height: 32px; font-size: 20px; }
    .hero-wardrobe-note { margin: 2px 0 5px; font-size: 10px; }
    .hero-grid { gap: 5px; max-height: min(44vh, 165px); }
    .hero-option { min-height: 61px; padding: 2px 3px 3px; }
    .hero-option img { width: min(58px, 7cqw); height: min(42px, 6cqh); }
    .hero-option b { font-size: 10px; }
    .hero-option small { font-size: 9px; }
    .hero-wardrobe-detail { min-height: 45px; margin-top: 4px; padding: 4px 7px; }
    .hero-wardrobe-detail strong { font-size: 11px; }
    .hero-wardrobe-detail span { font-size: 11px; }
    .hero-buy, .hero-cancel { min-height: 27px; padding: 3px 6px; font-size: 10px; }
    .hero-wardrobe-footer { margin-top: 5px; }
    .hero-wardrobe-footer .primary-menu-button { min-height: 31px; padding: 4px 16px; }

    .daily-card {
        top: 18%;
        width: 24%;
        padding: 7px 10px;
    }

    .menu-actions {
        top: 33%;
        left: 58%;
        width: 25%;
    }

    .menu-bird {
        left: 2%;
        bottom: -6%;
        width: 38%;
    }

    .menu-bird[data-hero]:not([data-hero="bert"]) {
        left: -2%;
        bottom: -11%;
        width: 39%;
        max-height: 68%;
    }

    .round-menu-button {
        top: 2.2%;
        right: 2%;
        width: min(94px, 12%);
        height: auto;
    }

    .menu-record {
        right: 2%;
        bottom: 3%;
        width: 27%;
        min-width: 0;
    }

    .leaderboard-button {
        right: 3%;
        bottom: 25%;
        width: 13%;
    }

    .menu-controls {
        display: none;
    }

    .level-menu {
        width: 96%;
        max-height: 96%;
        padding: 8px 12px;
    }

    .level-header img {
        width: 25%;
    }

    .level-header h2 {
        font-size: 27px;
    }

    .mode-tabs {
        margin: 6px 0;
    }

    .mode-tab {
        min-height: 50px;
        padding: 6px 10px;
    }

    .mode-tab strong {
        font-size: 20px;
    }

    .mode-tab small {
        margin-top: 2px;
        font-size: 11px;
    }

    .level-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        margin: 0;
    }

    .level-grid[data-mode='flappy'],
    .level-grid[data-mode='tunnel'] {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .scoreboard {
        width: min(50%, 460px);
    }

    .result-summary {
        min-height: 43px;
        gap: 9px;
    }

    .result-actions {
        width: auto;
        margin-top: 4px;
    }

    .result-kicker,
    .result-progress {
        font-size: 11px;
    }
}

@media (orientation: landscape) and (max-width: 720px) {
    .hero-selector {
        width: min(29%, 185px);
        max-width: 185px;
        transform: none;
    }

    .hero-selector > small { display: none; }

    .daily-card {
        display: grid;
        width: 27%;
    }

    .daily-card small {
        display: none;
    }

    .menu-actions {
        left: 55%;
        width: 23%;
    }

    .menu-record {
        width: 27%;
    }

    .level-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Score-tavle under spillet: slankere, mere gennemsigtig, og den viger,
   når Bert, en stjerne eller en forhindring er under den. */
.hud-strip {
    width: min(38%, 360px);
    padding: 4px clamp(12px, 2cqw, 20px) 5px;
    border-width: 1px;
    border-color: rgba(255, 255, 255, 0.28);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(20, 47, 60, 0.55), rgba(5, 25, 37, 0.55));
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.18);
    transition: opacity 160ms ease;
}
.hud-stat span { font-size: 11px; margin-bottom: 1px; }
.hud-stat strong { font-size: clamp(20px, 2.5vw, 28px); }
.hud-menu {
    padding: 6px 10px;
    background: linear-gradient(180deg, rgba(27, 56, 69, 0.6), rgba(6, 25, 36, 0.6));
    transition: opacity 160ms ease;
}
.hud.is-clear .hud-strip,
.hud.is-clear .hud-menu { opacity: 0.22; }

/* Banenavnet vises kun før start, ikke midt i spillet. */
.hud-level { transition: opacity 400ms ease; }
body:not(.is-prewarm) .hud-level { opacity: 0; }

@media (orientation: landscape) and (max-height: 520px) {
    .hud-strip { top: max(4px, env(safe-area-inset-top)); padding-block: 3px 4px; }
    .hud-stat span { font-size: 11px; }
    .hud-stat strong { font-size: 20px; }
}

/* Episke navnehelte: guldkant, så de føles særlige. */
.hero-option.epic { border-color: #ffd34d; box-shadow: 0 0 0 2px rgba(255, 211, 77, .35), 0 0 14px rgba(255, 196, 0, .35); }
.hero-option.epic small { color: #ffd34d; }

/* Fjerde fane: Eventyr med fem nye baner. */
.mode-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.level-grid[data-mode='adventure'] { grid-template-columns: repeat(5, minmax(0, 1fr)) !important; }
.level-grid[data-mode='adventure'] .level-card-mode { display: none; }
.level-grid[data-mode='adventure'] .level-card-title { font-size: clamp(12px, 1.6cqw, 17px); }

/* Første gang: spørg om navn. */
.first-name-input {
    display: block; width: min(320px, 100%); margin: 4px auto 14px; padding: 12px 14px;
    border: 2px solid rgba(255,255,255,.45); border-radius: 14px; background: rgba(4, 22, 32, .7);
    color: #fff; font: 800 18px 'Bert Rounded', sans-serif; text-align: center;
}
.first-name-input:focus { outline: none; border-color: var(--lime, #b6f23a); }
.name-card .challenge-actions { justify-content: center; }
.level-grid[data-mode='adventure'] .level-card-title { font-size: clamp(10px, 1.35cqw, 16px); letter-spacing: 0; }
.level-grid[data-mode='adventure'] .level-card-copy { grid-template-columns: 22px 1fr auto; gap: 4px; }

/* Testbanerne ligger nu som kort under Eventyr. */
.event-shelf { display: none; }

/* Tastaturet fylder det meste af skærmen på en telefon i landscape: løft dialogen op. */
body.keyboard-open .modal-backdrop { align-items: flex-start; padding-top: max(4px, env(safe-area-inset-top)); }
body.keyboard-open .modal-backdrop > * { margin-top: 0; max-height: none; }
body.keyboard-open .name-card p, body.keyboard-open .name-card .edition-label { display: none; }
body.keyboard-open .name-card h2 { font-size: 20px; margin: 0 0 6px; }
.first-name-input, #player-name { font-size: 16px; } /* 16px forhindrer iOS i at zoome ind */

/* Låste eventyrbaner: tydeligt låst, men man kan stadig kigge. */
.level-card.locked .level-thumb { filter: grayscale(.85) brightness(.55); }
.level-card.locked .level-card-lock { background: rgba(10, 18, 28, .9); color: #ffd34d; }
.mode-tab.locked-tab { opacity: .8; }
.mode-tab.locked-tab small { color: #ffd34d; }
.level-card.shake { animation: card-shake .4s ease; }
@keyframes card-shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* Fugleklat: klat-knappen nederst i højre hjørne, så den ikke dækker målene. */
.poop-button {
    position: absolute; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 12; width: 84px; height: 84px; border-radius: 50%; pointer-events: auto;
    border: 3px solid #fff; background: radial-gradient(circle at 35% 30%, #ffffff, #c9d6e2 70%);
    box-shadow: 0 5px 0 rgba(0,0,0,.3); display: grid; place-items: center; cursor: pointer;
}
.poop-button span { font-size: 38px; line-height: 1; }
.poop-button strong { position: absolute; right: -4px; top: -4px; min-width: 28px; height: 28px; border-radius: 14px; background: #1b2230; color: #fff; font: 900 15px/28px 'Bert Rounded', sans-serif; }
.poop-button.empty { opacity: .45; }
.poop-button:active { transform: scale(.94); }

.lock-icon { width: 1.35em; height: 1.35em; vertical-align: -0.3em; margin-right: 3px; object-fit: contain; }

.poop-button { background: none; border: 0; box-shadow: none; padding: 0; }
.poop-button img { width: 92px; height: 92px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); }

/* ---- Feedback pass 4. okt.: readable menu and result texts ----
   Type scale: nothing below 9 px; body text 11-12 px; labels 11 px. */
.settings-gear { min-width: 48px; min-height: 48px; padding: 6px 10px; font-size: 26px; line-height: 1; color: #ffd36b; }
.menu-record { flex-wrap: wrap; }
.menu-record .leaderboard-button { position: static; width: 100%; margin-top: 6px; padding: 6px 0 0; border-top: 1px solid rgba(255,255,255,.18); filter: none; }
.menu-record .leaderboard-button .ui-word { font-size: clamp(13px, 2.6cqh, 18px); }
.menu-record span { font-size: 12px; }
.hero-wardrobe-card .edition-label { font-size: 13px; color: #ffe08a; letter-spacing: .12em; text-shadow: 0 2px 0 rgba(0,0,0,.6); }
.hero-wardrobe-note { font-size: 13px !important; color: #eaf6f8 !important; }
.result-progress { display: inline-block; margin-top: 8px; padding: 6px 12px; border-radius: 10px; background: rgba(8,20,32,.78); font-size: 14px !important; letter-spacing: .04em !important; }
.hero-option img { width: 64px !important; height: 52px !important; object-fit: contain; }
.hero-option b { font-size: 12px; }
.edition-label { color: #ffd98a; font-size: 12px; letter-spacing: .12em; }

/* ---- Grafikrunde 2: panels, buttons and icons ---- */
.settings-gear img { width: 34px; height: 34px; display: block; }
.settings-gear { background: none !important; border: 0 !important; box-shadow: none !important; padding: 2px !important; }
.hero-selector, .daily-card, .menu-record {
    border: 12px solid transparent !important;
    border-image: url(assets/v2/ui/panel-dark.webp) 60 fill / 12px stretch !important;
    background: none !important; box-shadow: none !important;
}
.daily-card { background-image: none !important; padding: 4px 8px 4px 44px !important; }
.daily-card strong { white-space: nowrap; }
.daily-card { padding-right: 46px !important; }
.daily-card .daily-icon { position: absolute; left: -2px; top: 50%; width: 40px; height: 40px; transform: translateY(-50%); }
.play-button {
    border: 24px solid transparent !important;
    border-image: url(assets/v2/ui/button-primary.webp) 70 fill / 24px stretch !important;
    background: none !important; box-shadow: none !important;
}
.play-button .ui-play { color: #123018 !important; -webkit-text-stroke: 0 !important; text-shadow: 0 2px 0 rgba(255,255,255,.45) !important; }
.install-button .install-mark { width: 42px; height: 42px; background: none !important; border: 0 !important; object-fit: contain; }
.missions-button img { width: 60px !important; max-height: 60px; }
.menu-record .leaderboard-button { display: flex; align-items: center; justify-content: center; gap: 6px; }
.menu-record .leaderboard-button .trophy { width: 28px; height: 28px; }
.result-medal img { width: 64px !important; height: 64px !important; object-fit: contain; }
.challenge-button { display: inline-flex; align-items: center; gap: 8px; }
.challenge-button img { width: 34px; height: 18px; object-fit: contain; }
.result-kicker { background: url(assets/v2/ui/result-ribbon.webp) center / 100% 100% no-repeat; display: inline-block; min-width: 300px;
    padding: 12px 96px 14px; color: #1d3b5a !important; text-shadow: none !important; white-space: nowrap; box-sizing: border-box; }
.loading { background: #8fd3ff url(assets/v2/ui/splash.webp) center / cover no-repeat !important; }
.hero-wardrobe-card header > div { background: url(assets/v2/ui/wardrobe-header.webp) center / 100% 100% no-repeat; padding: 6px 64px 10px 48px; }

/* Mission claim buttons never wrap; big records shrink instead of overlapping. */
.mission-claim { white-space: nowrap; min-width: 92px; }
.menu-record #menu-highscore, .menu-record .record-total strong { font-size: clamp(18px, 4.4cqh, 30px) !important; white-space: nowrap; }
.menu-record .record-total { white-space: nowrap; gap: 4px; }
.menu-record .record-total img { width: 26px; height: 26px; }

/* ---- Gennemgang 4. okt. (2): symmetric menu, missions close, result board ---- */
.missions-card header { position: relative; }
.modal-x { position: absolute; right: 0; top: 0; width: 42px; height: 42px; border: 2px solid rgba(255,255,255,.45); border-radius: 50%;
    background: rgba(255,255,255,.12); color: #fff; font-size: 26px; font-weight: 900; line-height: 1; cursor: pointer; }
#hero-selector.hero-selector, #daily-btn.daily-card { top: 21% !important; width: min(250px, 28vw) !important; min-width: 0 !important; max-width: none !important; height: 96px !important; box-sizing: border-box; }
.hero-selector { left: max(22px, calc(env(safe-area-inset-left) + 16px)) !important; }
.daily-card { right: max(22px, calc(env(safe-area-inset-right) + 16px)) !important;
    grid-template-columns: 1fr auto !important; align-content: center; text-align: left; }
.daily-card .daily-kicker, .daily-card strong, .daily-card small { grid-column: 1; }
.daily-card #daily-state { grid-column: 2; grid-row: 1 / 4; align-self: center; }
aside.menu-record { width: min(250px, 28vw) !important; min-width: 0 !important; max-width: none !important; box-sizing: border-box; right: max(22px, calc(env(safe-area-inset-right) + 16px)) !important; grid-template-columns: 46px 1fr auto !important; }
.missions-button { left: max(16px, calc(env(safe-area-inset-left) + 10px)) !important; transform: scale(.85); transform-origin: left bottom; }
.menu-bird { left: clamp(70px, 11vw, 190px) !important; }
.result-medal { width: 104px !important; height: 104px !important; }
.result-medal img { width: 86px !important; height: 86px !important; }
.challenge-button img { width: 52px !important; height: 26px !important; }

/* ======================================================================
   Forside, ny opbygning (4. okt.): logo øverst, helten til venstre,
   SPIL til højre, og en fast række med fire ens kort i bunden.
   ====================================================================== */
#main-menu {
    --pad: max(14px, env(safe-area-inset-left), env(safe-area-inset-right));
    --gap: 12px;
    --tile-w: calc((100vw - 2 * var(--pad) - 3 * var(--gap)) / 4);
    --tile-h: clamp(64px, 19vh, 84px);
}
#main-menu .game-title { position: absolute !important; top: 2.5vh !important; left: 50% !important; transform: translateX(-50%) !important; width: min(38vw, 380px) !important; margin: 0 !important; }
#main-menu #settings-btn { position: absolute !important; top: 10px !important; right: var(--pad) !important; left: auto !important; }
#main-menu .menu-bird { left: calc(var(--pad) + 2vw) !important; top: 19vh !important; bottom: auto !important; width: min(31vw, 300px) !important; }
#main-menu .menu-actions {
    position: absolute !important; left: auto !important; right: calc(var(--pad) + 4vw) !important; top: 23vh !important; bottom: auto !important;
    width: min(36vw, 340px) !important; transform: none !important; display: flex !important; flex-direction: column; align-items: center; gap: 6px;
}
#main-menu .menu-actions .play-button { width: 100% !important; min-height: clamp(70px, 22vh, 110px) !important; }
#main-menu .menu-actions .quick-play-button { margin: 0 !important; }
#main-menu .menu-controls { display: none !important; }
/* "Hent spillet" bliver en lille pille øverst til venstre i stedet for et stort kort midt på. */
#main-menu #install-btn { position: absolute !important; top: 10px; left: var(--pad); right: auto; margin: 0 !important;
    padding: 4px 10px 4px 4px !important; min-height: 0 !important; height: 40px; border-radius: 20px !important; gap: 6px; }
#main-menu #install-btn .install-mark { width: 30px !important; height: 30px !important; }
#main-menu #install-btn small { display: none; }
#main-menu #install-btn strong { font-size: 11px !important; }

/* Bundrækken: fire ens kort. */
#main-menu #missions-btn, #main-menu #hero-selector.hero-selector, #main-menu #daily-btn.daily-card, #main-menu aside.menu-record {
    position: absolute !important; top: auto !important; right: auto !important; bottom: max(10px, env(safe-area-inset-bottom)) !important;
    width: var(--tile-w) !important; height: var(--tile-h) !important; min-width: 0 !important; max-width: none !important; min-height: 0 !important;
    transform: none !important; box-sizing: border-box; margin: 0 !important;
    border: 12px solid transparent !important; border-image: url(assets/v2/ui/panel-dark.webp) 60 fill / 12px stretch !important;
    background: none !important; box-shadow: none !important; padding: 0 6px !important;
    display: grid !important; grid-template-columns: auto 1fr auto !important; grid-template-rows: auto auto !important;
    align-items: center !important; align-content: center !important; column-gap: 8px; row-gap: 0; text-align: left;
}
#main-menu #missions-btn { left: var(--pad) !important; }
#main-menu #hero-selector.hero-selector { left: calc(var(--pad) + var(--tile-w) + var(--gap)) !important; }
#main-menu #daily-btn.daily-card { left: calc(var(--pad) + 2 * (var(--tile-w) + var(--gap))) !important; }
#main-menu aside.menu-record { left: calc(var(--pad) + 3 * (var(--tile-w) + var(--gap))) !important; }
/* Ikonet i venstre kolonne, tekst i midten. */
#main-menu #missions-btn img, #main-menu #hero-selector > img, #main-menu #daily-btn .daily-icon, #main-menu aside.menu-record > img {
    position: static !important; grid-column: 1; grid-row: 1 / 3; width: clamp(34px, 9vh, 46px) !important; height: clamp(34px, 9vh, 46px) !important;
    max-height: none !important; object-fit: contain; transform: none !important; margin: 0 !important;
}
#main-menu #missions-btn span { position: static !important; grid-column: 2; grid-row: 1 / 3; background: none !important; padding: 0 !important;
    font-size: 12px !important; letter-spacing: .1em; color: #fff; }
#main-menu #hero-selector > span, #main-menu #daily-btn .daily-kicker, #main-menu aside.menu-record > div > span {
    grid-column: 2; grid-row: 1; font-size: 10px !important; letter-spacing: .12em; color: #ffd98a !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#main-menu #hero-selector > strong, #main-menu #daily-btn strong { grid-column: 2; grid-row: 2; font-size: clamp(13px, 4.2vh, 18px) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#main-menu #hero-selector > small, #main-menu #daily-btn small { display: none !important; }
#main-menu #daily-btn #daily-state { grid-column: 3; grid-row: 1 / 3; font-size: 11px; }
#main-menu aside.menu-record > div { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; min-width: 0; }
#main-menu aside.menu-record #menu-highscore { font-size: clamp(15px, 4.6vh, 22px) !important; line-height: 1; }
#main-menu aside.menu-record #menu-best-level { display: none !important; }
#main-menu aside.menu-record .record-total { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 3px; }
#main-menu aside.menu-record .record-total img { width: 18px !important; height: 18px !important; }
#main-menu aside.menu-record .record-total strong { font-size: 14px !important; }
#main-menu aside.menu-record .leaderboard-button { position: static !important; grid-column: 3; grid-row: 2; width: auto !important; margin: 0 !important;
    padding: 0 !important; border: 0 !important; display: flex; align-items: center; gap: 3px; background: none !important; }
#main-menu aside.menu-record .leaderboard-button .trophy { width: 18px !important; height: 18px !important; }
#main-menu aside.menu-record .leaderboard-button .ui-word { font-size: 10px !important; }
#main-menu #install-btn { position: fixed !important; z-index: 8; }
#main-menu aside.menu-record > div > span { display: none !important; }
#main-menu aside.menu-record .leaderboard-button .ui-word { display: none !important; }
#main-menu aside.menu-record .leaderboard-button .trophy { width: 30px !important; height: 30px !important; }
#main-menu aside.menu-record .record-total strong { font-size: 13px !important; }
#main-menu aside.menu-record #menu-highscore { font-size: clamp(18px, 5.6vh, 26px) !important; }
#main-menu #install-btn { width: auto !important; max-width: 190px; }
/* Level cards: full level names on small adventure cards (two lines if needed). */
.level-card-title { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.05; }
.level-grid.mode-adventure .level-card-title, .level-card[data-mode="adventure"] .level-card-title { font-size: clamp(11px, 3.4vh, 14px) !important; }
.level-card[data-mode="adventure"] .level-card-lock { font-size: 9px !important; padding: 2px 6px !important; }

/* Runde A: missions show all rows; bigger challenge button; EDM top breathing room is in code. */
.mission-list { max-height: calc(100vh - 250px) !important; overflow-y: auto !important; }
@media (max-height: 460px) { .mission-note { display: none; } .mission-list { max-height: calc(100vh - 215px) !important; } }
.hero-wardrobe-card header > div .edition-label { color: #3a2410 !important; text-shadow: none !important; }
.missions-card .edition-label + h2 { font-size: 24px; }
.challenge-button { padding: 10px 22px !important; font-size: 14px !important; }
.challenge-button img { width: 64px !important; height: 32px !important; }

/* ---- Runde B: feel ---- */
#score.bump, .hud-score.bump { animation: score-pop .25s ease-out; }
.game-over.reveal .result-kicker { animation: result-pop .45s cubic-bezier(.2,1.4,.4,1) both; }
.game-over.reveal .scoreboard { animation: result-pop .5s .15s cubic-bezier(.2,1.4,.4,1) both; }
.game-over.reveal .result-medal { animation: result-pop .55s .45s cubic-bezier(.2,1.6,.4,1) both; }
.game-over.reveal .result-progress, .game-over.reveal .result-actions, .game-over.reveal .challenge-button { animation: result-rise .45s .7s ease-out both; }
@keyframes result-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }
@keyframes result-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.confetti-piece { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; pointer-events: none; z-index: 20;
    animation: confetti-fall var(--d, 2.4s) ease-in forwards; }
@keyframes confetti-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 1; } 100% { transform: translate(var(--x, 0), 110vh) rotate(var(--r, 360deg)); opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .game-over.reveal * { animation: none !important; } }

/* ======================================================================
   Runde D: menuerne i forsidens stil. Samme paneler, knapper og
   ikoner som forsiden, og en levende himmel bag det hele.
   ====================================================================== */
.hero-wardrobe-card, .pause-card, .settings-card, .leaderboard-card, .missions-card, .rescue-wheel-card, .challenge-card, .qualification-card, .install-card {
    border: 16px solid transparent !important;
    border-image: url(assets/v2/ui/panel-dark.webp) 60 fill / 16px stretch !important;
    background: none !important;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .35) !important;
    border-radius: 0 !important;
}
.primary-menu-button, .hero-wardrobe-footer .primary-menu-button, #close-missions, #confirm-hero {
    border: 14px solid transparent !important;
    border-image: url(assets/v2/ui/button-primary.webp) 70 fill / 14px stretch !important;
    background: none !important; box-shadow: none !important; border-radius: 0 !important;
    color: #123018 !important; text-shadow: 0 1px 0 rgba(255,255,255,.4) !important;
}
.hero-wardrobe-card header > button, .modal-x, #close-leaderboard, .leaderboard-card header button {
    background: url(assets/v2/ui/button-round.webp) center / 100% 100% no-repeat !important;
    border: 0 !important; color: #fff !important; width: 44px !important; height: 44px !important;
}
.modal-backdrop { backdrop-filter: blur(6px) saturate(1.1); }
/* Levende himmel bag forsiden: to lag drivende skyer tegnet som bløde pletter. */
.main-menu::after {
    content: ''; position: absolute; inset: -10% -20%; pointer-events: none; z-index: 0; opacity: .55;
    background:
        radial-gradient(ellipse 160px 60px at 10% 18%, rgba(255,255,255,.75), transparent 70%),
        radial-gradient(ellipse 220px 80px at 42% 10%, rgba(255,255,255,.65), transparent 70%),
        radial-gradient(ellipse 180px 70px at 72% 22%, rgba(255,255,255,.7), transparent 70%),
        radial-gradient(ellipse 260px 90px at 95% 12%, rgba(255,255,255,.6), transparent 70%),
        radial-gradient(ellipse 200px 70px at 28% 30%, rgba(255,255,255,.5), transparent 70%);
    animation: menu-clouds 70s linear infinite;
}
@keyframes menu-clouds { from { transform: translateX(0); } to { transform: translateX(-20%); } }
.main-menu > * { position: relative; }
.main-menu .menu-bird { animation: menu-bird-float 3.4s ease-in-out infinite; }
@keyframes menu-bird-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -12px; } }
@media (prefers-reduced-motion: reduce) { .main-menu::after, .main-menu .menu-bird { animation: none; } }
.hero-wardrobe-card, .pause-card, .settings-card, .leaderboard-card, .missions-card, .rescue-wheel-card, .challenge-card, .qualification-card, .install-card {
    border-width: 12px !important; box-sizing: border-box; max-height: calc(100vh - 12px) !important; overflow: auto;
}
.settings-card { padding: 6px 14px 10px !important; }
.settings-card .primary-menu-button { min-height: 40px !important; }
.hero-wardrobe-card header > div { padding: 4px 56px 6px 44px; }
.hero-wardrobe-card .hero-grid, .hero-wardrobe-card .hero-options { max-height: 34vh; overflow-y: auto; }

/* ======================================================================
   Grafikrunde 4, pakke 1 + 4: forsidebaggrund, paneler, faner, kontakter,
   ikoner, medaljering og lysstråler bag resultatet.
   ====================================================================== */
.main-menu { background: #78c8ea url(assets/v2/g4/menu/background.webp) center / cover no-repeat !important; }
.main-menu::before { display: none; }
.hero-wardrobe-card, .pause-card, .settings-card, .leaderboard-card, .missions-card, .rescue-wheel-card, .challenge-card, .qualification-card, .install-card {
    border-width: 22px !important;
    border-image: url(assets/v2/g4/ui/panel-modal.webp) 80 fill / 22px stretch !important;
}
.mode-tab { border: 10px solid transparent !important; border-image: url(assets/v2/g4/ui/tab-idle.webp) 36 fill / 10px stretch !important; background: none !important; box-shadow: none !important; }
.mode-tab.selected, .mode-tab.active { border-image: url(assets/v2/g4/ui/tab-active.webp) 36 fill / 10px stretch !important; color: #123018 !important; }
.mode-tab.selected *, .mode-tab.active * { color: #123018 !important; text-shadow: none !important; }
.settings-card input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 54px; height: 28px; margin: 0; border: 0; cursor: pointer;
    background: url(assets/v2/g4/ui/toggle-off.webp) center / contain no-repeat; }
.settings-card input[type="checkbox"]:checked { background-image: url(assets/v2/g4/ui/toggle-on.webp); }
.leaderboard-row.me, .leaderboard-row.own, .leaderboard-row[data-me="true"] { background: url(assets/v2/g4/ui/row-highlight.webp) center / 100% 100% no-repeat !important; }
.hud-menu img { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; }
.challenge-button img { width: 72px !important; height: 36px !important; }
.result-medal { background: url(assets/v2/g4/ui/medal-ring.webp) center / contain no-repeat !important; border: 0 !important; box-shadow: none !important; }
.result-medal img { width: 60px !important; height: 60px !important; }
.game-over::before { content: ''; position: absolute; inset: -20%; background: url(assets/v2/g4/result/light-rays.webp) center / 120% no-repeat; opacity: .55; pointer-events: none; z-index: 0;
    animation: rays-spin 40s linear infinite; }
.game-over > * { position: relative; z-index: 1; }
@keyframes rays-spin { to { transform: rotate(360deg); } }
.confetti-piece { background: url(assets/v2/g4/result/confetti-1.webp) center / contain no-repeat !important; width: 22px; height: 22px; border-radius: 0; }
.confetti-piece:nth-child(3n) { background-image: url(assets/v2/g4/result/confetti-2.webp) !important; }
.confetti-piece:nth-child(3n+1) { background-image: url(assets/v2/g4/result/confetti-3.webp) !important; }
@media (prefers-reduced-motion: reduce) { .game-over::before { animation: none; } }

/* ---- Reden ---- */
.nest-card { width: min(96vw, 1040px) !important; max-width: none !important; }
.nest-layout { display: grid; grid-template-columns: 180px 1fr; gap: 12px; align-items: center; }
.nest-scene { position: relative; height: 150px; }
.nest-tree { position: absolute; left: -10px; bottom: 0; height: 150px; }
.nest-image { position: absolute; left: 70px; bottom: 56px; width: 110px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.3)); animation: nest-pop .5s cubic-bezier(.2,1.5,.4,1) both; }
@keyframes nest-pop { from { transform: scale(.7); } to { transform: scale(1); } }
.nest-side { min-width: 0; }
.nest-next { display: grid !important; grid-template-columns: 56px 1fr auto !important; align-items: center; gap: 10px; }
.nest-next img { width: 56px; height: 56px; object-fit: contain; }
.nest-next em { display: block; font-style: normal; font-size: 11px; color: #c7e6f0; }
.nest-steps { display: flex; gap: 6px; margin-top: 8px; }
.nest-step { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.18); }
.nest-step img { width: 28px; height: 28px; object-fit: contain; }
.nest-step.done { border-color: #b6ff3b; background: rgba(182,255,59,.18); }
.nest-step.next { border-color: #ffd93b; box-shadow: 0 0 0 3px rgba(255,217,59,.25); }
.nest-step.locked img { filter: grayscale(1) brightness(.6); }
.nest-row-title { margin: 10px 0 4px; font-size: 11px; font-weight: 900; letter-spacing: .14em; color: #ffd98a; }
.nest-row-title small { color: #c7e6f0; font-weight: 700; letter-spacing: .04em; margin-left: 8px; }
.nest-calendar { display: flex; gap: 8px; }
.cal-day { width: 44px; height: 44px; background: url(assets/v2/g4/nest/calendar-day.webp) center / contain no-repeat; display: grid; place-items: center; font-size: 11px; font-weight: 900; color: #fff; }
.cal-day.done { background-image: url(assets/v2/g4/nest/calendar-day-done.webp); color: transparent; }
.cal-day.today { filter: drop-shadow(0 0 6px #ffd93b); }
.badge-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; }
.badge { position: relative; aspect-ratio: 1; background: url(assets/v2/g4/nest/badge-frame.webp) center / contain no-repeat; display: grid; place-items: center; }
.badge img { width: 62%; height: 62%; object-fit: contain; }
.badge.locked { background-image: url(assets/v2/g4/nest/badge-locked.webp); }
.badge.locked img { opacity: .25; filter: grayscale(1); }
.badge.new { animation: nest-pop .5s cubic-bezier(.2,1.5,.4,1) both; }
.badge-tip { position: fixed; z-index: 60; max-width: 240px; padding: 8px 10px; border-radius: 10px; background: rgba(8,20,32,.95); color: #fff; font-size: 12px; pointer-events: none; }
.badge-tip b { display: block; color: #ffd98a; }
#main-menu #missions-btn img { width: clamp(38px, 10vh, 50px) !important; height: clamp(38px, 10vh, 50px) !important; }
@media (max-height: 460px) { .nest-scene { height: 120px; } .nest-tree { height: 120px; } .nest-image { width: 88px; left: 56px; bottom: 44px; } .badge-grid { grid-template-columns: repeat(15, 1fr); } }

.result-nest { background: rgba(60, 30, 8, .78) !important; color: #ffd98a !important; margin-top: 4px !important; }
.game-over.reveal .result-nest { animation: result-rise .45s .8s ease-out both; }

/* Træet med reden på forsiden, bag helten. Tryk åbner reden. */
#main-menu .menu-nest { position: absolute !important; left: calc(var(--pad) - 1vw); top: 13vh; width: min(30vw, 290px); height: 60vh; border: 0; background: none; padding: 0; cursor: pointer; z-index: 1; }
#main-menu .menu-tree { position: absolute; left: 0; bottom: 0; height: 100%; }
#main-menu .menu-nest-image { position: absolute; left: 58%; bottom: 36%; width: 42%; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
#main-menu .menu-bird { left: calc(var(--pad) + 15vw) !important; top: 33vh !important; width: min(24vw, 230px) !important; z-index: 2; }
/* Eventyr-fanen: verdenskortet bag kortene. */
.level-grid[data-mode="adventure"] { background: url(assets/v2/g4/map/world-map.webp) center / cover no-repeat; border-radius: 14px; padding: 8px !important; }
.level-grid[data-mode="adventure"] .level-card { backdrop-filter: blur(2px); }

/* ---- Rugepladsen ---- */
.egg-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; }
.egg-view { position: relative; height: 90px; display: grid; place-items: center; }
.egg-shape { display: block; width: 54px; height: 70px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: radial-gradient(circle at 35% 30%, #fff9e6, #e8d9b0 70%); border: 3px solid #1b2a44; box-shadow: inset -6px -8px 0 rgba(0,0,0,.08); }
.egg-view.empty .egg-shape { opacity: .25; border-style: dashed; background: none; }
.egg-view.stage-1 .egg-shape { background-image: radial-gradient(circle at 35% 30%, #fff9e6, #e8d9b0 70%), linear-gradient(135deg, transparent 48%, #1b2a44 49%, #1b2a44 51%, transparent 52%); background-size: 100% 100%, 40% 30%; background-repeat: no-repeat; background-position: center, 60% 20%; }
.egg-view.stage-2 .egg-shape, .egg-view.stage-3 .egg-shape { animation: egg-wobble .9s ease-in-out infinite; }
@keyframes egg-wobble { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.egg-view span { position: absolute; bottom: 0; font-size: 10px; font-weight: 900; color: #ffd98a; letter-spacing: .06em; }
.egg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.egg-btn { min-height: 38px; border: 0; border-radius: 10px; background: linear-gradient(#c9ff3c, #81bd09); color: #123018; font-weight: 900; font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.egg-btn.secondary { background: linear-gradient(#7fe8ff, #2fa7d4); color: #0b2a3a; }
.egg-btn:disabled { opacity: .45; cursor: default; }
.egg-select { grid-column: 1 / -1; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.3); border-radius: 8px; padding: 6px; font-weight: 700; }
.egg-section.hidden { display: none; }

/* ---- Æg (runde 5) ---- */
.egg-view .egg-shape { display: none; }
.egg-view img.egg-art { width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 3px 0 rgba(0,0,0,.25)); }
.egg-view.stage-2 img.egg-art, .egg-view.stage-3 img.egg-art { animation: egg-wobble .9s ease-in-out infinite; }
.egg-view.empty img.egg-art { opacity: .8; }
.nest-basket { position: absolute; left: 6px; bottom: 6px; width: 54px; }
.hatch-stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 260px; height: 260px; z-index: 30; pointer-events: none; }
.hatch-egg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.hatch-hero { position: absolute; left: 50%; top: 50%; width: 160px; transform: translate(-50%, -50%) scale(0); transition: transform .5s cubic-bezier(.2,1.6,.4,1); }
.hatch-stage.open .hatch-hero { transform: translate(-50%, -62%) scale(1); }
.result-progress { display: block !important; max-width: 720px; margin-left: auto !important; margin-right: auto !important; font-size: 12px !important; }
.result-nest { display: block !important; }

/* ======================================================================
   Testrunde (ny spiller), 4. okt.
   ====================================================================== */
/* Forside: SPIL midt på skærmen */
#main-menu .menu-actions { left: 50% !important; right: auto !important; transform: translateX(-50%) !important; top: 27vh !important; width: min(32vw, 320px) !important; }
#main-menu .menu-bird { left: calc(var(--pad) + 12vw) !important; top: 33vh !important; width: min(20vw, 200px) !important; }
#main-menu .menu-nest { width: min(26vw, 250px); }
/* Reden: hele kortet ruller, ingen rulleboks inden i */
.nest-card { overflow-y: auto !important; -webkit-overflow-scrolling: touch; }
.nest-card .mission-list { max-height: none !important; overflow: visible !important; }
.nest-card #close-missions { display: block; width: 100%; margin: 10px 0 0 !important; }
.nest-card .mission-note { display: block !important; }
/* Navnevinduet: FLYV i midten */
.name-card { text-align: center; }
.name-card .challenge-actions { justify-content: center !important; display: flex; }
.name-card .first-name-input { margin-left: auto; margin-right: auto; display: block; }
/* Lyd: skydere */
.volume-slider { flex: 1; margin: 0 12px; accent-color: #b6ff3b; min-width: 90px; }
.settings-card label { display: flex !important; align-items: center; }
.reset-all { margin: 6px auto 8px !important; display: block; color: #ffb3b3 !important; font-size: 11px !important; letter-spacing: .1em; }
/* Resultat: knapperne får baggrund */
.result-actions button { border: 12px solid transparent !important; border-image: url(assets/v2/ui/button-secondary.webp) 60 fill / 12px stretch !important; padding: 0 14px !important; }
.result-actions button:first-child { border-image-source: url(assets/v2/ui/button-primary.webp) !important; }
.result-actions button:first-child .ui-word, .result-actions button:first-child * { color: #123018 !important; -webkit-text-stroke: 0 !important; text-shadow: none !important; }
/* Baneoversigt: faner i samme højde og bredde */
.mode-tabs { display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 8px; align-items: stretch; }
.mode-tabs .mode-tab.hidden { display: none !important; }
.mode-tab { min-height: 64px; display: flex !important; flex-direction: column; justify-content: center; text-align: left; padding: 2px 8px !important; }
.mode-tab small { font-size: 9px !important; line-height: 1.15; }
/* Startheltvalg */
.starter-card { text-align: center; }
.starter-row { display: flex; gap: 12px; justify-content: center; margin: 10px 0; flex-wrap: wrap; }
.starter-option { width: 120px; padding: 8px; border-radius: 14px; border: 2px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; gap: 4px; justify-items: center; }
.starter-option img { width: 96px; height: 86px; object-fit: contain; }
.starter-option:hover, .starter-option:focus-visible { border-color: #b6ff3b; }

/* Garderobe: én række store helte, der ruller til siden, med pile og hængelås */
.hero-wardrobe-card { position: relative; }
#hero-grid.hero-grid { display: flex !important; flex-wrap: nowrap !important; gap: 10px; overflow-x: auto !important; overflow-y: hidden !important; max-height: none !important;
    scroll-snap-type: x mandatory; padding: 6px 34px !important; scrollbar-width: none; }
#hero-grid.hero-grid::-webkit-scrollbar { display: none; }
#hero-grid .hero-option { flex: 0 0 132px; min-height: 150px; scroll-snap-align: start; position: relative; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
#hero-grid .hero-option img { width: 110px !important; height: 92px !important; }
#hero-grid .hero-option b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
#hero-grid .hero-option.locked img { filter: grayscale(.85) brightness(.55); }
#hero-grid .hero-option.locked::after { content: ''; position: absolute; top: 34%; left: 50%; width: 42px; height: 42px; transform: translate(-50%, -50%); background: url(assets/adventure/ui/lock.webp) center / contain no-repeat; }
.hero-scroll { position: absolute; z-index: 5; top: 46%; width: 34px; height: 54px; border: 0; border-radius: 10px; background: rgba(8,20,32,.75); color: #ffd98a; font-size: 30px; font-weight: 900; cursor: pointer; left: 14px; }
.hero-scroll.right { left: auto; right: 14px; }
.hero-lock-pop { position: absolute; z-index: 10; left: 50%; bottom: 18%; transform: translateX(-50%); width: min(92%, 520px); display: grid; grid-template-columns: 48px 1fr 28px; gap: 10px; align-items: start;
    padding: 12px 14px; border-radius: 14px; background: rgba(8,20,32,.96); border: 2px solid #ffd98a; color: #fff; font-size: 12px; }
.hero-lock-pop img { width: 44px; }
.hero-lock-pop b { color: #ffd98a; font-size: 14px; }
.hero-lock-pop p { margin: 4px 0 0; }
.hero-lock-pop button { border: 0; background: none; color: #fff; font-size: 22px; cursor: pointer; }

#main-menu .menu-actions { transform: none !important; left: calc(50% - min(16vw, 160px)) !important; }
.nest-card .mission-list { height: auto !important; min-height: 0 !important; }
.starter-card { width: min(94vw, 760px) !important; padding: 10px 16px !important; }
.starter-card h2 { margin: 2px 0 !important; font-size: 26px !important; }
.starter-card p { margin: 2px 0 !important; font-size: 12px; }
.starter-row { flex-wrap: nowrap !important; gap: 10px; margin: 8px 0 !important; }
.starter-option { width: 22% !important; padding: 6px !important; }
.starter-option img { width: 100% !important; height: 70px !important; }
.starter-option b { font-size: 13px; }
.nest-card { display: block !important; grid-template-rows: none !important; }
.nest-card > * { margin-bottom: 6px; }
.nest-card .nest-economy { display: grid; grid-template-columns: auto 1fr; gap: 10px; }

/* Mærker uden hvide firkanter, og FLYV VIDERE med teksten i midten */
.badge { border: 0 !important; background-color: transparent !important; padding: 0 !important; outline: none; }
.nest-card #close-missions, .missions-card #close-missions { display: flex !important; align-items: center; justify-content: center; line-height: 1 !important; padding: 0 !important; min-height: 52px !important; }
.level-card .lock-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.level-card.locked .level-card-copy { opacity: .85; }
/* Fanerne deler bredden mellem dem, der er synlige (3 eller 4), og teksten har luft i kanten. */
.mode-tabs { display: flex !important; gap: 10px; }
.mode-tabs .mode-tab { flex: 1 1 0; min-width: 0; padding: 4px 14px !important; }
.mode-tabs .mode-tab strong, .mode-tabs .mode-tab small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mode-tabs .mode-tab { width: auto !important; max-width: none !important; }
.mode-tabs { width: 100% !important; grid-template-columns: none !important; }
/* Fane-billederne er beskåret til selve fanen, så de fylder hele knappen. */
.mode-tab { border-image-slice: 18 fill !important; border-width: 8px !important; }
.mode-tab.selected, .mode-tab.active { border-image-slice: 18 fill !important; }

/* Lange ord på andre sprog: lidt mindre tekst i bundkortene, så intet overlapper */
#main-menu #hero-selector > strong, #main-menu #daily-btn strong { font-size: clamp(12px, 3.6vh, 16px) !important; }
#main-menu #daily-btn #daily-state { font-size: 10px !important; }
#main-menu #daily-btn.daily-card { column-gap: 6px !important; }

/* ---- Eventyr som kort (Mario-agtigt) ---- */
.level-grid[data-mode="adventure"] { background: none !important; display: grid !important; grid-template-columns: minmax(0, 1fr) 150px !important;
    grid-auto-rows: min-content; gap: 8px !important; align-items: start; }
.level-grid[data-mode="adventure"] .level-card[data-group="adventure"] { display: none !important; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] { grid-column: 2; min-height: 0 !important; height: auto; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] .level-thumb { height: 34px; object-fit: cover; }
.world-map { grid-column: 1; grid-row: 1 / span 6; position: relative; aspect-ratio: 16 / 9; width: 100%; max-height: 58vh; justify-self: center;
    background: url(assets/v2/g4/map/world-map.webp) center / cover no-repeat; border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.map-stop { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 2px; border: 0; background: none; cursor: pointer; padding: 0; }
.map-stop b { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #c8193c; color: #fff; font: 900 17px "Bert Display", sans-serif;
    border: 3px solid #fff; box-shadow: 0 3px 0 #1b2a44, 0 0 0 3px rgba(27,42,68,.4); }
.map-stop span { background: rgba(8,20,32,.82); color: #fff; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 8px; white-space: nowrap; }
.map-stop > img { position: absolute; top: -16px; right: -20px; width: 26px; height: 26px; }
.map-stop small { display: flex; align-items: center; gap: 3px; font-size: 8px; font-weight: 900; color: #ffd98a; background: rgba(8,20,32,.82); padding: 1px 5px; border-radius: 6px; white-space: nowrap; }
.map-stop small img { width: 10px; height: 10px; }
.map-stop.locked b { background: #4a5a6a; }
.map-stop.locked { opacity: .92; }
.map-stop.medal-gold b { background: #e9a81a; } .map-stop.medal-silver b { background: #8a9bb0; } .map-stop.medal-bronze b { background: #b0683a; }
.map-pin { position: absolute; width: 30px; transform: translate(-50%, -100%); animation: pin-bob 1.2s ease-in-out infinite; pointer-events: none; }
@keyframes pin-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
@media (prefers-reduced-motion: reduce) { .map-pin { animation: none; } }
.level-grid[data-mode="adventure"] { grid-template-columns: auto minmax(130px, 1fr) !important; grid-template-rows: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-rows: 0 !important; overflow: hidden !important; justify-content: center; }
.world-map { grid-row: 1 / span 4 !important; height: 100% !important; width: auto !important; max-height: none !important; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] { height: 100% !important; min-height: 0 !important; overflow: hidden; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] .level-card-score,
.level-grid[data-mode="adventure"] .level-card[data-group="event"] .level-card-lock { display: none !important; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] .level-thumb { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.level-grid[data-mode="adventure"] { grid-template-columns: auto minmax(0, 1fr) !important; justify-content: stretch !important; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] { width: 100% !important; }
.level-grid[data-mode="adventure"] .level-card[data-group="event"] .level-card-title { font-size: 13px !important; white-space: nowrap !important; }

/* Udfordringer i reden */
.mission-row[data-difficulty]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; display: inline-block; flex: 0 0 8px; }
.mission-row[data-difficulty="easy"]::before { background: #7ee36b; }
.mission-row[data-difficulty="medium"]::before { background: #ffd23b; }
.mission-row[data-difficulty="hard"]::before { background: #ff5a73; }
.book-tabs { display: flex; gap: 6px; margin-bottom: 6px; }
.book-tab { flex: 1; border: 2px solid rgba(255,255,255,.2); background: rgba(255,255,255,.06); color: #fff; border-radius: 10px; padding: 6px; font-weight: 900; font-size: 11px; letter-spacing: .08em; cursor: pointer; }
.book-tab small { display: block; color: #ffd98a; font-size: 10px; }
.book-tab.selected { border-color: #b6ff3b; background: rgba(182,255,59,.15); }
.book-list { max-height: none !important; }

/* Resultat: FLYV IGEN stor og i midten, SKIFT BANE og UDFORDR små (feedback 10. okt.) */
.result-actions { display: flex !important; justify-content: center; align-items: center; gap: 12px; }
.result-actions button:first-child { min-width: 240px; min-height: 64px; font-size: 26px !important; order: 2; }
.result-actions button:not(:first-child) { min-height: 48px; font-size: 14px !important; order: 1; }
.challenge-button { transform: scale(.85); }

/* ---- Rejsen: ét kort med alle baner som stop ---- */
.level-menu.journey-mode .mode-tabs, .level-menu.journey-mode #level-grid { position: absolute !important; left: -9999px !important; width: 10px; height: 10px; overflow: hidden; }
.journey { position: relative; width: 100%; flex: 1; min-height: 210px; overflow-x: auto; overflow-y: hidden; border-radius: 16px;
    background: linear-gradient(#8fd6f5, #c8ecfb); box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.journey::-webkit-scrollbar { display: none; }
.journey-track { position: relative; display: flex; height: 100%; min-height: 210px; }
.journey-area { position: relative; flex: 0 0 auto; height: 100%; background: linear-gradient(transparent 45%, color-mix(in srgb, var(--tint) 75%, transparent) 100%); }
.journey-area::after { content: ''; position: absolute; left: 10%; right: 10%; bottom: 8%; height: 18%; border-radius: 50%; background: color-mix(in srgb, var(--tint) 60%, #000 10%); opacity: .35; filter: blur(4px); }
.journey-area-name { position: absolute; left: 12px; bottom: 8px; font: 900 13px "Bert Display", sans-serif; letter-spacing: .08em; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.4); z-index: 2; }
.journey-path { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.journey-path path { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 2 12; stroke-linecap: round; opacity: .9; }
.journey-stop { position: absolute; z-index: 2; transform: translateY(-50%); width: 120px; display: grid; justify-items: center; gap: 2px; border: 0; background: none; cursor: pointer; padding: 0; }
.journey-thumb { position: relative; width: 74px; height: 74px; border-radius: 50%; background: #fff center / cover no-repeat; border: 4px solid #fff; box-shadow: 0 4px 0 #1b2a44, 0 0 0 3px rgba(27,42,68,.35); }
.journey-thumb b { position: absolute; left: -6px; top: -6px; width: 26px; height: 26px; border-radius: 50%; background: #c8193c; color: #fff; display: grid; place-items: center; font: 900 13px "Bert Display", sans-serif; border: 2px solid #fff; }
.journey-name { background: rgba(8,20,32,.82); color: #fff; font-size: 11px; font-weight: 900; padding: 2px 8px; border-radius: 8px; white-space: nowrap; }
.journey-stars i { font-style: normal; font-size: 16px; color: rgba(255,255,255,.55); text-shadow: 0 1px 0 #1b2a44; }
.journey-stars i.on { color: #ffd23b; }
.journey-lock { display: flex; align-items: center; gap: 3px; font-size: 9px; font-weight: 900; color: #ffd98a; background: rgba(8,20,32,.82); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.journey-lock img { width: 11px; height: 11px; }
.journey-stop.locked .journey-thumb { filter: grayscale(.9) brightness(.65); }
.journey-stop.here .journey-thumb::after { content: ''; position: absolute; left: 50%; top: -52px; width: 54px; height: 50px; transform: translateX(-50%);
    background: url(assets/heroes/bert/glide.webp) center / contain no-repeat; animation: pin-bob 1.2s ease-in-out infinite; }
.journey-balloons { position: sticky; left: 0; z-index: 3; display: flex; gap: 8px; padding: 6px 10px 0; height: 0; overflow: visible; }
.journey-balloon { border: 0; border-radius: 14px; background: rgba(255,255,255,.88); color: #1b2a44; font-weight: 900; font-size: 11px; padding: 4px 10px; box-shadow: 0 2px 0 rgba(27,42,68,.3); cursor: pointer; white-space: nowrap; }
.journey-balloon span { margin-right: 4px; }
@media (prefers-reduced-motion: reduce) { .journey-stop.here .journey-thumb::after { animation: none; } }

.journey-balloons { position: static !important; height: auto !important; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 !important; margin-left: auto; align-self: center; max-width: 52%; justify-content: flex-end; }
.level-menu.journey-mode .level-menu-head, .level-menu.journey-mode header { display: flex; align-items: center; gap: 14px; }

.journey-mirror { position: absolute; z-index: 4; width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; background: #7b4dff; color: #fff; font-weight: 900; font-size: 16px;
    box-shadow: 0 3px 0 #1b2a44; cursor: pointer; }

/* Rejsekortet med rigtig grafik (runde 6) */
.journey-area { background: var(--art) center bottom / cover no-repeat, linear-gradient(transparent 45%, color-mix(in srgb, var(--tint) 55%, transparent) 100%) !important; }
.journey-area::after { display: none; }
.journey-thumb { border: 0 !important; box-shadow: none !important; overflow: visible; }
.journey-thumb::before { content: ''; position: absolute; inset: -14px; background: url(assets/v2/g6/journey/stop-frame.webp) center / contain no-repeat; z-index: 1; pointer-events: none; }
.journey-stop.locked .journey-thumb::before { background-image: url(assets/v2/g6/journey/stop-locked.webp); filter: none; }
.journey-thumb b { z-index: 2; }
.journey-stop.here .journey-thumb::after { background-image: url(assets/v2/g6/journey/bert-map.webp) !important; width: 60px !important; height: 54px !important; top: -60px !important; z-index: 3; }
.journey-balloon { display: inline-flex; align-items: center; gap: 4px; }
.journey-balloon img { width: 16px; height: 22px; }
.journey-area-name { background: rgba(8,20,32,.55); padding: 2px 8px; border-radius: 8px; }
.journey-thumb { width: 64px !important; height: 64px !important; }
.journey-name { margin-top: 12px; position: relative; z-index: 3; }
.journey-stars, .journey-lock { position: relative; z-index: 3; }
.journey-balloon { font-size: 10px !important; padding: 3px 8px !important; }
.journey-balloons { max-width: 60% !important; gap: 4px !important; }
.level-menu.journey-mode h2, .level-menu.journey-mode h2 + p, .level-menu.journey-mode p { white-space: nowrap; }
.journey-balloons { max-width: 48% !important; }
.journey-balloon { font-size: 9px !important; padding: 2px 6px !important; }
.journey-balloon img { width: 12px !important; height: 17px !important; }

/* Udfordrings-ikoner og bjælker (runde 6) */
.mission-row[data-difficulty]::before { width: 22px !important; height: 22px !important; flex: 0 0 22px !important; border-radius: 0 !important; background: center / contain no-repeat !important; }
.mission-row[data-difficulty="easy"]::before { background-image: url(assets/v2/g6/ui/challenge-easy.webp) !important; }
.mission-row[data-difficulty="medium"]::before { background-image: url(assets/v2/g6/ui/challenge-medium.webp) !important; }
.mission-row[data-difficulty="hard"]::before { background-image: url(assets/v2/g6/ui/challenge-hard.webp) !important; }
.book-tab::before { content: ''; display: block; width: 30px; height: 30px; margin: 0 auto 2px; background: center / contain no-repeat; }
.book-tab[data-book="milestones"]::before { background-image: url(assets/v2/g6/ui/challenge-milestone.webp); }
.book-tab[data-book="mastery"]::before { background-image: url(assets/v2/g6/ui/challenge-mastery.webp); }
.book-tab[data-book="hidden"]::before { background-image: url(assets/v2/g6/ui/challenge-secret.webp); }
.weekly-list .mission-row::before { content: ''; width: 22px; height: 22px; flex: 0 0 22px; margin-right: 6px; background: url(assets/v2/g6/ui/challenge-week.webp) center / contain no-repeat; }
.mission-track { border: 6px solid transparent !important; border-image: url(assets/v2/g6/ui/progress-bar.webp) 18 fill / 6px stretch !important; background: none !important; }

/* Klistermærker */
.sticker-album-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin: 6px 0; padding: 6px 12px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.08); color: #fff; font-weight: 900; letter-spacing: .08em; cursor: pointer; }
.sticker-album-btn img { width: 34px; height: 34px; }
.sticker-album-btn small { margin-left: auto; color: #ffd98a; }
.sticker-album { position: relative; width: min(94vw, 760px); max-height: 92vh; overflow: auto; padding: 18px 24px; border-radius: 18px;
    background: url(assets/v2/g6/stickers/album.webp) center / cover no-repeat; color: #3a2a1a; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.sticker-album h2 { margin: 0 0 8px; font: 900 22px "Bert Display", sans-serif; color: #5a3a1a; text-align: center; }
.sticker-album p { text-align: center; font-weight: 700; margin: 8px 0 0; }
.sticker-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; padding: 4px 10px; background: rgba(255,255,255,.55); border-radius: 12px; }
.sticker-row b { width: 82px; font-size: 12px; }
.sticker-slot { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 10px; border: 2px dashed rgba(90,58,26,.35); }
.sticker-slot img { width: 58px; height: 58px; filter: brightness(0) opacity(.18); }
.sticker-slot.found { border-style: solid; border-color: transparent; }
.sticker-slot.found img { filter: none; transform: rotate(-4deg); }
.sticker-album .round-close { position: absolute; right: 10px; top: 10px; }
/* Bert drejer ved ny rekord */
.bert-spin { position: absolute; width: 120px; height: 120px; left: 50%; top: -96px; transform: translateX(-50%); pointer-events: none; z-index: 6; }

#game-over .scoreboard { position: relative; }
.sticker-row { background: rgba(255,250,240,.88) !important; }

/* Balloner: egen række under kortet med store trykflader (feedback: for svære at ramme) */
#journey-balloons.journey-balloons { position: static !important; display: flex !important; flex-wrap: nowrap !important; gap: 8px !important; max-width: none !important; width: 100%;
    overflow-x: auto; padding: 8px 2px 2px !important; margin: 0 !important; justify-content: flex-start !important; scrollbar-width: none; height: auto !important; }
#journey-balloons::-webkit-scrollbar { display: none; }
#journey-balloons .journey-balloon { flex: 0 0 auto; min-height: 46px; font-size: 14px !important; padding: 6px 14px !important; border-radius: 16px; gap: 6px; }
#journey-balloons .journey-balloon img { width: 20px !important; height: 28px !important; }
#journey-balloons .journey-balloon.flok { background: #b6ff3b; }

/* Flokken på forsiden: sit eget kort til højre for SPIL (feedback 10. okt.) */
.flok-promo { position: absolute; right: calc(var(--pad, 16px) + 2vw); top: 22vh; width: min(24vw, 250px); padding: 8px 10px 10px; border: 0; border-radius: 18px; cursor: pointer;
    background: linear-gradient(160deg, #7b4dff, #4a2bb8); color: #fff; box-shadow: 0 6px 0 #241466, 0 10px 24px rgba(0,0,0,.25); display: grid; justify-items: center; gap: 2px;
    animation: flok-promo-bob 3s ease-in-out infinite; z-index: 3; }
.flok-promo img { width: 100%; height: auto; max-height: 14vh; object-fit: contain; margin-top: -4px; }
.flok-promo strong { font: 900 clamp(16px, 4.2vh, 24px) "Bert Display", sans-serif; letter-spacing: .06em; text-shadow: 0 2px 0 #241466; }
.flok-promo small { font-size: clamp(8px, 2vh, 10px); font-weight: 900; letter-spacing: .1em; opacity: .9; text-align: center; }
.flok-promo-lives { font-size: clamp(11px, 2.8vh, 15px); color: #ffb3c0; letter-spacing: .12em; }
.flok-promo-new { position: absolute; top: -10px; left: -10px; background: #ff4d5e; color: #fff; font-weight: 900; font-size: 12px; letter-spacing: .1em; padding: 4px 10px; border-radius: 10px;
    transform: rotate(-10deg); box-shadow: 0 3px 0 #a3172a; }
@keyframes flok-promo-bob { 0%, 100% { transform: translateY(0) rotate(1deg); } 50% { transform: translateY(-6px) rotate(-1deg); } }
@media (prefers-reduced-motion: reduce) { .flok-promo { animation: none; } }

/* Bonusbaner på rejsekortet */
.journey-stop.bonus { width: 100px; }
.journey-stop.bonus .journey-thumb { width: 50px !important; height: 50px !important; }
.journey-stop.bonus .journey-thumb::before { inset: -10px; }
.bonus-balloon { position: absolute; right: -16px; top: -22px; width: 22px; height: 32px; z-index: 4; }
.journey-stop.bonus .journey-name { font-size: 10px; margin-top: 8px; background: rgba(123,77,255,.9); }
.bonus-week { font-size: 8px; font-weight: 900; letter-spacing: .08em; color: #fff; background: #ff4d5e; padding: 1px 6px; border-radius: 6px; position: relative; z-index: 3; }
.journey-stop.bonus.spotlight .journey-thumb { animation: pin-bob 1.4s ease-in-out infinite; }
/* Ugens bonusbane på forsiden, under Flokken */
.bonus-promo { position: absolute; right: calc(var(--pad, 16px) + 2vw); top: calc(22vh + min(24vw, 250px) * 0.95 + 18px); width: min(24vw, 250px); display: grid; grid-template-columns: 64px 1fr;
    gap: 8px; align-items: center; padding: 6px 8px; border: 0; border-radius: 14px; background: rgba(8,20,32,.82); color: #fff; cursor: pointer; text-align: left; box-shadow: 0 4px 0 rgba(8,20,32,.5); z-index: 3; }
.bonus-promo img { width: 64px; height: 40px; object-fit: cover; border-radius: 8px; }
.bonus-promo strong { display: block; font: 900 14px "Bert Display", sans-serif; letter-spacing: .04em; }
.bonus-promo small { display: block; font-size: 8px; font-weight: 900; letter-spacing: .08em; color: #ffd98a; }
.bonus-promo-tag { position: absolute; top: -9px; left: 10px; font-size: 9px; font-weight: 900; letter-spacing: .1em; background: #ff4d5e; padding: 2px 8px; border-radius: 8px; }
.bonus-promo.locked img { filter: grayscale(.9) brightness(.7); }

.bonus-promo { right: auto !important; left: 50% !important; transform: translateX(-50%); top: 64vh !important; width: min(42vw, 380px) !important; grid-template-columns: 56px 1fr !important; padding: 5px 10px !important; }
.bonus-promo img { width: 56px !important; height: 34px !important; }
.bonus-promo { top: 68.5vh !important; }

/* Runde 9: bonusballoner, ramme og sidevej på kortet */
.journey-stop.bonus .journey-thumb::before { background-image: url(assets/v2/g9/bonus/stop-frame.webp) !important; inset: -12px !important; }
.bonus-balloon { width: 34px !important; height: 48px !important; right: -24px !important; top: -40px !important; animation: pin-bob 2.2s ease-in-out infinite; }
.bonus-path { position: absolute; left: -64px; top: 48px; width: 90px; height: 27px; pointer-events: none; opacity: .9; transform: scaleY(-1); }
/* Ugens bonus på forsiden: banneret som baggrund, teksten til venstre */
.bonus-promo { background: center right / cover no-repeat, rgba(8,20,32,.82) !important; grid-template-columns: 1fr !important; height: 54px; padding: 6px 12px !important; overflow: visible; }
.bonus-promo > img:not(.bonus-promo-double) { display: none; }
.bonus-promo-text { background: linear-gradient(90deg, rgba(8,20,32,.85) 55%, rgba(8,20,32,0)); padding: 4px 30px 4px 8px; border-radius: 8px; justify-self: start; }
.bonus-promo-tag { background: url(assets/v2/g9/bonus/tag.webp) center / 100% 100% no-repeat !important; padding: 4px 14px !important; top: -12px !important; }
.bonus-promo-double { position: absolute; right: -10px; top: -14px; width: 40px; height: 40px; }

.bonus-promo { background: var(--banner) center right / cover no-repeat, rgba(8,20,32,.82) !important; height: 50px !important; top: 67vh !important; }
.bonus-promo.locked { filter: none; }
.bonus-promo.locked .bonus-promo-text small { color: #ffb3b3; }
.bonus-promo.locked img.bonus-promo-double { filter: none !important; }
.bonus-balloon { top: -30px !important; }
.bonus-path { top: 30px !important; left: -70px !important; opacity: 1 !important; filter: drop-shadow(0 1px 1px rgba(27,42,68,.6)); }

#bonus-promo img.bonus-promo-double { width: 38px !important; height: 38px !important; border-radius: 0 !important; object-fit: contain !important; filter: none !important; right: -12px; top: -16px; position: absolute; }

/* ======================================================================
   Forside, ryddet op (10. okt.): én tydelig midte, ingen overlap.
   ====================================================================== */
/* Toasten vises øverst i midten, så den aldrig dækker kortene i bunden. */
.app-status { right: auto !important; left: 50% !important; bottom: auto !important; top: max(14px, env(safe-area-inset-top)) !important;
    transform: translate(-50%, -20px) !important; text-align: center; max-width: min(90vw, 520px); }
.app-status.visible { transform: translate(-50%, 0) !important; }
/* Midterkolonnen: SPIL øverst, derunder Quick Play og Ugens bonus side om side. */
#main-menu .menu-actions { width: min(46vw, 460px) !important; left: calc(50% - min(23vw, 230px)) !important; top: 25vh !important;
    display: flex !important; flex-direction: column; align-items: stretch; gap: 1.6vh; }
#main-menu .play-button { width: 100% !important; margin: 0 !important; }
.menu-secondary { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 10px; align-items: stretch; margin-top: 4px; }
#main-menu .quick-play-button { position: static !important; width: 100% !important; margin: 0 !important; min-height: 52px; border-radius: 16px;
    background: rgba(8,20,32,.78) !important; box-shadow: 0 4px 0 rgba(8,20,32,.5); display: flex; align-items: center; justify-content: center; }
#main-menu .quick-play-button .ui-house { font-size: clamp(14px, 3.6vh, 20px) !important; }
.menu-secondary .bonus-promo { position: relative !important; left: auto !important; right: auto !important; top: auto !important; transform: none !important;
    width: 100% !important; height: auto !important; min-height: 52px; }
#main-menu .install-button { position: fixed !important; }
/* Flokken-kortet midt for SPIL i højden. */
.flok-promo { top: 25vh !important; }
/* Dagens rute: navn og "SPIL"/"KLARET" overlapper ikke. */
#daily-btn.daily-card { grid-template-columns: auto 1fr !important; }
#daily-btn #daily-state { position: absolute; right: 12px; top: 8px; font-size: 9px !important; letter-spacing: .1em; }
#daily-btn strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Lave skærme (iPhone på tværs): lidt tættere. */
@media (max-height: 430px) {
    #main-menu .menu-actions { top: 23vh !important; gap: 1.2vh; }
    .menu-secondary { gap: 8px; }
    #main-menu .quick-play-button, .menu-secondary .bonus-promo { min-height: 46px; }
}
/* Rækken under SPIL: fleksibel, så Ugens bonus fylder det hele, når Quick Play ikke vises endnu. */
.menu-secondary { display: flex !important; gap: 10px; }
.menu-secondary > .quick-play-button { flex: 0.8 1 0; }
.menu-secondary > .bonus-promo { flex: 1.2 1 0; }
.menu-secondary > .hidden { display: none !important; }
#main-menu .menu-actions { width: min(38vw, 400px) !important; left: calc(50% - min(19vw, 200px)) !important; }
#main-menu .menu-bird { left: calc(var(--pad, 16px) + 7vw) !important; }
.menu-secondary .bonus-promo strong { font-size: clamp(11px, 3vh, 14px) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-secondary .bonus-promo small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.bonus-promo-text { max-width: 70%; overflow: hidden; }
/* Smalle telefoner (fx iPhone SE på tværs): mindre tekst i bundkortene i stedet for afkortede ord. */
@media (max-width: 700px) {
    .bottom-cards .daily-kicker, #hero-selector > span, #missions-btn span { font-size: 9px !important; letter-spacing: .06em !important; }
    #hero-selector strong, #daily-btn strong { font-size: 12px !important; }
    .flok-promo small { display: none; }
}
@media (orientation: landscape) and (max-width: 720px) {
    #main-menu #missions-btn span { display: block !important; font-size: 11px !important; }
    #hero-selector > span, #daily-btn .daily-kicker { font-size: 8px !important; letter-spacing: .04em !important; white-space: nowrap; }
    #hero-selector strong, #daily-btn strong { font-size: 12px !important; }
    #daily-btn #daily-state { display: none !important; }
}
@media (orientation: landscape) and (max-width: 720px) {
    #main-menu #hero-selector > span, #main-menu #daily-btn .daily-kicker { font-size: 8px !important; letter-spacing: .03em !important; overflow: visible !important; text-overflow: clip !important; max-width: none !important; }
    #main-menu #hero-selector > strong, #main-menu #daily-btn > strong { font-size: 11px !important; overflow: visible !important; text-overflow: clip !important; max-width: none !important; }
}

/* ---- Forsiden: tre kolonner, der tager højde for kameraøen i siderne (10. okt.) ----
   Venstre: træ og helt (ca. 6–30 %), midten: SPIL (35–65 %), højre: Flokken (fra 70 %). */
#main-menu .menu-actions { width: 30vw !important; left: calc(50% - 15vw) !important; }
.flok-promo { width: 22vw !important; max-width: 250px; right: calc(env(safe-area-inset-right, 0px) + 1.5vw) !important; }
#main-menu .menu-bird { left: calc(env(safe-area-inset-left, 0px) + 6vw) !important; width: min(17vw, 190px) !important; }
#main-menu .menu-nest { left: calc(env(safe-area-inset-left, 0px) + 1vw) !important; width: min(24vw, 250px) !important; }
.menu-secondary { gap: 8px !important; }
.menu-secondary > .quick-play-button { flex: 0.75 1 0 !important; }
#main-menu .quick-play-button .ui-house { font-size: clamp(12px, 3.2vh, 18px) !important; white-space: nowrap; }
.flok-promo-new[hidden] { display: none !important; }
/* Dagens rute: status i hjørnet, navnet får hele linjen. */
#main-menu #daily-btn #daily-state { position: absolute !important; right: 14px !important; top: 9px !important; grid-column: auto !important; grid-row: auto !important; font-size: 9px !important; }
#main-menu #daily-btn > strong { grid-column: 2 / -1 !important; }

/* Kort før banen starter: hvad går banen ud på (10. okt.) */
.level-intro { position: absolute; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(78vw, 560px); padding: 14px 20px 12px;
    border-radius: 18px; background: rgba(8,20,32,.86); border: 2px solid rgba(255,217,138,.8); color: #fff; text-align: center; pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: intro-in .25s ease-out; }
.level-intro.hidden { display: none; }
.level-intro p { margin: 0; }
.intro-group { font-size: 10px; font-weight: 900; letter-spacing: .14em; color: #b6ff3b; }
.intro-name { margin: 2px 0 6px; font: 900 clamp(22px, 6vh, 32px) "Bert Display", sans-serif; letter-spacing: .04em; text-shadow: 0 3px 0 #0a2342; }
.intro-goal { font-size: clamp(13px, 3.6vh, 16px); font-weight: 800; line-height: 1.35; }
.intro-controls { margin-top: 6px !important; font-size: 11px; font-weight: 900; letter-spacing: .06em; color: #8fd6ff; }
.intro-medals { margin-top: 4px !important; font-size: 11px; font-weight: 800; color: #ffd98a; }
.intro-start { margin-top: 10px !important; font: 900 13px "Bert Display", sans-serif; letter-spacing: .12em; color: #b6ff3b; animation: intro-blink 1.2s ease-in-out infinite; }
@keyframes intro-in { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes intro-blink { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .level-intro, .intro-start { animation: none; } }

/* Introkort med ikoner (runde 10) */
.level-intro { padding-top: 34px !important; }
.intro-type { position: absolute; left: 50%; top: -30px; width: 60px; height: 60px; transform: translateX(-50%); filter: drop-shadow(0 3px 0 rgba(0,0,0,.3)); }
.intro-control { display: block; width: 120px; height: auto; margin: 6px auto 0; }
.intro-controls { margin-top: 2px !important; }
.intro-medals { display: flex; justify-content: center; align-items: center; gap: 4px; }
.intro-medal { width: 20px; height: 20px; }
.intro-medal[hidden] { display: none; }
@media (max-height: 430px) { .intro-control { width: 92px; } .level-intro { padding-top: 30px !important; padding-bottom: 8px !important; } .intro-start { margin-top: 6px !important; } }

/* Turens højdepunkter på resultatskærmen */
.result-highlights { list-style: none; margin: 6px auto 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 760px; }
.result-highlights.hidden { display: none; }
.result-highlights li { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 12px; background: rgba(8,20,32,.82); color: #fff;
    font-size: 12px; font-weight: 800; opacity: 0; animation: hl-in .35s ease-out forwards; }
.result-highlights li span { font-size: 15px; }
@keyframes hl-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .result-highlights li { animation: none; opacity: 1; } }
.book-tab[data-book="runs"]::before { background-image: url(assets/v2/g6/ui/challenge-hard.webp); }
#game-over .result-highlights { grid-column: 1 / -1 !important; width: 100%; max-width: 760px; justify-self: center; margin: 4px auto 2px !important; }
#game-over .result-highlights li { font-size: 11px; padding: 4px 9px; }
#game-over #result-progress { display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 11px !important; }

/* Samlefigurer */
.figures-icon { font-size: 26px; width: 34px; text-align: center; }
.figure-album { position: relative; width: min(94vw, 820px); max-height: 92vh; overflow: auto; padding: 16px 22px; border-radius: 18px; background: #123a6b; border: 3px solid #ffd98a; color: #fff; }
.figure-album h2 { margin: 0 0 8px; text-align: center; font: 900 22px "Bert Display", sans-serif; color: #ffd98a; }
.figure-album .round-close { position: absolute; right: 10px; top: 10px; }
.figure-bar { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.figure-bar .coins { font-weight: 900; font-size: 18px; background: rgba(0,0,0,.25); padding: 6px 12px; border-radius: 12px; }
.pack-btn, .swap-btn { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 900; letter-spacing: .06em; cursor: pointer; }
.pack-btn { background: #b6ff3b; color: #123018; box-shadow: 0 4px 0 #3c7a12; }
.swap-btn { background: #ffd98a; color: #3a2a1a; box-shadow: 0 4px 0 #a37a2a; }
.pack-btn[disabled], .swap-btn[disabled] { filter: grayscale(.9); opacity: .7; box-shadow: none; }
.figure-album .odds { text-align: center; font-size: 11px; opacity: .8; margin: 6px 0 10px; }
.figure-series h3 { margin: 10px 0 6px; font: 900 15px "Bert Display", sans-serif; letter-spacing: .06em; }
.figure-series h3 small { color: #ffd98a; }
.figure-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.figure-card { position: relative; aspect-ratio: 1; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.1); border: 3px solid #9fb3c8; overflow: hidden; }
.figure-card img { width: 86%; height: 86%; object-fit: contain; }
.figure-emoji { font-size: clamp(22px, 5vw, 40px); }
.figure-card b { position: absolute; left: 4px; top: 2px; font-size: 9px; opacity: .75; }
.figure-card i { position: absolute; right: 4px; bottom: 2px; font-style: normal; font-size: 10px; font-weight: 900; color: #ffd98a; }
.figure-card.rare { border-color: #3fa9ff; } .figure-card.epic { border-color: #b46bff; } .figure-card.legendary { border-color: #ffc21a; box-shadow: 0 0 12px rgba(255,194,26,.6); }
.figure-card.missing img, .figure-card.missing .figure-emoji { filter: brightness(0) opacity(.25); }
.pack-reveal { display: flex; justify-content: center; gap: 12px; margin: 6px 0 4px; }
.pack-reveal .figure-card { width: 120px; opacity: 0; animation: figure-flip .5s ease-out forwards; }
.pack-reveal small { position: absolute; top: 4px; right: 6px; font-weight: 900; font-size: 10px; color: #b6ff3b; }
.pack-reveal em { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font-style: normal; font-size: 10px; font-weight: 900; }
@keyframes figure-flip { from { opacity: 0; transform: rotateY(90deg) scale(.8); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pack-reveal .figure-card { animation: none; opacity: 1; } }
@media (max-width: 700px) { .figure-grid { grid-template-columns: repeat(4, 1fr); } }

/* Runde 12: rigtig grafik til samlefigurerne */
.figure-album { background: linear-gradient(rgba(12,30,60,.78), rgba(12,30,60,.86)), url(assets/v2/g12/album-bg.webp) center / cover no-repeat !important; }
.figure-card { border: 0 !important; background: url(assets/v2/g12/card-common.webp) center / 100% 100% no-repeat !important; box-shadow: none !important; }
.figure-card.rare { background-image: url(assets/v2/g12/card-rare.webp) !important; }
.figure-card.epic { background-image: url(assets/v2/g12/card-epic.webp) !important; }
.figure-card.legendary { background-image: url(assets/v2/g12/card-legendary.webp) !important; }
.figure-card img { width: 78% !important; height: 78% !important; }
.figure-card b { color: #1b2a44; opacity: .8; left: 10px; top: 8px; }
.figure-card i { color: #1b2a44; right: 10px; bottom: 6px; }
.figure-card.missing { filter: saturate(.3) brightness(.75); }
.figure-bar .coins { display: inline-flex; align-items: center; gap: 6px; }
.figure-bar .coins img { width: 26px; height: 26px; }
.pack-btn img, .swap-btn img { width: 26px; height: 32px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.pack-burst { position: absolute; inset: 0; display: grid; place-items: center; z-index: 5; pointer-events: none; }
.pack-burst img { grid-area: 1 / 1; width: min(40vw, 240px); }
.pack-burst img:first-child { animation: pack-shake .5s ease-in-out 2; }
.pack-burst img.open { opacity: 0; animation: pack-open .4s ease-out .65s forwards; }
@keyframes pack-shake { 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes pack-open { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: scale(1.1); } }
.pack-reveal small, .pack-reveal em { color: #1b2a44 !important; }

/* Resultatskærm, oprydning 10. okt.: alt inden for skærmen, intet hen over stat-kortet.
   Medalje til venstre, højdepunkter i midten, mission og rede til højre. Udfordr en ven står i knaprækken. */
#game-over .result-summary { display: grid !important; grid-template-columns: auto minmax(0, 1.25fr) minmax(0, 1fr); grid-template-rows: auto auto;
    align-items: center; gap: 4px 10px; width: min(94vw, 820px); min-height: 0 !important; height: auto !important; margin: 6px auto 0 !important; }
#game-over #result-medal { grid-column: 1; grid-row: 1 / span 2; width: 78px !important; height: 78px !important; margin: 0 !important; align-self: center; }
#game-over #result-medal img { width: 46px !important; height: 46px !important; }
#game-over #result-medal strong { font-size: 11px !important; }
#game-over .result-highlights { grid-column: 2 !important; grid-row: 1 / span 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px;
    width: auto; max-width: none; margin: 0 !important; align-self: center; }
#game-over .result-highlights.hidden { display: none; }
#game-over .result-highlights li { min-width: 0; font-size: 10.5px; line-height: 1.2; padding: 4px 8px; }
#game-over .result-highlights li > :not(span) , #game-over .result-highlights li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#game-over .result-highlights li span { flex: 0 0 auto; font-size: 13px; }
#game-over #result-progress, #game-over #result-nest { grid-column: 3; max-width: none; width: auto; margin: 0 !important; padding: 5px 9px !important; text-align: left;
    font-size: 10.5px !important; line-height: 1.25; letter-spacing: .02em !important; display: -webkit-box !important; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
#game-over #result-progress { grid-row: 1; }
#game-over #result-nest { grid-row: 2; }
#game-over #result-nest.hidden { display: none !important; }
#game-over #result-progress:only-of-type { grid-row: 1 / span 2; }
#game-over .result-highlights.hidden ~ #result-progress, #game-over .result-highlights.hidden ~ #result-nest { grid-column: 2 / -1; }
#game-over .result-actions { width: auto !important; margin-top: 8px !important; gap: 10px; flex-wrap: nowrap; }
#game-over .result-actions .challenge-button { order: 3; transform: none !important; margin: 0 !important; min-height: 48px; padding: 6px 14px !important; font-size: 12px !important;
    border: 0 !important; border-image: none !important; white-space: nowrap; }
#game-over .result-actions .challenge-button img { width: 44px !important; height: 22px !important; }
#game-over .result-actions .challenge-button * { color: inherit !important; }
@media (max-height: 420px) {
    #game-over .result-kicker { margin-bottom: 0 !important; }
    #game-over .result-actions button:first-child { min-height: 54px; min-width: 200px; font-size: 22px !important; }
}
#game-over .result-highlights li { white-space: normal; text-overflow: clip; }
#game-over .score-icons .score-streak-icon { width: 84px; height: 42px; object-fit: contain; transform: scale(1.35); }

.feedback-btn { display: block; margin: 8px auto 2px; border: 0; border-radius: 12px; padding: 9px 16px; background: #ffd98a; color: #3a2a1a; font-weight: 900; letter-spacing: .08em; cursor: pointer; box-shadow: 0 3px 0 #a37a2a; }

.journey-arrival { position: fixed; z-index: 60; left: 50%; top: 50%; width: min(80vw, 760px); transform: translate(-50%, -50%); pointer-events: none;
    animation: arrival-in 3.2s ease-out forwards; filter: drop-shadow(0 10px 20px rgba(0,0,0,.35)); }
@keyframes arrival-in { 0% { opacity: 0; transform: translate(-50%, -40%) scale(.8); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; } }

.privacy-link { display: block; text-align: center; color: #bfe9ff; font-size: 11px; font-weight: 800; margin: 4px 0; }
/* Udfordringsrækker: tal og knap får plads, bjælken kan ses (feedback 11. okt.) */
.mission-row { grid-template-columns: minmax(0, 1fr) minmax(70px, 160px) auto auto !important; }
.mission-row[data-difficulty], .weekly-list .mission-row { grid-template-columns: auto minmax(0, 1fr) minmax(70px, 160px) auto auto !important; }
.mission-row strong { overflow: hidden; text-overflow: ellipsis; }
.mission-row b { white-space: nowrap; min-width: 78px; font-size: 11px !important; }
.mission-row .mission-claim { min-width: 0 !important; padding-left: 12px !important; padding-right: 12px !important; }
.mission-row .mission-track { height: 18px !important; box-sizing: border-box; border-width: 4px !important; border-image-width: 4px !important; padding: 0; background: rgba(0,0,0,.35) !important; }
.mission-row .mission-track i { min-width: 0; height: 100% !important; border-radius: 6px; }

.google-login { background: #fff !important; color: #1f1f1f !important; box-shadow: 0 3px 0 #9aa7b5 !important; }
.google-login[hidden] { display: none; }
