@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Russo+One&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #080516;
    --panel-bg: #110d26;
    --panel-border: #7b2ff7;
    --panel-glow: transparent;
    --neon-purple: #7b2ff7;
    --neon-blue: #00f5d4;
    --gold: #ffd60a;
    --crit-red: #ff0055;
    --text-white: #f0f0f5;
    --text-muted: #8a8ea8;
    --glass-bg: #110d26;
    --glass-border: #7b2ff7;
    
    /* Premium gamer fonts typography stack */
    --font-heading: 'Press Start 2P', monospace;
    --font-body: 'Press Start 2P', monospace;
    --font-stat: 'Press Start 2P', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

button, input, select, textarea, a {
    outline: none;
    font-family: var(--font-heading);
}

button:focus, input:focus, select:focus, textarea:focus, a:focus {
    outline: none !important;
}

body {
    background: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-body);
    font-size: 8px;
    line-height: 1.4;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Animated cosmic background behind the game container */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(123, 47, 247, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(0, 245, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 0, 85, 0.05) 0%, transparent 50%);
    animation: cosmicDrift 12s ease-in-out infinite alternate;
    z-index: -1;
}

@keyframes cosmicDrift {
    0% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    100% { transform: scale(1.15) rotate(3deg); opacity: 1; }
}

/* Simulated Mobile Container */
#game-container {
    position: relative;
    width: 400px;
    height: 700px;
    background: #050210;
    border-radius: 4px;
    box-shadow: 
        0 0 0 1px rgba(123, 47, 247, 0.2),
        0 0 30px rgba(123, 47, 247, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.8),
        0 0 0 6px #0d0825;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Isolate layout bounds to prevent document reflows */
    contain: strict;
}

.desktop-browser #game-container {
    width: min(520px, calc((100vh - 24px) * 0.5714), calc(100vw - 24px));
    height: min(calc(100vh - 24px), calc((100vw - 24px) * 1.75), 910px);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(123, 47, 247, 0.22),
        0 18px 58px rgba(0, 0, 0, 0.72);
}

/* Screen shake animation */
#game-container.shake {
    animation: screenShake 0.15s ease-in-out;
}

@keyframes screenShake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    20% { transform: translate3d(-3px, 2px, 0); }
    40% { transform: translate3d(3px, -2px, 0); }
    60% { transform: translate3d(-2px, -1px, 0); }
    80% { transform: translate3d(2px, 1px, 0); }
}

/* Game Canvas */
#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* HUD Overlay */
.hud-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 102; /* Lift above canvas and tutorial overlay */
}

.interactive {
    pointer-events: auto;
}

/* ─── Top Stats Bar ─── */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 8px;
    margin: 6px 10px 0 10px;
    background: rgba(10, 6, 25, 0.75);
    border: 1px solid rgba(123, 47, 247, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 4px;
    gap: 4px;
    min-width: 0;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.hud-stat, .hud-stat-small {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1 1 0;
    min-width: 0;
    font-weight: 800;
    font-size: 12.5px;
    transition: all 0.3s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    overflow: hidden;
}

.hud-stat-small {
    flex: 0.85 1 0;
}

.hud-stat:hover, .hud-stat-small:hover {
    background: rgba(123, 47, 247, 0.08);
    border-color: rgba(123, 47, 247, 0.3);
    transform: translateY(-1px);
}

/* Gold capsule */
.hud-stat:nth-child(1) {
    border-color: rgba(255, 214, 10, 0.15);
}
.hud-stat:nth-child(1):hover {
    border-color: rgba(255, 214, 10, 0.4);
    background: rgba(255, 214, 10, 0.05);
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.15);
}

/* Dust capsule */
.hud-stat:nth-child(2) {
    border-color: rgba(0, 245, 212, 0.15);
}
.hud-stat:nth-child(2):hover {
    border-color: rgba(0, 245, 212, 0.4);
    background: rgba(0, 245, 212, 0.05);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.15);
}

/* Wave capsule */
.hud-stat:nth-child(3) {
    border-color: rgba(247, 37, 133, 0.15);
}
.hud-stat:nth-child(3):hover {
    border-color: rgba(247, 37, 133, 0.4);
    background: rgba(247, 37, 133, 0.05);
    box-shadow: 0 0 10px rgba(247, 37, 133, 0.15);
}

.hud-stat span:first-child:not(.pixel-icon), .hud-stat-small span:first-child:not(.pixel-icon) {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    font-size: 15px;
}

#hud-gold, #hud-dust, #hud-wave, #hud-dps {
    font-family: var(--font-stat);
    font-size: 8.5px;
    font-weight: normal;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.desktop-browser #hud-gold,
.desktop-browser #hud-dust,
.desktop-browser #hud-wave,
.desktop-browser #hud-dps {
    font-size: 9px;
}

#hud-gold {
    color: var(--gold);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#hud-gold.bump {
    transform: scale(1.25);
}

#hud-dust {
    color: var(--neon-blue);
}

#hud-wave {
    color: #ff477e;
    text-shadow: 0 0 8px rgba(247, 37, 133, 0.2);
}

/* ─── Bottom Navigation Bar ─── */
.bottom-nav {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    padding: 8px 10px 10px;
    margin: 0 10px 10px 10px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 4px;
    box-shadow: 
        0 -4px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    cursor: grab;
    user-select: none; /* Prevent text selection during drag-to-scroll */
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav.nav-hidden {
    transform: translateY(150%) !important;
    pointer-events: none !important;
}

.bottom-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.world-boss-widget {
    position: absolute;
    top: 86px;
    right: 14px;
    z-index: 55;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 60px;
    pointer-events: auto;
}

.world-boss-btn {
    width: 48px;
    height: 48px;
    border: 1.5px solid rgba(255, 71, 126, 0.7);
    background: radial-gradient(circle, rgba(120, 10, 40, 0.95), rgba(30, 5, 20, 0.95));
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 0 15px rgba(255, 71, 126, 0.4),
        inset 0 0 8px rgba(255, 71, 126, 0.3);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.world-boss-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(255, 71, 126, 0.6);
}

.world-boss-btn.joined {
    border-color: rgba(0, 245, 212, 0.7);
    background: radial-gradient(circle, rgba(10, 80, 70, 0.95), rgba(5, 20, 30, 0.95));
    box-shadow: 
        0 0 15px rgba(0, 245, 212, 0.4),
        inset 0 0 8px rgba(0, 245, 212, 0.3);
}

.world-boss-mark {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: #fff;
}

.world-boss-timer {
    width: 58px;
    height: 16px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(5, 2, 16, 0.85);
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 800;
    text-align: center;
    line-height: 14px;
    font-variant-numeric: tabular-nums;
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-weight: normal;
    font-size: 7px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 6px 6px;
    border-radius: 4px;
    position: relative;
    flex-shrink: 0;
    min-width: 55px;
}

/* Bottom Nav Badges */
.nav-badge {
    position: absolute;
    top: 3px;
    right: 14px;
    width: 6px;
    height: 6px;
    background-color: var(--crit-red);
    border-radius: 0; /* blocky square */
    display: none; /* Hidden by default */
    pointer-events: none;
    z-index: 10;
}

.nav-btn:hover {
    color: var(--text-white);
    background: rgba(255, 255, 255, 0.06);
}

.nav-btn:active {
    transform: translateY(1px);
}

.nav-btn.active {
    color: var(--neon-blue);
    background: rgba(0, 245, 212, 0.08);
}

/* Neon dot indicator under active nav */
.nav-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 2px;
    background: var(--neon-blue);
    border-radius: 0;
}

/* Quest ready pulse */
.nav-btn.has-reward {
    animation: questPulse 1.5s ease-in-out infinite;
}

@keyframes questPulse {
    0%, 100% { box-shadow: none; }
    50% { box-shadow: 0 0 12px rgba(0, 245, 212, 0.4), inset 0 0 8px rgba(0, 245, 212, 0.1); }
}

.nav-icon {
    display: block;
    width: 15px;
    height: 15px;
    margin-bottom: 2px;
    margin-left: auto;
    margin-right: auto;
    background-image: url('../buttons_pixel.png');
    background-repeat: no-repeat;
    background-size: 105px 15px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    opacity: 0.75;
    transition: opacity 0.15s ease;
}

.nav-btn:hover .nav-icon,
.nav-btn.active .nav-icon {
    opacity: 1;
}

.nav-icon-merge { background-position: 0px 0px; }
.nav-icon-eggs { background-position: -15px 0px; }
.nav-icon-upgrades { background-position: -30px 0px; }
.nav-icon-quests { background-position: -45px 0px; }
.nav-icon-codex { background-position: -60px 0px; }
.nav-icon-prestige { background-position: -75px 0px; }
.nav-icon-settings { background-position: -90px 0px; }

/* ─── Modal System ─── */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 2, 16, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 102;
}

.modal-content {
    width: 90%;
    max-height: 80%;
    background: var(--glass-bg);
    border: 3px double var(--glass-border);
    border-radius: 4px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: scale(0.85) translateY(10px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 4px 4px 0px #000;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

/* Modal Title */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 10px;
}

.modal-title {
    font-size: 10px;
    font-weight: normal;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #00f5d4;
    text-shadow: 1px 1px 0px #000;
}

.modal-icon {
    display: inline-block;
    width: 30px;
    height: 30px;
    background-image: url('../buttons_pixel.png');
    background-repeat: no-repeat;
    background-size: 210px 30px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.modal-icon-merge { background-position: 0px 0px; }
.modal-icon-eggs { background-position: -30px 0px; }
.modal-icon-upgrades { background-position: -60px 0px; }
.modal-icon-quests { background-position: -90px 0px; }
.modal-icon-codex { background-position: -120px 0px; }
.modal-icon-prestige { background-position: -150px 0px; }
.modal-icon-settings { background-position: -180px 0px; }

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.close-btn:hover {
    background: rgba(255, 0, 85, 0.2);
    border-color: rgba(255, 0, 85, 0.5);
    color: #ff3377;
    box-shadow: 0 0 8px rgba(255, 0, 85, 0.3);
}

.close-btn:active {
    transform: scale(0.92);
}

/* ─── Shop Modal ─── */
.shop-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(20, 16, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    padding: 14px 16px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.shop-item:hover {
    border-color: rgba(123, 47, 247, 0.4);
    background: rgba(123, 47, 247, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(123, 47, 247, 0.1);
}

/* Seasonal Shop Items */
.shop-item.seasonal-shop-item[data-event="spring"] {
    border-color: rgba(255, 181, 167, 0.3);
    background: linear-gradient(135deg, rgba(255, 181, 167, 0.05), rgba(20, 16, 42, 0.6));
}
.shop-item.seasonal-shop-item[data-event="spring"]:hover {
    border-color: rgba(255, 181, 167, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 181, 167, 0.2);
}

.shop-item.seasonal-shop-item[data-event="summer"] {
    border-color: rgba(255, 183, 3, 0.3);
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.05), rgba(20, 16, 42, 0.6));
}
.shop-item.seasonal-shop-item[data-event="summer"]:hover {
    border-color: rgba(255, 183, 3, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 183, 3, 0.2);
}

.shop-item.seasonal-shop-item[data-event="halloween"] {
    border-color: rgba(251, 133, 0, 0.3);
    background: linear-gradient(135deg, rgba(251, 133, 0, 0.05), rgba(20, 16, 42, 0.6));
}
.shop-item.seasonal-shop-item[data-event="halloween"]:hover {
    border-color: rgba(251, 133, 0, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(251, 133, 0, 0.2);
}

.shop-item.seasonal-shop-item[data-event="winter"] {
    border-color: rgba(142, 202, 230, 0.3);
    background: linear-gradient(135deg, rgba(142, 202, 230, 0.05), rgba(20, 16, 42, 0.6));
}
.shop-item.seasonal-shop-item[data-event="winter"]:hover {
    border-color: rgba(142, 202, 230, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(142, 202, 230, 0.2);
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.item-name {
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    column-gap: 6px;
    row-gap: 2px;
}

.egg-name-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.item-desc {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
}

.btn-buy {
    background: var(--neon-purple);
    border: 2px solid #000;
    color: white;
    font-size: 8px;
    font-family: var(--font-heading);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 2px 2px 0px #000;
    transition: all 0.1s;
    white-space: nowrap;
}

.btn-buy:hover {
    background: #8c43ff;
}

.btn-buy:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}

.btn-buy:disabled {
    background: #33323a !important;
    color: #666 !important;
    border-color: #555 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none !important;
}

/* Premium Buy Button (Gold/Amber) */
.btn-buy.premium-buy {
    background: var(--gold);
    color: #000;
    border-color: #000;
    box-shadow: 2px 2px 0px #000;
}

.btn-buy.premium-buy:hover {
    background: #ffe359;
}

/* ─── Prestige ─── */
.upgrade-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 10px 14px;
    transition: all 0.2s;
}

.upgrade-item:hover {
    border-color: var(--panel-border);
}

.prestige-btn {
    background: #ff0055;
    color: #ffffff;
    font-size: 8px;
    font-family: var(--font-heading);
    padding: 10px;
    border: 2px solid #000;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000;
    transition: all 0.1s;
    width: 100%;
    text-transform: uppercase;
}

.prestige-btn:hover {
    background: #ff2a73;
}

.prestige-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}

.prestige-btn:disabled {
    background: #33323a;
    color: #666;
    border-color: #555;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

/* ─── Monster Detail Card ─── */
.monster-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Monster preview canvas in detail modal */
.monster-preview-container {
    width: 150px;
    height: 150px;
    border-radius: 4px;
    background: radial-gradient(circle, rgba(123, 47, 247, 0.12) 0%, transparent 80%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4), 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

#detail-preview-canvas, #wb-detail-preview-canvas {
    border-radius: 4px;
    width: 180px;
    height: 180px;
}

.monster-element-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.monster-rarity-badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-weight: 800;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.monster-rarity-badge.common {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.monster-rarity-badge.rare {
    background: rgba(0, 245, 212, 0.12);
    color: var(--neon-blue);
    border: 1px solid rgba(0, 245, 212, 0.3);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.15);
}

.monster-rarity-badge.legendary {
    background: rgba(255, 214, 10, 0.12);
    color: var(--gold);
    border: 1px solid rgba(255, 214, 10, 0.3);
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.2);
}

.monster-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    width: 100%;
    margin: 8px 0;
}

.stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    padding: 8px;
    text-align: center;
}

