html,
body{
    margin: 0px;
    padding: 0px;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0);
    user-select: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    overflow: hidden;
    overscroll-behavior: none;
}

* {
    touch-action: none;
    /* overscroll-behavior-y: none; */
}

#powerUpGuideOverlay,
#powerUpGuideOverlay *,
#powerUpGuideScroll,
.power-up-guide-scroll {
    touch-action: pan-y;
}

#feedback{
    position: fixed;
    display: none;
    z-index:50000;
    color:aliceblue;
    background-color: rgb(28, 42, 48);
}

#fpsDebug {
    position: fixed;
    top: 6px;
    left: 6px;
    z-index: 2147483647;
    padding: 4px 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: #7fff7f;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(127, 255, 127, 0.35);
    border-radius: 3px;
    pointer-events: none;
    user-select: none;
    max-width: calc(100vw - 12px);
}

#perfDebugOverlay {
    position: fixed;
    left: 6px;
    bottom: 6px;
    z-index: 2147483647;
    max-width: min(92vw, 340px);
    max-height: 45vh;
    overflow: auto;
    margin: 0;
    padding: 6px 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 10px;
    line-height: 1.35;
    color: #9fd3ff;
    background: rgba(0, 0, 0, 0.82);
    border: 1px solid rgba(120, 180, 255, 0.35);
    border-radius: 4px;
    pointer-events: none;
    user-select: none;
    white-space: pre;
}

@font-face{
    font-family: 'BMSpace';
    src: url('src/fonts/BMSpace.ttf');
    
}

@font-face{
    font-family: 'SFPixelate';
    src: url('src/fonts/SFPixelate.ttf');
    
}

@font-face{
    font-family: 'Ambitsek';
    src: url('src/fonts/ambitsek.ttf');
    
}

@font-face{
    font-family: 'elektr_05';
    src: url('src/fonts/elektr_05.ttf');
}

@font-face{
    font-family: '5x5';
    src: url('src/fonts/five_by_five.ttf');
}

@font-face{
    font-family: 'Silkscreen';
    src: url('src/fonts/slkscr.ttf');
}

#useFont{
    font-family: 'BMSpace';
    font-size: 0pt;
}

#useFont2{
    font-family: 'SFPixelate';
    font-size: 0pt;
}

#useFont3{
    font-family: 'Ambitsek';
    font-size: 0pt;
}

#useFont4{
    font-family: 'elektr_05';
    font-size: 0pt;
}

#useFont5{
    font-family: '5x5';
    font-size: 0pt;
}

#useFont6{
    font-family: 'Silkscreen';
    font-size: 0pt;
}

#stickIn{
    position: fixed;
    z-index: 11000;
    width: 100px;
    height: 100px;
    opacity: 0;
    pointer-events: none;
}

#stickOut{
    position: fixed;
    z-index: 11000;
    width: 100px;
    height: 100px;
    opacity: 0;
    pointer-events: none;
}

#loadingImage{

    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
   
    background: linear-gradient(
        rgba(11, 122, 140, 1),
        rgba(0, 200, 0, 0),
        rgba(0, 200, 0, 0),
        rgba(11, 122, 140, 1)
    );
    -webkit-mask: radial-gradient(circle, rgba(0,0,0,0) 65%, rgba(0,0,0,1) 66%);
    mask: radial-gradient(circle, rgba(0,0,0,0) 65%, rgba(0,0,0,1) 66%);
    z-index: 11000;
    pointer-events: none;
    animation: spin 1s linear infinite;
    /* opacity: 0; */

}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

#pushDown{
    display: none;
}

#loadingBack{
    position: fixed;
    width: 100%;
    height: 100%;
    z-index:10000;
    background-color: #000000;
    opacity: 1;
}

#introTextContainer {
    position: fixed;
    display: none;
    z-index: 3500;
    pointer-events: none;
    transform: translate(-50%, -100%);
    text-align: center;
}

.intro-line {
    display: none;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.35em;
    white-space: nowrap;
}

.intro-word-wrap {
    display: inline-block;
    opacity: 0;
}

.intro-word {
    display: inline-block;
    font-family: 'elektr_05', monospace;
    font-size: 30pt;
    font-weight: normal;
    color: #ddd8c4;
    opacity: 1;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

body.is-mobile .intro-word {
    font-size: 18pt;
}

body.is-mobile .intro-line {
    gap: 0.25em;
}

#mycanvas{
    /* border: 1px solid red; */
    height: 100%;
    width: 100%;
    position: fixed;
    z-index:5;
    /* display: none; */
}

/* HTML Hearts Container */
#htmlHeartsContainer {
    position: fixed;
    top: 57px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    display: none;
    gap: 4px;
    align-items: center;
    z-index: 4000;
}

#htmlHeartsContainer .heart {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    opacity: 1;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#htmlHeartsContainer .bullet-shield-charge {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    opacity: 1;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

#htmlHeartsContainer .heart:last-of-type + .bullet-shield-charge {
    margin-left: 8px;
}

body.is-mobile #htmlHeartsContainer {
    transform: scale(0.5);
    transform-origin: top center;
    gap: 2px;
}

body.is-mobile #htmlHeartsContainer .heart:last-of-type + .bullet-shield-charge {
    margin-left: 4px;
}

body.is-mobile #bulletShieldHud {
    transform: translate(-50%, -50%) scale(0.5);
}

body.is-mobile #bulletShieldGraphic {
    width: 24px;
    height: 24px;
}

body.is-mobile #bulletShieldText {
    font-size: 8pt;
}

.ui{
    position: absolute;
    font-family: "Montserrat", sans-serif;
    font-weight: 600;
}

#playButton{
    background: linear-gradient(to bottom, #9e3a3a, #5b221e);
    color: white;
}

#instructionsButton{
    color: white;
}

#topDiv, #bonusDiv, #centerMiddleDiv {
    display: none !important;
}

#upperLeftDiv{
    color: white;
}

#upperRightDiv{
    color: white;
}

/* New Score and Time Display */
#scoreTimeContainer {
    position: fixed;
    top: 12px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    height: auto;
    display: none;
    z-index: 3200;
    line-height: 0;
}

#scoreTimeBack {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

#stealthText {
    position: fixed;
    display: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    color: white;
    font-family: 'elektr_05', monospace;
    font-size: 16pt;
    font-weight: normal;
    text-align: center;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#storePurchaseFlash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    background: #ffffff;
    opacity: 0;
    z-index: 16500;
    pointer-events: none;
}

