@font-face {
    font-family: 'SuperMoneyBunny';
    src: url('./assets/Fonts/SuperMoneyBunny.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    font-family: 'SuperMoneyBunny', 'Courier New', monospace;
}

html, body {
    width: 100%; height: 100%;
    overflow: hidden;
    background: #1a0a2e;
    font-family: 'SuperMoneyBunny', 'Courier New', monospace;
    touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    -webkit-text-size-adjust: 100%;
}

/* ---- LAYOUT ---- */
#scale-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    background: #1a0a2e;
    background: transparent;
}

#game-container {
    background: transparent;
    position: relative;
    border: 3px solid #e8c43a;
    box-shadow: 0 0 40px #e8c43a55, 0 0 80px #e8c43a22;
    image-rendering: pixelated;
    transform-origin: center center;
    flex-shrink: 0;
    z-index: 1;
    /* container-type: inline-size; */
}

canvas { display: block; image-rendering: pixelated; }

/* ---- LOADER ---- */
#loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #1a0a2e;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    transition: opacity 0.4s ease;
}
#loader.fade-out {
    opacity: 0;
    pointer-events: none;
}
#loader-title {
    color: #e8c43a;
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 4px;
    text-align: center;
    text-shadow: 3px 3px 0 #c0392b, 5px 5px 0 #000;
    text-transform: uppercase;
    line-height: 1.2;
}
#loader-track {
    width: 260px;
    height: 14px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(232,196,58,0.4);
    border-radius: 8px;
    overflow: hidden;
}
#loader-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #c0392b, #e8c43a);
    border-radius: 6px;
    transition: width 0.15s ease;
}
#loader-label {
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

#played-today-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(0.5px);
    display: flex;
    align-items: center;
    justify-content: center;
}
#played-today-screen-container {
    display: flex;
    flex-direction: column;
    gap: calc(var(--cw)*1.1);
    padding: calc(var(--cw)*5.2) calc(var(--cw)*2.4) calc(var(--cw)*3.2);
}
.ui_container {
    background: url('./assets/UI_Elements/UI_Container_Menu.png') center / 100% 100% no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(var(--cw)*1.09);
    padding: calc(var(--cw)*1.6) calc(var(--cw)*1.98);
    margin: 0 calc(var(--cw)*5);
}
#ui-container {
    z-index: 2;
}

.hud-heart {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}
.trophy-icon {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
    vertical-align: middle;
}
/* General text */
.super_title {
    color: #fff;
    text-shadow: calc(var(--cw)*0.2) calc(var(--cw)*0.2) #b0b0b0, calc(var(--cw)*0.3) calc(var(--cw)*0.3) #000000;
}

.money_bunny_title {
    color: #9EC240;
    text-shadow: calc(var(--cw)*0.2) calc(var(--cw)*0.2) #3f4e19, calc(var(--cw)*0.3) calc(var(--cw)*0.3) #000000;
}
/* ---- HUD ---- */
#ui-overlay {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    justify-content: space-between;
    padding: calc(var(--cw)*1.77);
    pointer-events: none;
    background: linear-gradient(
        to bottom,
        #495788 0%,
        #495788 18%,
        #424f7c 19%,   /* sharp drop */
        #424f7c 63%,
        #3d4a76 64%,   /* sharp drop */
        #3d4a76 89%,
        #8794b7 90%,   /* sharp bright highlight band */
        #919dc5 91%,
        #6f7bab 92%,
        #4d5a8e 93%,
        #4d5a8e 96%,
        #27355a 97%,   /* sharp dark bottom edge */
        #2e3c59 100%
    );
}

html.fs-active.android-device #ui-overlay { padding-top: calc(var(--cw)*1.77 + 4vh); }

.ui-section { display: flex; flex-direction: column; align-items: center; gap: calc(var(--cw)*0.6) }
/* UI labels: base 11px × 1.15 ≈ 12.65px → 12.65px */
.ui-label { color: #F3C936; 
    font-size: calc(var(--cw)*1.05); 
    letter-spacing: 0; 
    text-transform: uppercase; 
    text-shadow: 1px 1px 0 #000; 
}
/* UI values: base 20px × 1.15 = 23px */
.ui-value { 
    color: #fff; 
    font-size: calc(var(--cw)*1.5); 
    font-weight: bold; 
    text-shadow: 2px 2px 0 #000; 
    min-width: 60px; 
    text-align: center; 
}
#hearts { 
    display: flex;
}

#hearts .hud-heart {
    height: calc(var(--cw)*2.19);
    width: calc(var(--cw)*2.19);
}
#level-display {
    
    /* base 13px × 1.15 ≈ 14.95px */
    font-size: 14.95px;
    font-weight: bold;
    color: #ffe;
    letter-spacing: 1px;
    padding: 0 6px;
    white-space: nowrap;
}

/* ---- SCREENS ---- */
#start-screen, #game-over-screen, #win-screen, #played-today-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 20;
    background: rgba(0,0,0,0.82);
    backdrop-filter: blur(1px);
    gap: 18px;
}

.start-screen-title {
    font-size: calc(var(--cw)*2.5);
    text-align: center;
    line-height: 105%;
    padding-bottom: var(--cw);
}

.screen-title {
    color: #9EC240;
    font-size: calc(var(--cw)*2.5);
    font-weight: bold;
    text-shadow: 3px 3px 0 #000;
    letter-spacing: 3px;
    text-align: center;
    line-height: 1.2;
}

.played-today-msg {
    color: #fff;
    font-size: var(--cw);
    text-align: center;
    max-width: 340px;
    line-height: 1.5;
    margin: 0;
    padding-bottom: var(--cw);
}

.screen-sub {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    font-size: calc(var(--cw)*0.73);
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 #000;
    /* text-align: center; */
    /* max-width: 350px; */
    line-height: 1.8;
    opacity: 0.85;
    list-style-type: none;
    list-style-position: inside;
}