.stat-label {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 11px;
    font-family: var(--font-stat);
    color: var(--text-white);
}

.btn-sell {
    background: #ff0055;
    border: 2px solid #000;
    color: white;
    font-size: 8px;
    font-family: var(--font-heading);
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 4px;
    transition: all 0.1s;
    box-shadow: 2px 2px 0px #000;
    text-transform: uppercase;
}

.btn-sell:hover {
    background: #ff3377;
}

.btn-sell:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}

.btn-levelup {
    background: #8338ec;
    border: 2px solid #000;
    color: white;
    font-size: 8px;
    font-family: var(--font-heading);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: all 0.1s;
    box-shadow: 2px 2px 0px #000;
    text-transform: uppercase;
}

.btn-levelup:hover:not(:disabled) {
    background: #9d4edd;
}

.btn-levelup:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}

.btn-levelup:disabled {
    background: #4a4e69;
    color: #9a8c98;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.btn-soulbound {
    background: #00f5d4;
    border: 2px solid #000;
    color: #000;
    font-size: 8px;
    font-family: var(--font-heading);
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    transition: all 0.1s;
    box-shadow: 2px 2px 0px #000;
    text-transform: uppercase;
    font-weight: bold;
}

.btn-soulbound:hover:not(:disabled) {
    background: #ffd60a;
}

.btn-soulbound:active:not(:disabled) {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}

.btn-soulbound:disabled {
    background: #ffd60a;
    color: #000;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.8;
}

/* ─── Settings ─── */
#modal-settings .modal-content {
    width: 92%;
    max-width: 380px;
    max-height: 92%;
    gap: 10px;
    padding: 14px 18px;
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#select-language {
    background: var(--glass-bg);
    color: var(--text-white);
    border: 1px solid var(--glass-border);
    padding: 8px 12px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

#select-language:hover {
    border-color: var(--neon-blue);
    background: rgba(25, 15, 60, 0.95);
}

#select-language:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 245, 212, 0.3);
}

#select-language option {
    background: #0f0a28;
    color: var(--text-white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 5px;
}

/* ─── Offline Panel ─── */
.offline-card {
    text-align: center;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.offline-value {
    font-size: 20px;
    font-family: var(--font-stat);
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 214, 10, 0.3);
}

.btn-double {
    background: linear-gradient(135deg, #4cc9f0, #4895ef);
    color: white;
    font-weight: 800;
    font-family: var(--font-heading);
    border: none;
    border-radius: 4px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(76, 201, 240, 0.25);
    transition: all 0.2s;
}

.btn-double:hover {
    box-shadow: 0 4px 24px rgba(76, 201, 240, 0.4);
    transform: translateY(-1px);
}

.btn-double:active {
    transform: scale(0.96);
}

.btn-claim {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-white);
    font-weight: 800;
    font-family: var(--font-heading);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-claim:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── Scrollbars ─── */
.modal-content::-webkit-scrollbar {
    width: 4px;
}

.modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.modal-content::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 247, 0.3);
    border-radius: 10px;
}

/* ─── Animations ─── */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

.shake {
    animation: shake 0.25s ease-in-out;
}

/* Combo display */
.combo-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 48px;
    color: var(--gold);
    text-shadow: 
        0 0 20px rgba(255, 214, 10, 0.6),
        0 0 40px rgba(255, 214, 10, 0.3),
        0 4px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.combo-display.active {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.combo-display.fadeout {
    opacity: 0;
    transform: translate(-50%, -60%) scale(0.8);
}

/* ─── Quest Styles ─── */
.quest-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 12px 14px;
    transition: all 0.25s;
}

.quest-item:hover {
    border-color: var(--panel-border);
}

.quest-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.quest-item .item-info {
    min-width: 0;
}

.quest-item .item-name {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.quest-item .item-name span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
}

.quest-item .item-desc {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.quest-pixel-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    background-image: url('../buttons_pixel.png');
    background-repeat: no-repeat;
    background-size: 105px 15px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    flex: 0 0 15px;
}

.quest-pixel-icon-merge { background-position: 0 0; }
.quest-pixel-icon-egg { background-position: -15px 0; }
.quest-pixel-icon-defeat,
.quest-pixel-icon-dps,
.quest-pixel-icon-tap,
.quest-pixel-icon-boss { background-position: -30px 0; }
.quest-pixel-icon-gold { background-position: -45px 0; }
.quest-pixel-icon-reach_wave { background-position: -75px 0; }
.quest-pixel-icon-quest { background-position: -60px 0; }

.quest-row-bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.quest-progress-container {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), #4cc9f0);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    box-shadow: 0 0 6px rgba(0, 245, 212, 0.3);
}

.quest-progress-text {
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-muted);
    min-width: 45px;
    text-align: right;
}

.btn-claim-quest {
    background: linear-gradient(135deg, #00f5d4, #00bbf9);
    border: none;
    color: #000;
    font-weight: 800;
    font-size: 11px;
    font-family: var(--font-heading);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 245, 212, 0.2);
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-claim-quest:active {
    transform: scale(0.95);
}

.btn-claim-quest:disabled {
    background: rgba(60, 60, 80, 0.6);
    color: #5a5e78;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-claim-quest.claimed {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* ─── Auto-Buy Toggle ─── */
.auto-buy-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    margin-top: 4px;
}

.auto-buy-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
    padding: 0;
}

.toggle-switch.active {
    background: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 2px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.toggle-switch.active::after {
    transform: translateX(20px);
}

/* ─── Wave Banner ─── */
.wave-banner {
    position: absolute;
    top: 42%;
    left: -100%;
    width: 100%;
    text-align: center;
    font-family: var(--font-heading);
    font-weight: 900;
    font-size: 28px;
    color: white;
    text-shadow: 0 0 20px rgba(123, 47, 247, 0.6), 0 4px 8px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 15;
    transition: none;
}

.wave-banner.boss {
    color: var(--crit-red);
    text-shadow: 0 0 30px rgba(255, 0, 85, 0.6), 0 4px 8px rgba(0, 0, 0, 0.8);
    font-size: 32px;
}

#hud-dps {
    color: #ff9f1c;
    font-family: 'Outfit', 'Inter', sans-serif;
    font-weight: 900;
}

/* ─── Element Strategy Cards ─── */
.element-strategy-card {
    margin: 10px 0;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-white);
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.element-strategy-card .card-title {
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 2px;
}
.element-strategy-card .card-row {
    display: flex;
    justify-content: space-between;
}
.element-strategy-card.water { background: linear-gradient(135deg, rgba(72, 191, 227, 0.2), rgba(72, 191, 227, 0.05)); border-color: rgba(72, 191, 227, 0.3); }
.element-strategy-card.fire { background: linear-gradient(135deg, rgba(255, 107, 53, 0.25), rgba(255, 107, 53, 0.05)); border-color: rgba(255, 107, 53, 0.3); }
.element-strategy-card.nature { background: linear-gradient(135deg, rgba(6, 214, 160, 0.2), rgba(6, 214, 160, 0.05)); border-color: rgba(6, 214, 160, 0.3); }
.element-strategy-card.electric { background: linear-gradient(135deg, rgba(255, 214, 10, 0.18), rgba(255, 214, 10, 0.03)); border-color: rgba(255, 214, 10, 0.3); }
.element-strategy-card.dark { background: linear-gradient(135deg, rgba(177, 133, 219, 0.25), rgba(177, 133, 219, 0.05)); border-color: rgba(177, 133, 219, 0.3); }
.element-strategy-card.light { background: linear-gradient(135deg, rgba(240, 230, 255, 0.15), rgba(240, 230, 255, 0.03)); border-color: rgba(240, 230, 255, 0.3); }
.element-strategy-card.antigravity { background: linear-gradient(135deg, rgba(0, 245, 212, 0.25), rgba(0, 245, 212, 0.05)); border-color: rgba(0, 245, 212, 0.45); box-shadow: 0 0 10px rgba(0, 245, 212, 0.15); }

/* ─── Achievements List in Settings ─── */
.achievements-section {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 10px;
    text-align: left;
}
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}
.achievement-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.achievement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.achievement-name {
    font-size: 13px;
    font-weight: 800;
}
.achievement-rank-pill {
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    color: #000;
    background: var(--neon-blue);
    box-shadow: 0 0 6px rgba(0, 245, 212, 0.3);
}
.achievement-rank-pill.max {
    background: var(--gold);
    box-shadow: 0 0 6px rgba(255, 214, 10, 0.3);
}
.achievement-progress-outer {
    height: 5px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    width: 100%;
}
.achievement-progress-inner {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}
.achievement-progress-text {
    font-size: 9px;
    color: var(--text-muted);
    font-weight: 600;
    text-align: right;
}
.achievements-summary-table {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}
.ach-buff-box {
    background: rgba(123, 47, 247, 0.05);
    border: 1px solid rgba(123, 47, 247, 0.15);
    border-radius: 4px;
    padding: 6px;
    text-align: center;
}
.ach-buff-label {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ach-buff-value {
    font-size: 13px;
    font-weight: 800;
    color: var(--neon-blue);
}

/* ─── Speed Toggle Button Overlay ─── */
/* ─── Control Toolbar Overlay ─── */
.control-toolbar-overlay {
    position: absolute;
    top: 30%;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 4px;
    pointer-events: none;
    z-index: 102;
}

.control-group-left {
    display: flex;
    gap: 4px;
    pointer-events: auto;
}

.control-group-right {
    display: flex;
    pointer-events: auto;
}

/* Compact and Consistent Button Styles */
.auto-merge-btn, .speed-btn {
    background: rgba(12, 8, 32, 0.75);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 10px; /* More compact font size */
    padding: 6px 8px; /* Compact padding */
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

.auto-merge-btn {
    border: 1px solid rgba(123, 47, 247, 0.4);
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 8px rgba(123, 47, 247, 0.15);
}

.auto-merge-btn:hover {
    background: rgba(123, 47, 247, 0.15);
    border-color: var(--neon-purple);
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.3), 0 0 12px rgba(123, 47, 247, 0.20);
    transform: scale(1.05);
}

.auto-merge-btn:active {
    transform: scale(0.95);
}

.speed-btn {
    border: 1px solid rgba(0, 245, 212, 0.4);
    color: var(--neon-blue);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 8px rgba(0, 245, 212, 0.1);
}

.speed-btn:hover {
    background: rgba(0, 245, 212, 0.15);
    border-color: var(--neon-blue);
    box-shadow: 0 4px 15px rgba(0, 245, 212, 0.25), 0 0 12px rgba(0, 245, 212, 0.2);
    transform: scale(1.05);
}

.speed-btn:active {
    transform: scale(0.95);
}

/* Glassmorphism Polish & Neon Glows */
.modal-content {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

.btn-buy:hover, .prestige-btn:hover, .btn-double:hover {
    filter: brightness(1.15);
}

@keyframes speedGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(255, 214, 10, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 18px rgba(255, 214, 10, 0.6), 0 4px 15px rgba(255, 214, 10, 0.3); }
}
.speed-btn.active {
    animation: speedGlow 1.5s ease-in-out infinite;
}

@keyframes claimPulse {
    0%, 100% { box-shadow: 0 4px 10px rgba(0, 245, 212, 0.2); filter: brightness(1); }
    50% { box-shadow: 0 4px 18px rgba(0, 245, 212, 0.5); filter: brightness(1.2); }
}
.btn-claim-quest:not(.claimed):not(:disabled) {
    animation: claimPulse 1.5s infinite;
}

/* ─── Tutorial System ─── */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 2, 16, 0.45);
    z-index: 100;
    pointer-events: none; /* Let clicks pass through to elements under the overlay */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.tutorial-overlay.active {
    opacity: 1;
}

