/* CuginiParty — Cube Rush */

.cube-rush-page {
    --cr-ink: #15283a;
    --cr-muted: #617386;
    --cr-paper: #f7fbfa;
    --cr-line: rgba(20, 52, 67, .14);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: clip;
    background:
        linear-gradient(rgba(255,255,255,.72), rgba(255,255,255,.9)),
        repeating-linear-gradient(135deg, rgba(8,127,140,.08) 0 1px, transparent 1px 18px),
        #eaf5f3;
    color: var(--cr-ink);
}

.cube-rush-container { max-width: 1180px; }
.cube-rush-topbar { margin-bottom: clamp(16px, 3vw, 28px); }

.cube-rush-top-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #315263;
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .14em;
}

.cube-rush-top-label > span {
    width: 9px;
    height: 9px;
    transform: rotate(45deg);
    background: #f0b429;
    box-shadow: 0 0 0 3px rgba(240,180,41,.18);
}

.cube-rush-menu {
    width: min(100%, 1080px);
    margin: 0 auto;
}

.cube-rush-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(18px, 4vw, 34px);
    margin: 6px auto 30px;
}

.cube-rush-logo {
    position: relative;
    flex: 0 0 auto;
    width: clamp(76px, 11vw, 112px);
    aspect-ratio: 1;
    transform: rotate(-7deg);
    border: clamp(6px, .8vw, 9px) solid #163f4f;
    border-radius: 18%;
    background: #2ec4b6;
    box-shadow: 8px 9px 0 #f0b429, 0 22px 38px rgba(18,79,87,.2);
}

.cube-rush-logo::before,
.cube-rush-logo::after {
    content: "";
    position: absolute;
    top: 29%;
    width: 17%;
    aspect-ratio: 1;
    border-radius: 2px;
    background: #163f4f;
}

.cube-rush-logo::before { left: 21%; }
.cube-rush-logo::after { right: 21%; }

.cube-rush-logo span {
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 21%;
    height: 15%;
    border: 5px solid #163f4f;
    border-top: 0;
}

.cube-rush-logo i {
    position: absolute;
    width: 14%;
    aspect-ratio: 1;
    background: #fff8d8;
}

.cube-rush-logo i:nth-of-type(1) { top: 8%; right: 9%; }
.cube-rush-logo i:nth-of-type(2) { bottom: 8%; left: 8%; }

.cube-rush-kicker {
    color: #087f8c;
    font-size: clamp(.65rem, 1.2vw, .78rem);
    font-weight: 950;
    letter-spacing: .22em;
}

.cube-rush-hero h1 {
    margin: 4px 0 3px;
    color: #163f4f;
    font-size: clamp(3rem, 9vw, 6.4rem);
    font-weight: 950;
    line-height: .86;
    letter-spacing: -.075em;
    text-transform: uppercase;
    text-shadow: 0 5px 0 rgba(240,180,41,.32);
}

.cube-rush-hero p {
    margin: 10px 0 0;
    color: var(--cr-muted);
    font-size: clamp(.9rem, 1.7vw, 1.08rem);
    font-weight: 700;
}

.cube-rush-menu-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding-bottom: 13px;
    border-bottom: 2px solid rgba(22,63,79,.12);
}

.cube-rush-mode-switch,
.cube-rush-audio-switches {
    display: flex;
    gap: 8px;
}

.cube-rush-mode-switch button,
.cube-rush-audio-switches button {
    min-height: 42px;
    padding: 9px 14px;
    border: 2px solid rgba(22,63,79,.16);
    border-radius: 10px;
    background: #fff;
    color: #536b77;
    font: inherit;
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .08em;
    cursor: pointer;
    touch-action: manipulation;
}

.cube-rush-mode-switch button.is-active {
    border-color: #163f4f;
    background: #163f4f;
    color: #fff;
    box-shadow: 4px 4px 0 #f0b429;
}

