:root {
    /* BALATRO DECK UPDATE */
    --bg-green: #004225;
    /* Aston Martin Racing Green */
    --amr-lime: #c4d600;
    /* AMR Signature Lime */
    --panel-dark: #0a1a14;
    --panel-border: #1a3a2a;
    --accent-blue: #0059ff;
    --accent-red: #ff3b3f;
    --accent-gold: var(--amr-lime);
    --text-white: #f5f5f5;
    --text-grey: #8a9a94;
    --carbon: #121212;
}

.hidden {
    display: none !important;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background-color: #050a08;
    background-image:
        radial-gradient(circle at center, #0a1510 0%, #050a08 100%);
    height: 100dvh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-white);
}

#game-container {
    width: 100%;
    max-width: 440px;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom, 20px));
    gap: 8px;
    position: relative;
    border: 1px solid rgba(196, 214, 0, 0.2);
    /* Island Background */
    background: var(--bg-green);
    background-image:
        radial-gradient(circle at center, rgba(6, 49, 36, 0.8) 0%, rgba(0, 26, 16, 0.9) 100%),
        url('assets/TilableBackground.png');
    background-size: cover, 256px 256px;
    background-repeat: no-repeat, repeat;

    overflow: hidden;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    /* Subtle rounding for the island */
}

/* Boss Container Styling */
#boss-container {
    background: #0a1012;
    border: 3px solid var(--panel-border);
    border-radius: 12px;
    padding: 10px 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
    margin-bottom: 5px;
    position: relative;
    overflow: hidden;
}

#boss-info {
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

#boss-icon-container {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #2a3a3a 0%, #1a2a2a 100%);
    border-radius: 8px;
    border: 2px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

#boss-icon {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.boss-name-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#boss-name {
    font-size: 1rem;
    font-weight: 900;
    color: var(--amr-lime);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.health-bar-wrapper {
    height: 32px;
    background: #1a1a1a;
    border: 2px solid #333;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.8);
}

#boss-health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #d32f2f, #f44336, #ff7043);
    transition: width 0.4s ease-out;
}

#boss-health-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 32px;
    top: 0;
    left: 0;
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 1);
    letter-spacing: 1px;
}

@keyframes healthFlash {
    0% {
        filter: brightness(3);
        transform: scaleY(1.2);
    }

    100% {
        filter: brightness(1);
        transform: scaleY(1);
    }
}

.health-flash {
    animation: healthFlash 0.3s ease-out forwards;
}

/* Updated Top Score Bar Placement */
#top-score-bar {
    display: flex;
    gap: 12px;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-4px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(4px);
    }
}