.screen-sub li > div {
    display: flex;
    gap: 4px;
    align-items: center;
}
.screen-sub li > div > div {
    height: calc(var(--cw)*1.05);
    aspect-ratio: 1;
}
.screen-sub li > div p {
    font-size: calc(var(--cw)*0.72);
}
.screen-sub li > div > div img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block; /* optional, removes inline spacing issues */
}
canvas { image-rendering: pixelated; }

.start-btn {
    background-image: url('./assets/UI_Elements/UI_Container_Primary_NoText.png');
    background-color: transparent;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    color: #0b1a2b;
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 12px 36px;
    font-size: calc(var(--cw)*1.3);
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    transition: filter 0.1s, transform 0.1s;
    pointer-events: all;
}
.start-btn:hover  { filter: brightness(1.08); transform: translate(-1px, -1px); }
.start-btn:active { filter: brightness(0.95); transform: translate(1px, 1px); }

#controls-strip {
    touch-action: none;
    -webkit-user-select: none;
}

#portrait-joy-zone,
#portrait-joystick-base {
    touch-action: none;
}

#go-home-btn {
    background: #e8c43a;
    color: #1a0a2e;
    border: none;
    padding: 12px 36px;
    font-size: 18px;
    
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 3px 3px 0 #000;
    transition: transform 0.1s, box-shadow 0.1s;
    pointer-events: all;
}
#go-home-btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 #000; }
#go-home-btn:active { transform: translate(1px,1px); box-shadow: 2px 2px 0 #000; }

#controls-hint {
    color: #ffffff;
    font-size: calc(var(--cw)*0.72);
    letter-spacing: 1px;
    text-align: center;
    margin-top: -6px;
    line-height: 150%;
}

/* ---- LEVEL COMPLETE SCREEN ---- */
#level-complete-screen {
    display: none;
    position: absolute;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(0,0,0,0.72);
    backdrop-filter: blur(1px);
    z-index: 500;
    color: #fff;
}

#lc-level {
    text-align: center;
    font-size: calc(var(--cw)*1.88);
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 0 0 16px #f1c40f;
}

.lc-stats {
    flex-direction: row;
    gap: 24px;
    margin: 0;
    padding: 0;
}
.lc-stats li div {
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.lc-stats li div img {
    height: 32px;
    image-rendering: pixelated;
}
.lc-stats li div p {
    font-size: 16px;
    font-weight: bold;
    color: #f1c40f;
    text-shadow: 1px 1px 0 #000;
    margin: 0;
}

.lc-powerups-text,
#lc-powerups,
#lc-score { 
    font-size: calc(var(--cw)*1.04);
    color: #eee; 
    text-align: center;
}
#lc-next  { font-size: 16px; color: #aef; margin-top: 4px; }

#redeem-error {
    margin-top: 10px;
    padding: 10px 14px;
    background: rgba(180, 30, 30, 0.85);
    border: 1px solid #e74c3c;
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
    max-width: 320px;
}

#lc-buttons {
    display: flex;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#lc-img-clock {
    font-size: 32px;
    line-height: 32px;
}
.lc-img-powerups {
    height: 32px;
}
#next-level-button, 
#redeem-button {
    padding: 12px 36px;
    font-size: calc(var(--cw)*1.3);
    font-weight: bold;
    background-color: transparent;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    border: none;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    letter-spacing: 2px;
    transition: filter 0.1s, transform 0.1s;
}
#next-level-button {
    background-image: url('./assets/UI_Elements/UI_Container_Primary_NoText.png');
    color: #0b1a2b;
}
#redeem-button {
    background-image: url('./assets/UI_Elements/UI_Container_Secondary_NoText.png');
    color: #a8c841;
}
#next-level-button:hover  { filter: brightness(1.08); transform: translate(-1px, -1px); }
#next-level-button:active { filter: brightness(0.95); transform: translate(1px, 1px); }
#redeem-button:hover      { filter: brightness(1.08); transform: translateY(-1px); }
#redeem-button:active     { filter: brightness(0.95); transform: translateY(2px); }

#quit-submit-button {
    margin-top: 6px;
    padding: 10px 28px;
    
    font-size: 15px;
    font-weight: bold;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    letter-spacing: 1px;
    box-shadow: 0 4px 0 #7b241c;
    transition: background 0.15s, transform 0.1s;
}
#quit-submit-button:hover { background: #e74c3c; transform: translateY(-1px); }
#quit-submit-button:active { transform: translateY(2px); box-shadow: 0 2px 0 #7b241c; }


/* ---- ROTATE PROMPT: shown on touch landscape, asking user to go portrait ---- */
#rotate-prompt {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #1a0a2e;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    color: #e8c43a;
    
    text-align: center;
    padding: 20px;
}
#rotate-prompt .rotate-icon {
    font-size: 72px;
    animation: rotateHint 1.8s ease-in-out infinite;
}
#rotate-prompt p {
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #000;
    line-height: 1.6;
}

/* Show rotate prompt ONLY on touch landscape — prompt asks to switch to portrait */
@media (pointer: coarse) and (orientation: landscape) {
    #rotate-prompt {
        display: flex;
    }
}

@keyframes rotateHint {
    0%   { transform: rotate(0deg);   }
    40%  { transform: rotate(90deg);  }
    60%  { transform: rotate(90deg);  }
    100% { transform: rotate(0deg);   }
}

/* ---- VIRTUAL JOYSTICK ---- */
#joystick-zone {
    display: none;
    position: absolute;
    right: 24px;
    bottom: 28px;
    z-index: 15;
    pointer-events: all;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