#bulletShieldHud {
    position: fixed;
    display: none;
    z-index: 100;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

#bulletShieldGraphic {
    display: block;
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    opacity: 1;
}

#bulletShieldText {
    color: white;
    font-family: 'elektr_05', monospace;
    font-size: 16pt;
    font-weight: normal;
    text-align: center;
    white-space: nowrap;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#scoreDisplay,
#timeDisplay {
    position: absolute;
    top: -1px;
    width: 50%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-family: 'elektr_05', monospace;
    font-size: 15pt;
    font-weight: normal;
    text-align: center;
    line-height: 1;
    letter-spacing: 0;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
    pointer-events: none;
}

#scoreDisplay {
    left: 0;
    padding-right: 8px;
}

#timeDisplay {
    right: 0;
    padding-left: 8px;
}

#scoreTimeDivider {
    display: none;
}

:root {
    --coin-meter-bottom: 21px;
    --coin-meter-height: 22px;
    --hud-control-size: 48px;
}

#coinLevelMeter {
    position: fixed;
    left: 50%;
    bottom: var(--coin-meter-bottom);
    width: 236px;
    height: var(--coin-meter-height);
    transform: translateX(-50%);
    z-index: 3500;
    display: none;
    pointer-events: none;
}

.coin-level-meter-wrap {
    position: relative;
    width: 236px;
    height: 22px;
    line-height: 0;
}

.coin-level-meter-bar {
    position: absolute;
    left: 4px;
    top: 4px;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    z-index: 0;
}

.coin-level-meter-track {
    width: 100%;
    height: 100%;
    background: #2b2b2b;
    overflow: hidden;
}

.coin-level-meter-fill {
    width: 0%;
    height: 100%;
    background: #fb3d3d;
}

.coin-level-meter-frame {
    position: relative;
    z-index: 2;
    display: block;
    width: 236px;
    height: 22px;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#pauseButton {
    position: fixed;
    bottom: calc(var(--coin-meter-bottom) + (var(--coin-meter-height) / 2) - (var(--hud-control-size) / 2));
    left: 10px;
    z-index: 12001;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--hud-control-size);
    min-width: var(--hud-control-size);
    height: var(--hud-control-size);
    min-height: var(--hud-control-size);
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    outline: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

#pauseButton:focus,
#pauseButton:focus-visible,
#pauseButton:active {
    outline: none;
    box-shadow: none;
}

#pauseButton .pause-button-icon {
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#pauseButton .pause-button-icon-pause {
    display: block;
    width: 9px;
    height: 11px;
    background:
        linear-gradient(#ffffff, #ffffff) 0 0 / 3px 11px no-repeat,
        linear-gradient(#ffffff, #ffffff) 100% 0 / 3px 11px no-repeat;
    background-position: 0 0, 6px 0;
}

#pauseButton .pause-button-icon-play {
    display: none;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 0 5px 9px;
    border-color: transparent transparent transparent #ffffff;
    margin-left: 2px;
}

#pauseButton.is-paused .pause-button-icon-pause {
    display: none;
}

#pauseButton.is-paused .pause-button-icon-play {
    display: block;
}

#muteButton {
    position: fixed;
    bottom: calc(var(--coin-meter-bottom) + (var(--coin-meter-height) / 2) - (var(--hud-control-size) / 2));
    right: 10px;
    z-index: 12001;
    display: none;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: var(--hud-control-size);
    min-width: var(--hud-control-size);
    height: var(--hud-control-size);
    min-height: var(--hud-control-size);
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
}

#muteButton img,
#muteIcon {
    display: block;
    width: auto;
    height: 14px;
    max-width: none;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}


body.is-mobile {
    --coin-meter-bottom: 16px;
}

body.is-mobile #pauseButton,
body.is-mobile #muteButton {
    z-index: 25000;
}

/* Mobile corner score/time HUD (no bar image) */
#gameplayHudLandscape {
    display: none;
    pointer-events: none;
}

#scoreDisplayLandscape,
#timeDisplayLandscape {
    position: fixed;
    top: 9px;
    z-index: 3200;
    color: #ffffff;
    font-family: 'elektr_05', monospace;
    font-size: 10px;
    font-weight: normal;
    line-height: 10px;
    letter-spacing: 0;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
    pointer-events: none;
}

#scoreDisplayLandscape {
    left: 8px;
    text-align: left;
}

#timeDisplayLandscape {
    right: 8px;
    text-align: right;
}

body.is-mobile #scoreTimeContainer {
    display: none !important;
}

body.is-landscape-mobile-layout #coinLevelMeter {
    display: none !important;
}

body.is-mobile #scoreDisplayLandscape,
body.is-mobile #timeDisplayLandscape {
    top: 5px;
    font-size: 20px;
    line-height: 20px;
}

body.is-mobile #scoreDisplayLandscape {
    left: 22px;
}

body.is-mobile #timeDisplayLandscape {
    right: 22px;
}

body.is-mobile #htmlHeartsContainer {
    top: 8px;
    left: 0;
    right: 0;
    margin: 0 auto;
}

body.is-landscape-mobile-layout #htmlHeartsContainer .heart {
    width: 15px;
    height: 14px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

body.is-landscape-mobile-layout #htmlHeartsContainer .bullet-shield-charge {
    width: 13px;
    height: 14px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

body.is-mobile:not(.is-landscape) #highScoreDisplay {
    top: 10px;
    left: 50%;
    right: auto;
    width: auto;
    transform: translateX(-50%) scale(2);
    transform-origin: top center;
    font-size: 8pt;
    line-height: 1;
    text-align: center;
}

#highScoreDisplay {
    position: fixed;
    top: 12px;
    left: 16px;
    z-index: 8000;
    transform: scale(2);
    transform-origin: top left;
    font-family: '5x5', monospace;
    font-size: 8pt;
    font-weight: normal;
    line-height: 1;
    color: #d4965e;
    white-space: nowrap;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

body.is-mobile:not(.is-landscape) #upgradeCounter {
    left: 50%;
    right: auto;
    transform-origin: center center;
}

#upgradeCounter {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    z-index: 9000;
    transform: none;
    transform-origin: bottom right;
    pointer-events: auto;
    cursor: pointer;
}