.cube-rush-audio-switches button span { color: #0a927f; }
.cube-rush-audio-switches button[aria-pressed="false"] span { color: #a3493e; }

.cube-rush-levels {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.cube-rush-level-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 2px solid var(--level-edge);
    border-radius: 18px;
    background: var(--level-paper);
    box-shadow: 0 13px 30px rgba(27,52,61,.12);
}

.cube-rush-level-art {
    position: relative;
    height: 148px;
    overflow: hidden;
    background: var(--level-bg);
}

.cube-rush-level-art::before {
    content: "";
    position: absolute;
    inset: auto -12% 18px -12%;
    height: 46px;
    transform: skewX(-18deg);
    border-top: 4px solid var(--level-bright);
    background: var(--level-ground);
    box-shadow: 0 18px 0 var(--level-ground);
}

.cube-rush-level-art::after {
    content: "";
    position: absolute;
    width: 36px;
    height: 36px;
    left: 19%;
    bottom: 64px;
    transform: rotate(18deg);
    border: 4px solid var(--level-player-edge);
    background: var(--level-player);
    box-shadow: 54px -11px 0 -12px var(--level-bright), 105px 30px 0 -8px var(--level-danger);
}

.cube-rush-level-number {
    position: absolute;
    top: 12px;
    left: 13px;
    z-index: 1;
    color: rgba(255,255,255,.9);
    font-size: .65rem;
    font-weight: 950;
    letter-spacing: .16em;
}

.cube-rush-level-card[data-level="prisma-coast"] {
    --level-edge: #0d7e8a; --level-paper: #f4fffd; --level-bg: linear-gradient(145deg,#27bdd0,#8eead5);
    --level-ground: #087f8c; --level-bright: #ffdc62; --level-player: #fff; --level-player-edge: #145467; --level-danger: #ff6b4a;
}

.cube-rush-level-card[data-level="foundry-beat"] {
    --level-edge: #9e3f20; --level-paper: #fff9ef; --level-bg: linear-gradient(145deg,#2f3034,#df5a25);
    --level-ground: #202124; --level-bright: #ffc857; --level-player: #fff2d2; --level-player-edge: #772d18; --level-danger: #f24c2e;
}

.cube-rush-level-card[data-level="voltage-core"] {
    --level-edge: #315f46; --level-paper: #f7fff4; --level-bg: linear-gradient(145deg,#090d12,#123e61);
    --level-ground: #080b0f; --level-bright: #a6ff39; --level-player: #f5f7ff; --level-player-edge: #1b63d2; --level-danger: #a8142c;
}

.cube-rush-level-card[data-level="obsidian-switch"] {
    --level-edge: #6c3c8f; --level-paper: #fbf6ff; --level-bg: linear-gradient(145deg,#171631,#6b2f79);
    --level-ground: #100c22; --level-bright: #f0b429; --level-player: #fff7e8; --level-player-edge: #48266b; --level-danger: #ff4f7b;
}

.cube-rush-level-card[data-level="neon-cathedral"] {
    --level-edge: #087f8c; --level-paper: #f1ffff; --level-bg: linear-gradient(145deg,#062438,#08a7ad);
    --level-ground: #03151e; --level-bright: #f5e960; --level-player: #effdff; --level-player-edge: #075467; --level-danger: #ff4e8a;
}

.cube-rush-level-card[data-level="apex-protocol"] {
    --level-edge: #3d3aa5; --level-paper: #f8f7ff; --level-bg: linear-gradient(145deg,#090c18,#34338a);
    --level-ground: #04050c; --level-bright: #61f4de; --level-player: #ffffff; --level-player-edge: #3325aa; --level-danger: #ff365e;
}

.cube-rush-level-body { padding: 17px; }

.cube-rush-level-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.cube-rush-level-heading h2 {
    margin: 0;
    color: var(--cr-ink);
    font-size: 1.2rem;
    line-height: 1.05;
    letter-spacing: -.035em;
    text-transform: uppercase;
}

.cube-rush-difficulty {
    padding: 4px 7px;
    border: 1px solid var(--level-edge);
    border-radius: 6px;
    color: var(--level-edge);
    font-size: .56rem;
    font-weight: 950;
    letter-spacing: .09em;
}

.cube-rush-level-body > p {
    min-height: 42px;
    margin: 9px 0 14px;
    color: var(--cr-muted);
    font-size: .78rem;
    line-height: 1.45;
}

.cube-rush-level-progress {
    display: grid;
    gap: 7px;
    margin-bottom: 13px;
}

.cube-rush-progress-row {
    display: grid;
    grid-template-columns: minmax(76px, max-content) minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
}

.cube-rush-card-progress-label {
    color: var(--cr-muted);
    font-size: .49rem;
    font-weight: 950;
    letter-spacing: .04em;
    white-space: nowrap;
}

.cube-rush-card-progress-track {
    height: 7px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(22,63,79,.12);
}

.cube-rush-card-progress-track i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--level-edge);
}

.cube-rush-progress-row strong {
    min-width: 34px;
    color: var(--level-edge);
    font-size: .72rem;
    text-align: right;
}

.cube-rush-progress-row.is-practice .cube-rush-card-progress-track i {
    background: #35e4f2;
    box-shadow: 0 0 5px rgba(53,228,242,.38);
}