.boss-hit {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

.score-card {
    flex: 1;
    background: #1a1c22;
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.score-card.player .card-label {
    text-align: right;
}

.card-label {
    font-size: 0.7rem;
    font-weight: 850;
    line-height: 1.1;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-val-box {
    background: #3d414d;
    border-radius: 8px;
    padding: 6px 15px;
    min-width: 85px;
    text-align: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#target-score,
#current-score {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

/* Hand Info Section - Horizontal Row */
#hand-progress-bar {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 15px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-square {
    width: 65px;
    height: 85px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.stat-square.hands .sq-label {
    background: #0059ff;
}

.stat-square.discards .sq-label {
    background: #ff3b3f;
}

.sq-label {
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.55rem;
    font-weight: 900;
    color: #fff;
    line-height: 1;
    text-transform: uppercase;
    padding: 0 5px;
}

.sq-value {
    flex: 1;
    background: #1a1c22;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 950;
    color: #fff;
}

.center-hand-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.hand-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#predicted-hand {
    font-size: 1.3rem;
    font-weight: 950;
    color: #fff;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    text-align: center;
}

.calc-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-bubble {
    width: 80px;
    height: 38px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 950;
    color: #fff;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.stat-bubble.blue {
    background: #4a90e2;
}

.stat-bubble.red {
    background: #f06a6c;
}

.cross {
    font-size: 1.4rem;
    font-weight: 950;
    color: #fff;
}

.info-icon {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 100;
    width: 26px;
    height: 26px;
    background: #fff;
    border: none;
    border-radius: 50%;
    color: #000;
    font-size: 0.9rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cheat-icon {
    position: absolute;
    top: 12px;
    left: 45px;
    /* Offset from info-btn */
    z-index: 100;
    width: 26px;
    height: 26px;
    background: #ff3b3f;
    /* Red for cheat */
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.money-panel-top {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 100;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 950;
    text-transform: uppercase;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    font-family: 'Outfit', sans-serif;
}

.cheat-panel-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.cheat-panel-content {
    background: #1a1c22;
    border: 2px solid #ff3b3f;
    border-radius: 12px;
    padding: 20px;
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
}

.cheat-panel-content h3 {
    color: #ff3b3f;
    margin: 0;
    text-align: center;
}

#cheat-input {
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #333;
    background: #000;
    color: #fff;
    font-size: 1rem;
}

#cheat-submit {
    padding: 10px;
    background: #ff3b3f;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 900;
    cursor: pointer;
}

#cheat-close {
    background: transparent;
    color: #888;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

/* Play Area */
#play-area {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 1px solid rgba(196, 214, 0, 0.05);
}

.badge-row {
    position: absolute;
    top: 15%;
    display: flex;
    gap: 10px;
    z-index: 10;
}

.score-badge {
    background: var(--amr-lime);
    color: #000;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 900;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    80% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.poker-hand {
    display: flex;
    height: 180px;
    align-items: center;
    justify-content: center;
    padding: 10px;
    padding-top: 40px;
    /* Move cards down */
    width: 100%;
}

.card {
    width: 75px;
    height: 110px;
    background: #fff;
    border-radius: 6px;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-left: -30px;
    /* Adjusted overlap for larger width */
}

.card:first-child {
    margin-left: 0;
}



.card.selected {
    transform: translateY(-25px);
    border: 3px solid var(--accent-gold);
    box-shadow: 0 0 20px rgba(196, 214, 0, 0.4), 0 10px 20px rgba(0, 0, 0, 0.5);
    /* No z-index change to maintain right-side neighbor visibility */
}

@media (max-width: 380px) {
    .card {
        width: 65px;
        height: 95px;
        margin-left: -35px;
    }

    .center-suit-big {
        font-size: 2rem;
    }
}

.card-top-left {
    position: absolute;
    top: 5px;
    left: 5px;
    text-align: center;
    line-height: 1;
    font-weight: 950;
    font-size: 0.85rem;
}

.card-bottom-right {
    position: absolute;
    bottom: 5px;
    right: 5px;
    transform: rotate(180deg);
    line-height: 1;
    font-weight: 950;
    font-size: 0.85rem;
}

.center-suit-big {
    font-size: 2.8rem;
    font-weight: 950;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.card.red {
    color: var(--accent-red);
}

.card.black {
    color: #1a1c22;
}

/* --- CARD ANIMATIONS --- */
@keyframes dealCard {
    0% {
        transform: translate(var(--deal-x, 250px), var(--deal-y, 400px)) scale(0.2) rotate(30deg);
        opacity: 0;
    }

    100% {
        transform: translate(0, 0) scale(1) rotate(0deg);
        opacity: 1;
    }
}

@keyframes bossDefeated {
    0% {
        transform: scale(1) translateY(0);
        filter: brightness(1);
    }

    15% {
        transform: scale(1.2) translateY(10px);
        filter: brightness(2);
    }

    30% {
        transform: scale(1.1) translateY(-20px);
        filter: brightness(1.5);
    }

    100% {
        transform: scale(0.5) translateY(-600px) rotate(15deg);
        opacity: 0;
    }
}

.boss-defeated {
    animation: bossDefeated 1.2s ease-in forwards;
}

.star-particle {
    position: absolute;
    top: -30px;
    color: #ffd700;
    font-size: 24px;
    pointer-events: none;
    z-index: 10000;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    user-select: none;
}

@keyframes starFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(110vh) rotate(360deg);
        opacity: 0;
    }
}

@keyframes playCard {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    30% {
        transform: translate(0, -20px) scale(1.1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--play-x, 0), var(--play-y, -400px)) scale(0.3) rotate(-15deg);
        opacity: 0;
    }
}

@keyframes discardCard {
    0% {
        transform: translateY(0) rotate(0);
        opacity: 1;
    }

    100% {
        transform: translateY(300px) rotate(20deg);
        opacity: 0;
    }
}

.card.dealing {
    animation: dealCard 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    animation-delay: var(--delay);
}

.card.playing {
    animation: playCard 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: var(--delay);
    pointer-events: none;
}

.card.discarding {
    animation: discardCard 0.5s cubic-bezier(0.4, 0, 1, 1) forwards;
    animation-delay: var(--delay);
    pointer-events: none;
}

/* Ensure selected state doesn't override animation during play/discard */
.card.playing.selected,
.card.discarding.selected {
    border-color: transparent !important;
    box-shadow: none !important;
}

/* Controls */
#controls-section {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 15px;
    height: 100px;
}

.action-btn {
    flex: 1;
    height: 100%;
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5);
    /* Slightly smaller shadow for better space */
    transition: all 0.1s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.1;
}

.action-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
}

.action-btn:disabled {
    opacity: 0.3;
    filter: grayscale(1);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 1);
    cursor: not-allowed;
}