#upgradeCounter img {
    display: block;
    height: 17px;
    width: auto;
    flex-shrink: 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.upgrade-mid {
    display: flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    min-width: 0;
    height: 17px;
    padding: 0;
    box-sizing: border-box;
    background-image: url('./src/img/splash/upgradeStretch.png');
    background-repeat: repeat-x;
    background-position: left center;
    background-size: auto 17px;
    flex-shrink: 0;
}

#upgradeNumber {
    display: block;
    font-family: 'elektr_05', monospace;
    font-size: 32px;
    font-weight: normal;
    line-height: 1;
    letter-spacing: 0;
    padding: 0 6px 0 0;
    margin: 0;
    color: #01a2c4;
    white-space: nowrap;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#powerUpFader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 12000;
    display: none;
    pointer-events: none;
}

#htmlPowerUpContainer {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: -277px 0 0 0;
    transform: translateX(-50%);
    width: 380px;
    height: 534px;
    z-index: 200000;
    display: none;
}

body.is-mobile #htmlPowerUpContainer {
    left: 50%;
    right: auto;
    margin-left: 0;
    margin-right: 0;
    transform: translateX(-50%);
}

.power-up-back {
    display: block;
    width: 380px;
    height: 534px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.power-up-options {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.power-up-row {
    position: absolute;
    left: 35px;
    width: 310px;
    height: 142px;
    cursor: pointer;
    pointer-events: auto;
}

.power-up-row[data-index="0"] {
    top: 80px;
}

.power-up-row[data-index="1"] {
    top: 226px;
}

.power-up-row[data-index="2"] {
    top: 372px;
}

.power-up-icon {
    position: absolute;
    top: 52px;
    left: 26px;
    z-index: 1;
    display: block;
    width: 66px;
    height: 66px;
    max-width: none;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.power-up-window {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: block;
    width: 310px;
    height: 142px;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.power-up-title {
    position: absolute;
    top: 6px;
    left: 0;
    z-index: 3;
    width: 100%;
    text-align: center;
    font-family: 'elektr_05', monospace;
    font-size: 15pt;
    line-height: 1;
    color: #ffeaac;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.power-up-description {
    position: absolute;
    top: 50px;
    left: 112px;
    right: 24px;
    z-index: 3;
    font-family: 'elektr_05', monospace;
    font-size: 15pt;
    line-height: 1.1;
    color: #5c584a;
    text-transform: uppercase;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.power-up-levels {
    position: absolute;
    left: 0;
    bottom: -2px;
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.power-up-dots-wrap {
    position: relative;
    height: 24px;
}

.power-up-dots-bg {
    position: relative;
    z-index: 2;
    display: block;
    height: 24px;
    width: auto;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.power-up-dots-fill {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.power-up-dot {
    position: absolute;
    top: calc(50% + 1px);
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: #2a2218;
    pointer-events: none;
}

.power-up-dot.active {
    background: #e8c040;
}

#htmlPowerUpContainerLandscape {
    display: none;
}

body:not(.is-compact-power-up-menu) #htmlPowerUpContainerLandscape {
    display: none !important;
}

body.is-compact-power-up-menu #htmlPowerUpContainer {
    display: none !important;
}

/* Compact horizontal power-up pick menu (mobile landscape / short desktop) */
body.is-compact-power-up-menu #htmlPowerUpContainerLandscape {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 200000;
    width: 408px;
    box-sizing: border-box;
    pointer-events: none;
}

body.is-compact-power-up-menu .pu-landscape-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 408px;
}

body.is-compact-power-up-menu .pu-landscape-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 408px;
    min-height: 0;
    padding: 3px 8px 4px 4px;
    box-sizing: border-box;
    cursor: pointer;
    pointer-events: auto;
    background: #000000;
    border: 2px solid #3a3a3a;
}

body.is-compact-power-up-menu .pu-landscape-row.pu-border-green {
    border-color: #58a848;
}

body.is-compact-power-up-menu .pu-landscape-row.pu-border-red {
    border-color: #c84848;
}

body.is-compact-power-up-menu .pu-landscape-row.pu-border-blue {
    border-color: #4878c8;
}

body.is-compact-power-up-menu .pu-landscape-icon-col {
    position: relative;
    flex-shrink: 0;
    width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

body.is-compact-power-up-menu .pu-landscape-icon {
    display: block;
    width: 33px;
    height: 33px;
    margin-top: 3px;
    max-width: none;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

body.is-compact-power-up-menu .pu-landscape-levels {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

body.is-compact-power-up-menu .pu-landscape-level-text {
    font-family: 'Silkscreen', monospace;
    font-size: 8pt;
    line-height: 1;
    color: #e8c040;
    margin-top: 2px;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

body.is-compact-power-up-menu .pu-landscape-text {
    position: relative;
    flex: 1;
    min-width: 0;
    align-self: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: 'elektr_05', monospace;
    font-size: 10pt;
    line-height: 1.12;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
    pointer-events: none;
}

body.is-compact-power-up-menu .pu-landscape-name {
    display: block;
    color: #ffffff;
    text-transform: uppercase;
    line-height: 1.12;
}

body.is-compact-power-up-menu .pu-landscape-desc {
    font-size: 10pt;
    color: #d4965e;
    text-transform: lowercase;
    line-height: 1.12;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.power-up-reshuffle-ad-button {
    position: fixed;
    left: 50%;
    z-index: 200001;
    transform: translateX(-50%);
    pointer-events: auto;
    margin: 0;
}

body.await-first-run-check #startMenu,
body.await-first-run-check #startMenuBackdrop,
body.await-first-run-check #highScoreDisplay,
body.await-first-run-check #upgradeCounter,
body.await-first-run-check #rewardedHeartButton {
    visibility: hidden;
    pointer-events: none;
}

#startMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 8001;
    pointer-events: auto;
}

#startMenuBackdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 7999;
    pointer-events: none;
}

#splashAnimation {
    position: absolute;
    top: calc(50% - 24px);
    left: 50%;
    width: 1002px;
    height: 657px;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    z-index: 2;
    pointer-events: none;
}

.splash-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 1002px;
    height: 657px;
    z-index: 1;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.splash-frame-1 {
    opacity: 1;
}

.splash-frame-2 {
    opacity: 0;
}

.splash-shine {
    position: absolute;
    top: 0;
    left: 0;
    width: 1002px;
    height: 657px;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
    mix-blend-mode: screen;
    -webkit-mask-image: url('./src/img/splash/mask.png');
    mask-image: url('./src/img/splash/mask.png');
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-mode: alpha;
    mask-mode: alpha;
}

.splash-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.12) 30%,
        rgba(255, 255, 255, 0.5) 50%,
        rgba(255, 255, 255, 0.12) 70%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: splashShineSweep 2.8s ease-in-out infinite;
    will-change: transform;
}

@keyframes splashShineSweep {
    0% {
        transform: translateX(-130%);
    }
    100% {
        transform: translateX(290%);
    }
}

.edition-title {
    position: absolute;
    top: 174px;
    left: 50%;
    width: 183px;
    height: 21px;
    transform: translateX(-50%);
    z-index: 3;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#startMenuButtons {
    position: absolute;
    bottom: clamp(5px, 18vh, 145px);
    left: 50%;
    transform: translateX(-50%);
    width: 309px;
    height: 129px;
    z-index: 4;
}

@media (max-height: 880px) {
    #startMenuButtons {
        bottom: 10%;
    }
}