.tutorial-bubble {
    pointer-events: none; /* Let clicks/drags pass through to elements underneath */
    width: 85%;
    left: 7.5%;
    background: rgba(16, 10, 42, 0.95);
    border: 3px double var(--neon-purple);
    border-radius: 4px;
    padding: 15px 15px 32px 15px; /* Leave space at bottom for Skip button */
    display: flex;
    gap: 12px;
    box-shadow: 4px 4px 0px #000;
    position: absolute;
    top: 250px;
    z-index: 105;
    animation: bubbleFloat 3s ease-in-out infinite alternate;
}

@keyframes bubbleFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.tutorial-avatar {
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.tutorial-character-sprite {
    width: 80px;
    height: 80px;
    background-image: url('../mentor_tamer_bozy.png');
    background-repeat: no-repeat;
    background-size: 320px 80px; /* 4 frames of 80px each */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    margin: 0 auto;
}
.tutorial-character-sprite.frame-idle {
    background-position: 0px 0px;
}
.tutorial-character-sprite.frame-greet {
    background-position: -80px 0px;
}
.tutorial-character-sprite.frame-egg {
    background-position: -160px 0px;
}
.tutorial-character-sprite.frame-merge {
    background-position: -240px 0px;
}

.tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.tutorial-speaker {
    font-family: var(--font-heading);
    font-size: 11px;
    font-weight: 800;
    color: var(--gold);
    margin-bottom: 2px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 6px rgba(255, 214, 10, 0.4);
}

.tutorial-content p {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--text-white);
    font-weight: 600;
}

.tutorial-btn {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--neon-blue), #00bbf9);
    color: #000;
    font-weight: 800;
    font-size: 10px;
    border: 2px solid #000;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 2px 2px 0px #000;
    transition: all 0.1s;
    pointer-events: auto; /* Ensure clicks register */
}
.tutorial-skip-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: linear-gradient(135deg, #ff2a5f, #ff7e40);
    color: #fff;
    font-weight: 800;
    font-size: 9px;
    border: 2px solid #000;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: 1.5px 1.5px 0px #000;
    transition: all 0.1s;
    pointer-events: auto; /* Ensure clicks register */
    z-index: 110;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.tutorial-skip-btn:hover {
    filter: brightness(1.1);
}
.tutorial-skip-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 0.5px 0.5px 0px #000;
}
.tutorial-btn:active {
    transform: translate(1px, 1px);
    box-shadow: 1px 1px 0px #000;
}
.tutorial-pointer {
    position: absolute;
    font-size: 36px;
    z-index: 106;
    pointer-events: none;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.tutorial-pointer.dir-down {
    animation: pointerBounceUp 0.6s infinite alternate;
}

.tutorial-pointer.dir-up {
    animation: pointerBounceDown 0.6s infinite alternate;
}

.tutorial-pointer.dir-left {
    animation: pointerBounceRight 0.6s infinite alternate;
}

.tutorial-pointer.dir-right {
    animation: pointerBounceLeft 0.6s infinite alternate;
}

@keyframes pointerBounceUp {
    0% { transform: translateY(0); }
    100% { transform: translateY(-12px); }
}

@keyframes pointerBounceDown {
    0% { transform: translateY(0); }
    100% { transform: translateY(12px); }
}

@keyframes pointerBounceRight {
    0% { transform: translateX(0); }
    100% { transform: translateX(12px); }
}

@keyframes pointerBounceLeft {
    0% { transform: translateX(0); }
    100% { transform: translateX(-12px); }
}

/* ─── Tutorial Highlight effect ─── */
.tutorial-highlight {
    position: relative;
    z-index: 103 !important;
    box-shadow: 0 0 20px 4px var(--neon-purple) !important;
    animation: highlightPulse 1s infinite alternate !important;
}

@keyframes highlightPulse {
    0% { box-shadow: 0 0 10px 2px var(--neon-purple); }
    100% { box-shadow: 0 0 25px 6px var(--neon-purple); }
}

/* Dim other shop items when a shop item is highlighted in tutorial */
.shop-grid:has(.tutorial-highlight) .shop-item:not(.tutorial-highlight):not(:has(.tutorial-highlight)) {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Dim HUD elements during tutorial active phase */
#game-container.tutorial-active .hud-layer .top-bar,
#game-container.tutorial-active .hud-layer .auto-merge-overlay,
#game-container.tutorial-active .hud-layer .speed-toggle-overlay {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

#game-container.tutorial-active .hud-layer .bottom-nav .nav-btn:not(.tutorial-highlight) {
    opacity: 0.35;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.codex-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 330px;
    overflow-y: auto;
    padding-right: 4px;
    margin-top: 5px;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 247, 0.3) transparent;
}

.codex-grid::-webkit-scrollbar {
    width: 4px;
}

.codex-grid::-webkit-scrollbar-track {
    background: transparent;
}

.codex-grid::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 247, 0.35);
    border-radius: 10px;
}

/* Premium Progress Card */
.codex-progress-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.codex-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.codex-progress-title {
    font-size: 11.5px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.codex-progress-count {
    font-size: 13px;
    font-weight: 900;
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 245, 212, 0.3);
}

.codex-progress-bar-container {
    height: 6px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.codex-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-blue));
    box-shadow: 0 0 8px var(--neon-blue);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Element Filters Bar */
.codex-filter-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px 0;
    scrollbar-width: none;
}

.codex-filter-bar::-webkit-scrollbar {
    display: none;
}

.codex-filter-tab {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
}

.codex-filter-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-white);
    transform: translateY(-1px);
}