#joystick-base {
    width: 171px;
    height: 171px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.6) 100%);
    border: 3px solid rgba(255,255,255,0.3);
    box-shadow: 0 0 20px rgba(0,0,0,0.7), inset 0 2px 10px rgba(255,255,255,0.1);
    position: relative;
    overflow: visible;
}
.joy-arrow {
    position: absolute;
    color: rgba(255,255,255,0.35);
    font-size: 21px;
    pointer-events: none;
    line-height: 1;
}
.joy-arrow.left  { left: 10px;  top: 50%; transform: translateY(-50%); }
.joy-arrow.right { right: 10px; top: 50%; transform: translateY(-50%); }
#joystick-nub {
    width: 69px;
    height: 69px;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 34%, #f1c40f, #b8860b);
    border: 3px solid rgba(255,255,255,0.45);
    box-shadow: 0 4px 12px rgba(0,0,0,0.55), inset 0 1px 4px rgba(255,255,255,0.25);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform;
    transition: transform 0.15s ease-out;
}
#joystick-nub.active { transition: none; }

/* ---- JUMP BUTTON (in-canvas, landscape touch) ---- */
#jump-btn-zone {
    display: none;
    position: absolute;
    left: 28px;
    bottom: 28px;
    z-index: 15;
    pointer-events: all;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}
#jump-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 34%, #e74c3c, #8b1a0a);
    border: 3px solid rgba(255,255,255,0.45);
    box-shadow: 0 6px 0 #5a1008, 0 0 20px rgba(231,76,60,0.5), inset 0 1px 4px rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 2px;
    cursor: pointer;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
}
#jump-btn.pressed {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #5a1008, 0 0 12px rgba(231,76,60,0.4), inset 0 1px 4px rgba(255,255,255,0.1);
}
#jump-btn .btn-label {
    color: #fff;
    
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 1px 1px 0 #000;
    text-transform: uppercase;
    pointer-events: none;
}
#jump-btn .btn-icon {
    font-size: 28px;
    pointer-events: none;
    line-height: 1;
}

/* ---- POWERUP BANNER ---- */
@keyframes fadeupbanner {
    0%   { opacity:1; top:104px; }
    65%  { opacity:1; }
    100% { opacity:0; top:82px; }
}
.powerup-banner {
    position: absolute;
    left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.78);
    
    font-size: 14px;
    font-weight: bold;
    padding: 5px 18px;
    letter-spacing: 2px;
    z-index: 11;
    pointer-events: none;
    border: 2px solid;
    animation: fadeupbanner 2.1s forwards;
}

/* ---- LEADERBOARD OPEN BUTTON ---- */
#lb-open-btn, .lb-open-btn {
    background-image: url('./assets/UI_Elements/UI_Container_Leaderboard.png');
    background-color: transparent;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    color: #f3c936;
    border: none;
    border-radius: 0;
    font-size: calc(var(--cw)*0.66);
    font-weight: bold;
    letter-spacing: 2px;
    padding: 7px 22px;
    cursor: pointer;
    text-transform: uppercase;
    transition: filter 0.1s, transform 0.1s;
    margin-top: -4px;
}
#lb-open-btn:hover,  .lb-open-btn:hover  { filter: brightness(1.08); }
#lb-open-btn:active, .lb-open-btn:active { filter: brightness(0.95); }

/* ---- LEADERBOARD PANEL ---- */
#lb-panel {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 100;
    background: rgba(5, 2, 18, 0.97);
    flex-direction: column;
    
    color: #eee;
    overflow: hidden;
}
#lb-panel.open { display: flex; }

#lb-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 0;
    flex-shrink: 0;
}
#lb-panel-title {
    font-size: 17px;
    font-weight: bold;
    color: #e8c43a;
    letter-spacing: 3px;
    text-transform: uppercase;
    text-shadow: 2px 2px 0 #000;
}
#lb-close-btn {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.2);
    color: #aaa;
    
    font-size: 12px;
    font-weight: bold;
    padding: 4px 12px;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: border-color 0.15s, color 0.15s;
}
#lb-close-btn:hover { border-color: #fff; color: #fff; }

/* ---- TABS ---- */
#lb-tabs {
    display: flex;
    padding: 12px 20px 0;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    gap: 4px;
}
.lb-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: rgba(255,255,255,0.38);
    
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 1.5px;
    padding: 5px 14px 10px;
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.15s, border-color 0.15s;
    margin-bottom: -1px;
}
.lb-tab:hover { color: rgba(255,255,255,0.7); }
.lb-tab.active {
    color: #f1c40f;
    border-bottom-color: #f1c40f;
}

/* ---- LB CONTROLS ROW ---- */
#lb-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
#lb-controls label {
    color: rgba(255,255,255,0.5);
    
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
#lb-limit-select {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(232,196,58,0.4);
    color: #e8c43a;
    
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px;
    cursor: pointer;
    outline: none;
    letter-spacing: 1px;
}
#lb-limit-select:hover { border-color: #e8c43a; }
#lb-refresh-btn {
    background: transparent;
    border: 1px solid rgba(232,196,58,0.35);
    color: rgba(232,196,58,0.6);
    
    font-size: 11px;
    letter-spacing: 1px;
    padding: 4px 12px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.15s;
}
#lb-refresh-btn:hover { border-color: #e8c43a; color: #e8c43a; background: rgba(232,196,58,0.08); }
#lb-refresh-btn.spinning { animation: spin 0.6s linear; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- TABLE AREA ---- */
#lb-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#lb-status {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aac8ff;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
}
#lb-status.loading { animation: lb-blink 1s ease-in-out infinite; }
#lb-status.error   { color: #e74c3c; }

@keyframes lb-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

#lb-table-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.12) transparent;
    min-height: 0;
    padding: 0 20px;
}
#lb-table-wrap::-webkit-scrollbar { width: 4px; }
#lb-table-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 2px; }