@media (max-height: 690px) {
    #startMenuButtons {
        bottom: 5px;
    }
}

.startButAnimation {
    position: absolute;
    top: 0;
    left: 0;
    width: 103px;
    height: 43px;
    transform: scale(3);
    transform-origin: top left;
    z-index: 1;
    pointer-events: none;
}

#playButton,
#instructionsButton {
    position: absolute;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
    font-size: 0;
    color: transparent;
    box-shadow: none;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

#playButton {
    top: 30px;
    left: 50%;
    width: 254px;
    height: 33px;
    transform: translateX(-50%);
    z-index: 3;
}

#instructionsButton {
    top: 84px;
    left: 50%;
    width: 200px;
    height: 21px;
    transform: translateX(-50%);
    z-index: 2;
}

#rewardedHeartButton {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 9000;
    width: 121px;
    height: 17px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent url('./src/img/watchAd.png') no-repeat center;
    background-size: 121px 17px;
    cursor: pointer;
    box-shadow: none;
    outline: none;
    font-size: 0;
    color: transparent;
    white-space: nowrap;
    pointer-events: auto;
    transform: none;
    transform-origin: bottom left;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    -webkit-appearance: none;
    appearance: none;
}

#rewardedHeartButton:hover:not(:disabled) {
    filter: brightness(1.12);
}

#rewardedHeartButton:disabled {
    cursor: default;
    opacity: 0.85;
}

#rewardedHeartButton.is-ready {
    filter: hue-rotate(70deg) brightness(1.1);
}

#rewardedHeartButton.is-loading {
    opacity: 0.55;
    filter: grayscale(0.35);
}

#rewardedHeartButton.is-unavailable {
    opacity: 0.7;
    filter: grayscale(0.45) brightness(0.9);
}

#rewardedHeartButton .rewarded-heart-status {
    position: absolute;
    left: 0;
    top: calc(100% + 4px);
    font-family: 'Montserrat', sans-serif;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.2;
    color: #ffccaa;
    white-space: nowrap;
    pointer-events: none;
}

#rewardedHeartButton:not(.is-unavailable) .rewarded-heart-status {
    display: none;
}

.start-but-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 103px;
    height: 43px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.start-but-frame-1 {
    opacity: 1;
}

.start-but-frame-2 {
    opacity: 0;
}

/* Splash — half size on mobile, upper third layout (no transform scale — stays crisp on retina) */
body.is-mobile #splashAnimation {
    top: calc(33.33vh - 4px);
    width: 501px;
    height: 329px;
    transform: translate(-50%, -50%);
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

body.is-mobile .splash-frame,
body.is-mobile .splash-shine {
    width: 501px;
    height: 329px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

body.is-mobile .splash-shine::before {
    will-change: auto;
}

body.is-mobile .edition-title {
    display: none !important;
}

body.is-mobile #startMenuButtons {
    left: 50%;
    transform: translateX(-50%);
    width: 206px;
    height: 86px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

body.is-mobile:not(.is-landscape) #startMenuButtons {
    bottom: auto;
}

body.is-mobile .startButAnimation {
    width: 206px;
    height: 86px;
    transform: none;
}

body.is-mobile .start-but-frame {
    width: 206px;
    height: 86px;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

body.is-mobile #playButton {
    top: 20px;
    width: 169px;
    height: 22px;
}

body.is-mobile #instructionsButton {
    top: 56px;
    width: 133px;
    height: 14px;
}

body.is-landscape-mobile-layout #rewardedHeartButton {
    left: 4px;
    bottom: 4px;
    transform: none;
    transform-origin: bottom left;
}

/* Mobile landscape: splash upper-mid, high score upper-left, progress lower-right */
body.is-landscape-mobile-layout #highScoreDisplay {
    top: 4px;
    left: 8px;
    right: auto;
    width: auto;
    transform: scale(2);
    transform-origin: top left;
    font-size: 8pt;
    text-align: left;
}

body.is-landscape-mobile-layout #upgradeCounter {
    top: auto;
    left: auto;
    right: 4px;
    bottom: 4px;
    transform: none;
    transform-origin: bottom right;
}

body.is-landscape-mobile-layout #splashAnimation {
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

body.is-landscape-mobile-layout #startMenuButtons {
    top: auto;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
}

@media (max-height: 880px) {
    body.is-landscape-mobile-layout #startMenuButtons {
        bottom: 10%;
    }
}

@media (max-height: 640px) {
    body.is-landscape-mobile-layout #startMenuButtons {
        bottom: 5px;
    }
}

/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */

/* INSTRUCTIONS OVERLAY */

#instructionsOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}

#instructionsContainer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: -20px;
    background: transparent;
    padding: 0;
    text-align: center;
    font-family: "Montserrat", sans-serif;
}