.codex-filter-tab.active {
    background: linear-gradient(135deg, var(--neon-purple), #560bad);
    border-color: var(--neon-purple);
    color: var(--text-white);
    box-shadow: 
        0 0 10px rgba(123, 47, 247, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.codex-filter-tab span {
    font-size: 11px;
}

/* Family Grid Layout */
.codex-family-row {
    background: rgba(20, 16, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
    animation: codexFadeInUp 0.35s ease forwards;
}

@keyframes codexFadeInUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mastered Row Highlight */
.codex-family-row.mastered {
    border-color: rgba(255, 214, 10, 0.35);
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.04), rgba(20, 16, 42, 0.75));
    box-shadow: 0 4px 15px rgba(255, 214, 10, 0.03);
}

.codex-family-header {
    font-size: 11px;
    font-weight: 800;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.codex-family-header .family-title {
    display: flex;
    align-items: center;
    gap: 6px;
}

.codex-family-header .family-meta {
    display: flex;
    align-items: center;
    gap: 6px;
}

.codex-family-header .element-badge {
    font-size: 8.5px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
}

.codex-family-header .element-badge.water { background: rgba(0, 187, 249, 0.12); color: #00bbf9; border: 1px solid rgba(0, 187, 249, 0.2); }
.codex-family-header .element-badge.fire { background: rgba(255, 0, 85, 0.12); color: #ff0055; border: 1px solid rgba(255, 0, 85, 0.2); }
.codex-family-header .element-badge.nature { background: rgba(0, 245, 212, 0.12); color: #00f5d4; border: 1px solid rgba(0, 245, 212, 0.2); }
.codex-family-header .element-badge.electric { background: rgba(255, 214, 10, 0.12); color: #ffd60a; border: 1px solid rgba(255, 214, 10, 0.2); }
.codex-family-header .element-badge.dark { background: rgba(123, 47, 247, 0.12); color: #7b2ff7; border: 1px solid rgba(123, 47, 247, 0.2); }
.codex-family-header .element-badge.light { background: rgba(240, 240, 245, 0.08); color: var(--text-white); border: 1px solid rgba(255, 255, 255, 0.15); }
.codex-family-header .element-badge.antigravity { background: rgba(0, 245, 212, 0.12); color: #00f5d4; border: 1px solid rgba(0, 245, 212, 0.2); }

.codex-family-header .master-badge {
    background: rgba(255, 214, 10, 0.15);
    color: var(--gold);
    border: 1px solid rgba(255, 214, 10, 0.3);
    font-size: 8.5px;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 3px;
    font-weight: 900;
}

.codex-slots-container {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.codex-slot {
    flex: 1;
    height: 60px;
    background: rgba(5, 2, 16, 0.65);
    border: 1.5px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    position: relative;
    cursor: default;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.codex-slot.locked {
    background: rgba(5, 2, 16, 0.85);
    border-color: rgba(255, 255, 255, 0.02);
}

.codex-slot.unlocked {
    background: rgba(255, 255, 255, 0.02);
}

.codex-slot.unlocked.common { border-color: rgba(255, 255, 255, 0.12); }
.codex-slot.unlocked.rare { border-color: rgba(0, 245, 212, 0.35); background: rgba(0, 245, 212, 0.01); }
.codex-slot.unlocked.legendary { border-color: rgba(255, 214, 10, 0.35); background: rgba(255, 214, 10, 0.01); }

/* Pulsing highlight for claimable entries */
.codex-slot.claimable {
    cursor: pointer;
    animation: codexClaimPulse 1.5s infinite alternate;
}

@keyframes codexClaimPulse {
    0% {
        box-shadow: 0 0 4px rgba(255, 214, 10, 0.2), inset 0 0 4px rgba(255, 214, 10, 0.2);
        border-color: rgba(255, 214, 10, 0.4);
    }
    100% {
        box-shadow: 0 0 12px rgba(255, 214, 10, 0.5), inset 0 0 8px rgba(255, 214, 10, 0.35);
        border-color: rgba(255, 214, 10, 0.8);
    }
}

.codex-slot.unlocked:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.04);
}

.codex-slot.claimable:hover {
    transform: translateY(-2px) scale(1.03);
}

.codex-slot.unlocked:active {
    transform: translateY(0) scale(0.97);
}

.codex-slot-tier {
    font-size: 8px;
    font-weight: 800;
    color: var(--text-muted);
}

.codex-slot.unlocked .codex-slot-tier {
    color: var(--text-white);
}

.codex-monster-canvas {
    width: 32px;
    height: 32px;
    display: block;
}

/* Semi-transparent lock silhouette details */
.codex-slot.locked .codex-monster-canvas {
    opacity: 0.12;
    filter: brightness(0);
}

.codex-lock-icon {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.1);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.codex-claim-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--gold);
    color: #000;
    font-size: 8px;
    font-weight: 900;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    animation: claimBadgePulse 0.5s infinite alternate;
    z-index: 5;
}

@keyframes claimBadgePulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

.codex-slot.claimed::after {
    content: '✓';
    position: absolute;
    bottom: 2px;
    right: 4px;
    color: var(--neon-blue);
    font-size: 9px;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    z-index: 3;
}

/* ─── Egg Hatching Overlay Modal ─── */
.hatch-modal-overlay {
    z-index: 1100 !important;
    background: rgba(4, 2, 12, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.hatch-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.hatch-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.hatch-egg-container {
    position: relative;
    width: 220px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.hatch-egg {
    font-size: 110px;
    user-select: none;
    filter: drop-shadow(0 0 25px rgba(255, 255, 255, 0.25));
    transition: transform 0.15s ease;
}

/* Egg Shake animations */
.hatch-egg.shake-gentle {
    animation: eggShakeGentle 1.2s infinite ease-in-out;
}

.hatch-egg.shake-violent {
    animation: eggShakeViolent 0.4s infinite linear;
}

@keyframes eggShakeGentle {
    0%, 100% { transform: rotate(0deg) scale(3); }
    20% { transform: rotate(-6deg) scale(3.06); }
    40% { transform: rotate(6deg) scale(2.94); }
    60% { transform: rotate(-4deg) scale(3.03); }
    80% { transform: rotate(4deg) scale(2.97); }
}

@keyframes eggShakeViolent {
    0% { transform: translate(3px, 2px) rotate(0deg) scale(3.24); }
    10% { transform: translate(-2px, -3px) rotate(-3deg) scale(3.24); }
    20% { transform: translate(-4px, 0px) rotate(3deg) scale(3.24); }
    30% { transform: translate(0px, 3px) rotate(0deg) scale(3.24); }
    40% { transform: translate(2px, -2px) rotate(3deg) scale(3.24); }
    50% { transform: translate(-2px, 3px) rotate(-3deg) scale(3.24); }
    60% { transform: translate(-4px, 2px) rotate(0deg) scale(3.24); }
    70% { transform: translate(3px, 2px) rotate(3deg) scale(3.24); }
    80% { transform: translate(-2px, -2px) rotate(-3deg) scale(3.24); }
    90% { transform: translate(3px, -3px) rotate(0deg) scale(3.24); }
    100% { transform: translate(-2px, 2px) rotate(3deg) scale(3.24); }
}

.hatch-glow {
    position: absolute;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    transition: background 0.4s ease;
}

/* Rarity glow effects */
.glow-common {
    background: radial-gradient(circle, rgba(72, 191, 227, 0.45) 0%, transparent 70%);
    animation: pulseGlow 1.8s infinite alternate;
}
.glow-rare {
    background: radial-gradient(circle, rgba(177, 133, 219, 0.55) 0%, transparent 70%);
    animation: pulseGlow 1.4s infinite alternate;
}
.glow-legendary {
    background: radial-gradient(circle, rgba(255, 214, 10, 0.65) 0%, transparent 70%);
    animation: pulseGlowGold 0.8s infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); opacity: 0.7; }
    100% { transform: scale(1.25); opacity: 1; }
}

@keyframes pulseGlowGold {
    0% { transform: scale(0.95) rotate(0deg); opacity: 0.8; filter: hue-rotate(0deg); }
    100% { transform: scale(1.35) rotate(180deg); opacity: 1; filter: hue-rotate(60deg); }
}

.hatch-monster-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 200px;
}

.hatch-monster-preview-wrapper {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hatch-monster-glow {
    position: absolute;
    top: -20px;
    left: -20px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    z-index: -1;
    pointer-events: none;
    transition: background 0.4s ease;
}

#hatch-monster-name {
    font-size: 26px;
    font-weight: 900;
    margin: 14px 0 6px 0;
    text-shadow: 0 0 15px rgba(255,255,255,0.3);
}

.hatch-tap-prompt {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 13px;
    color: var(--text-muted);
    letter-spacing: 2px;
    animation: pulseText 1s infinite alternate;
    user-select: none;
    margin-top: 10px;
}

@keyframes pulseText {
    0% { opacity: 0.4; transform: scale(0.95); }
    100% { opacity: 1; transform: scale(1.05); }
}

/* Hatch Pop Animations by Rarity */
.hatch-pop-common {
    animation: popCommon 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hatch-pop-rare {
    animation: popRare 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hatch-pop-legendary {
    animation: popLegendary 1.6s cubic-bezier(0.175, 0.885, 0.32, 1.35) forwards;
}

/* Static text fade-in */
.hatch-fade-in {
    animation: hatchFadeIn 0.6s ease-out forwards;
}

@keyframes hatchFadeIn {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes popCommon {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    50% { transform: scale(1.15) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes popRare {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    40% { transform: scale(1.25) rotate(15deg); }
    70% { transform: scale(0.9) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes popLegendary {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; filter: brightness(3) blur(5px); }
    30% { transform: scale(1.4) rotate(45deg); filter: brightness(2) blur(0); }
    55% { transform: scale(0.8) rotate(-15deg); }
    75% { transform: scale(1.15) rotate(10deg); }
    90% { transform: scale(0.95) rotate(-5deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ─── Premium Paywall & IAP Sheet Styles ─── */
.paywall-content {
    max-width: 350px;
    background: linear-gradient(180deg, rgba(20, 10, 48, 0.96) 0%, rgba(8, 4, 24, 0.98) 100%);
    border: 1px solid rgba(255, 214, 10, 0.25);
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 214, 10, 0.08);
}

.paywall-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 10px 5px;
}

.paywall-badge-icon {
    font-size: 55px;
    text-shadow: 0 0 20px rgba(255, 214, 10, 0.5);
    animation: goldCrownPulse 2s infinite alternate ease-in-out;
}

@keyframes goldCrownPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.15); filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 214, 10, 0.6)); }
}

.paywall-tagline {
    font-size: 13px;
    color: var(--text-white);
    line-height: 1.45;
    text-align: center;
    font-weight: 600;
}

.paywall-features-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 5px 0;
}

.paywall-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 8px 12px;
    transition: all 0.25s ease;
}

.paywall-feature-item:hover {
    background: rgba(255, 214, 10, 0.04);
    border-color: rgba(255, 214, 10, 0.2);
}

.feature-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.feature-name {
    font-weight: 800;
    font-size: 12.5px;
    color: var(--text-white);
}

.feature-desc {
    font-size: 10px;
    color: var(--text-muted);
}

.paywall-buy-btn {
    width: 100%;
    background: linear-gradient(135deg, #ffd60a, #ff9f1c);
    border: none;
    color: #000;
    font-family: inherit;
    font-weight: 900;
    font-size: 15px;
    padding: 12px 20px;
    border-radius: 16px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(255, 214, 10, 0.35);
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.5px;
    margin-top: 5px;
}

.paywall-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 214, 10, 0.5);
    filter: brightness(1.05);
}

.paywall-buy-btn:active {
    transform: scale(0.96) translateY(0);
}

/* ─── Simulated Google Play Bottom Sheet ─── */
.iap-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1300;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.iap-sheet-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.iap-sheet-content {
    width: 100%;
    background: #f7f9fc;
    color: #202124;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 18px 20px 24px 20px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.iap-sheet-overlay.active .iap-sheet-content {
    transform: translateY(0);
}

.iap-sheet-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 10px;
}

.google-play-logo {
    font-size: 14px;
    font-weight: 700;
    color: #5f6368;
    display: flex;
    align-items: center;
    gap: 2px;
}

.gp-color-blue { color: #4285f4; }
.gp-color-red { color: #ea4335; }
.gp-color-yellow { color: #fbbc05; }
.gp-color-green { color: #34a853; }

.iap-product-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #dadce0;
}

.iap-app-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #7b2ff7, #00f5d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.iap-app-details {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.iap-app-name {
    font-size: 12px;
    color: #5f6368;
    font-weight: 500;
}

.iap-product-name {
    font-size: 14px;
    font-weight: 700;
    color: #202124;
}

.iap-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #202124;
}

.iap-payment-method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 4px;
}

.payment-icon {
    font-size: 22px;
}

.payment-details {
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
}

.payment-name {
    font-size: 13px;
    font-weight: 600;
    color: #202124;
}

.payment-email {
    font-size: 11px;
    color: #5f6368;
}

.iap-confirm-btn {
    width: 100%;
    background: #01875f; /* Google Play green */
    border: none;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.iap-confirm-btn:hover {
    background: #016f4e;
}

.iap-confirm-btn:active {
    transform: scale(0.98);
}

/* Spinner */
.iap-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e0e0e0;
    border-top: 3px solid #01875f;
    border-radius: 50%;
    animation: iapSpin 0.8s linear infinite;
}

@keyframes iapSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Tick */
.iap-success-checkmark {
    width: 44px;
    height: 44px;
    background: #e6f7ed;
    color: #01875f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    box-shadow: 0 0 10px rgba(1, 135, 95, 0.15);
    animation: checkmarkPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes checkmarkPop {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}

/* Settings Badge Indicator */
.settings-pro-badge {
    background: linear-gradient(135deg, #ffd60a, #ff9f1c);
    color: #000;
    font-weight: 900;
    font-size: 11px;
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    animation: goldPulse 1.5s infinite alternate ease-in-out;
}

@keyframes goldPulse {
    0% { box-shadow: 0 0 5px rgba(255, 214, 10, 0.3); }
    100% { box-shadow: 0 0 15px rgba(255, 214, 10, 0.6); }
}

@media (max-width: 480px), (max-height: 720px) {
    body {
        min-height: 100vh;
    }
}

/* Quests Premium Sliding Tab System */
.quests-tabs {
    position: relative;
    display: flex;
    flex-shrink: 0;
    background: rgba(5, 2, 16, 0.65);
    border: 2px solid #5a508c;
    border-radius: 14px;
    padding: 4px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

.tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border-radius: 14px;
    border: 4px solid transparent;
    background-clip: padding-box;
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.45);
}

.tab-btn {
    position: relative;
    flex: 1;
    padding: 10px 12px;
    background: none !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    z-index: 2; /* Sits above the sliding indicator */
    transition: color 0.25s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 10px;
    font-family: var(--font-heading);
}

.tab-btn:hover {
    color: var(--text-white) !important;
}

.tab-btn:active {
    transform: scale(0.95);
}

.tab-btn.active {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.webview-keeper {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 2px;
    height: 2px;
    background: rgba(0, 245, 212, 0.8);
    pointer-events: none;
    z-index: 9999;
    animation: keepAlive 0.05s linear infinite;
    transform: translate3d(0, 0, 0);
}

@keyframes keepAlive {
    0% { opacity: 0.7; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

/* ── Graphic Quality Selector ── */
.quality-btn {
    padding: 6px 10px;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.quality-btn:hover {
    border-color: rgba(0, 245, 212, 0.5);
    color: #fff;
    background: rgba(0, 245, 212, 0.1);
}
.quality-btn.active {
    border-color: #00f5d4;
    background: rgba(0, 245, 212, 0.18);
    color: #00f5d4;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.3);
}
.quality-btn[data-q="low"].active {
    border-color: #ff9f1c;
    background: rgba(255, 159, 28, 0.18);
    color: #ff9f1c;
    box-shadow: 0 0 10px rgba(255, 159, 28, 0.3);
}
.quality-btn[data-q="high"].active {
    border-color: #c77dff;
    background: rgba(199, 125, 255, 0.18);
    color: #c77dff;
    box-shadow: 0 0 10px rgba(199, 125, 255, 0.3);
}

/* ── FPS Debug Overlay ── */
#fps-debug-overlay {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 82px;
    height: 44px;
    background: rgba(5, 2, 16, 0.82);
    border-radius: 6px;
    padding: 4px 6px;
    font-family: monospace;
    font-size: 10px;
    font-weight: bold;
    color: #ffffff;
    pointer-events: none;
    z-index: 999999; /* Higher than modals and HUD layers */
    display: none;
    border: 1px solid rgba(123, 47, 247, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}
#fps-debug-overlay div {
    line-height: 1.2;
}

/* Disable heavy backdrop-filters on mobile devices to prevent GPU readback stalls and low FPS */
.mobile-device .top-bar,
.mobile-device .bottom-nav,
.mobile-device .modal-overlay,
.mobile-device .modal-content,
.mobile-device .speed-btn,
.mobile-device .auto-merge-btn {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Compensate opacity on mobile to maintain clean premium dark contrast */
.mobile-device .top-bar,
.mobile-device .bottom-nav {
    background: rgba(16, 10, 42, 0.97) !important;
}

.mobile-device .modal-overlay {
    background: rgba(5, 2, 16, 0.94) !important;
}

.mobile-device .modal-content {
    background: rgba(16, 10, 42, 0.98) !important;
}

.mobile-device .speed-btn,
.mobile-device .auto-merge-btn {
    background: rgba(12, 8, 32, 0.96) !important;
}

/* Shop and Upgrades Tabbed System */
.shop-tabs, .upgrades-tabs, .social-tabs-container, .leaderboard-tabs, .rebirth-tabs-header {
    position: relative;
    display: flex;
    background: rgba(5, 2, 16, 0.65);
    border: 2px solid #5a508c;
    border-radius: 4px;
    padding: 4px;
    margin-bottom: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

.tab-indicator-3 {
    position: absolute;
    top: 0;
    left: 0;
    width: 33.333%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border-radius: 4px;
    border: 4px solid transparent;
    background-clip: padding-box;
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.45);
}

.tab-indicator-4 {
    position: absolute;
    top: 0;
    left: 0;
    width: 25%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border-radius: 4px;
    border: 4px solid transparent;
    background-clip: padding-box;
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.45);
}

/* Dynamic leaderboard tab indicator - width set via JS */
.tab-indicator-leaderboard {
    position: absolute;
    top: 0;
    left: 0;
    width: 25%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border-radius: 4px;
    border: 4px solid transparent;
    background-clip: padding-box;
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1), width 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.45);
}

.leaderboard-tabs.has-wb .leaderboard-tab {
    padding: 8px 2px 4px 2px !important;
    font-size: 7px !important;
    letter-spacing: -0.3px;
}

.tab-indicator-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue));
    border-radius: 4px;
    border: 4px solid transparent;
    background-clip: padding-box;
    transition: transform 0.28s cubic-bezier(0.25, 1, 0.5, 1);
    z-index: 1;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.45);
}

.shop-tab, .upgrades-tab, .social-tab-btn, .leaderboard-tab, .rebirth-tab-btn {
    position: relative;
    flex: 1;
    padding: 11px 8px 7px 8px;
    background: none !important;
    border: none !important;
    color: var(--text-muted) !important;
    font-size: 8px;
    font-weight: normal;
    cursor: pointer;
    z-index: 2;
    transition: color 0.25s ease, transform 0.1s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
}

.shop-tab:hover, .upgrades-tab:hover, .social-tab-btn:hover, .leaderboard-tab:hover, .rebirth-tab-btn:hover {
    color: var(--text-white) !important;
}

.shop-tab:active, .upgrades-tab:active, .social-tab-btn:active, .leaderboard-tab:active, .rebirth-tab-btn:active {
    transform: scale(0.95);
}

.shop-tab.active, .upgrades-tab.active, .social-tab-btn.active, .leaderboard-tab.active, .rebirth-tab-btn.active {
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.shop-panel {
    display: none;
}

.shop-panel.active {
    display: block;
}

/* Event Banner styling */
.event-banner {
    background: linear-gradient(135deg, rgba(123, 47, 247, 0.2), rgba(0, 245, 212, 0.2));
    border: 1px solid rgba(0, 245, 212, 0.35);
    border-radius: 12px;
    padding: 10px 15px;
    text-align: center;
    font-weight: 800;
    color: #e0f2fe;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 245, 212, 0.15);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    font-size: 14px;
}

/* Inactive Event Egg Locked styling */
.shop-item.locked {
    opacity: 0.45;
    position: relative;
}

.shop-item.locked .btn-buy {
    background: #475569 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    filter: grayscale(1);
    pointer-events: none;
}

/* ─── Egg Info & Visual Polishes ─── */
.btn-egg-info {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--neon-blue);
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    padding: 0;
    line-height: 1;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    vertical-align: middle;
}

.btn-egg-info:hover {
    background: var(--neon-blue);
    color: #000;
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px rgba(0, 245, 212, 0.6);
    transform: scale(1.2);
}

.btn-egg-info:active {
    transform: scale(0.9);
}

/* Category-specific styling for Gold Upgrades */
.shop-item.upgrade-combat {
    border-color: rgba(255, 0, 85, 0.12);
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.03), rgba(20, 16, 42, 0.65));
}
.shop-item.upgrade-combat:hover {
    border-color: rgba(255, 0, 85, 0.45);
    background: linear-gradient(135deg, rgba(255, 0, 85, 0.06), rgba(20, 16, 42, 0.7));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 0, 85, 0.18);
}