.cube-rush-progress-row.is-practice strong { color: #079eaf; }

.cube-rush-play-button {
    width: 100%;
    min-height: 43px;
    border: 0;
    border-radius: 9px;
    background: var(--level-edge);
    color: #fff;
    font: inherit;
    font-size: .72rem;
    font-weight: 950;
    letter-spacing: .11em;
    cursor: pointer;
    touch-action: manipulation;
}

.cube-rush-play-button:hover { filter: brightness(1.08); }

.cube-rush-complete-mark {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    border: 2px solid rgba(255,255,255,.9);
    border-radius: 50%;
    background: #0b9b6d;
    color: #fff;
    font-weight: 950;
}

.cube-rush-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 22px;
    overflow: hidden;
    border: 1px solid var(--cr-line);
    border-radius: 13px;
    background: var(--cr-line);
}

.cube-rush-stats > div {
    padding: 13px 9px;
    background: rgba(255,255,255,.88);
    text-align: center;
}

.cube-rush-stats span,
.cube-rush-result-grid span {
    display: block;
    color: var(--cr-muted);
    font-size: .56rem;
    font-weight: 950;
    letter-spacing: .11em;
}

.cube-rush-stats strong {
    display: block;
    margin-top: 3px;
    font-size: 1.15rem;
    font-variant-numeric: tabular-nums;
}

.cube-rush-game { width: 100%; }

.cube-rush-hud {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(200px, 430px) minmax(120px, 1fr);
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
    color: #173c4b;
}

.cube-rush-hud-left { display: flex; flex-direction: column; }
.cube-rush-hud-left span { font-size: .66rem; font-weight: 950; letter-spacing: .12em; }
.cube-rush-hud-left strong { margin-top: 2px; font-size: .9rem; }

.cube-rush-progress {
    position: relative;
    height: 20px;
    overflow: hidden;
    border: 2px solid #173c4b;
    border-radius: 5px;
    background: rgba(255,255,255,.78);
}

.cube-rush-progress > span {
    display: block;
    width: 0;
    height: 100%;
    background: #2ec4b6;
}

.cube-rush-progress strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #14313d;
    font-size: .62rem;
    font-variant-numeric: tabular-nums;
}

.cube-rush-hud-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.cube-rush-hud-right > span {
    color: #173c4b;
    font-size: .66rem;
    font-weight: 950;
    letter-spacing: .1em;
}

.cube-rush-hud-right button {
    display: grid;
    width: 39px;
    height: 39px;
    place-items: center;
    border: 2px solid #173c4b;
    border-radius: 8px;
    background: #fff;
    color: #173c4b;
    font: inherit;
    font-size: 1rem;
    font-weight: 950;
    cursor: pointer;
}

.cube-rush-stage {
    position: relative;
    width: 100%;
    overflow: hidden;
    border: 4px solid #143847;
    border-radius: 13px;
    background: #092431;
    box-shadow: 0 20px 45px rgba(9,36,49,.24), 7px 7px 0 #f0b429;
}

.cube-rush-stage > .cube-rush-hud {
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 10px;
    left: 10px;
    margin: 0;
}

#cubeRushCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    outline: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#cubeRushCanvas:focus-visible { box-shadow: inset 0 0 0 4px rgba(255,220,98,.75); }

.cube-rush-center-message {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    pointer-events: none;
    color: #fff;
    font-size: clamp(2rem, 7vw, 5rem);
    font-weight: 950;
    letter-spacing: -.05em;
    text-shadow: 0 5px 0 rgba(0,0,0,.25);
}

.cube-rush-center-message.is-death { animation: cr-death-message .5s ease both; }
@keyframes cr-death-message { 0% { opacity: 0; transform: scale(.8); } 25% { opacity: 1; transform: scale(1.04); } 100% { opacity: 0; transform: scale(.96); } }

.cube-rush-practice-badge {
    position: absolute;
    top: 60px;
    left: 10px;
    z-index: 2;
    padding: 5px 8px;
    border: 2px solid #fff;
    border-radius: 6px;
    background: #e64a35;
    color: #fff;
    font-size: .58rem;
    font-weight: 950;
    letter-spacing: .12em;
}

.cube-rush-controls-hint {
    position: absolute;
    right: 12px;
    bottom: 10px;
    display: flex;
    gap: 8px;
    align-items: center;
    color: rgba(255,255,255,.76);
    font-size: .55rem;
    font-weight: 800;
    pointer-events: none;
}

.cube-rush-controls-hint span:first-child {
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,.5);
    border-radius: 4px;
}

.cube-rush-stage.is-dead::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: rgba(255,255,255,.5);
    animation: cr-death-flash .34s ease-out both;
}