.instructions-image-wrap {
    width: 524px;
    height: 268px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#instructionsImage {
    display: block;
    width: 524px;
    height: 268px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.instructions-landscape-content {
    display: none;
    width: 408px;
    box-sizing: border-box;
    padding: 14px 18px 12px;
    background: #000000;
    border: 1px solid #3a3a3a;
    text-align: center;
}

.inst-landscape-title {
    margin: 0 0 10px;
    font-family: 'elektr_05', monospace;
    font-size: 10pt;
    line-height: 1.12;
    color: #8eb8b8;
    text-transform: uppercase;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.inst-landscape-block {
    margin: 0;
    font-family: 'elektr_05', monospace;
    font-size: 10pt;
    line-height: 1.2;
    color: #c5a368;
    text-transform: uppercase;
    white-space: normal;
    overflow: visible;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.inst-landscape-highlight {
    color: #8eb8b8;
}

.inst-landscape-rule {
    width: 36px;
    height: 0;
    margin: 7px auto;
    border: none;
    border-top: 1px solid #c5a368;
    opacity: 0.65;
}

body.is-landscape-mobile-layout .instructions-image-wrap {
    display: none;
}

body.is-landscape-mobile-layout .instructions-landscape-content {
    display: block;
}

body.is-landscape-mobile-layout #closeInstructionsButton {
    position: fixed;
    top: 12px;
    right: 12px;
    margin-top: 0;
    z-index: 10001;
    font-size: 8pt;
    transform: scale(3);
    transform-origin: top right;
}

#closeInstructionsButton {
    margin-top: 16px;
    font-family: '5x5', monospace;
    font-size: 8pt;
    font-weight: normal;
    line-height: 1;
    color: #e60000;
    transform: scale(3);
    transform-origin: center center;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    border: none;
    background: transparent;
    padding: 0;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#powerUpGuideOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
    overflow: hidden;
}

#powerUpGuideContainer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 350px;
    max-height: 90vh;
    height: 90vh;
    padding: 20px 0 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.power-up-guide-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    margin-bottom: 12px;
}

.power-up-guide-title,
.power-up-guide-back {
    font-family: '5x5', monospace;
    font-size: 8pt;
    font-weight: normal;
    line-height: 1;
    transform: scale(2.2);
    transform-origin: center center;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.power-up-guide-title {
    color: #fff;
    letter-spacing: 0;
    margin: 0;
    text-align: center;
}

.power-up-guide-scroll {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    pointer-events: auto;
}


.power-up-guide-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding-bottom: 4px;
    box-sizing: border-box;
    touch-action: pan-y;
    pointer-events: auto;
}

.power-up-guide-cell {
    width: 310px;
    height: 142px;
}

.power-up-guide-row-inner {
    position: relative;
    width: 310px;
    height: 142px;
    pointer-events: none;
}

.power-up-guide-row-inner .power-up-icon {
    position: absolute;
    top: 52px;
    left: 26px;
    z-index: 1;
    display: block;
    width: 66px;
    height: 66px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.power-up-guide-row-inner .power-up-window {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    display: block;
    width: 310px;
    height: 142px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.power-up-guide-row-inner .power-up-title {
    position: absolute;
    top: 6px;
    left: 0;
    z-index: 3;
    width: 100%;
    text-align: center;
    font-family: 'elektr_05', monospace;
    font-size: 15pt;
    line-height: 1;
    color: #ffeaac;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    -webkit-font-smoothing: none;
}

.power-up-guide-row-inner .power-up-description {
    position: absolute;
    top: 50px;
    left: 112px;
    right: 24px;
    z-index: 3;
    font-family: 'elektr_05', monospace;
    font-size: 15pt;
    line-height: 1.1;
    color: #5c584a;
    text-transform: uppercase;
    -webkit-font-smoothing: none;
}

.power-up-guide-row-inner .power-up-levels {
    position: absolute;
    left: 0;
    bottom: -2px;
    z-index: 3;
    width: 100%;
    display: flex;
    justify-content: center;
}

.power-up-guide-row-inner .power-up-dots-wrap {
    position: relative;
    height: 24px;
}

.power-up-guide-row-inner .power-up-dots-bg {
    display: block;
    height: 24px;
    width: auto;
    image-rendering: pixelated;
}

.power-up-guide-row-inner .power-up-dots-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.power-up-guide-row-inner .power-up-dot {
    position: absolute;
    top: calc(50% + 1px);
    width: 8px;
    height: 8px;
    transform: translate(-50%, -50%) rotate(45deg);
    background: #2a2218;
}

.power-up-guide-row-inner .power-up-dot.active {
    background: #e8c040;
}

.power-up-guide-back {
    flex: 0 0 auto;
    color: #e60000;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    margin-top: 8px;
}

.power-up-guide-back:hover {
    color: #ff3333;
}

/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------------------------------------------------- */

/* BARS (removed from layout) */

#topDiv, #bonusDiv {
    display: none !important;
}

/* PROGRESS */

body.is-mobile #progressDiv {
    -webkit-overflow-scrolling: touch;
}

body.is-mobile:not(.is-landscape) #progressDiv {
    height: 100dvh;
    max-height: 100dvh;
    justify-content: flex-start;
    align-items: center;
    overflow: hidden;
    padding:
        max(8px, env(safe-area-inset-top))
        max(8px, env(safe-area-inset-right))
        max(8px, env(safe-area-inset-bottom))
        max(8px, env(safe-area-inset-left));
    box-sizing: border-box;
}

body.is-mobile:not(.is-landscape) .progress-content {
    width: 100%;
    max-width: 100%;
    max-height: calc(
        100dvh
        - max(8px, env(safe-area-inset-top))
        - max(8px, env(safe-area-inset-bottom))
    );
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.progress-content.progress-hide-top-graphic .progress-top-animation {
    display: none !important;
}

body.is-mobile:not(.is-landscape) .progress-content.progress-portrait-compact .progress-page-subtitle {
    margin-bottom: 8px;
}

body.is-mobile:not(.is-landscape) .progress-content.progress-portrait-compact .progress-grid {
    row-gap: 14px;
    margin-top: 12px;
    column-gap: 20px;
}

body.is-mobile:not(.is-landscape) .progress-content.progress-portrait-compact .progress-footer .progress-tally-top-flip {
    margin-bottom: 6px;
}

body.is-mobile:not(.is-landscape) .progress-content.progress-portrait-compact .progress-jewel-row {
    margin-top: 4px;
    margin-bottom: 2px;
}

.progress-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

body.is-mobile:not(.is-landscape) .progress-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding-top: 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(0, 0, 0, 0.97) 85%, rgba(0, 0, 0, 0));
    box-sizing: border-box;
}

body.is-mobile:not(.is-landscape) .progress-footer .progress-tally-top-flip {
    margin-top: 0;
    margin-bottom: 12px;
    flex-shrink: 0;
}