.shop-item.upgrade-economy {
    border-color: rgba(0, 245, 212, 0.12);
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.03), rgba(20, 16, 42, 0.65));
}
.shop-item.upgrade-economy:hover {
    border-color: rgba(0, 245, 212, 0.45);
    background: linear-gradient(135deg, rgba(0, 245, 212, 0.06), rgba(20, 16, 42, 0.7));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(0, 245, 212, 0.18);
}

/* Premium outlines and shadows for Eggs in Shop */
.shop-item.egg-basic {
    border-color: rgba(255, 255, 255, 0.08);
}
.shop-item.egg-basic:hover {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 255, 255, 0.1);
}

.shop-item.egg-rare {
    border-color: rgba(0, 245, 212, 0.15);
}
.shop-item.egg-rare:hover {
    border-color: rgba(0, 245, 212, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(0, 245, 212, 0.25);
}

.shop-item.egg-legendary {
    border-color: rgba(255, 214, 10, 0.15);
}
.shop-item.egg-legendary:hover {
    border-color: rgba(255, 214, 10, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 214, 10, 0.25);
}

.shop-item.egg-ad {
    border-color: rgba(123, 47, 247, 0.15);
}
.shop-item.egg-ad:hover {
    border-color: rgba(123, 47, 247, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(123, 47, 247, 0.25);
}

.shop-item.egg-elemental {
    border-color: rgba(76, 201, 240, 0.2);
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.05), rgba(20, 16, 42, 0.65));
}
.shop-item.egg-elemental:hover {
    border-color: rgba(76, 201, 240, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(76, 201, 240, 0.3);
}

.shop-item.egg-ancient {
    border-color: rgba(244, 92, 192, 0.2);
    background: linear-gradient(135deg, rgba(244, 92, 192, 0.05), rgba(20, 16, 42, 0.65));
}
.shop-item.egg-ancient:hover {
    border-color: rgba(244, 92, 192, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(244, 92, 192, 0.3);
}



.rebirth-tab-content {
    display: none;
}

.rebirth-tab-content.active {
    display: block;
}

/* Custom Scrollbars to replace ugly browser scrollbars */
.upgrade-list::-webkit-scrollbar,
.quests-list::-webkit-scrollbar,
.achievements-list::-webkit-scrollbar,
#prestige-milestones-list::-webkit-scrollbar,
.settings-list::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.upgrade-list::-webkit-scrollbar-track,
.quests-list::-webkit-scrollbar-track,
.achievements-list::-webkit-scrollbar-track,
#prestige-milestones-list::-webkit-scrollbar-track,
.settings-list::-webkit-scrollbar-track {
    background: transparent;
}

.upgrade-list::-webkit-scrollbar-thumb,
.quests-list::-webkit-scrollbar-thumb,
.achievements-list::-webkit-scrollbar-thumb,
#prestige-milestones-list::-webkit-scrollbar-thumb,
.settings-list::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 247, 0.4);
    border-radius: 10px;
}

.upgrade-list::-webkit-scrollbar-thumb:hover,
.quests-list::-webkit-scrollbar-thumb:hover,
.achievements-list::-webkit-scrollbar-thumb:hover,
#prestige-milestones-list::-webkit-scrollbar-thumb:hover,
.settings-list::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 47, 247, 0.7);
}

/* Firefox support for scrollbars */
.upgrade-list,
.quests-list,
.achievements-list,
#prestige-milestones-list,
.settings-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 247, 0.4) transparent;
}

/* ─── Redesigned Egg Shop Card Grid ─── */
#modal-shop .shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 4px;
}

#modal-shop .shop-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    background: linear-gradient(135deg, rgba(25, 20, 50, 0.75), rgba(15, 10, 30, 0.85));
    border-width: 1.5px;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px;
    gap: 10px;
    text-align: center;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    min-height: 190px; /* Ensures all card heights match precisely and have room for larger preview */
}

/* Ensure the single board expansion item spans full width! */
#modal-shop #shop-item-expansion {
    grid-column: span 2;
    min-height: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    gap: 12px;
}

#modal-shop .item-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

/* For expansion, keep it row layout alignment */
#modal-shop #shop-item-expansion .item-info {
    align-items: flex-start;
    width: auto;
}

#modal-shop #shop-item-expansion .item-desc {
    height: auto;
    display: block;
    -webkit-line-clamp: none;
    text-overflow: clip;
    overflow: visible;
}

#modal-shop #shop-item-expansion .btn-buy {
    width: auto;
    min-width: 90px;
    margin-top: 0;
}

/* Egg Preview Canvas styles */
#modal-shop .egg-preview-canvas {
    width: 85px;
    height: 85px;
    align-self: center;
    pointer-events: none; /* so click passes through to the card */
}

/* Egg Info Modal Monster Preview styles */
.egg-info-monster-preview {
    width: 50px;
    height: 50px;
    align-self: center;
    pointer-events: none;
    background: transparent;
    display: inline-block;
    vertical-align: middle;
}

#modal-shop .item-name {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

#modal-shop .egg-name-wrapper {
    font-size: 8px;
    font-weight: 800;
    color: #fff;
    white-space: normal;
    overflow: visible;
    max-width: calc(100% - 20px); /* Leave space for the info button */
    font-family: var(--font-heading);
}

/* Style the ℹ️ button professionally as a circular neon badge */
#modal-shop .btn-egg-info {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    z-index: 2;
}

#modal-shop .btn-egg-info:hover {
    background: var(--neon-blue);
    border-color: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
    transform: scale(1.1);
}

#modal-shop .item-desc {
    font-size: 9.5px;
    color: var(--text-muted);
    line-height: 1.3;
    font-family: var(--font-body);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 26px; /* fixed height for description text container */
}

/* Adjust purchase buttons inside cards */
#modal-shop .btn-buy {
    width: 100%;
    padding: 8px;
    font-size: 10.5px;
    font-weight: 800;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    font-family: var(--font-heading);
    margin-top: auto; /* force buy button to bottom of the card */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

#modal-shop .auto-buy-container {
    grid-column: span 2;
    margin-top: 6px;
    background: rgba(12, 8, 32, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Specific Egg Color Overrides for Cards */
#modal-shop .shop-item.egg-basic {
    border-color: rgba(255, 255, 255, 0.08);
}
#modal-shop .shop-item.egg-basic:hover {
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 255, 255, 0.15);
}

#modal-shop .shop-item.egg-rare {
    border-color: rgba(0, 245, 212, 0.15);
}
#modal-shop .shop-item.egg-rare:hover {
    border-color: rgba(0, 245, 212, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(0, 245, 212, 0.25);
}

#modal-shop .shop-item.egg-legendary {
    border-color: rgba(255, 214, 10, 0.15);
}
#modal-shop .shop-item.egg-legendary:hover {
    border-color: rgba(255, 214, 10, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 214, 10, 0.25);
}

#modal-shop .shop-item.egg-ad {
    border-color: rgba(123, 47, 247, 0.15);
}
#modal-shop .shop-item.egg-ad:hover {
    border-color: rgba(123, 47, 247, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(123, 47, 247, 0.25);
}