.lb-table {
    width: 100%;
    border-collapse: collapse;
    
    font-size: 13px;
    color: #eee;
}
.lb-table thead tr {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(5,2,18,0.97);
}
.lb-table th {
    padding: 10px 10px 6px;
    font-weight: bold;
    color: #aac8ff;
    text-align: left;
    font-size: 10px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.lb-table td {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.lb-table tbody tr:hover td { background: rgba(255,255,255,0.025); }

.lb-pos   { width: 38px; color: #555; text-align: center; font-size: 11px; }
.lb-pos-gold   { color: #f1c40f; font-weight: bold; }
.lb-pos-silver { color: #aaa;    font-weight: bold; }
.lb-pos-bronze { color: #cd7f32; font-weight: bold; }
.lb-name  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; }
.lb-score { text-align: right; color: #7dffb3; font-weight: bold; font-variant-numeric: tabular-nums; }
.lb-time  { text-align: right; color: rgba(255,255,255,0.3); font-size: 11px; font-variant-numeric: tabular-nums; padding-right: 4px; }

/* ---- STICKY "MY POSITION" ROW ---- */
#lb-my-section {
    flex-shrink: 0;
    border-top: 1px solid rgba(241,196,15,0.25);
    background: rgba(241,196,15,0.06);
    padding: 0 20px 12px;
}
.lb-my-label {
    font-size: 9px;
    letter-spacing: 2px;
    color: rgba(241,196,15,0.5);
    text-transform: uppercase;
    padding: 7px 10px 2px;
}
.lb-my-row td {
    padding: 6px 10px;
    color: #f1c40f;
    font-weight: bold;
    font-size: 13px;
    border-bottom: none;
}
.lb-my-row .lb-score { color: #f1c40f; }
.lb-my-row .lb-pos   { color: #f1c40f; }
#lb-table-wrap .lb-my-row td { background: rgba(241,196,15,0.10); }
#lb-table-wrap .lb-my-row td:first-child { border-left: 2px solid rgba(241,196,15,0.6); }

/* ---- FULLSCREEN HINT ---- */
#fs-hint {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}
#fs-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    user-select: none;
}
#fs-overlay svg { display: block; margin-bottom: 8px; }
#fs-hand {
    background-image: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 16.2.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Layer_2' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='550px' height='400px' viewBox='0 0 550 400' enable-background='new 0 0 550 400' xml:space='preserve'%3E%3Csymbol id='hand' viewBox='-364.275 -463.175 728.602 926.3'%3E%3Cg id='Layer_3_1_'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' fill='%23FFFFFF' d='M209.5,105.85c0-0.4,0-0.817,0-1.25l-0.15-68.4l0.15-15.55 l-0.15,15.55l0.15,68.4C209.5,105.033,209.5,105.45,209.5,105.85v32.8l8.4-1c9.167-0.667,22.7-1,40.6-1 c30.833,0,52.25-13.667,64.25-41c3.767-8.533,6.35-17.933,7.75-28.2c0.7-5.133,1.033-9.4,1-12.8l-0.25-51 c-6.167-121.433-18.083-214.5-35.75-279.2c-17.633-64.7-33.3-115.967-47-153.8l-364-1c-36.2,172.967-108.183,307.633-215.95,404 C-306.75,88.383-249.1,89.7-158.5-22.4v373.05c0.1,3,0.417,6.55,0.95,10.649c1.3,10.267,3.683,19.667,7.15,28.2 c10.367,25.533,28.333,39.134,53.9,40.8c25.6-1.666,43.583-15.267,53.95-40.8c3.466-8.533,5.85-17.934,7.15-28.2 c0.533-4.1,0.833-7.649,0.9-10.649V225.55v-117v117h8.4c9.167-0.666,22.7-1,40.6-1c30.833,0,52.25-13.666,64.25-41 c3.767-8.533,6.35-17.933,7.75-28.2c0.567-4.1,0.9-7.65,1-10.65v-75v75v42h8.4c9.167-0.667,22.7-1,40.6-1 c30.833,0,52.25-13.667,64.25-41c3.767-8.534,6.35-17.934,7.75-28.2C209.067,112.4,209.4,108.85,209.5,105.85z M209.05,11.7 l0.3,24.5L209.05,11.7z'/%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' fill='none' stroke='%23000000' stroke-width='65.65' stroke-linecap='round' stroke-linejoin='round' stroke-miterlimit='3' d=' M209.5,105.85c-0.1,3-0.433,6.55-1,10.65c-1.4,10.267-3.983,19.667-7.75,28.2c-12,27.333-33.417,41-64.25,41 c-17.9,0-31.433,0.333-40.6,1h-8.4v-42v-75 M87.5,144.7c-0.1,3-0.433,6.55-1,10.65c-1.4,10.267-3.983,19.667-7.75,28.2 c-12,27.334-33.417,41-64.25,41c-17.9,0-31.433,0.334-40.6,1h-8.4v-117 M-34.5,225.55V350.65c-0.067,3-0.367,6.55-0.9,10.649 c-1.3,10.267-3.684,19.667-7.15,28.2c-10.367,25.533-28.35,39.134-53.95,40.8c-25.567-1.666-43.533-15.267-53.9-40.8 c-3.467-8.533-5.85-17.934-7.15-28.2c-0.534-4.1-0.85-7.649-0.95-10.649V-22.4c-90.6,112.1-148.25,110.783-172.95-3.95 c107.767-96.367,179.75-231.033,215.95-404l364,1c13.7,37.833,29.367,89.1,47,153.8c17.667,64.7,29.583,157.767,35.75,279.2 l0.25,51c0.033,3.4-0.3,7.667-1,12.8c-1.4,10.267-3.983,19.667-7.75,28.2c-12,27.333-33.417,41-64.25,41 c-17.9,0-31.433,0.333-40.6,1l-8.4,1v-32.8c0-0.4,0-0.817,0-1.25l-0.15-68.4l0.15-15.55 M209.05,11.7l0.3,24.5'/%3E%3C/g%3E%3C/symbol%3E%3Cuse xlink:href='%23hand' width='728.602' height='926.3' x='-364.275' y='-463.175' transform='matrix(0.353 0 0 -0.353 256.5 196.6499)' overflow='visible'/%3E%3C/svg%3E");
    width: 10vw;
    height: 10vw;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    animation: swipeUp 1.6s ease-in-out infinite;
}
#fs-arr1 { animation: arrowPulse 1.6s ease-in-out 0.00s infinite; }
#fs-arr2 { animation: arrowPulse 1.6s ease-in-out 0.15s infinite; }
#fs-arr3 { animation: arrowPulse 1.6s ease-in-out 0.30s infinite; }
#fs-arr4 { animation: arrowPulse 1.6s ease-in-out 0.45s infinite; }
#fs-arr5 { animation: arrowPulse 1.6s ease-in-out 0.60s infinite; }
#fs-arr6 { animation: arrowPulse 1.6s ease-in-out 0.75s infinite; }
@keyframes swipeUp {
    0%   { transform: translateY(0px);   opacity: 1; }
    60%  { transform: translateY(-72px); opacity: 1; }
    80%  { transform: translateY(-80px); opacity: 0; }
    100% { transform: translateY(-80px); opacity: 0; }
}
@keyframes arrowPulse {
    0%,100% { opacity: 0.2; }
    50%     { opacity: 1;   }
}

/* ---- POWERUP COUNTER ---- */
#powerup-counter {
    position: absolute;
    left: 50%;
    top: calc(100% + var(--cw));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    padding: 4px 10px 4px 6px;
    pointer-events: none;
    z-index: 3;
    font-size: calc(var(--cw)*1.51);
    font-weight: bold;
    color: #fff;
    white-space: nowrap;
    user-select: none;
}
#powerup-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}

/* ---- LANDSCAPE JUMP ZONE (touch landscape only) ---- */
#landscape-jump-zone {
    position: absolute;
    left: 0;
    top: 0;
    width: 20%;
    height: 100%;
    background: rgba(0,0,0,0.05);
    touch-action: none;
    z-index: 3;
    pointer-events: auto;
    display: none;
}

/* ---- PORTRAIT CONTROLS STRIP ---- */
#controls-strip {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35dvh;
    background: #0d0620;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    z-index: 50;
    align-items: stretch;
}

#portrait-jump-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    background: rgba(231, 76, 60, 0.07);
    transition: background 0.1s;
    position: relative;
}
#portrait-jump-zone.pressed {
    background: rgba(231, 76, 60, 0.25);
}