body.is-mobile:not(.is-landscape) .progress-footer #progressRewardAdButton {
    margin-top: 0;
    margin-bottom: 10px;
}

body.is-mobile:not(.is-landscape) .progress-footer #closeProgressButton {
    margin-top: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    background: none;
}

body.is-mobile:not(.is-landscape) .progress-content.progress-reward-ad-available .progress-footer #closeProgressButton {
    margin-top: 0;
}

@media (max-height: 680px) and (orientation: portrait) {
    body.is-mobile:not(.is-landscape) .progress-page-subtitle {
        margin-bottom: 8px;
    }

    body.is-mobile:not(.is-landscape) .progress-grid {
        row-gap: 14px;
        margin-top: 12px;
        column-gap: 20px;
    }

    body.is-mobile:not(.is-landscape) .progress-reward-ad-button {
        margin-top: 0;
        margin-bottom: 10px;
    }

    body.is-mobile:not(.is-landscape) .progress-footer .progress-tally-top-flip {
        margin-bottom: 8px;
    }
}

.progress-landscape-chrome {
    display: none;
}

.progress-landscape-jewel-icon {
    display: block;
    width: 10px;
    height: 20px;
    max-width: none;
    flex-shrink: 0;
    object-fit: contain;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.progress-landscape-jewel-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-landscape-jewel-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.progress-landscape-jewel-x,
.progress-landscape-jewel-amount {
    font-family: 'elektr_05', monospace;
    font-size: 9pt;
    line-height: 1;
    color: #01a2c4;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.progress-landscape-heading {
    display: none;
}

.progress-landscape-title {
    margin: 0 0 4px;
    padding: 0 8px;
    font-family: 'elektr_05', monospace;
    font-size: 9pt;
    line-height: 1.15;
    color: #01a2c4;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

body.is-landscape-mobile-layout #progressDiv {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    overflow-y: auto;
    position: fixed;
}

body.is-landscape-mobile-layout .progress-landscape-chrome {
    display: block;
    position: relative;
    width: min(96vw, 520px);
    box-sizing: border-box;
    padding: 8px 8px 2px;
    flex-shrink: 0;
}

body.is-landscape-mobile-layout .progress-landscape-top-bar {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 15502;
    pointer-events: none;
}

body.is-landscape-mobile-layout .progress-landscape-jewel-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

body.is-landscape-mobile-layout .progress-landscape-title {
    padding-top: 0;
    margin-bottom: 4px;
    white-space: nowrap;
}

body.is-landscape-mobile-layout .progress-content {
    width: min(96vw, 520px);
    max-height: calc(100vh - 56px);
    overflow: visible;
}

body.is-landscape-mobile-layout .progress-top-animation,
body.is-landscape-mobile-layout .progress-jewel-row,
body.is-landscape-mobile-layout .progress-page-subtitle,
body.is-landscape-mobile-layout .progress-content .go-tally-top {
    display: none !important;
}

body.is-landscape-mobile-layout .progress-grid {
    gap: 8px;
    margin-top: 2px;
}

body.is-landscape-mobile-layout .progress-grid-row {
    gap: 8px;
}

body.is-landscape-mobile-layout .progress-cell::after {
    display: none;
}

@media (max-height: 380px) {
    body.is-landscape-mobile-layout .progress-grid {
        gap: 8px;
    }

    body.is-landscape-mobile-layout .progress-grid-row {
        gap: 8px;
    }

    body.is-landscape-mobile-layout .progress-cell-inner {
        width: 33px;
        height: 33px;
        margin: 0 auto;
    }

    body.is-landscape-mobile-layout .progress-frame {
        width: 33px;
        height: 33px;
    }

    body.is-landscape-mobile-layout .progress-icon {
        left: 3px;
        top: 3px;
        width: 27px;
        height: 27px;
    }

    body.is-landscape-mobile-layout .progress-cell-count {
        width: 33px;
        margin-top: 4px;
        font-size: 8pt;
    }
}

body.is-landscape-mobile-layout #closeProgressButton {
    display: none !important;
}

body.is-landscape-mobile-layout #progressCloseCornerButton {
    display: block;
}

#progressDiv {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.97);
    display: none;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 15500;
    opacity: 0;
    pointer-events: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.progress-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: default;
    overflow: visible;
}

.progress-top-animation {
    position: relative;
    width: 264px;
    height: 88px;
    flex-shrink: 0;
    margin-bottom: 0;
    overflow: visible;
}

.progress-page-subtitle {
    margin: 0 0 16px;
    padding: 0 8px;
    font-family: 'elektr_05', monospace;
    font-size: 18pt;
    line-height: 1;
    color: #01a2c4;
    text-align: center;
    text-transform: uppercase;
    white-space: nowrap;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.progress-subtitle-line {
    display: inline;
}

.progress-subtitle-line + .progress-subtitle-line::before {
    content: ' ';
}

body.is-mobile:not(.is-landscape) .progress-page-subtitle {
    white-space: normal;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
    gap: 0;
}

body.is-mobile:not(.is-landscape) .progress-subtitle-line {
    display: block;
}

body.is-mobile:not(.is-landscape) .progress-subtitle-line + .progress-subtitle-line::before {
    content: none;
}

body.is-landscape-mobile-layout .progress-page-subtitle {
    display: none;
}

.progress-top-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 264px;
    height: 88px;
    max-width: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.progress-top-1 {
    opacity: 1;
}

.progress-top-2 {
    opacity: 0;
}

.progress-jewel-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 8px 0 4px;
    pointer-events: none;
}