@keyframes cr-death-flash { from { opacity: 1; } to { opacity: 0; } }

.cube-rush-overlay {
    position: fixed;
    z-index: 120;
    inset: 0;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    background: rgba(7,25,34,.72);
    backdrop-filter: blur(8px);
}

.cube-rush-overlay[hidden] { display: none; }

.cube-rush-dialog {
    width: min(100%, 430px);
    padding: 26px;
    border: 3px solid #173c4b;
    border-radius: 15px;
    background: #f8fffd;
    box-shadow: 8px 8px 0 #f0b429, 0 26px 80px rgba(0,0,0,.35);
    text-align: center;
}

.cube-rush-dialog-mark {
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    margin: 0 auto 11px;
    border-radius: 10px;
    background: #173c4b;
    color: #fff;
    font-size: 1.55rem;
    font-weight: 950;
}

.cube-rush-dialog-eyebrow {
    margin: 0 0 5px;
    color: #087f8c;
    font-size: .65rem;
    font-weight: 950;
    letter-spacing: .15em;
}

.cube-rush-dialog h2 {
    margin: 0;
    color: #173c4b;
    font-size: clamp(1.55rem, 5vw, 2.25rem);
    letter-spacing: -.045em;
}

.cube-rush-dialog > p:not(.cube-rush-dialog-eyebrow) { color: var(--cr-muted); font-weight: 700; }

.cube-rush-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-top: 20px;
}

.cube-rush-dialog-actions .game-button:first-child { grid-column: 1 / -1; }

.cube-rush-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 17px;
}

.cube-rush-result-grid > div {
    padding: 10px 6px;
    border: 1px solid var(--cr-line);
    border-radius: 8px;
    background: #edf7f4;
}