#modal-shop .shop-item.egg-elemental {
    border-color: rgba(76, 201, 240, 0.2);
    background: linear-gradient(135deg, rgba(76, 201, 240, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.egg-elemental:hover {
    border-color: rgba(76, 201, 240, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(76, 201, 240, 0.3);
}

#modal-shop .shop-item.egg-ancient {
    border-color: rgba(244, 92, 192, 0.2);
    background: linear-gradient(135deg, rgba(244, 92, 192, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.egg-ancient:hover {
    border-color: rgba(244, 92, 192, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(244, 92, 192, 0.3);
}

#modal-shop .shop-item.egg-nature {
    border-color: rgba(6, 214, 160, 0.2);
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.egg-nature:hover {
    border-color: rgba(6, 214, 160, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(6, 214, 160, 0.3);
}

#modal-shop .shop-item.seasonal-shop-item[data-event="spring"] {
    border-color: rgba(255, 181, 167, 0.2);
    background: linear-gradient(135deg, rgba(255, 181, 167, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.seasonal-shop-item[data-event="spring"]:hover {
    border-color: rgba(255, 181, 167, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 181, 167, 0.3);
}

#modal-shop .shop-item.seasonal-shop-item[data-event="summer"] {
    border-color: rgba(255, 183, 3, 0.2);
    background: linear-gradient(135deg, rgba(255, 183, 3, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.seasonal-shop-item[data-event="summer"]:hover {
    border-color: rgba(255, 183, 3, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(255, 183, 3, 0.3);
}

#modal-shop .shop-item.seasonal-shop-item[data-event="halloween"] {
    border-color: rgba(251, 133, 0, 0.2);
    background: linear-gradient(135deg, rgba(251, 133, 0, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.seasonal-shop-item[data-event="halloween"]:hover {
    border-color: rgba(251, 133, 0, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(251, 133, 0, 0.3);
}

#modal-shop .shop-item.seasonal-shop-item[data-event="winter"] {
    border-color: rgba(142, 202, 230, 0.2);
    background: linear-gradient(135deg, rgba(142, 202, 230, 0.05), rgba(20, 16, 42, 0.65));
}
#modal-shop .shop-item.seasonal-shop-item[data-event="winter"]:hover {
    border-color: rgba(142, 202, 230, 0.6);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), 0 0 15px rgba(142, 202, 230, 0.3);
}

/* Custom overrides to compress the shop modal vertically and prevent scrolling */
#modal-shop .modal-content {
    max-height: 90% !important;
    padding: 10px 14px !important;
    gap: 8px !important;
}

#modal-shop .modal-header {
    padding-bottom: 6px !important;
}

#modal-shop .shop-tabs {
    margin-bottom: 8px !important;
}

#modal-shop .shop-grid {
    gap: 8px !important;
}

#modal-shop .shop-item {
    min-height: 165px !important; /* Compact matching height */
    padding: 8px 10px !important;
    gap: 6px !important;
}

#modal-shop .egg-preview-canvas {
    width: 75px !important;
    height: 75px !important;
}

#modal-shop .shop-item.locked {
    display: none !important; /* Hide locked seasonal eggs to fit screen height */
}

/* ─── Login Screen Overlay ─── */
.login-screen-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, #0f082e 0%, #040209 100%);
    background-size: 400% 400%;
    animation: driftBg 15s ease infinite;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* On top of everything */
}

@keyframes driftBg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.login-screen-overlay.active {
    display: flex;
}

.login-screen-content {
    width: 85%;
    max-width: 340px;
    background: rgba(12, 8, 32, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(199, 125, 255, 0.25);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 
                0 0 30px rgba(123, 47, 247, 0.15),
                inset 0 1px 1px rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: authPopIn 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
}

/* Glowing outline animation on content hover/active */
.login-screen-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 180deg, transparent 30%, rgba(0, 245, 212, 0.15), rgba(123, 47, 247, 0.15), transparent 70%);
    animation: rotateGlow 8s linear infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes authPopIn {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.login-logo {
    display: none;
}

.login-logo-canvas {
    width: 116px;
    height: 116px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 18px rgba(72, 191, 227, 0.55));
    animation: floatLogo 3s ease-in-out infinite alternate;
}

@keyframes floatLogo {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-8px) scale(1.05); }
}

.login-title {
    font-family: var(--font-heading);
    font-size: 26px;
    font-weight: 900;
    color: #ffffff;
    background: linear-gradient(135deg, #00f5d4, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 22px;
    text-shadow: 0 0 15px rgba(123, 47, 247, 0.4);
    letter-spacing: 0.5px;
}

.login-tabs {
    display: flex;
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 22px;
}

.login-tab {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    padding: 10px 0;
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 800;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: var(--font-heading);
}

.login-tab.active {
    background: linear-gradient(135deg, var(--neon-purple), #5b21b6);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.login-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    align-items: flex-start;
}

.input-group label {
    font-size: 11px;
    font-weight: 800;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
    font-family: var(--font-heading);
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: var(--font-body);
}

.input-group input:focus {
    border-color: var(--neon-blue);
    box-shadow: 0 0 12px rgba(0, 245, 212, 0.25);
    background: rgba(0, 0, 0, 0.6);
}

.auth-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #7b2ff7, #00f5d4);
    border: none;
    border-radius: 14px;
    padding: 12px;
    color: #ffffff;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.25s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    box-shadow: 0 4px 15px rgba(123, 47, 247, 0.35);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(123, 47, 247, 0.5);
    filter: brightness(1.05);
}

.auth-submit-btn:active {
    transform: translateY(0);
}

.auth-divider {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 18px 0;
}

.auth-divider::before, .auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.auth-divider span {
    padding: 0 12px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-google-btn {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 12px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: all 0.25s ease;
    font-family: var(--font-heading);
}

.auth-google-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.05);
}

.google-icon {
    font-weight: 900;
    color: #4285F4;
    font-size: 14px;
    background: #ffffff;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}

.auth-error-message {
    width: 100%;
    background: rgba(239, 35, 60, 0.08);
    border: 1px solid rgba(239, 35, 60, 0.25);
    color: var(--crit-red);
    font-size: 12px;
    padding: 10px;
    border-radius: 12px;
    margin-top: 16px;
    text-align: center;
    box-sizing: border-box;
}

.auth-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}

@keyframes authSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ─── Premium Loading Curtain ─── */
.loading-curtain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #0e0825 0%, #05020c 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999999; /* Highest possible overlay */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease-out;
}

.loading-curtain.instant {
    transition: none;
}

.loading-curtain.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-curtain-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.loading-battle-scene {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 300px;
    height: 150px;
}

.loading-text {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-shadow: 0 0 12px rgba(0, 245, 212, 0.45);
    background: linear-gradient(135deg, #00f5d4, #7b2ff7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.3s ease;
}

.loading-tip {
    font-family: var(--font-heading);
    font-size: 8.5px;
    font-weight: 600;
    color: var(--text-muted);
    max-width: 380px;
    width: 90%;
    line-height: 1.6;
    text-align: center;
    opacity: 0.8;
    transition: opacity 0.3s ease;
    min-height: 33px;
    margin-top: 6px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.loading-progress-dots span {
    animation: loadingDots 1.4s infinite both;
    font-size: 16px;
    -webkit-text-fill-color: initial;
    color: #00f5d4;
    display: inline-block;
}

.loading-progress-dots span:nth-child(2) {
    animation-delay: .2s;
}

.loading-progress-dots span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes loadingDots {
    0% { opacity: .2; transform: translateY(0); }
    20% { opacity: 1; transform: translateY(-3px); }
    100% { opacity: .2; transform: translateY(0); }
}

/* ─── Leaderboard CSS ─── */
#app-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    min-height: 100vh;
    width: 100vw;
    background: var(--bg-dark);
    padding: 10px;
    box-sizing: border-box;
    transition: padding-right 0.3s ease;
}

@media (min-width: 1100px) {
    #app-layout {
        padding-right: 0px;
    }
}

#leaderboard-container {
    width: 320px;
    height: min(calc(100vh - 24px), 910px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 
        0 18px 58px rgba(0, 0, 0, 0.72),
        0 0 40px rgba(123, 47, 247, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.leaderboard-title {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--gold), #ffaa00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}



.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 247, 0.3) rgba(0, 0, 0, 0.1);
}

.leaderboard-list::-webkit-scrollbar {
    width: 4px;
}
.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
.leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 247, 0.3);
    border-radius: 2px;
}

.leaderboard-row {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    padding: 8px 10px;
    gap: 10px;
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(123, 47, 247, 0.04);
    border-color: rgba(123, 47, 247, 0.2);
}

.leaderboard-row.user-highlight {
    background: rgba(0, 245, 212, 0.06) !important;
    border-color: rgba(0, 245, 212, 0.3) !important;
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.05);
}

.leaderboard-rank {
    width: 24px;
    font-family: var(--font-stat);
    font-size: 11px;
    text-align: center;
    font-weight: bold;
    color: var(--text-muted);
}

.leaderboard-rank.rank-1 { color: #ffd700; font-size: 14px; text-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
.leaderboard-rank.rank-2 { color: #c0c0c0; font-size: 14px; }
.leaderboard-rank.rank-3 { color: #cd7f32; font-size: 14px; }

.leaderboard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(123, 47, 247, 0.25);
    position: relative;
    overflow: visible;
}

.leaderboard-avatar-tier {
    position: absolute;
    bottom: -4px;
    left: -4px;
    background: #ffd60a;
    border: 1px solid #1a1040;
    border-radius: 4px;
    padding: 2px 4px;
    font-family: var(--font-heading);
    font-size: 9px;
    font-weight: 800;
    color: #1a1040;
    line-height: 1;
}

.leaderboard-avatar-stars {
    position: absolute;
    top: -4px;
    right: -4px;
    background: rgba(7, 3, 18, 0.85);
    border: 1px solid var(--gold);
    border-radius: 4px;
    padding: 1px 3px;
    font-family: var(--font-stat);
    font-size: 8px;
    font-weight: bold;
    color: var(--gold);
    line-height: 1;
}

.leaderboard-avatar-level {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #06d6a0;
    border: 1px solid #1a1040;
    border-radius: 4px;
    padding: 2px 4px;
    font-family: var(--font-heading);
    font-size: 8px;
    font-weight: bold;
    color: #1a1040;
    line-height: 1;
}


.leaderboard-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.leaderboard-name {
    font-size: 8px;
    font-weight: normal;
    color: var(--text-white);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: translateZ(0);
}

.leaderboard-sub {
    font-size: 6.5px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 3px;
}

.leaderboard-score {
    font-family: var(--font-stat);
    font-size: 8px;
    font-weight: normal;
    color: var(--gold);
    text-align: right;
    white-space: nowrap;
}

.leaderboard-score.score-wave {
    color: #ff477e;
}

.leaderboard-user-card {
    background: linear-gradient(135deg, rgba(12, 8, 32, 0.95), rgba(123, 47, 247, 0.1));
    border: 1.5px solid var(--neon-purple);
    box-shadow: 0 0 15px rgba(123, 47, 247, 0.2);
    border-radius: 4px;
    padding: 10px;
    box-sizing: border-box;
}

/* Social Modal Tabs */
.social-tab {
    transition: all 0.3s ease;
}

/* Friend Row Card */
.friend-row-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.friend-row-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(76, 201, 240, 0.15);
    border-color: rgba(76, 201, 240, 0.4);
}

/* Trade Grid Selector */
.trade-grid-selector {
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}
.trade-grid-slot {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.2s ease;
}
.trade-grid-slot:hover:not(:disabled) {
    background: rgba(123, 47, 247, 0.15);
    border-color: var(--neon-purple);
    box-shadow: 0 0 10px rgba(123, 47, 247, 0.4);
    transform: scale(1.05);
}
.trade-grid-slot .slot-tier {
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 9px;
    font-weight: 800;
    background: rgba(0,0,0,0.6);
    color: var(--neon-pink);
    padding: 1px 4px;
    border-radius: 4px;
    line-height: 1;
}

/* Loading spinner for social panel */
.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--neon-blue);
    animation: spin 1s linear infinite;
    margin: 40px auto;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* Social Panel Title styling */
.social-panel-title {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, var(--neon-blue), #4cc9f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}



/* Custom Scrollbar for social-content */
#social-content::-webkit-scrollbar {
    width: 4px;
}
#social-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}
#social-content::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 247, 0.3);
    border-radius: 4px;
}
#social-content::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 47, 247, 0.6);
}

/* Input Focus Glow */
#social-search-input {
    transition: all 0.25s ease;
}
#social-search-input:focus {
    border-color: var(--neon-blue) !important;
    box-shadow: 0 0 8px rgba(76, 201, 240, 0.3);
    background: rgba(0,0,0,0.5) !important;
}

/* Social Panel Desktop Layout (>= 1100px) */
.social-panel-overlay {
    display: block !important;
    position: static !important;
    background: none !important;
    padding: 0 !important;
    z-index: auto !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.social-panel-content {
    width: 320px;
    height: min(calc(100vh - 24px), 910px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 
        0 18px 58px rgba(0, 0, 0, 0.72),
        0 0 40px rgba(76, 201, 240, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}
/* close button visible on desktop */
#social-panel-close-btn {
    display: block;
}

/* Premium Social Panel Styles */
.social-profile-card {
    background: linear-gradient(135deg, rgba(16, 10, 42, 0.95), rgba(76, 201, 240, 0.05));
    border: 1px solid rgba(123, 47, 247, 0.4);
    border-radius: 4px;
    padding: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 20px rgba(123, 47, 247, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.social-profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.social-profile-crown {
    font-size: 36px;
    filter: drop-shadow(0 0 8px rgba(255, 214, 10, 0.6));
    animation: crownPulse 2s ease-in-out infinite alternate;
}

@keyframes crownPulse {
    0% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(255, 214, 10, 0.5)); }
    100% { transform: scale(1.08) rotate(3deg); filter: drop-shadow(0 0 12px rgba(255, 214, 10, 0.8)); }
}

.social-profile-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.social-profile-name {
    font-size: 11px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    letter-spacing: 0.5px;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-profile-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--neon-blue);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(0, 245, 212, 0.4);
}

.social-divider {
    border: none;
    border-top: 1px solid rgba(123, 47, 247, 0.25);
    margin: 4px 0;
}

.social-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.social-stat-card {
    background: rgba(12, 8, 32, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 10px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all 0.25s ease;
    min-width: 0;
    overflow: hidden;
}

.social-stat-card:hover {
    background: rgba(123, 47, 247, 0.08);
    border-color: rgba(123, 47, 247, 0.3);
    transform: translateY(-1px);
}

.social-stat-card.rebirth-card {
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.12), rgba(12, 8, 32, 0.6));
    border: 1px solid rgba(255, 214, 10, 0.25);
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.05);
}