.progress-jewel-graphic {
    display: block;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.progress-jewel-count {
    font-family: 'elektr_05', monospace;
    font-size: 28px;
    line-height: 1;
    color: #01a2c4;
    text-align: left;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.progress-tally-top-header {
    margin-top: 0;
}

.progress-content .go-tally-top {
    display: block;
    width: 270px;
    height: 14px;
    max-width: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.progress-tally-top-flip {
    margin-top: 10px;
    transform: scaleY(-1);
}

.progress-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    overflow: visible;
    width: 100%;
}

.progress-grid-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 28px;
    width: 100%;
}

body.is-mobile:not(.is-landscape) .progress-grid {
    display: grid;
    grid-template-columns: repeat(3, 66px);
    grid-template-rows: repeat(3, auto);
    column-gap: 28px;
    row-gap: 20px;
    margin-top: 20px;
    width: auto;
    align-items: start;
}

body.is-mobile:not(.is-landscape) .progress-grid-row {
    display: contents;
}

.progress-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.progress-cell:focus {
    outline: none;
}

.progress-cell:focus-visible .progress-cell-inner {
    outline: 2px solid #378c93;
    outline-offset: 2px;
}

.progress-cell-inner {
    position: relative;
    width: 66px;
    height: 66px;
    flex-shrink: 0;
}

.progress-frame {
    display: block;
    width: 66px;
    height: 66px;
    max-width: none;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.progress-icon {
    position: absolute;
    left: 6px;
    top: 6px;
    width: 54px;
    height: 54px;
    max-width: none;
    box-sizing: border-box;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    pointer-events: none;
}

body.is-landscape-mobile-layout .progress-frame,
body.is-landscape-mobile-layout .progress-icon,
body.is-landscape-mobile-layout .progress-landscape-jewel-icon {
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.progress-cell-count {
    margin-top: 4px;
    width: 66px;
    font-family: 'Silkscreen', monospace;
    font-size: 13px;
    line-height: 1;
    color: #01a2c4;
    text-align: center;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.progress-cell.is-maxed .progress-cell-inner {
    opacity: 0.2;
}

.progress-cell::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    padding: 5px 8px;
    background: #07758b;
    color: #ffffff;
    font-family: 'Silkscreen', monospace;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 20;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.progress-cell:hover::after,
.progress-cell:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

#closeProgressButton,
.progress-next-button {
    margin-top: 12px;
    padding: 0;
    border: none;
    background: transparent;
    font-family: '5x5', monospace;
    font-size: 8pt;
    font-weight: normal;
    line-height: 1;
    color: #e60000;
    transform: scale(3);
    transform-origin: center center;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#closeProgressButton:focus,
.progress-next-button:focus {
    outline: none;
}

@keyframes progress-reward-ad-bg-pulse {
    0%, 100% {
        background-color: #01a2c4;
    }
    50% {
        background-color: #38c8e4;
    }
}

.progress-reward-ad-button {
    margin: 15px 0 14px;
    padding: 10px 14px;
    border: none;
    border-radius: 0;
    background-color: #01a2c4;
    animation: progress-reward-ad-bg-pulse 2s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    max-width: calc(100% - 24px);
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-appearance: none;
    appearance: none;
}

.progress-reward-ad-button .progress-reward-ad-label {
    display: block;
    font-family: '5x5', monospace;
    font-size: 16px;
    font-weight: normal;
    line-height: 1;
    letter-spacing: 0;
    color: #000000;
    text-transform: uppercase;
    white-space: nowrap;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.progress-reward-ad-button:hover:not(:disabled) {
    animation-play-state: paused;
    background-color: #33b8d8;
}

.progress-reward-ad-button:hover:not(:disabled) .progress-reward-ad-label {
    color: #000000;
}

.progress-reward-ad-button:disabled {
    opacity: 0.55;
    cursor: default;
    animation-play-state: paused;
}

.progress-reward-ad-button:focus {
    outline: none;
}

#powerUpReshuffleAdButton.progress-reward-ad-button {
    margin: 0;
    padding: 10px 22px;
}

body.is-mobile #powerUpReshuffleAdButton.progress-reward-ad-button {
    padding: 8px 16px;
    max-width: calc(100% - 16px);
}

.progress-content.progress-reward-ad-available #closeProgressButton {
    margin-top: 0;
}

.progress-content:not(.progress-reward-ad-available) #closeProgressButton {
    margin-top: 28px;
}

#progressCloseCornerButton {
    display: none;
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 15503;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: '5x5', monospace;
    font-size: 8pt;
    font-weight: normal;
    line-height: 1;
    color: #e60000;
    transform: scale(3);
    transform-origin: top right;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-appearance: none;
    appearance: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

#progressCloseCornerButton:focus {
    outline: none;
}

@media (max-height: 599px) and (orientation: landscape) {
    body:not(.is-mobile) #progressCloseCornerButton {
        display: block;
    }
}

/* GAME OVER */

#gameOverDiv {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    z-index: 16000;
    opacity: 0;
    pointer-events: none;
}

.game-over-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

/* Desktop: scaled stack, centered in overlay */
body:not(.is-mobile):not(.is-game-over-mobile) #gameOverDiv {
    align-items: center;
    justify-content: center;
}

body:not(.is-mobile):not(.is-game-over-mobile) .game-over-content {
    transform: scale(2);
    transform-origin: center center;
}

/* Mobile portrait: centered vertically in the overlay */
body.is-mobile:not(.is-landscape) #gameOverDiv {
    align-items: center;
    justify-content: center;
}

body.is-mobile:not(.is-landscape) .game-over-content {
    transform: scale(2);
    transform-origin: center center;
}

.go-landscape-columns,
.go-panel-left,
.go-panel-right {
    display: contents;
}