.play-btn {
    background: #004ecc;
    border-bottom: 4px solid #002b74;
}

.discard-btn {
    background: #cc2a2e;
    border-bottom: 4px solid #801316;
}

#middle-control-column {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex: 1.5;
    height: 100%;
    gap: 12px;
}

.sort-ctrl {
    background: var(--carbon);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 6px;
    text-align: center;
    min-width: 110px;
}

.sort-title {
    font-size: 0.5rem;
    font-weight: 900;
    color: var(--amr-lime);
    margin-bottom: 2px;
    text-transform: uppercase;
}

.sort-btns {
    display: flex;
    gap: 4px;
}

.sort-opt {
    flex: 1;
    background: #252525;
    border: none;
    color: #888;
    font-size: 0.7rem;
    font-weight: 900;
    padding: 8px 0;
    border-radius: 4px;
    cursor: pointer;
}

.sort-opt.active {
    background: var(--amr-lime);
    color: #000;
}

/* Overlays */
.overlay {
    position: absolute;
    /* Set to absolute so it stays within #game-container */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    overflow: hidden;
}

#lobby-moving-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image: url('assets/TilableBackground.png');
    background-repeat: repeat;
    background-size: 256px 256px;
    /* Adjust based on image scale */
    opacity: 0.3;
    z-index: -1;
    animation: moveLobbyBg 60s linear infinite;
    pointer-events: none;
}

@keyframes moveLobbyBg {
    from {
        transform: translate(0, 0);
    }

    to {
        transform: translate(-256px, -256px);
    }
}

.overlay-content {
    background: #121212;
    border: 3px solid var(--amr-lime);
    border-radius: 20px;
    padding: 30px;
    /* Reduced for mobile */
    text-align: center;
    max-width: 420px;
    width: 90%;
    max-height: 85svh;
    /* Prevent clipping */
    overflow-y: auto;
    color: #fff;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8), inset 0 0 20px rgba(196, 214, 0, 0.1);
    position: relative;
}

.overlay-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: none;
    font-size: 1.4rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.1s ease;
    background: linear-gradient(180deg, var(--amr-lime) 0%, #a4b300 100%);
    color: #000;
    box-shadow: 0 6px 0 #6d7800;
    margin-top: 25px;
    display: block;
}

.overlay-btn:hover {
    filter: brightness(1.1);
}

.overlay-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 #6d7800;
}

.overlay-content.dark-panel.large {
    width: 90%;
    max-width: 600px;
    min-height: 500px;
    padding: 25px;
    display: flex;
    flex-direction: column;
}

.run-info-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
}

.info-tab {
    background: #252525;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    font-weight: 900;
    font-size: 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 0 #000;
    text-transform: uppercase;
}

.info-tab.active {
    background: var(--amr-lime);
    color: #000;
    box-shadow: 0 4px 0 #899600;
}