.ctrl-hint {
    color: rgba(255,255,255,0.22);
    
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    pointer-events: none;
    user-select: none;
}

#portrait-divider {
    width: 2px;
    height: 55%;
    align-self: center;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
    flex-shrink: 0;
}

#portrait-joy-zone {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#portrait-joystick-base {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.55) 100%);
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 18px rgba(0,0,0,0.6), inset 0 2px 8px rgba(255,255,255,0.07);
    position: relative;
    overflow: visible;
}

#portrait-joystick-nub {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 34%, #f1c40f, #b8860b);
    border: 3px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 1px 3px rgba(255,255,255,0.2);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    will-change: transform;
    transition: transform 0.12s ease-out;
}
#portrait-joystick-nub.active { transition: none; }

/* ---- MUTE / FULLSCREEN BUTTONS ---- */
#mute-btn {
    display: block;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    padding: 2px 7px;
    cursor: pointer;
    position: absolute;
    top: 73px;
    right: 16px;
    line-height: 1.4;
    z-index: 3;
    pointer-events: all;
}
#fs-btn {
    display: block;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    padding: 2px 7px;
    cursor: pointer;
    position: absolute;
    top: 99px;
    right: 16px;
    margin-top: 4px;
    line-height: 1.4;
    z-index: 3;
    pointer-events: all;
}
#fs-btn::after { content: '⛶'; }
html.fs-active #fs-btn::after { content: '✕'; }

@media (pointer: fine) {
    #mute-btn:hover {
        background: rgba(0, 0, 0, 0.75);
        border-color: rgba(255, 255, 255, 0.6);
    }
}

/* ================================================================
   JUMP BUTTON VISUAL — touch devices only
   ================================================================ */
@media (pointer: coarse) {
    .jump-btn-visual {
        width: 82px;
        height: 82px;
        border-radius: 50%;
        background: radial-gradient(circle at 38% 32%, #f9e07a, #c89a10 60%, #7a5a00);
        border: 3px solid rgba(255, 220, 80, 0.7);
        box-shadow: 0 6px 0 rgba(0,0,0,0.5), 0 0 18px rgba(230,180,20,0.45), inset 0 2px 5px rgba(255,255,200,0.3);
        pointer-events: none;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        transition: transform 0.08s ease, box-shadow 0.08s ease;
    }

    .jump-btn-visual::after {
        content: '';
        display: block;
        width: 0;
        height: 0;
        border-left: 14px solid transparent;
        border-right: 14px solid transparent;
        border-bottom: 22px solid rgba(30, 15, 0, 0.75);
        margin-top: -4px;
        filter: drop-shadow(0 1px 2px rgba(255,220,80,0.4));
    }

    #portrait-jump-zone {
        flex-direction: column;
        gap: 8px;
    }

    #portrait-jump-btn {
        position: relative;
    }
    #portrait-jump-btn:active,
    #portrait-jump-zone.pressed .jump-btn-visual {
        transform: translateY(4px);
        box-shadow: 0 2px 0 rgba(0,0,0,0.5), 0 0 10px rgba(230,180,20,0.3), inset 0 2px 5px rgba(255,255,200,0.2);
    }

    #landscape-jump-zone {
        align-items: flex-end;
        justify-content: center;
        padding-bottom: 20px;
    }

    #landscape-jump-btn {
        position: relative;
    }
}

/* Hide jump button visuals entirely on non-touch */
@media (pointer: fine) {
    .jump-btn-visual {
        display: none;
    }
}


@media (pointer: coarse) and (orientation: landscape) {
    #landscape-jump-zone { display: flex; }
}


/* ================================================================
   TUTORIAL SCREEN
   ================================================================ */
#tutorial-screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    z-index: 25;
    background: rgba(8, 4, 20, 0.97);
    overflow: hidden;
}