/* Regular / portrait: flatten panels and restore original vertical order */
body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-top-animation {
    order: 1;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-meter-wrap {
    order: 2;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-time {
    order: 3;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-tally-top-header {
    order: 4;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-stats {
    order: 5;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-tally-top-flip {
    order: 6;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-final-reveal {
    order: 7;
}

body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content .go-next-button,
body:not(.is-landscape-mobile-layout):not(.is-game-over-mobile) .game-over-content > #gameOverNextButton {
    order: 8;
}

body.is-mobile:not(.is-landscape) .go-landscape-columns,
body.is-mobile:not(.is-landscape) .go-panel-left,
body.is-mobile:not(.is-landscape) .go-panel-right {
    display: contents;
}

/* Mobile landscape game over: left = meter/score/next, right = stats */
body.is-landscape-mobile-layout #gameOverDiv,
body.is-game-over-mobile #gameOverDiv {
    align-items: center;
    justify-content: center;
}

body.is-landscape-mobile-layout .game-over-content,
body.is-game-over-mobile .game-over-content {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: auto 0;
    padding: 0 8px;
    box-sizing: border-box;
    transform: none;
    gap: 0;
}

body.is-landscape-mobile-layout .go-landscape-columns,
body.is-game-over-mobile .go-landscape-columns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: auto;
    max-width: 100%;
}

body.is-landscape-mobile-layout .go-panel-left,
body.is-landscape-mobile-layout .go-panel-right,
body.is-game-over-mobile .go-panel-left,
body.is-game-over-mobile .go-panel-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0;
    box-sizing: border-box;
}

body.is-landscape-mobile-layout .go-panel-left > *,
body.is-landscape-mobile-layout .go-panel-right > *,
body.is-game-over-mobile .go-panel-left > *,
body.is-game-over-mobile .go-panel-right > * {
    order: unset;
}

body.is-landscape-mobile-layout .go-top-animation,
body.is-game-over-mobile .go-top-animation {
    margin-bottom: 8px;
}

body.is-landscape-mobile-layout .go-meter-wrap,
body.is-game-over-mobile .go-meter-wrap {
    margin-top: 0;
}

body.is-landscape-mobile-layout .go-panel-right .go-tally-top-header,
body.is-landscape-mobile-layout .go-panel-right .go-tally-top-flip,
body.is-game-over-mobile .go-panel-right .go-tally-top-header,
body.is-game-over-mobile .go-panel-right .go-tally-top-flip {
    display: none;
}

body.is-landscape-mobile-layout .go-stats,
body.is-game-over-mobile .go-stats {
    margin-top: 0;
    margin-bottom: 0;
    width: auto;
    min-width: 160px;
}

body.is-landscape-mobile-layout .go-final-reveal,
body.is-game-over-mobile .go-final-reveal {
    margin-top: 10px;
    min-height: 0;
}

body.is-landscape-mobile-layout .go-time,
body.is-game-over-mobile .go-time {
    font-size: 10px;
    line-height: 10px;
    min-height: 10px;
    color: #ff0730;
}

body.is-landscape-mobile-layout .go-score,
body.is-game-over-mobile .go-score {
    font-size: 20px;
    line-height: 20px;
    height: auto;
    margin-bottom: 0;
}

body.is-landscape-mobile-layout .go-stat-row,
body.is-game-over-mobile .go-stat-row {
    min-height: 20px;
    margin-bottom: 6px;
}

body.is-landscape-mobile-layout .go-stat-label,
body.is-landscape-mobile-layout .go-stat-value,
body.is-game-over-mobile .go-stat-label,
body.is-game-over-mobile .go-stat-value {
    font-size: 20px;
    line-height: 20px;
}

body.is-landscape-mobile-layout #gameOverNextButton,
body.is-game-over-mobile #gameOverNextButton {
    margin-top: 14px;
    align-self: center;
    order: unset;
}

.go-top-animation {
    position: relative;
    width: 119px;
    height: 45px;
}

.go-top-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 119px;
    height: 45px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.go-top-1 {
    opacity: 1;
}

.go-top-2 {
    opacity: 0;
}

.go-meter-wrap {
    position: relative;
    width: 153px;
    height: 33px;
    margin-top: 13px;
}

.go-meter-bar {
    position: absolute;
    left: 10px;
    top: 12px;
    width: 132px;
    height: 7px;
    z-index: 0;
}

.go-progress-track {
    position: relative;
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    overflow: hidden;
}

.go-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    width: 0;
    height: 100%;
    background: #c0392b;
}

.go-meter-frame {
    position: relative;
    z-index: 2;
    display: block;
    width: 153px;
    height: 33px;
    pointer-events: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.go-time {
    margin-top: 3px;
    font-family: 'Silkscreen', monospace;
    font-size: 8px;
    line-height: 1;
    color: #8b1a1a;
    text-align: center;
    min-height: 10px;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.go-stats {
    margin-top: 6px;
    width: 130px;
}

.go-stat-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    min-height: 10px;
}

.go-stat-label {
    font-family: '5x5', monospace;
    font-size: 8pt;
    line-height: 1;
    color: #fb3d3d;
    flex-shrink: 0;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.go-stat-value {
    font-family: '5x5', monospace;
    font-size: 8pt;
    line-height: 1;
    color: #18717e;
    min-width: 0;
    text-align: right;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.go-tally-top {
    display: block;
    width: 135px;
    height: 7px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.go-tally-top-header {
    margin-top: 10px;
}

.go-tally-top-flip {
    margin-top: 8px;
    transform: scaleY(-1);
}

.go-final-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    min-height: 36px;
    margin-top: 10px;
}

.go-score {
    display: block;
    height: 16px;
    line-height: 16px;
    margin-top: 0;
    margin-bottom: 10px;
    font-family: 'BMSpace', monospace;
    font-size: 16pt;
    color: #fb3d3d;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.go-next-button {
    margin-top: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: default;
    display: block;
    width: 103px;
    height: 8px;
    opacity: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
}

.go-next-button:not([aria-hidden="true"]) {
    cursor: pointer;
}

.go-next-button img {
    display: block;
    width: 103px;
    height: 8px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#upperLeftDiv{
    top: 5px;
    left: 10px;
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: "Montserrat", sans-serif;
    z-index: 3200;
}

#upperRightDiv{
    top: 5px;
    right: 10px;
    font-size: 9pt;
    font-weight: 700;
    letter-spacing: 1px;
    font-family: "Montserrat", sans-serif;
    z-index: 3200;
}

.death-revive-overlay {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    pointer-events: auto;
}

.death-revive-overlay.is-visible {
    display: flex;
}

.death-revive-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    max-width: min(92vw, 520px);
    padding: 24px 20px;
    text-align: center;
}

.death-revive-prompt {
    margin: 0;
    font-family: 'elektr_05', monospace;
    font-size: clamp(11px, 2.8vw, 16px);
    line-height: 1.35;
    color: #fb3d3d;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.death-revive-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}

.death-revive-button {
    margin: 0;
    padding: 10px 22px;
    min-width: 180px;
    border: 2px solid #5a5a5a;
    border-radius: 0;
    background: #1a1a1a;
    font-family: 'elektr_05', monospace;
    font-size: clamp(12px, 2.6vw, 15px);
    line-height: 1.2;
    color: #c5a368;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-font-smoothing: none;
    -moz-osx-font-smoothing: grayscale;
    font-smooth: never;
}

.death-revive-button:hover:not(:disabled) {
    border-color: #c5a368;
    color: #f0d090;
}

.death-revive-watch {
    border-color: #8b3030;
    color: #fb3d3d;
}

.death-revive-watch:hover:not(:disabled) {
    border-color: #fb3d3d;
    color: #ff7070;
}

.death-revive-button:disabled {
    opacity: 0.55;
    cursor: default;
}

.death-revive-button:focus {
    outline: none;
}