.info-list {
    width: 100%;
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.hand-row {
    background: rgba(0, 0, 0, 0.4);
    margin-bottom: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

.lvl-badge {
    background: #fff;
    color: #333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: lowercase;
}

.hand-name-txt {
    flex: 1;
    text-align: left;
    font-size: 1rem;
    color: #fff;
}

.chips-badge {
    background: #4a90e2;
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    min-width: 45px;
    font-size: 0.8rem;
    box-shadow: 0 3px 0 #2e64a1;
}

.mult-badge {
    background: #f06a6c;
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    min-width: 35px;
    font-size: 0.8rem;
    box-shadow: 0 3px 0 #b34a4c;
}

.played-count {
    color: #aaa;
    font-size: 0.8rem;
    min-width: 40px;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 4px;
}

.played-count::before {
    content: '#';
    color: #888;
}

.menu-play-btn.secondary {
    background: #ff9d00;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px;
    font-size: 1.5rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 0 #b34200;
    margin-top: 20px;
}

.hidden {
    display: none !important;
}

/* Home Screen */
.overlay-content.transparent {
    background: transparent;
    border: none;
    box-shadow: none;
    max-width: 600px;
    /* Increased to allow wider logo */
}

.main-logo-container {
    margin-bottom: 0px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.main-logo-img {
    width: 90%;
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    animation: logoBreath 3s ease-in-out infinite;
}

@keyframes logoBreath {

    0%,
    100% {
        transform: scale(1);
        text-shadow: 0 0 20px rgba(196, 214, 0, 0.4);
    }

    50% {
        transform: scale(1.05);
        text-shadow: 0 0 40px rgba(196, 214, 0, 0.8);
    }
}

@keyframes playPulse {
    0% {
        box-shadow: 0 8px 0 #917608, 0 0 0 rgba(241, 196, 15, 0);
    }

    50% {
        box-shadow: 0 8px 0 #917608, 0 0 30px rgba(241, 196, 15, 0.4);
    }

    100% {
        box-shadow: 0 8px 0 #917608, 0 0 0 rgba(241, 196, 15, 0);
    }
}

/* Old text logo styles removed */

.home-buttons {
    display: flex;
    flex-direction: column;
    gap: 0px;
    /* Moves play button up */
    align-items: center;
}

.menu-play-btn {
    padding: 22px 100px;
    font-size: 2.5rem;
    font-weight: 950;
    background: linear-gradient(180deg, #f1c40f 0%, #d4ac0d 100%);
    border: none;
    border-radius: 100px;
    /* Pill shape like image 2 */
    color: #000;
    cursor: pointer;
    box-shadow: 0 8px 0 #917608;
    transition: all 0.1s;
    text-transform: uppercase;
    animation: playPulse 2s infinite;
}

@media (max-width: 480px) {
    .menu-play-btn {
        padding: 16px 60px;
        font-size: 1.8rem;
        border-radius: 12px;
        box-shadow: 0 6px 0 #6d7800;
    }
}

.menu-play-btn:active {
    transform: translateY(5px);
    box-shadow: 0 5px 0 #6d7800;
}

/* Floating Cards Removed as requested */

/* Level Select (New) */
#stage-select-view {
    background: radial-gradient(circle at center, #006b3c 0%, #004225 100%);
    background-image:
        repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.05) 0, rgba(0, 0, 0, 0.05) 1px, transparent 1px, transparent 20px),
        radial-gradient(circle at center, #006b3c 0%, #004225 100%);
}

.level-select-container {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    height: 90vh;
}

.level-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 30px;
}

.back-btn-round {
    position: absolute;
    left: 0;
    width: 45px;
    height: 45px;
    background: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.back-btn-round::before {
    content: '◀';
    color: #333;
    font-size: 1.2rem;
}

.level-logout-btn {
    position: absolute;
    right: 0;
    z-index: 99;
    pointer-events: auto;
    background: linear-gradient(90deg, #ff3b3f, #cc2a2e, #801316, #ff3b3f);
    background-size: 300% 100%;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 0 #500002, 0 8px 16px rgba(204, 42, 46, 0.35);
    text-transform: uppercase;
    animation: pulseRed 2.2s infinite ease-in-out, sweepGradient 3s infinite linear;
    transition: all 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-logout-btn:hover {
    filter: brightness(1.25);
    transform: scale(1.08);
}

.level-logout-btn:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 2px 0 #500002;
}

@keyframes pulseRed {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 4px 0 #500002, 0 0 0 rgba(255, 59, 63, 0);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 0 #500002, 0 0 20px rgba(255, 59, 63, 0.8);
    }
}

@keyframes sweepGradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.level-select-title {
    font-size: 2.8rem;
    font-weight: 950;
    color: #fff;
    text-transform: uppercase;
    line-height: 0.9;
    text-align: center;
    text-shadow: 0 4px 0 rgba(0, 0, 0, 0.4);
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    padding: 10px 0;
    flex: 1;
    /* Allow it to take up available space */
    overflow-y: auto;
    /* Enable vertical scrolling */
    padding-right: 12px;
    /* Space for scrollbar */
}

/* Custom Scrollbar for Level Grid */
.level-grid::-webkit-scrollbar {
    width: 6px;
}

.level-grid::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.level-grid::-webkit-scrollbar-thumb {
    background: var(--amr-lime);
    border-radius: 10px;
}


.level-card {
    background: #d1d8e0;
    border-radius: 15px;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    height: 160px;
    padding-top: 10px;
}

.level-card:not(.locked):hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.level-card.locked {
    background: #2d3436;
    opacity: 0.9;
    cursor: not-allowed;
}

.lvl-boss-name {
    font-size: 0.7rem;
    font-weight: 900;
    color: #1e272e;
    text-align: center;
    text-transform: capitalize;
    margin-bottom: 2px;
}

.level-card.locked .lvl-boss-name {
    color: #485460;
}

.lvl-icon-box {
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.lvl-icon-img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.2));
}

.level-card.locked .lvl-icon-img {
    filter: brightness(0.1) contrast(0.5);
    opacity: 0.5;
}

.slash-mark {
    position: absolute;
    width: 100%;
    height: 10px;
    background: #e74c3c;
    transform: rotate(-45deg);
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    z-index: 5;
}

.lock-icon {
    font-size: 4rem !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    opacity: 1;
    z-index: 10;
    text-shadow: none;
}

.lvl-target-box {
    width: 100%;
    background: #34495e;
    border-radius: 0 0 15px 15px;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
}

.lvl-target-label {
    font-size: 0.6rem;
    font-weight: 950;
    color: #95afc0;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1;
}

.lvl-target-val {
    font-size: 1.4rem;
    font-weight: 950;
    color: #fff;
    line-height: 1;
}

.level-card.locked .lvl-target-box {
    background: #1e272e;
}

.level-card.locked .lvl-target-val {
    color: #485460;
}

.hidden {
    display: none !important;
}

/* Utility */
.blue-bg {
    background: #0059ff;
}

.red-bg {
    background: #ff3b3f;
}

.dark-bg {
    background: var(--carbon);
}

/* --- DECK VISUAL IN-GAME (Revised) --- */
#deck-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    gap: 4px;
    margin-top: 35px;
    /* Move down */
}