.cube-rush-result-grid strong { display: block; margin-top: 3px; color: #173c4b; font-size: 1rem; }

.cube-rush-complete-burst { position: relative; width: 70px; height: 58px; margin: 0 auto 5px; }
.cube-rush-complete-burst span { position: absolute; width: 28px; height: 28px; transform: rotate(45deg); background: #2ec4b6; }
.cube-rush-complete-burst span:nth-child(1) { left: 21px; top: 16px; background: #f0b429; }
.cube-rush-complete-burst span:nth-child(2) { left: 0; top: 2px; transform: rotate(22deg) scale(.45); }
.cube-rush-complete-burst span:nth-child(3) { right: 0; bottom: 2px; transform: rotate(68deg) scale(.42); background: #ff6b4a; }

.cube-rush-rotate-hint,
.cube-rush-rotate-hint[hidden] { display: none; }

body.dark-mode .cube-rush-page {
    --cr-ink: #edf7f7;
    --cr-muted: #a7bbc1;
    --cr-paper: #101c24;
    --cr-line: rgba(194,225,225,.14);
    background:
        linear-gradient(rgba(9,22,29,.89), rgba(9,22,29,.97)),
        repeating-linear-gradient(135deg, rgba(46,196,182,.11) 0 1px, transparent 1px 18px),
        #09161d;
}

body.dark-mode .cube-rush-top-label,
body.dark-mode .cube-rush-hud { color: #c8dede; }
body.dark-mode .cube-rush-hero h1 { color: #e8f8f5; }
body.dark-mode .cube-rush-level-card { background: #13232b; }
body.dark-mode .cube-rush-level-heading h2 { color: #eef9f7; }
body.dark-mode .cube-rush-level-card[data-level] { --level-paper: #13232b; }
body.dark-mode .cube-rush-mode-switch button,
body.dark-mode .cube-rush-audio-switches button { background: #12242c; color: #c0d4d7; border-color: rgba(198,229,229,.18); }
body.dark-mode .cube-rush-mode-switch button.is-active { background: #2ec4b6; color: #09202a; border-color: #2ec4b6; }
body.dark-mode .cube-rush-stats > div { background: #12242c; }
body.dark-mode .cube-rush-progress { background: rgba(9,24,31,.75); border-color: #c4dcdc; }
body.dark-mode .cube-rush-progress strong,
body.dark-mode .cube-rush-hud-right > span { color: #f0f9f8; }
body.dark-mode .cube-rush-hud-right button { background: #142a34; color: #eef9f7; border-color: #c4dcdc; }
body.dark-mode .cube-rush-dialog { background: #12242c; border-color: #c3dddd; }
body.dark-mode .cube-rush-dialog h2,
body.dark-mode .cube-rush-result-grid strong { color: #eef9f7; }
body.dark-mode .cube-rush-result-grid > div { background: #0d1d24; }

@media (max-width: 820px) {
    .cube-rush-levels { gap: 11px; }
    .cube-rush-level-art { height: 120px; }
    .cube-rush-level-body { padding: 13px; }
    .cube-rush-level-heading { display: block; }
    .cube-rush-difficulty { display: inline-block; margin-top: 7px; }
    .cube-rush-hud { grid-template-columns: 130px 1fr 105px; gap: 8px; }
}

@media (max-width: 680px) {
    .cube-rush-page { padding-left: 11px; padding-right: 11px; }
    .cube-rush-hero { justify-content: flex-start; margin-bottom: 22px; }
    .cube-rush-logo { width: 72px; border-width: 6px; box-shadow: 5px 6px 0 #f0b429; }
    .cube-rush-hero h1 { font-size: clamp(2.55rem, 14vw, 4.2rem); }
    .cube-rush-menu-bar { align-items: stretch; flex-direction: column; }
    .cube-rush-mode-switch button { flex: 1; }
    .cube-rush-audio-switches { justify-content: space-between; }
    .cube-rush-audio-switches button { flex: 1; }
    .cube-rush-levels { grid-template-columns: 1fr; }
    .cube-rush-level-card { display: grid; grid-template-columns: 38% 62%; }
    .cube-rush-level-art { height: 100%; min-height: 170px; }
    .cube-rush-level-body > p { min-height: 0; }
    .cube-rush-stats { grid-template-columns: repeat(2, 1fr); }
    .cube-rush-hud { grid-template-columns: auto 1fr auto; }
    .cube-rush-hud-left strong, .cube-rush-hud-right > span { display: none; }
    .cube-rush-progress { min-width: 0; }
    .cube-rush-stage { border-width: 3px; border-radius: 9px; box-shadow: 4px 4px 0 #f0b429; }
    .cube-rush-controls-hint { display: none; }
}

@media (max-width: 460px) {
    .cube-rush-level-card { grid-template-columns: 34% 66%; }
    .cube-rush-level-art::after { left: 14%; }
    .cube-rush-level-heading h2 { font-size: 1rem; }
    .cube-rush-level-body > p { font-size: .7rem; margin-bottom: 9px; }
    .cube-rush-dialog { padding: 21px 16px; }
}

@media (orientation: landscape) and (max-height: 680px) and (max-width: 1100px) {
    html:has(.cube-rush-game:not([hidden])),
    body:has(.cube-rush-game:not([hidden])) { overflow: hidden; }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-page {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
        padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
        background: #092431;
    }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-container {
        width: 100%;
        max-width: none;
        height: 100%;
        margin: 0;
    }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-topbar { display: none; }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-game {
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
    }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-hud {
        grid-template-columns: minmax(118px, 1fr) minmax(130px, 2.4fr) auto;
        top: 8px;
        right: 8px;
        left: 8px;
        width: auto;
        gap: 8px;
        margin: 0;
    }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-hud-left strong,
    body:has(.cube-rush-game:not([hidden])) .cube-rush-hud-right > span { display: block; }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-hud-left strong {
        overflow: hidden;
        max-width: 28vw;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: .76rem;
    }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-hud-right > span { font-size: .58rem; }

    body:has(.cube-rush-game:not([hidden])) .cube-rush-stage {
        display: grid;
        place-items: center;
        width: 100%;
        height: 100%;
        min-height: 0;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    body:has(.cube-rush-game:not([hidden])) #cubeRushCanvas {
        width: 100%;
        height: 100%;
        aspect-ratio: auto;
        object-fit: contain;
    }

    .cube-rush-practice-badge { top: 56px; left: 8px; }
    .cube-rush-controls-hint { right: 7px; bottom: 6px; }
}

@media (orientation: portrait) and (max-width: 680px) and (max-height: 1100px) {
    .cube-rush-rotate-hint:not([hidden]) {
        position: fixed;
        z-index: 110;
        inset: 0;
        display: grid;
        place-content: center;
        padding: 28px;
        background: #0c2430;
        color: #fff;
        text-align: center;
    }

    .cube-rush-rotate-hint > div { width: 50px; height: 76px; margin: 0 auto 18px; border: 4px solid #fff; border-radius: 9px; transform: rotate(90deg); }
    .cube-rush-rotate-hint > div span { display: block; width: 7px; height: 7px; margin: 4px auto; border-radius: 50%; background: #f0b429; }
    .cube-rush-rotate-hint strong { font-size: 1.4rem; }
    .cube-rush-rotate-hint p { max-width: 320px; margin: 8px auto 0; color: #bad0d6; line-height: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
    .cube-rush-center-message.is-death,
    .cube-rush-stage.is-dead::after { animation-duration: .01ms; }
}