/* Each step fills all remaining space above the nav bar */
.tut-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* padding: 16px 18px 0; */
    padding-top: 24px;
    gap: 14px;
    overflow: hidden;
    min-height: 0;
}

.tut-step-bg {
    flex: 1;
    width: 100%;
    min-height: 0;
    background: linear-gradient(#0e0630 0%, #1c0f5e 55%, #2d1a7a 100%);
    border-radius: 12px 12px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 16px;
}

.tut-game-title {
    font-size: 26px;
    font-weight: bold;
    color: #e8c43a;
    letter-spacing: 3px;
    text-align: center;
    text-shadow: 3px 3px 0 #c0392b, 5px 5px 0 #000;
    text-transform: uppercase;
    line-height: 1.1;
    flex-shrink: 0;
}

.tut-step-title {
    font-size: 20px;
    font-weight: bold;
    color: #e8c43a;
    letter-spacing: 4px;
    text-align: center;
    text-shadow: 2px 2px 0 #000, 0 0 24px rgba(232,196,58,0.35);
    text-transform: uppercase;
    flex-shrink: 0;
}

.tut-scene {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    min-height: 0;
}

/* ---- Step 1: Controls ---- */
.tut-bunny-center {
    display: flex;
    align-items: center;
    justify-content: center;
}
.tut-bunny-center .tut-sprite {
    height: 88px;
}

.tut-ctrl-panel {
    display: flex;
    align-items: center;
    gap: 32px;
    justify-content: center;
}
/* Desktop keyboard only on non-touch; mobile only on touch */
.tut-keyboard { display: flex; }
.tut-touch    { display: none; }
@media (pointer: coarse) {
    .tut-keyboard { display: none; }
    .tut-touch    { display: flex; }
}

.tut-ctrl-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.tut-ctrl-sep {
    width: 2px;
    height: 70px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
    flex-shrink: 0;
}
.tut-keys-row {
    display: flex;
    gap: 8px;
}
.tut-key {
    min-width: 48px;
    height: 48px;
    background: linear-gradient(to bottom, #3a3a50, #1e1e30);
    border: 2px solid rgba(255,255,255,0.22);
    border-bottom: 4px solid rgba(0,0,0,0.65);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e8c43a;
    font-size: 20px;
    font-weight: bold;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
    padding: 0 10px;
}
.tut-key-lg {
    min-width: 96px;
    font-size: 12px;
    letter-spacing: 1px;
}
.tut-klabel {
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-align: center;
}

/* Mobile joystick replica — identical to #portrait-joystick-base/nub */
.tut-mjoy-wrap {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: radial-gradient(circle at 40% 38%, rgba(255,255,255,0.12) 0%, rgba(0,0,0,0.55) 100%);
    border: 3px solid rgba(255,255,255,0.2);
    box-shadow: 0 0 18px rgba(0,0,0,0.6), inset 0 2px 8px rgba(255,255,255,0.07);
    position: relative;
    overflow: visible;
}
.tut-mjoy-wrap .joy-arrow {
    position: absolute;
    color: rgba(255,255,255,0.35);
    font-size: 21px;
    pointer-events: none;
    line-height: 1;
    top: 50%;
    transform: translateY(-50%);
}
.tut-mjoy-wrap .joy-arrow.left  { left: 10px; }
.tut-mjoy-wrap .joy-arrow.right { right: 10px; }
.tut-mjoy-nub {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: radial-gradient(circle at 36% 34%, #f1c40f, #b8860b);
    border: 3px solid rgba(255,255,255,0.4);
    box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 1px 3px rgba(255,255,255,0.2);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
/* Reuse .jump-btn-visual for the tutorial jump button visual */
.tut-mjump-btn {
    pointer-events: none;
}

/* ---- Step 2: Goals ---- */
/* Matches #powerup-counter in the game exactly */
.tut-pup-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.55);
    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 8px;
    padding: 4px 10px 4px 6px;
    flex-shrink: 0;
    white-space: nowrap;
}
.tut-pup-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}
.tut-pup-count {
    font-size: 15px;
    font-weight: bold;
    color: #fff;
}

/* Game stage (shared by steps 2 & 3) */
.tut-stage {
    width: 100%;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.07);
}
.tut-stage-sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, #0e0630 0%, #1c0f5e 55%, #2d1a7a 100%);
}
.tut-stage-ground-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background-image: url('./assets/Tiles/Tile_Ground.png');
    background-repeat: repeat-x;
    background-size: 36px 36px;
    image-rendering: pixelated;
}
/* Step 2 stage sprites */
.tut-stage-char-l {
    position: absolute;
    bottom: 36px;
    left: 8%;
    height: 76px;
    image-rendering: pixelated;
}
.tut-stage-egg {
    position: absolute;
    bottom: 36px;
    left: 38%;
    height: 34px;
    image-rendering: pixelated;
}
/* Locked gate wrapper — label above, gate below */
.tut-gate-wrap {
    position: absolute;
    bottom: 36px;
    right: calc(8% + 68px);   /* 2 tiles left of the flag pole */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.tut-gate-label {
    color: #e8c43a;
    font-size: calc(var(--cw)*0.73);
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    text-shadow: 1px 1px 0 #000;
    white-space: nowrap;
    background: rgba(0,0,0,0.55);
    border: 1px solid rgba(232,196,58,0.4);
    border-radius: 5px;
    padding: 3px 7px;
}
.tut-stage-gate {
    height: 144px;
    image-rendering: pixelated;
}
/* Flag + pole: pole on the right, flag hangs to the left */
.tut-stage-flag-r {
    position: absolute;
    bottom: 36px;
    right: 8%;
    width: 64px;
    height: 110px;
}
.tut-pole {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 5px;
    height: 100px;
    background: linear-gradient(to bottom, #ddd, #999);
    border-radius: 2px;
}
.tut-flag-img {
    position: absolute;
    bottom: 76px;
    right: 5px;   /* right edge of flag meets left edge of pole */
    height: 20px;
    image-rendering: pixelated;
}
.tut-goal-text {
    color: rgba(255,255,255,0.88);
    font-size: 14px;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.8;
    text-shadow: 1px 1px 0 #000;
    flex-shrink: 0;
}

/* ---- Step 3: Dangers — annotation wrapper ---- */
.tut-ann-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 0;
}
/* Curved_Line.png arrow images */
.tut-curve {
    position: absolute;
    width: 75px;
    height: 75px;
    object-fit: contain;
    pointer-events: none;
    z-index: 8;
}
.tut-ann-label {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(8,4,20,0.84);
    border: 1px solid rgba(232,196,58,0.5);
    border-radius: 5px;
    padding: 4px 8px;
    color: rgba(255,255,255,0.92);
    font-size: calc(var(--cw)*0.83);
    letter-spacing: 1px;
    white-space: nowrap;
    z-index: 10;
    pointer-events: none;
}
.tut-ann-icon {
    color: #e8c43a;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
}
.tut-danger-hud {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    width: 100%;
    padding: 7px 14px;
    background: rgba(0,0,0,0.45);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}
.tut-d-hearts {
    display: flex;
    gap: 5px;
    align-items: center;
}
.tut-heart {
    width: 28px;
    height: 28px;
    image-rendering: pixelated;
    object-fit: contain;
}
.tut-d-timer {
    font-size: 18px;
    font-weight: bold;
    color: rgba(255,255,255,0.7);
    letter-spacing: 2px;
    position: relative;
    overflow: visible;
}
.tut-d-timer-val {
    color: #e74c3c;
}

/* Step 3 danger stage layout (left-ground | gap | right-ground) */
.tut-danger-stage {
    display: flex;
    flex-direction: column;
}
.tut-danger-stage .tut-stage-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.tut-ground-seg {
    position: absolute;
    bottom: 0;
    height: 80px;
}
.tut-ground-seg .tut-stage-ground-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 36px;
    background-image: url('./assets/Tiles/Tile_Ground.png');
    background-repeat: repeat-x;
    background-size: 36px 36px;
    image-rendering: pixelated;
}
.tut-gseg-l {
    left: 0;
    width: 58%;
}
.tut-gseg-r {
    right: 0;
    width: 30%;
}
.tut-jump-char {
    position: absolute;
    bottom: 89px;
    left: 26%;
    height: 60px;
    image-rendering: pixelated;
}
/* Goomba anchor: takes the goomba's old absolute position, children positioned relative to it */
.tut-goomba-anchor {
    position: absolute;
    bottom: 36px;
    left: 54%;
    overflow: visible;
}
.tut-goomba {
    display: block;
    height: 46px;
    image-rendering: pixelated;
}
.tut-label-goomba {
    position: absolute;    
    top: calc(-100% - 21px);
    left: 68%;
    white-space: nowrap;
}
.tut-curve-goomba {
    position: absolute;
    top: -100%;
    left: 69%;
    transform: rotate(186deg);
}
.tut-label-gap {
    position: absolute;
    top: calc(100% - 119px);
    left: calc(100% + 78px);
    white-space: nowrap;
}
.tut-curve-gap {
    position: absolute;
    top: calc(-100% - 40px);
    left: calc(100% + 20px);
    transform: scaleX(-1) rotate(139deg);
}
.tut-label-timer {
    position: absolute;
    top: calc(100% + 71px);
    left: -110%;
    white-space: nowrap;
}
.tut-curve-timer {
    position: absolute;
    top: 100%;
    right: 10px;
    left: -10%;
    transform: scaleY(-1) rotate(-208deg);
}