#deck-area.hidden {
    display: none !important;
}

#deck-area:hover {
    transform: scale(1.05);
}

.deck-visual {
    width: 45px;
    height: 63px;
    background: url('assets/card_back_red.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 1px 1px 0 #333, 2px 2px 0 #333, 0 5px 15px rgba(0, 0, 0, 0.4);
}

#deck-count-badge {
    background: #1a1c22;
    color: var(--amr-lime);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 900;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

/* --- DECK MODAL --- */
.deck-modal-container {
    background: #34495e;
    border: 4px solid #4a5d6a;
    border-radius: 20px;
    width: 90%;
    /* Reduced from 95% */
    max-width: 750px;
    /* Reduced from 1000px */
    height: 85svh;
    /* Reduced from 90svh */
    display: flex;
    flex-direction: column;
    padding: 15px;
    position: relative;
    box-shadow: 0 0 60px rgba(0, 0, 0, 1), inset 0 0 30px rgba(0, 0, 0, 0.5);
    color: #fff;
    overflow: hidden;
}

.deck-modal-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.deck-tab {
    padding: 10px 30px;
    background: #1a1c22;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 5px 0 #000;
    transition: all 0.1s;
    position: relative;
}

.deck-tab.active {
    background: #e74c3c;
    box-shadow: 0 5px 0 #801316;
}

.deck-tab.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #e74c3c;
}

.deck-modal-body {
    flex: 1;
    display: flex;
    gap: 15px;
    overflow: hidden;
    padding: 5px;
}

.deck-modal-sidebar {
    display: none !important;
}

.deck-info-card {
    background: #1a1c22;
    border: 3px solid #3d414d;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.deck-info-card h2 {
    font-size: 1.6rem;
    color: #fff;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.deck-effect {
    background: #fff;
    color: #000;
    padding: 15px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 950;
    line-height: 1.3;
}

.deck-effect .highlight {
    color: #e74c3c;
    font-size: 1.4rem;
}

.base-cards-stats {
    background: #0f1a1a;
    border: 3px solid #1a3a2a;
    border-radius: 12px;
    padding: 15px;
    flex: 1;
}

.base-cards-stats h3 {
    font-size: 0.9rem;
    color: #e74c3c;
    margin-bottom: 15px;
    text-align: center;
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-bubble-small {
    background: #1a1c22;
    border-radius: 8px;
    padding: 8px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 3px 0 #000;
}

.stat-bubble-small .label {
    font-size: 1.2rem;
    font-weight: 950;
}

.stat-bubble-small.white {
    color: #fff;
}

.stat-bubble-small.black {
    color: #5dade2;
}

.stat-bubble-small.red {
    color: #e74c3c;
}

.stat-bubble-small .val {
    font-size: 1rem;
    font-weight: 900;
}

.rank-counts-col {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    background: rgba(0, 0, 0, 0.25);
    padding: 10px;
    border-radius: 10px;
    overflow-y: auto;
}

.rank-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 10px;
    font-size: 1rem;
    font-weight: 900;
}

.deck-grid-rows {
    flex: 1;
    background: #1a1c22;
    border: 3px solid #3d414d;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: auto;
}