.social-stat-card.rebirth-card:hover {
    background: linear-gradient(135deg, rgba(255, 214, 10, 0.2), rgba(123, 47, 247, 0.08));
    border-color: rgba(255, 214, 10, 0.5);
    box-shadow: 0 0 15px rgba(255, 214, 10, 0.15);
}

.social-stat-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: bold;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.social-stat-value {
    font-size: 12px;
    font-weight: 800;
    font-family: var(--font-stat);
}

/* Friend row updates */
.social-friend-row {
    background: rgba(16, 10, 42, 0.7);
    border: 1px solid rgba(123, 47, 247, 0.2);
    padding: 14px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.social-friend-row:hover {
    background: rgba(123, 47, 247, 0.12);
    border-color: rgba(0, 245, 212, 0.4);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(0, 245, 212, 0.08);
}

.social-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.social-status-pill.online {
    background: rgba(76, 175, 80, 0.15);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.2);
}

.social-status-pill.offline {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Search bar additions */
.social-search-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(5, 2, 16, 0.8);
    border: 1px solid rgba(123, 47, 247, 0.3);
    border-radius: 4px;
    padding: 3px;
    transition: all 0.25s ease;
    height: 38px;
}

.social-search-input-wrapper:focus-within {
    border-color: var(--neon-blue);
    box-shadow: 
        0 0 12px rgba(0, 245, 212, 0.2),
        inset 0 1px 5px rgba(0, 0, 0, 0.8);
}

.social-search-field {
    flex: 1;
    background: none !important;
    border: none !important;
    color: white;
    padding: 0 10px;
    font-size: 8px;
    height: 100%;
    outline: none !important;
    line-height: 1;
}

.social-search-submit {
    background: linear-gradient(135deg, var(--neon-blue), #3a0ca3) !important;
    border: none !important;
    border-radius: 4px;
    color: white;
    padding: 0 16px;
    height: 100%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-search-submit:hover {
    transform: scale(1.04);
    filter: brightness(1.1);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}

/* Trade card additions */
.social-trade-card {
    background: linear-gradient(135deg, rgba(16, 10, 42, 0.9), rgba(123, 47, 247, 0.05));
    border: 1px solid rgba(123, 47, 247, 0.25);
    border-radius: 4px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s ease;
}

.social-trade-card:hover {
    border-color: rgba(123, 47, 247, 0.45);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.social-trade-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.social-trade-user {
    font-size: 12px;
    font-weight: 800;
    color: var(--neon-blue);
    letter-spacing: 0.5px;
}

.social-trade-date {
    font-size: 9px;
    color: var(--text-muted);
}

/* Visual Trade Swapping Flow (User-friendly Side-by-Side Swap!) */
.social-trade-flow {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.35);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.social-trade-flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(123, 47, 247, 0.2);
    border: 1px solid rgba(123, 47, 247, 0.4);
    color: var(--neon-blue);
    font-size: 11px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-blue);
}

.social-trade-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
}

.social-trade-slot-label {
    font-size: 8px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.social-trade-slot-item {
    font-size: 18px;
    filter: drop-shadow(0 0 5px rgba(255,255,255,0.1));
}

.social-trade-slot-name {
    font-size: 11px;
    font-weight: 800;
    color: white;
    max-width: 85px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.social-trade-slot-desc {
    font-size: 8px;
    color: var(--neon-blue);
}

/* Responsive Breakpoint (Hide sidebars on desktop viewports < 1100px and mobile) */
@media (max-width: 1100px) {
    #leaderboard-container {
        display: none !important;
    }
    #app-layout {
        display: block !important;
        padding: 0;
        min-height: auto;
        width: auto;
    }
    
    /* Hide Social Panel on smaller screens since close/toggle buttons are removed */
    .social-panel-overlay {
        display: none !important;
    }
}

/* ─── Nickname Custom Styles & Badges ─── */
.nickname-styled {
    display: inline-block;
    transition: all 0.3s ease;
}