/* ---- Tutorial Nav Bar ---- */
#tut-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    flex-shrink: 0;
    border-top: 1px solid rgba(255,255,255,0.07);
    background: rgba(0,0,0,0.35);
}
#tut-dots {
    display: flex;
    gap: 9px;
    align-items: center;
}
.tut-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.18);
    transition: background 0.2s, transform 0.2s;
}
.tut-dot-active {
    background: #e8c43a;
    border-color: #e8c43a;
    transform: scale(1.35);
    box-shadow: 0 0 6px rgba(232,196,58,0.5);
}
#tut-skip-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.45);
    font-size: 11px;
    letter-spacing: 1.5px;
    padding: 9px 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.15s, border-color 0.15s;
    text-transform: uppercase;
}
#tut-skip-btn:hover { color: rgba(255,255,255,0.8); border-color: rgba(255,255,255,0.45); }
#tut-next-btn {
    background-image: url('./assets/UI_Elements/UI_Container_Primary_NoText.png');
    background-color: transparent;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    color: #0b1a2b;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 2px;
    padding: 10px 24px;
    cursor: pointer;
    transition: filter 0.1s, transform 0.1s;
    text-transform: uppercase;
}
#tut-next-btn:hover  { filter: brightness(1.08); transform: translate(-1px, -1px); }
#tut-next-btn:active { filter: brightness(0.95); transform: translate(1px, 1px); }

/* ---- END SCREEN BUTTONS ---- */
.end-screen-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
    pointer-events: all;
}
.end-lb-btn,
.end-exit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    transition: filter 0.1s, transform 0.1s;
    pointer-events: all;
}
.end-lb-btn {
    background: #e8c43a;
    color: #1a0a2e;
    box-shadow: 3px 3px 0 #8a6a00;
}
.end-lb-btn:hover  { filter: brightness(1.08); transform: translate(-1px, -1px); }
.end-lb-btn:active { filter: brightness(0.92); transform: translate(1px, 1px); }
.end-exit-btn {
    background: #555;
    color: #fff;
    box-shadow: 3px 3px 0 #222;
}
.end-exit-btn:hover  { filter: brightness(1.2); transform: translate(-1px, -1px); }
.end-exit-btn:active { filter: brightness(0.85); transform: translate(1px, 1px); }

/* ================================================================
   PORTRAIT TOUCH — all (pointer: coarse) and (orientation: portrait) rules
   Must be last so it overrides all base styles above.
   ================================================================ */