@media (max-width: 768px) {
    .deck-modal-container {
        padding: 10px;
        width: 98%;
        height: 95svh;
    }

    .deck-modal-tabs {
        margin-bottom: 10px;
        gap: 8px;
    }

    .deck-tab {
        padding: 8px 15px;
        font-size: 0.9rem;
    }

    .deck-modal-body {
        flex-direction: column;
        overflow-y: hidden;
        gap: 10px;
        display: flex;
    }

    /* Hide sidebar and info cards fully */
    .deck-modal-sidebar {
        display: none !important;
    }

    .deck-grid-rows {
        order: 1;
        flex: 1;
        height: 100%;
        width: 100%;
        padding: 5px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .suit-row {
        height: auto;
        gap: 5px;
        margin-bottom: 5px;
    }

    .mini-card {
        min-width: 35px;
        height: 50px;
        font-size: 0.7rem;
    }

    .suit-label-large {
        width: 30px;
        font-size: 2rem;
    }

    .deck-back-btn {
        margin-top: 10px;
        padding: 10px;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    #controls-section {
        height: 85px;
        gap: 6px;
        padding-bottom: 10px;
    }

    .action-btn {
        font-size: 0.85rem;
        padding: 5px;
    }

    #middle-control-column {
        flex: 1.2;
        gap: 6px;
    }

    .sort-ctrl {
        min-width: 80px;
        padding: 4px;
    }

    .sort-opt {
        padding: 6px 0;
        font-size: 0.6rem;
    }

    .deck-visual {
        width: 35px;
        height: 50px;
    }

    #deck-area {
        margin-top: 25px;
    }

    .deck-info-card h2 {
        font-size: 1rem;
    }

    .deck-effect {
        padding: 8px;
        font-size: 0.8rem;
    }

    .base-cards-stats h3 {
        font-size: 0.7rem;
        margin-bottom: 8px;
    }

    .stat-bubble-small .label {
        font-size: 0.9rem;
    }

    .stat-bubble-small .val {
        font-size: 0.8rem;
    }
}

.suit-row {
    display: flex;
    gap: 12px;
    height: 75px;
    align-items: center;
}

.suit-label-large {
    width: 50px;
    font-size: 3.5rem;
    font-weight: 950;
    text-align: center;
}

.suit-label-large.black {
    color: #5dade2;
}

.suit-label-large.red {
    color: #e74c3c;
}

.suit-cards {
    flex: 1;
    display: flex;
    gap: 6px;
    justify-content: space-between;
}

.mini-card {
    flex: 1;
    background: #fff;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    max-width: 48px;
    height: 65px;
}

.mini-card.black {
    color: #1a1c22;
}

.mini-card.red {
    color: #e74c3c;
}

.deck-back-btn {
    margin-top: 20px;
    background: #f39c12;
    color: #fff;
    border: none;
    border-radius: 15px;
    padding: 15px;
    font-size: 1.8rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 8px 0 #d35400;
    text-transform: uppercase;
}

@media (max-width: 480px) {
    .info-icon {
        width: 22px;
        height: 22px;
        font-size: 0.8rem;
        top: 10px;
        left: 10px;
    }
}

.audio-toggle {
    background: rgba(10, 26, 20, 0.8);
    border: 2px solid var(--amr-lime);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 200;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    padding: 0;
    outline: none;
}

.audio-toggle:hover {
    transform: scale(1.1);
    background: var(--amr-lime);
    box-shadow: 0 0 20px rgba(196, 214, 0, 0.4);
}

.audio-toggle:hover .mute-icon {
    filter: invert(1);
}

.audio-toggle.muted {
    border-color: #ff3b3f;
    background: rgba(255, 59, 63, 0.1);
}

.audio-toggle.muted:hover {
    background: #ff3b3f;
}

.mute-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.music-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: filter 0.3s;
}

.audio-toggle:hover .music-icon-img {
    filter: brightness(0);
}

.audio-toggle.muted .mute-icon-container::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 3px;
    background: #ff3b3f;
    transform: rotate(45deg);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    border-radius: 2px;
}

.mute-icon {
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- SHOP & UPGRADES --- */
.level-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.shop-btn-large {
    width: 80%;
    padding: 18px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    border-radius: 15px;
    color: #000;
    font-size: 1.8rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 8px 0 #b37700, 0 15px 30px rgba(255, 165, 0, 0.4);
    transition: all 0.1s;
    font-family: 'Outfit', sans-serif;
}

.shop-btn-large:active {
    transform: translateY(4px);
    box-shadow: 0 4px 0 #b37700, 0 5px 15px rgba(255, 165, 0, 0.4);
}

.shop-container,
.level-select-container {
    background: #0d1a15;
    width: 90%;
    max-width: 440px;
    height: 94vh;
    border-radius: 24px;
    border: 4px solid var(--amr-lime);
    display: flex;
    flex-direction: column;
    padding: 15px;
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.9);
}

.shop-header,
.level-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.shop-title,
.level-select-title {
    font-size: 2.2rem;
    font-weight: 950;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.upgrade-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px;
}

/* Custom Scrollbar for Upgrade List */
.upgrade-list::-webkit-scrollbar {
    width: 6px;
}

.upgrade-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.upgrade-list::-webkit-scrollbar-thumb {
    background: var(--amr-lime);
    border-radius: 10px;
}