.nickname-styled.style-glow-gold {
    color: #ffd43b !important;
    filter: drop-shadow(0 0 1px #e5a93b) drop-shadow(0 0 3px #ffd43b);
    font-weight: 800;
    padding: 2px 6px;
    margin: -2px -6px;
}

.nickname-styled.style-glow-neon-red {
    color: #ffb3c1 !important;
    filter: drop-shadow(0 0 1px #ff4d6d) drop-shadow(0 0 3px #ff758f);
    font-weight: 800;
    padding: 2px 6px;
    margin: -2px -6px;
}

.nickname-styled.style-glow-neon-blue {
    color: #a0c4ff !important;
    filter: drop-shadow(0 0 1px #3a86c8) drop-shadow(0 0 3px #70e2ff);
    font-weight: 800;
    padding: 2px 6px;
    margin: -2px -6px;
}

.nickname-styled.style-glow-neon-purple {
    color: #e0aaff !important;
    filter: drop-shadow(0 0 1px #7b2cbf) drop-shadow(0 0 3px #c77dff);
    font-weight: 800;
    padding: 2px 6px;
    margin: -2px -6px;
}

.nickname-styled.style-gradient-rainbow {
    background: linear-gradient(90deg, #ff007f, #7f00ff, #00f0ff, #7f00ff, #ff007f);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow-text-flow 3s linear infinite;
    font-weight: 800;
    text-shadow: none !important;
}

@keyframes rainbow-text-flow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

.nickname-styled.style-sparkle {
    background: linear-gradient(to right, #ff4e50, #f9d423);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse-glow 1.5s ease-in-out infinite alternate;
    font-weight: 800;
    text-shadow: none !important;
    filter: drop-shadow(0 0 2px rgba(255, 78, 80, 0.6));
}

@keyframes pulse-glow {
    from { filter: drop-shadow(0 0 1px rgba(255, 78, 80, 0.4)); }
    to { filter: drop-shadow(0 0 5px rgba(255, 212, 35, 0.9)); }
}

.leaderboard-title-badge, .friend-title-badge {
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04) !important;
    font-weight: 700 !important;
    text-transform: uppercase;
}

/* ─── SVG Icon Enhancements (Emoji Replacements) ─── */
.svg-icon {
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
    display: inline-block;
    transition: transform 0.2s ease;
}
.svg-icon.stroke-only {
    fill: none;
    stroke: currentColor;
}
.hud-svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
}
.nav-svg {
    width: 20px;
    height: 20px;
    margin-bottom: 2px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.modal-svg {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-right: 8px;
}
.element-svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
}
.inline-svg {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin: 0 3px;
}

/* Hide leaderboard and social panel during auth mode (login screen) and center the game container */
#app-layout.auth-mode #leaderboard-container,
#app-layout.auth-mode #modal-social {
    display: none !important;
}

/* Pixelated rendering for monster canvases to prevent browser blur */
#game-canvas,
#hatch-preview-canvas,
#loading-canvas,
.login-logo-canvas,
.codex-monster-canvas,
.leaderboard-monster-canvas,
.leaderboard-user-canvas,
.trade-monster-canvas,
#detail-preview-canvas,
#wb-detail-preview-canvas,
.egg-preview-canvas,
.leaderboard-avatar canvas,
.social-profile-card canvas {
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* ─── Grayscale Pixel Icons (icons_pixel.png) Colorized via Filters ─── */
.pixel-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: middle;
    background-image: url('../icons_pixel.png');
    background-repeat: no-repeat;
    background-size: 105px 15px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
    margin-right: 4px;
}

/* 1. DPS (Sword) */
.pixel-icon-dps {
    background-position: 0px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(160deg) brightness(1.6) drop-shadow(0 0 3px rgba(76, 201, 240, 0.6)) !important;
}

/* 2. Coin (Gold) */
.pixel-icon-coin {
    background-position: -15px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(15deg) brightness(1.8) drop-shadow(0 0 3px rgba(255, 214, 10, 0.6)) !important;
}

/* 3. Wave */
.pixel-icon-wave {
    background-position: -30px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(310deg) brightness(1.5) drop-shadow(0 0 3px rgba(255, 71, 126, 0.6)) !important;
}

/* 4. Star Dust */
.pixel-icon-dust {
    background-position: -45px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(245deg) brightness(1.7) drop-shadow(0 0 3px rgba(224, 170, 255, 0.6)) !important;
}

/* 5. Sort */
.pixel-icon-sort {
    background-position: -60px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(245deg) brightness(1.7) !important;
}

/* 6. Auto Merge */
.pixel-icon-merge {
    background-position: -75px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(160deg) brightness(1.6) !important;
}

/* 7. Speed */
.pixel-icon-speed {
    background-position: -90px 0px;
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(160deg) brightness(1.6) !important;
}

/* ─── Clean Grayscale / Plain Pixel Icons (icons2_pixel.png) ─── */
.pixel2-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: middle;
    background-image: url('../icons2_pixel.png');
    background-repeat: no-repeat;
    background-size: 75px 15px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.pixel2-icon-trade { background-position: 0px 0px; }
.pixel2-icon-profile { background-position: -15px 0px; }
.pixel2-icon-search { background-position: -30px 0px; }
.pixel2-icon-pro { background-position: -45px 0px; }
.pixel2-icon-boss { background-position: -60px 0px; }

/* Large variant (30x30px) for general UI widgets and crown profiles */
.pixel2-icon.large {
    width: 30px;
    height: 30px;
    background-size: 150px 30px;
}
.pixel2-icon.large.pixel2-icon-trade { background-position: 0px 0px; }
.pixel2-icon.large.pixel2-icon-profile { background-position: -30px 0px; }
.pixel2-icon.large.pixel2-icon-search { background-position: -60px 0px; }
.pixel2-icon.large.pixel2-icon-pro { background-position: -90px 0px; }
.pixel2-icon.large.pixel2-icon-boss { background-position: -120px 0px; }

/* Super large variant (60x60px) for the main paywall crown */
.pixel2-icon.super-large {
    width: 60px;
    height: 60px;
    background-size: 300px 60px;
}
.pixel2-icon.super-large.pixel2-icon-pro { background-position: -180px 0px; }

/* Modal Icons for icons2_pixel.png (30x30px) */
.modal-icon2 {
    display: inline-block;
    width: 30px;
    height: 30px;
    vertical-align: middle;
    background-image: url('../icons2_pixel.png');
    background-repeat: no-repeat;
    background-size: 150px 30px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.modal-icon2-trade { background-position: 0px 0px; }
.modal-icon2-profile { background-position: -30px 0px; }
.modal-icon2-search { background-position: -60px 0px; }
.modal-icon2-pro { background-position: -90px 0px; }
.modal-icon2-boss { background-position: -120px 0px; }

/* ─── Social Panel Redesign ─── */
.social-panel-title {
    font-size: 18px;
    font-weight: 800;
    font-family: var(--font-heading);
    background: linear-gradient(135deg, #00f5d4, #00bbf9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.social-title-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    background-image: url('../icons2_pixel.png');
    background-repeat: no-repeat;
    background-size: 90px 18px;
    background-position: -18px 0px; /* frame 2 (profile) */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
}

.pixel-icon-rebirth {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: middle;
    background-image: url('../buttons_pixel.png');
    background-repeat: no-repeat;
    background-size: 105px 15px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    flex-shrink: 0;
    margin-right: 4px;
    background-position: -75px 0px; /* frame 6 (prestige/rebirth) */
}

/* Friend Row Layout */
.friend-info-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
    margin-right: 12px;
}

.friend-row-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
}

.friend-username {
    font-size: 13px;
    font-weight: 800;
    color: white;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
    flex: 1;
}

.friend-stats-wrapper {
    display: flex;
    gap: 12px;
    font-size: 9px;
    color: var(--text-muted);
    align-items: center;
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
}

.friend-stat-item {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 3px;
}

.friend-stat-item.wave {
    color: #ff477e;
}

.friend-stat-item.gold {
    color: var(--gold);
}

.friend-stat-item.damage {
    color: var(--neon-purple);
}

.friend-actions-col {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

/* Friend row buttons */
.friend-action-btn {
    width: 30px;
    height: 30px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.friend-action-btn-profile {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}

.friend-action-btn-profile:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
    transform: scale(1.05);
}

.friend-action-btn-trade {
    background: rgba(0, 245, 212, 0.06);
    border: 1px solid rgba(0, 245, 212, 0.3);
    color: #00f5d4;
    box-shadow: 0 0 5px rgba(0, 245, 212, 0.05);
}

.friend-action-btn-trade:hover {
    background: rgba(0, 245, 212, 0.15);
    border-color: #00f5d4;
    box-shadow: 0 0 12px rgba(0, 245, 212, 0.25);
    transform: scale(1.05);
}

/* Active Speed Button Icon Filter (Gold/Yellow) */
.speed-btn.active .pixel-icon-speed {
    filter: brightness(0.5) sepia(1) saturate(20) hue-rotate(15deg) brightness(1.8) !important;
}

/* Final UI stability pass: prevent compact tabs/buttons from overlapping after dynamic text changes. */
.modal-content {
    max-width: min(380px, calc(100% - 24px));
    box-sizing: border-box;
}

.shop-tab,
.upgrades-tab,
.social-tab-btn,
.leaderboard-tab,
.rebirth-tab-btn,
.tab-btn {
    min-width: 0;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

.leaderboard-tabs,
.shop-tabs,
.upgrades-tabs,
.social-tabs-container,
.rebirth-tabs-header,
.quests-tabs {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.prestige-btn,
.btn-buy,
.btn-claim-quest,
.auto-merge-btn,
.speed-btn {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    line-height: 1.2;
}

.item-name,
.item-desc,
.social-trade-user,
.social-trade-slot-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.world-boss-widget {
    top: 92px;
    right: 10px;
}

@media (max-width: 420px), (max-height: 700px) {
    .modal-content {
        width: calc(100% - 20px);
        max-height: 86%;
        padding: 14px;
        gap: 10px;
    }

    .top-bar {
        margin-left: 8px;
        margin-right: 8px;
        padding-left: 6px;
        padding-right: 6px;
    }

    .hud-stat,
    .hud-stat-small {
        padding-left: 5px;
        padding-right: 5px;
        gap: 2px;
    }

    .bottom-nav {
        gap: 6px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Upgrades Tabs Fix */
.upgrades-tabs {
    display: flex !important;
    height: auto !important;
    min-height: 28px !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
}

.upgrades-tab {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Upgrades Multiplier Buttons Active Styles */
.upgrades-mult-selector .mult-btn.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue)) !important;
    box-shadow: 0 0 10px rgba(186, 12, 248, 0.5) !important;
}

.upgrades-mult-selector .mult-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Rebirth Multiplier Buttons Active Styles */
.rebirth-mult-selector .rebirth-mult-btn.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-blue)) !important;
    box-shadow: 0 0 10px rgba(186, 12, 248, 0.5) !important;
}

.rebirth-mult-selector .rebirth-mult-btn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.05) !important;
}

/* Animation for when World Boss spawns */
@keyframes worldBossSpawnAnim {
    0% {
        transform: scale(0.3) rotate(-45deg) translate(150px, -150px);
        opacity: 0;
        filter: brightness(3) drop-shadow(0 0 30px #ff0055);
    }
    50% {
        transform: scale(1.3) rotate(15deg);
        filter: brightness(2) drop-shadow(0 0 40px #ff0055);
    }
    70% {
        transform: scale(0.9) rotate(-10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: none;
    }
}

.world-boss-widget.world-boss-spawn {
    animation: worldBossSpawnAnim 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* World Boss Button pulse effect */
@keyframes worldBossPulse {
    0% {
        box-shadow: 0 0 8px rgba(255, 0, 85, 0.6), inset 0 0 4px rgba(255, 0, 85, 0.6);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 85, 0.95), inset 0 0 10px rgba(255, 0, 85, 0.95);
        transform: scale(1.06);
    }
    100% {
        box-shadow: 0 0 8px rgba(255, 0, 85, 0.6), inset 0 0 4px rgba(255, 0, 85, 0.6);
        transform: scale(1);
    }
}

.world-boss-btn {
    animation: worldBossPulse 1.8s infinite ease-in-out;
}

.app-beta-warning {
    position: fixed;
    bottom: 10px;
    left: 10px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    z-index: 9999;
    pointer-events: none;
    font-family: 'Inter', 'Outfit', sans-serif;
    font-weight: 500;
}

.login-beta-warning {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
    pointer-events: none;
    font-family: 'Inter', 'Outfit', sans-serif;
    text-align: center;
    white-space: nowrap;
    z-index: 99;
}

/* Social Footer Button Bar */
.social-footer-buttons {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.social-footer-btn {
    flex: 1;
    padding: 8px 4px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 7.5px;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
    text-align: center;
}

.social-footer-btn:hover {
    background: rgba(123, 47, 247, 0.12);
    border-color: var(--panel-border);
    color: #fff;
    box-shadow: 0 0 10px rgba(123, 47, 247, 0.15);
}

.social-footer-btn:active {
    transform: scale(0.96) translateY(0.5px);
}

/* Wiki Modal Styles */
.wiki-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.wiki-section {
    background: rgba(20, 16, 42, 0.55);
    border: 1.5px solid rgba(123, 47, 247, 0.15);
    border-radius: 4px;
    padding: 10px 12px;
    transition: border-color 0.25s ease;
}

.wiki-section:hover {
    border-color: rgba(123, 47, 247, 0.45);
}

.wiki-sec-title {
    font-size: 10.5px;
    font-weight: 800;
    color: var(--neon-blue);
    margin-bottom: 5px;
    text-transform: uppercase;
}

.wiki-sec-desc {
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Changelog Modal Styles */
.changelog-body {
    display: flex;
    flex-direction: column;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.changelog-ver {
    font-size: 11.5px;
    font-weight: bold;
    color: var(--gold);
    margin-bottom: 12px;
    border-bottom: 1.5px double rgba(255, 214, 10, 0.2);
    padding-bottom: 6px;
    text-shadow: 0 0 6px rgba(255, 214, 10, 0.15);
}

.changelog-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.changelog-item {
    font-size: 9px;
    color: var(--text-white);
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.01);
    padding: 8px 10px;
    border-radius: 4px;
    border-left: 2px solid var(--neon-purple);
}

/* Credits Modal Styles */
.credits-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-height: 380px;
    overflow-y: auto;
}

.credits-card {
    background: linear-gradient(135deg, rgba(16, 10, 42, 0.95), rgba(123, 47, 247, 0.05));
    border: 2px double rgba(123, 47, 247, 0.35);
    border-radius: 4px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.credits-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.credits-role {
    font-size: 8px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.credits-name {
    font-size: 9.5px;
    color: var(--neon-blue);
    font-weight: 800;
}

.credits-thanks-msg {
    font-size: 9.5px;
    color: var(--gold);
    font-weight: 800;
    margin-top: 8px;
    text-transform: uppercase;
    text-shadow: 0 0 6px rgba(255, 214, 10, 0.2);
}

/* Daily Login Modal Styles */
.daily-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin: 10px 0;
    width: 100%;
    box-sizing: border-box;
}

.daily-card {
    background: rgba(20, 20, 35, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    padding: 8px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    position: relative;
    transition: all 0.2s ease;
    cursor: not-allowed;
    min-height: 72px;
    box-sizing: border-box;
}

.daily-card[data-day="7"] {
    grid-column: span 2;
}

.daily-card.claimed {
    opacity: 0.6;
    border-color: var(--neon-green) !important;
    background: rgba(46, 213, 115, 0.05);
    cursor: not-allowed;
}

.daily-card.claimed::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 6px;
    color: var(--neon-green);
    font-size: 8px;
    font-weight: 900;
    font-family: 'Press Start 2P', monospace;
}

.daily-card.active {
    border-color: var(--gold);
    background: rgba(255, 214, 10, 0.08);
    box-shadow: 0 0 10px rgba(255, 214, 10, 0.25);
    cursor: pointer;
    animation: daily-pulse 2s infinite ease-in-out;
}

@keyframes daily-pulse {
    0% {
        box-shadow: 0 0 4px rgba(255, 214, 10, 0.2);
        border-color: rgba(255, 214, 10, 0.7);
    }
    50% {
        box-shadow: 0 0 12px rgba(255, 214, 10, 0.55);
        border-color: rgba(255, 214, 10, 1);
    }
    100% {
        box-shadow: 0 0 4px rgba(255, 214, 10, 0.2);
        border-color: rgba(255, 214, 10, 0.7);
    }
}

.daily-card.locked {
    opacity: 0.45;
    filter: grayscale(80%);
}

.daily-card-day {
    font-size: 6px;
    font-family: 'Press Start 2P', monospace;
    color: var(--text-muted);
}

.daily-card.active .daily-card-day {
    color: var(--gold);
}

.daily-card-icon {
    font-size: 14px;
    line-height: 1;
    margin: 2px 0;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.daily-card.active .daily-card-icon {
    animation: daily-bounce 1s infinite alternate ease-in-out;
}

@keyframes daily-bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-3px); }
}

.daily-card-value {
    font-size: 5.5px;
    font-family: 'Press Start 2P', monospace;
    color: var(--text-white);
    line-height: 1.2;
}

/* Neon Sliders */
.neon-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: background 0.3s;
}
.neon-slider:hover {
    background: rgba(255, 255, 255, 0.15);
}
.neon-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}
.neon-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}
#slider-sound-volume::-webkit-slider-thumb {
    background: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple);
}
#slider-sound-volume::-moz-range-thumb {
    background: var(--neon-purple);
    box-shadow: 0 0 8px var(--neon-purple);
}
#slider-music-volume::-webkit-slider-thumb {
    background: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
}
#slider-music-volume::-moz-range-thumb {
    background: var(--neon-blue);
    box-shadow: 0 0 8px var(--neon-blue);
}
.neon-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
.neon-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

/* ─── Global Chat Styles ─── */
.global-chat-panel {
    display: flex;
    flex-direction: column;
    height: 220px;
    background: rgba(16, 10, 42, 0.7);
    border: 1px solid rgba(123, 47, 247, 0.35);
    border-radius: 4px;
    padding: 10px;
    gap: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(123, 47, 247, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chat-header {
    display: flex;
    align-items: center;
    font-size: 8px;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--neon-blue);
    text-shadow: 0 0 8px rgba(0, 245, 212, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(123, 47, 247, 0.2);
    padding-bottom: 4px;
}

.chat-messages-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-right: 4px;
}

/* Scrollbar for chat messages */
.chat-messages-list::-webkit-scrollbar {
    width: 3px;
}
.chat-messages-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}
.chat-messages-list::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 247, 0.3);
    border-radius: 2px;
}
.chat-messages-list::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 47, 247, 0.6);
}

.chat-message-row {
    font-size: 7px;
    line-height: 1.4;
    padding: 3px 6px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
    border-left: 2.5px solid var(--neon-purple);
    word-break: break-word;
}

.chat-title-badge {
    font-family: var(--font-heading);
    font-size: 6px;
    font-weight: 800;
    color: var(--neon-blue);
    background: rgba(0, 245, 212, 0.08);
    border: 1.2px solid rgba(0, 245, 212, 0.3);
    padding: 1px 3.5px;
    border-radius: 3px;
    text-transform: uppercase;
    margin-right: 5px;
    display: inline-block;
    vertical-align: middle;
    letter-spacing: 0.2px;
}

.chat-message-author {
    font-weight: 800;
    display: inline-block;
    vertical-align: middle;
    margin-right: 2px;
}

.chat-message-text {
    color: var(--text-white);
    vertical-align: middle;
}

.chat-input-area {
    display: flex;
    gap: 5px;
    height: 28px;
}

#chat-input {
    flex: 1;
    background: rgba(5, 2, 16, 0.8) !important;
    border: 1px solid rgba(123, 47, 247, 0.3) !important;
    border-radius: 4px;
    color: white;
    padding: 0 10px;
    font-size: 8px;
    outline: none !important;
    line-height: 1;
    transition: all 0.25s ease;
}

#chat-input:focus {
    border-color: var(--neon-blue) !important;
    box-shadow: 0 0 8px rgba(0, 245, 212, 0.3) !important;
    background: rgba(0,0,0,0.5) !important;
}

.chat-send-submit {
    background: linear-gradient(135deg, var(--neon-blue), #3a0ca3) !important;
    border: none !important;
    border-radius: 4px;
    color: white;
    width: 28px;
    height: 28px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-submit:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
    box-shadow: 0 0 10px rgba(0, 245, 212, 0.4);
}