@media (pointer: coarse) and (orientation: portrait) {

    /* ---- Layout ---- */
    #game-container { border: unset; }
    #rotate-prompt  { display: none; }
    #joystick-zone  { display: none; }
    #jump-btn-zone  { display: none; }
    #ui-container {
        width: 100vw;
        height: 65vh;
    }

    /* ---- Screens: shared position/size ---- */
    #start-screen,
    #game-over-screen,
    #win-screen,
    #level-complete-screen,
    #lb-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: unset;
        width: 100vw;
        height: 65dvh;
        border-radius: 0;
        z-index: 1000;
    }

    #start-screen,
    #game-over-screen,
    #win-screen {
        gap: 10px;
    }

    .ui_container {
        gap: calc(var(--cw)*3.27);
        padding: calc(var(--cw)*4.8) calc(var(--cw)*5.94);
    }
    .start-screen-title {
        font-size: calc(var(--cw)*7.5);
        padding-bottom: calc(var(--cw)*3);
    }
    .screen-title {
        font-size: calc(var(--cw)*7.5);
    }
    /* ---- Start screen ---- */
    .screen-sub {
        font-size: calc(var(--cw)*2.19);
        letter-spacing: 1px;
        max-width: 90vw;
        line-height: 1.5;
    }
    .screen-sub li > div > div {
        height: calc(var(--cw)*3.15);
    }
    .screen-sub li > div p {
        font-size: calc(var(--cw)*2.16)
    }

    .start-btn,
    #go-home-btn {
        padding: 9px 24px;
        font-size: 16px;
        letter-spacing: 1px;
    }

    #controls-hint {
        font-size: calc(var(--cw)*2.16);
    }

    #lb-open-btn, .lb-open-btn {
        font-size: calc(var(--cw)*1.98);
        padding: 6px 16px;
    }

    /* ---- Level complete ---- */
    #lc-level  { 
        font-size: calc(var(--cw)*5.64); 
    }
    .lc-powerups-text,
    #lc-powerups,
    #lc-score  { 
        font-size: calc(var(--cw)*3.12);
    }
    #lc-next   { font-size: 14px; }

    #level-complete-screen {
        gap: 8px;
    }

    #lc-buttons {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
    }
    #lc-buttons button {
        width: 100%;
    }

    #next-level-button,
    #redeem-button {
        padding: 9px 18px;
        font-size: calc(var(--cw)*2.5);
        letter-spacing: 1px;
    }

    /* ---- HUD ---- */
    #ui-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        right: unset;
        padding: calc(var(--cw)*4.07) calc(var(--cw)*2.03);
        justify-content: space-around;
    }
    .ui-section {
        gap: calc(var(--cw)*1.07);
    }
    .ui-label {
        font-size: calc(var(--cw)*1.8);
    }
    .ui-value {
        font-size: calc(var(--cw)*3.05);
    }
    #hearts .hud-heart {
        height: calc(var(--cw)*4.07);
        width: calc(var(--cw)*4.07);
    }
    #level-display {
        font-size: 10.5px;
        letter-spacing: 0px;
        padding: 0 2px;
        align-self: center;
    }

    #powerup-counter {
        left: 50%;
        transform: translateX(-50%);
        font-size: calc(var(--cw)*3.58);
        padding: 3px 8px 3px 5px;
        z-index: 3;
    }
    #powerup-img {
        width: 16px;
        height: 16px;
    }
    .powerup-banner {
        position: fixed;
        top: 1004px;
        font-size: 11px;
        padding: 4px 12px;
        z-index: 1003;
        white-space: nowrap;
    }
    #mute-btn {
        
    }
    #fs-btn {
        
    }
    .tut-gate-label {
        font-size: calc(var(--cw)*2);
    }
    /* ---- Leaderboard panel ---- */
    #lb-panel-title { font-size: 13px; letter-spacing: 1px; }
    #lb-close-btn   { font-size: 10px; padding: 3px 8px; }
    .lb-tab         { font-size: 9px;  padding: 4px 10px 8px; }
    .lb-table       { font-size: 11px; }
    .lb-table th,
    .lb-table td    { padding: 6px 6px; }
    #lb-controls    { gap: 6px; padding: 8px 12px 6px; }
    #lb-controls label { font-size: 9px; }
    #lb-limit-select   { font-size: 10px; padding: 3px 6px; }
    #lb-refresh-btn    { font-size: 9px;  padding: 3px 8px; }

    /* ---- Tutorial ---- */
    #tutorial-screen {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: unset;
        width: 100vw;
        height: 65dvh;
        z-index: 1001;
    }
    .tut-game-title { font-size: 20px; }
    .tut-step-title { font-size: 12px; letter-spacing: 2px; }
    .tut-bunny-center .tut-sprite { height: 64px; }
    .tut-goal-text { font-size: 11px; line-height: 1.6; padding: 8px; }
    .tut-warn-item { font-size: 10px; padding: 4px 8px; }
    #tut-skip-btn  { font-size: 10px; padding: 7px 10px; }
    #tut-next-btn  { font-size: 11px; padding: 8px 18px; }
    .tut-key       { min-width: 38px; height: 38px; font-size: 16px; }
    .tut-key-lg    { min-width: 76px; font-size: 10px; }
    .tut-stage-egg {
        left: 28%;
    }
    .tut-gate-wrap {
        left: 45%;
    }
    .tut-gseg-r {
        width: 20%;
    }
    .tut-curve-gap {
        top: calc(-100% - 4px);
        left: calc(100% + 8px);
        transform: scaleX(-1) rotate(152deg);
    }
    .tut-label-gap {
        top: calc(100% - 102px);
        left: calc(100% + 15px);
    }
    .tut-ann-label {
        font-size: calc(var(--cw)*2.49);
    }
    .end-screen-btns {
        flex-direction: column;
    }
    .played-today-msg {
        font-size: calc(var(--cw)*3);
        padding-bottom: calc(var(--cw)*3);
    }
}