.upgrade-item {
    background: #1a2a24;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}

.upgrade-item:hover {
    background: #20352c;
}

.lvl-badge {
    background: #fff;
    color: #000;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 900;
}

.hand-name-upgrade {
    flex: 1;
    font-size: 1rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
}

.stat-preview {
    display: flex;
    align-items: center;
    gap: 5px;
}

.bubble-mini {
    padding: 4px 8px;
    border-radius: 4px;
    color: #fff;
    font-weight: 900;
    font-size: 0.8rem;
    min-width: 40px;
    text-align: center;
}

.bubble-mini.blue {
    background: #0059ff;
}

.bubble-mini.red {
    background: #ff3b3f;
}

.upgrade-price-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    color: #000;
    font-weight: 950;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #b37700;
    transition: all 0.1s;
    min-width: 60px;
}

.upgrade-price-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #b37700;
}

.upgrade-price-btn:disabled {
    filter: grayscale(1);
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: 0 2px 0 #333;
}

.shop-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid rgba(255, 255, 255, 0.05);
}

.shop-money-info {
    font-size: 1.4rem;
    font-weight: 950;
    text-align: center;
    color: var(--amr-lime);
}

.special-upgrade {
    background: #2a1a2a;
    border: 2px solid #a259ff;
}

.special-upgrade .hand-name-upgrade {
    color: #ffd700;
}

.special-upgrade .upgrade-price-btn {
    background: linear-gradient(135deg, #a259ff, #6a11cb);
    box-shadow: 0 4px 0 #4c0099;
}


/* Level Select Footer & Shop Button */
.level-footer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 15px 0;
    margin-top: 10px;
}

.shop-btn-large {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    font-size: 1.4rem;
    font-weight: 950;
    border: 3px solid #4a90e2;
    border-radius: 12px;
    padding: 10px 60px;
    cursor: pointer;
    box-shadow: 0 0 25px rgba(30, 60, 114, 0.4);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.shop-btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 30px rgba(30, 60, 114, 0.6);
    filter: brightness(1.2);
}

.shop-btn-large:active {
    transform: translateY(2px);
    box-shadow: 0 2px 10px rgba(30, 60, 114, 0.4);
}

/* --- Poker Hand Upgrade Shop Styles --- */
.upgrade-panel-container {
    background: radial-gradient(circle at center, #0a3d24 0%, #001a10 100%);
    border: 3px solid var(--panel-border);
    border-radius: 20px;
    padding: 15px 10px;
    width: 95%;
    max-width: 440px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.upgrade-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(196, 214, 0, 0.2);
    position: relative;
}

.upgrade-title {
    font-size: 2rem;
    font-weight: 950;
    color: #fff;
    text-align: center;
    flex: 1;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(196, 214, 0, 0.3);
}

.upgrade-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 5px;
}

/* Image 2 Type Panel Styling */
.upgrade-item {
    background: #111;
    border-radius: 12px;
    padding: 6px 8px;
    display: grid;
    grid-template-columns: 36px 1fr 92px 72px;
    align-items: center;
    gap: 6px;
    border: 2px solid #222;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.upgrade-item:hover {
    background: #1a1a1a;
    border-color: #333;
    transform: translateX(4px);
}

.lvl-badge-shop {
    width: 36px;
    height: 40px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    color: #1a1c22;
    font-size: 1.1rem;
    font-weight: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px;
    flex-shrink: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hand-name-upgrade {
    font-size: 0.85rem;
    font-weight: 800;
    color: #fff;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0px;
}

.upgrade-vals {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 92px;
}

.stat-chip-shop {
    background: #0059ff;
    color: #fff;
    padding: 3px 4px;
    border-radius: 6px;
    font-weight: 950;
    font-size: 0.8rem;
    min-width: 42px;
    text-align: center;
}

.stat-mult-shop {
    background: #ff3b3f;
    color: #fff;
    padding: 3px 4px;
    border-radius: 6px;
    font-weight: 950;
    font-size: 0.8rem;
    min-width: 32px;
    text-align: center;
}

.upgrade-buy-btn {
    background: #ffdb00;
    color: #111;
    border: none;
    padding: 5px 6px;
    border-radius: 8px;
    font-weight: 950;
    font-size: 0.85rem;
    cursor: pointer;
    box-shadow: 0 4px 0 #b39900;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: all 0.1s;
    width: 72px;
}

.upgrade-buy-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #8a9600;
}

.upgrade-buy-btn:disabled {
    background: #333;
    color: #999;
    opacity: 1;
    filter: none;
    cursor: not-allowed;
    box-shadow: 0 2px 0 #111;
}


.upgrade-footer {
    padding-top: 15px;
    border-top: 2px solid rgba(196, 214, 0, 0.2);
    margin-top: 5px;
}

.upgrade-item.max-level {
    border: 2px solid var(--amr-lime);
    background: #0a1f16;
}

.upgrade-item.max-level .lvl-badge-shop {
    color: #1a1c22;
}

.upgrade-item.max-level .upgrade-buy-btn {
    background: #333;
    color: #888;
    box-shadow: none;
    cursor: default;
}

/* --- Authentication Styles (Image 1 / BalPoker styling) --- */
#auth-screen {
    z-index: 9999; /* Overlay everything including home screen */
}

.auth-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0a1f16 0%, #030a07 100%);
    background-image:
        radial-gradient(circle at center, rgba(6, 49, 36, 0.9) 0%, rgba(0, 26, 16, 0.95) 100%),
        url('assets/TilableBackground.png');
    background-size: cover, 256px 256px;
    background-repeat: no-repeat, repeat;
    opacity: 0.95;
}

.auth-box {
    background: radial-gradient(circle at center, #0a1f16 0%, #001a10 100%);
    border: 3px solid var(--panel-border);
    border-radius: 20px;
    padding: 30px 20px;
    width: 90%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
    z-index: 10;
}

.auth-header-title {
    font-size: 2.8rem;
    font-weight: 950;
    color: #fff;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(196, 214, 0, 0.3);
    margin-bottom: 5px;
}

/* Tab toggle: [ SIGN IN ] [ SIGN UP ] */
.auth-tabs {
    display: flex;
    background: #0c1a14;
    border: 2px solid var(--panel-border);
    border-radius: 30px;
    width: 100%;
    padding: 4px;
    gap: 4px;
}

.auth-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-grey);
    padding: 10px 15px;
    font-size: 0.9rem;
    font-weight: 900;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

/* Active tab style: white bg, dark green text */
.auth-tab.active {
    background: #fff;
    color: #004225;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.auth-form-fields {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-input {
    width: 100%;
    padding: 14px 20px;
    border-radius: 12px;
    border: 2px solid var(--panel-border);
    background: #fff;
    color: #111;
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input::placeholder {
    color: #888;
    font-weight: 500;
}

.auth-input:focus {
    border-color: var(--amr-lime);
}

/* CONTINUE / SIGN UP Button (Amber style) */
.auth-submit-button {
    width: 100%;
    padding: 14px;
    background: #ffb700;
    color: #000;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 950;
    cursor: pointer;
    transition: all 0.1s ease;
    text-transform: uppercase;
    box-shadow: 0 4px 0 #cc9200, 0 10px 20px rgba(255, 183, 0, 0.2);
    text-align: center;
    margin-top: 5px;
}

.auth-submit-button:hover {
    background: #ffc425;
    transform: translateY(-1px);
}

.auth-submit-button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 #b38000;
}

.auth-divider {
    font-size: 1.1rem;
    font-weight: 950;
    color: #fff;
    text-transform: uppercase;
    margin: 5px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.auth-social-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.social-login-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 5px 0;
    outline: none;
    border-radius: 8px;
    overflow: hidden;
}

.social-img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.1s, filter 0.1s;
}

.social-login-btn:hover .social-img {
    transform: scale(1.02);
    filter: brightness(0.95);
}

.social-login-btn:active .social-img {
    transform: scale(0.98);
}

.auth-error-text {
    color: #ff3b3f;
    font-size: 0.85rem;
    font-weight: 850;
    text-align: center;
    margin-top: 5px;
    background: rgba(255, 59, 63, 0.1);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 59, 63, 0.3);
    width: 100%;
}

/* --- Settings UI --- */
.settings-icon {
    position: absolute;
    top: 12px;
    left: 78px; /* Offset from cheat-btn */
    z-index: 100;
    width: 26px;
    height: 26px;
    background: #0059ff;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 950;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.settings-icon:hover {
    transform: scale(1.1);
}

.settings-icon:active {
    transform: scale(0.9);
}

.settings-title {
    font-size: 2.2rem;
    font-weight: 950;
    color: #fff;
    text-align: center;
    letter-spacing: 3px;
    text-shadow: 0 0 15px rgba(196, 214, 0, 0.3);
    margin-bottom: 20px;
}

.settings-options {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.danger-btn {
    background: #cc2a2e !important;
    border-bottom: 4px solid #801316 !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.5) !important;
}

.danger-btn:hover {
    filter: brightness(1.1);
}

.danger-btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.5) !important;
}

/* Custom Scrollbar for Overlay Content */
.overlay-content::-webkit-scrollbar {
    width: 6px;
}

.overlay-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.overlay-content::-webkit-scrollbar-thumb {
    background: var(--amr-lime);
    border-radius: 10px;
}
