body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(255, 163, 149, 0.22), transparent 30%),
                linear-gradient(180deg, #16031f, #2c0039 45%, #2d094c 100%),
                url('https://images.unsplash.com/photo-1518837695005-2083093ee35b?w=1920') no-repeat center center fixed;
    background-size: cover;
    color: #efe6ff;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    overflow-x: hidden;
    touch-action: manipulation;
}

@media (max-width: 480px) {
    body {
        font-size: clamp(13px, 1.5vw, 14px);
    }
}

/* Touch-friendly form elements */
input[type="checkbox"],
input[type="text"],
button,
select {
    font-size: 16px;
}

@media (max-width: 480px) {
    input[type="checkbox"],
    input[type="text"],
    button,
    select {
        font-size: clamp(14px, 2vw, 16px);
        min-height: 44px;
    }
    
    input[type="checkbox"] {
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
    }
}

body.theme-night {
    background: radial-gradient(circle at top, rgba(90, 76, 175, 0.22), transparent 30%),
                linear-gradient(180deg, #0a0515, #141425 45%, #1a0f2e 100%),
                url('https://images.unsplash.com/photo-1500530855697-b586d89ba3ee?w=1920') no-repeat center center fixed;
    background-size: cover;
    color: #c2b8ff;
}

body.theme-night .glass-panel {
    background: rgba(10, 5, 20, 0.92);
    border-color: rgba(100, 80, 200, 0.15);
}

body.theme-night .header-content h1 {
    color: #7dd3fc;
    text-shadow: 0 0 24px rgba(125, 211, 252, 0.35);
}

body.theme-night .tagline,
body.theme-night #news-ticker {
    color: #b8a8ff;
}

body.theme-night .stat-row,
body.theme-night .upgrade-name,
body.theme-night .mini-game-frame h3 {
    color: #c2b8ff;
}

body.theme-night #combo-text {
    color: #7dd3fc;
}

body.theme-night .prestige-button {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
}

body.theme-sakura {
    background: radial-gradient(circle at top, rgba(255, 192, 203, 0.25), transparent 30%),
                linear-gradient(180deg, #3d1429, #8b2e5f 45%, #c94d7a 100%),
                url('https://images.unsplash.com/photo-1499084732479-de2c02d45fcc?w=1920') no-repeat center center fixed;
    background-size: cover;
    color: #ffd6e8;
}

body.theme-sakura .glass-panel {
    background: rgba(61, 20, 41, 0.92);
    border-color: rgba(255, 182, 193, 0.18);
}

body.theme-sakura .header-content h1 {
    color: #ff85c0;
    text-shadow: 0 0 24px rgba(255, 133, 192, 0.4);
}

body.theme-sakura .tagline,
body.theme-sakura #news-ticker,
body.theme-sakura .stat-row,
body.theme-sakura .upgrade-name {
    color: #ffd6e8;
}

body.theme-sakura #combo-text {
    color: #ff85c0;
}

body.theme-sakura .prestige-button {
    background: linear-gradient(135deg, #f472b6, #e879f9);
    color: #fff;
}

#game {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) 2fr minmax(280px, 1fr);
    gap: max(16px, 2vw);
    padding: clamp(16px, 4vw, 32px);
    min-height: 100vh;
    box-sizing: border-box;
    grid-auto-rows: max-content;
}

@media (max-width: 1200px) {
    #game {
        grid-template-columns: 1fr 1.5fr 1fr;
        gap: clamp(12px, 3vw, 24px);
    }
}

@media (max-width: 768px) {
    #game {
        display: flex;
        flex-direction: column;
        gap: clamp(12px, 3vw, 20px);
        padding: clamp(12px, 3vw, 24px);
    }
}

#left-pane,
#right-pane,
#center {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 2vw, 20px);
}

.mini-game-frame {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#mini-game-area {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: clamp(10px, 2vw, 16px);
    align-items: center;
    width: 100%;
}

@media (max-width: 768px) {
    #mini-game-area {
        grid-template-columns: 1fr 1fr;
        gap: clamp(8px, 2vw, 12px);
    }
}

@media (max-width: 480px) {
    #mini-game-area {
        grid-template-columns: 1fr;
        gap: clamp(8px, 2vw, 12px);
    }
}

#news-ticker {
    width: 100%;
    padding: clamp(10px, 1.5vw, 16px);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

.glass-panel {
    background: rgba(18, 8, 34, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(14px);
}

.panel-block {
    padding: 18px;
    margin-bottom: 18px;
}

@media (max-width: 768px) {
    .panel-block {
        padding: clamp(14px, 3vw, 16px);
        margin-bottom: clamp(12px, 2vw, 14px);
    }
}

@media (max-width: 480px) {
    .panel-block {
        padding: clamp(12px, 2vw, 14px);
        margin-bottom: clamp(10px, 1.5vw, 12px);
    }
}

#left-pane,
#right-pane,
#center {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#left-pane, #right-pane, #center {
    width: 100%;
}

header {
    width: 100%;
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: center;
}

.header-content h1 {
    margin: 0;
    font-size: 3.4rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #ffb3d8;
    text-shadow: 0 0 18px rgba(255, 168, 204, 0.35);
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: clamp(2rem, 6vw, 3rem);
    }
}

@media (max-width: 480px) {
    .header-content h1 {
        font-size: clamp(1.5rem, 5vw, 2.2rem);
    }
}

.tagline {
    margin: 0;
    color: #f7e6ff;
    font-size: 1rem;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .tagline {
        font-size: clamp(0.85rem, 2vw, 0.95rem);
    }
}

@media (max-width: 480px) {
    .tagline {
        font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    }
}

.settings-button,
.prestige-button,
.upgrade button,
#closeSettings {
    border: none;
    cursor: pointer;
    border-radius: 14px;
    font-weight: bold;
}

.settings-button {
    padding: 12px 18px;
    background: linear-gradient(135deg, #ff6fcf, #6d3cff);
    color: #fff;
    box-shadow: 0 16px 30px rgba(232, 132, 233, 0.2);
}

@media (max-width: 480px) {
    .settings-button {
        padding: clamp(10px, 2vw, 12px) clamp(14px, 3vw, 16px);
        font-size: clamp(0.9rem, 2vw, 1rem);
        min-width: 44px;
        min-height: 44px;
    }
}

.settings-button:hover {
    transform: translateY(-1px);
}

#settings-overlay {
    position: fixed;
    inset: 0;
    background: rgba(8, 2, 22, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: clamp(12px, 2vw, 20px);
    box-sizing: border-box;
}

#settings-overlay.hidden {
    display: none;
}

.settings-panel {
    width: min(420px, calc(100% - 40px));
    padding: 22px;
    position: relative;
}

@media (max-width: 480px) {
    .settings-panel {
        width: min(380px, calc(100% - 20px));
        padding: clamp(16px, 4vw, 20px);
        border-radius: clamp(16px, 5vw, 24px);
    }
}

@media (max-width: 350px) {
    .settings-panel {
        width: calc(100% - 16px);
        padding: clamp(14px, 3vw, 16px);
    }
}

.settings-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.settings-head h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #ffcee7;
}

@media (max-width: 480px) {
    .settings-head h3 {
        font-size: clamp(1.2rem, 4vw, 1.4rem);
    }
}

#closeSettings {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    color: #fff;
}

@media (max-width: 480px) {
    #closeSettings {
        width: 36px;
        height: 36px;
        font-size: clamp(1rem, 2vw, 1.1rem);
    }
}

.setting-row {
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 1rem;
    color: #f0e6ff;
}

.setting-row select,
.setting-row input[type="checkbox"] {
    margin-left: 12px;
}

#notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    width: min(320px, calc(100vw - 48px));
    z-index: 60;
}

@media (max-width: 480px) {
    #notification-container {
        top: 12px;
        right: 12px;
        left: 12px;
        width: calc(100vw - 24px);
    }
}

.notification {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-left: 5px solid #ffb6c1;
    padding: 10px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
    color: #fff;
    font-size: 13px;
    box-shadow: 0 8px 16px rgba(10, 4, 28, 0.15);
    animation: slide-in 0.3s ease;
    max-width: 280px;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
}

.notification.success {
    border-left-color: #6df5a0;
}

@keyframes slide-in {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

#achievement-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 12px;
}

@media (max-width: 768px) {
    #achievement-list {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 480px) {
    #achievement-list {
        grid-template-columns: repeat(auto-fit, minmax(75px, 1fr));
        gap: 8px;
    }
}

.achievement {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    opacity: 0.4;
    transition: opacity 0.3s, transform 0.3s;
}

.achievement.unlocked {
    opacity: 1;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(255, 204, 229, 0.16);
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-name {
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffe4ff;
}

#main {
    position: relative;
    min-height: 390px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#particle-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 15;
}

.particle {
    position: absolute;
    pointer-events: none;
    font-size: 1.8rem;
    font-weight: bold;
    z-index: 15;
}

@keyframes particle-rise {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-220px) translateX(var(--drift, 0)) scale(0.4);
    }
}

.particle.rise {
    animation: particle-rise 2.4s ease-out forwards;
}

.mini-game-frame {
    background: linear-gradient(135deg, rgba(255, 122, 214, 0.15), rgba(108, 92, 231, 0.15));
    border: 2px solid rgba(255, 168, 204, 0.3);
    border-radius: 20px;
    padding: 18px;
    margin-top: 12px;
}

.mini-game-frame h3 {
    margin-top: 0;
    color: #ffe6ff;
    text-align: center;
}

#mini-game-area {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 14px;
    align-items: center;
}

#combo-display {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

@media (max-width: 768px) {
    #combo-display {
        padding: clamp(12px, 2vw, 14px);
        border-radius: clamp(12px, 2vw, 16px);
    }
}

@media (max-width: 480px) {
    #combo-display {
        padding: clamp(10px, 1.5vw, 12px);
        border-radius: clamp(10px, 2vw, 14px);
    }
}

#combo-text {
    margin: 0;
    font-size: 1.6rem;
    color: #ffb3d8;
    font-weight: 700;
}

@media (max-width: 768px) {
    #combo-text {
        font-size: clamp(1.3rem, 3vw, 1.5rem);
    }
}

@media (max-width: 480px) {
    #combo-text {
        font-size: clamp(1.1rem, 2.5vw, 1.3rem);
    }
}

.combo-timer {
    margin: 6px 0 0;
    font-size: 0.9rem;
    color: #d7c2ff;
}

@media (max-width: 768px) {
    .combo-timer {
        font-size: clamp(0.75rem, 1.5vw, 0.85rem);
        margin: 4px 0 0;
    }
}

@media (max-width: 480px) {
    .combo-timer {
        font-size: clamp(0.65rem, 1.2vw, 0.75rem);
        margin: 3px 0 0;
    }
}

#tap-zone {
    background: linear-gradient(135deg, rgba(255, 122, 214, 0.25), rgba(255, 168, 204, 0.18));
    border: 2px dashed rgba(255, 168, 204, 0.4);
    border-radius: 18px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    font-size: 1.1rem;
    color: #ffe6ff;
    font-weight: 700;
    user-select: none;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    #tap-zone {
        padding: clamp(16px, 3vw, 20px);
        font-size: clamp(0.95rem, 2vw, 1.05rem);
        border-radius: clamp(14px, 3vw, 18px);
    }
}

@media (max-width: 480px) {
    #tap-zone {
        padding: clamp(12px, 2vw, 16px);
        font-size: clamp(0.85rem, 1.5vw, 0.95rem);
        border-radius: clamp(12px, 2vw, 16px);
        min-height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

#tap-zone:hover {
    background: linear-gradient(135deg, rgba(255, 122, 214, 0.35), rgba(255, 168, 204, 0.28));
    transform: scale(1.02);
}

#tap-zone.active {
    background: linear-gradient(135deg, #ff7ad6, #ffa8cc);
    color: #21142d;
    border-color: #ffb3d8;
}

#clickButton {
    position: relative;
    z-index: 5;
    width: clamp(220px, 28vw, 340px);
    height: auto;
    max-height: 420px;
    cursor: pointer;
    border-radius: 32px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 20px 50px rgba(255, 109, 186, 0.18);
    border: 5px solid rgba(255, 122, 214, 0.65);
}

@media (max-width: 768px) {
    #clickButton {
        width: clamp(160px, 35vw, 280px);
        height: auto;
        max-height: 300px;
        border: 4px solid rgba(255, 122, 214, 0.65);
    }
}

@media (max-width: 480px) {
    #clickButton {
        width: clamp(120px, 30vw, 200px);
        height: auto;
        max-height: 250px;
        border: 3px solid rgba(255, 122, 214, 0.65);
        box-shadow: 0 12px 30px rgba(255, 109, 186, 0.18);
    }
}

#clickButton:hover {
    transform: scale(1.04);
}

#clickButton.squish {
    animation: squish 0.28s ease;
}

#golden-napa {
    position: absolute;
    top: 20%;
    left: 70%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    animation: golden-shine 1.8s infinite;
    z-index: 20;
}

#golden-image {
    width: 90px;
    max-width: 90px;
    border-radius: 18px;
}

#news-ticker {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    color: #fff;
    font-size: 1rem;
    text-align: center;
}

@media (max-width: 768px) {
    #news-ticker {
        padding: clamp(10px, 2vw, 12px) clamp(12px, 3vw, 14px);
        font-size: clamp(0.85rem, 1.5vw, 0.95rem);
        border-radius: clamp(14px, 3vw, 18px);
    }
}

@media (max-width: 480px) {
    #news-ticker {
        padding: clamp(8px, 1.5vw, 10px) clamp(10px, 2.5vw, 12px);
        font-size: clamp(0.75rem, 1.2vw, 0.85rem);
        border-radius: clamp(12px, 2vw, 16px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

#upgrade-list {
    display: grid;
    gap: 12px;
}

.upgrade {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    gap: 12px;
    align-items: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 18px;
    transition: transform 0.2s ease, background 0.2s ease;
}

@media (max-width: 768px) {
    .upgrade {
        grid-template-columns: 56px 1fr auto;
        gap: 10px;
        padding: 12px;
    }
}

@media (max-width: 480px) {
    .upgrade {
        grid-template-columns: 48px 1fr;
        gap: 8px;
        padding: 10px;
    }
    
    .upgrade button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

.upgrade:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
}

.upgrade-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 18px;
}

@media (max-width: 768px) {
    .upgrade-icon {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .upgrade-icon {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
    }
}

.upgrade-info {
    display: grid;
    gap: 4px;
}

.upgrade-name {
    margin: 0;
    font-size: 1rem;
    color: #ffe6ff;
}

.upgrade-desc,
.upgrade-cost,
.upgrade-owned {
    margin: 0;
    color: #d7c2ff;
    font-size: 0.88rem;
}

.upgrade button {
    padding: 10px 16px;
    min-width: 90px;
    background: linear-gradient(135deg, #ff8fb3, #bd53f2);
    color: #fff;
    box-shadow: 0 10px 20px rgba(191, 89, 236, 0.18);
}

@media (max-width: 480px) {
    .upgrade button {
        padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 16px);
        min-width: 70px;
        font-size: clamp(0.85rem, 2vw, 0.95rem);
    }
}

.upgrade button:disabled {
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.7);
}

#prestige-section .stat-row,
#stats .stat-row,
#detail-stats .stat-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    color: #f5e9ff;
}

@media (max-width: 768px) {
    #prestige-section .stat-row,
    #stats .stat-row,
    #detail-stats .stat-row {
        gap: 8px;
        margin-top: 10px;
        font-size: clamp(0.85rem, 2vw, 0.95rem);
    }
}

@media (max-width: 480px) {
    #prestige-section .stat-row,
    #stats .stat-row,
    #detail-stats .stat-row {
        gap: 6px;
        margin-top: 8px;
        font-size: clamp(0.75rem, 1.5vw, 0.85rem);
    }
}

.progress-bar {
    width: 100%;
    height: 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
    margin-top: 10px;
}

@media (max-width: 480px) {
    .progress-bar {
        height: 12px;
        margin-top: 8px;
    }
}

#xpProgressBar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #ff82d6, #b652ff);
}

.prestige-button {
    padding: 12px 20px;
    width: 100%;
    background: linear-gradient(135deg, #faca57, #ff75b2);
    color: #21142d;
    box-shadow: 0 15px 30px rgba(255, 150, 190, 0.2);
}

@media (max-width: 480px) {
    .prestige-button {
        padding: clamp(10px, 2vw, 12px) clamp(16px, 3vw, 20px);
        font-size: clamp(0.9rem, 2vw, 1rem);
    }
}

.prestige-button:disabled {
    background: rgba(255, 255, 255, 0.16);
    color: rgba(255, 255, 255, 0.75);
    cursor: not-allowed;
}

.tooltip {
    position: fixed;
    background: rgba(10, 5, 20, 0.95);
    color: #ffe6ff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 168, 204, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 99;
    max-width: 280px;
    word-wrap: break-word;
    animation: tooltip-fade 0.2s ease;
}

@keyframes tooltip-fade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

[data-tooltip] {
    position: relative;
    cursor: help;
}

/* Tablet - 768px and below */

@media (max-width: 480px) {
    body {
        font-size: clamp(13px, 1.5vw, 14px);
    }
}

@media (max-width: 350px) {
    body {
        font-size: clamp(12px, 1.3vw, 13px);
    }
}

.tooltip {
    position: fixed;
    background: rgba(10, 5, 20, 0.95);
    color: #ffe6ff;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 168, 204, 0.25);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    z-index: 99;
    max-width: 280px;
    word-wrap: break-word;
    animation: tooltip-fade 0.2s ease;
}

@keyframes tooltip-fade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

[data-tooltip] {
    position: relative;
    cursor: help;
}

@keyframes prestige-flash {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.006); filter: brightness(1.12); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* ===== REDEEM CODE & PLANET MODALS ===== */

.header-buttons {
    display: flex;
    gap: clamp(8px, 1vw, 12px);
    margin-top: 10px;
}

.secret-button {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.5), rgba(138, 43, 226, 0.5));
    color: #fff;
    border: 1px solid rgba(255, 105, 180, 0.3);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    font-size: clamp(0.8rem, 1vw, 1rem);
}

@media (max-width: 480px) {
    .secret-button {
        padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 14px);
        min-height: 40px;
        font-size: clamp(0.75rem, 1.5vw, 0.9rem);
    }
}

.secret-button:hover {
    background: linear-gradient(135deg, rgba(255, 105, 180, 0.8), rgba(138, 43, 226, 0.8));
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 105, 180, 0.3);
}

/* Redeem Modal */
#redeem-modal,
#planet-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

#redeem-modal.hidden,
#planet-modal.hidden {
    display: none;
}

.redeem-panel,
.planet-panel {
    background: rgba(25, 10, 35, 0.98);
    border: 2px solid rgba(255, 105, 180, 0.4);
    border-radius: 16px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

@media (max-width: 480px) {
    .redeem-panel,
    .planet-panel {
        padding: clamp(16px, 4vw, 20px);
        max-width: 360px;
        width: 95%;
        border-radius: clamp(12px, 3vw, 16px);
    }
}

@media (max-width: 350px) {
    .redeem-panel,
    .planet-panel {
        padding: clamp(14px, 3vw, 16px);
        max-width: none;
        width: calc(100% - 16px);
    }
}

.planet-panel {
    max-width: 700px;
    max-height: 80vh;
    overflow-y: auto;
}

@media (max-width: 480px) {
    .planet-panel {
        max-width: 360px;
        max-height: 85vh;
        padding: clamp(16px, 4vw, 20px);
    }
}

.planet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 105, 180, 0.3);
    padding-bottom: 16px;
}

.planet-head h3 {
    margin: 0;
    color: #ffb8e6;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#closePlanet {
    background: none;
    border: none;
    color: #ffb8e6;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closePlanet:hover {
    transform: scale(1.2);
}

/* Special styling for NAPA PLANET */
.napa-planet-node {
    animation: napa-glow 1.5s ease-in-out infinite;
    border: 3px solid #00ff00 !important;
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.3), rgba(200, 200, 0, 0.2)) !important;
}

@keyframes napa-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 0, 0.4), 0 0 40px rgba(0, 255, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 0, 0.6), 0 0 60px rgba(0, 255, 0, 0.3);
    }
}

.napa-planet-achieved {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.2), rgba(255, 215, 0, 0.2)) !important;
    border-color: #00ff00 !important;
}

@media (max-width: 480px) {
    .planet-head h3 {
        font-size: clamp(1rem, 2.5vw, 1.2rem);
    }
}

/* Redeem Modal Head */
.redeem-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 105, 180, 0.2);
    padding-bottom: 12px;
}

.redeem-head h3 {
    margin: 0;
    color: #ffb8e6;
    font-size: 1.3rem;
}

#closeRedeem {
    background: none;
    border: none;
    color: #ffb8e6;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#closeRedeem:hover {
    transform: scale(1.2);
}

#redeem-input {
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(255, 105, 180, 0.3);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    color: #ffe6ff;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 12px;
    font-family: 'Comic Sans MS', cursive;
}

@media (max-width: 480px) {
    #redeem-input {
        padding: clamp(10px, 2vw, 12px);
        font-size: clamp(0.95rem, 2vw, 1rem);
        margin-bottom: clamp(10px, 2vw, 12px);
        border-radius: clamp(6px, 2vw, 8px);
    }
}

#redeem-input:focus {
    outline: none;
    border-color: rgba(255, 105, 180, 0.8);
    box-shadow: 0 0 12px rgba(255, 105, 180, 0.3);
}

#redeem-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff69b4, #da70d6);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

@media (max-width: 480px) {
    #redeem-submit {
        padding: clamp(10px, 2vw, 12px);
        font-size: clamp(0.95rem, 2vw, 1rem);
        min-height: 44px;
        border-radius: clamp(6px, 2vw, 8px);
    }
}

#redeem-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(255, 105, 180, 0.4);
}

#redeem-message {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

#redeem-message.success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

#redeem-message.error {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Planet Tree Diagram */
#planet-map {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 0;
    max-height: 600px;
    overflow-y: auto;
    align-items: center;
}

.planet-tree-level {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 15px;
    position: relative;
    width: 100%;
}

.planet-node {
    padding: 12px 16px;
    background: rgba(100, 50, 150, 0.4);
    border: 2px solid rgba(200, 100, 255, 0.4);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 100px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.planet-node:hover {
    transform: scale(1.08);
    border-color: rgba(200, 100, 255, 0.8);
    background: rgba(100, 50, 150, 0.6);
    box-shadow: 0 6px 16px rgba(100, 200, 255, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.planet-node.current {
    border-color: rgba(255, 215, 0, 0.8);
    background: rgba(255, 215, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.planet-node.unlocked {
    border-color: rgba(255, 105, 180, 0.6);
    background: rgba(200, 80, 180, 0.4);
}

.planet-node.locked {
    opacity: 0.5;
}

.planet-node.locked:hover {
    opacity: 0.65;
}

.planet-emoji {
    font-size: 2rem;
    margin-bottom: 4px;
    display: block;
}

.planet-name {
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.planet-number {
    font-size: 0.8rem;
    color: #aaaaaa;
    font-weight: bold;
}

.planet-node.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.planet-emoji {
    font-size: 2rem;
    margin-bottom: 6px;
}

.planet-name {
    font-size: 0.85rem;
    color: #ffb8e6;
    font-weight: bold;
    word-wrap: break-word;
}

.planet-number {
    font-size: 0.7rem;
    color: #d7c2ff;
    margin-top: 4px;
}

@media (max-width: 480px) {
    #planet-map {
        gap: 15px;
        padding: 15px 0;
    }
    
    .planet-tree-level {
        gap: 12px;
        padding: 10px;
    }
    
    .planet-node {
        padding: clamp(8px, 2vw, 10px);
        border-radius: clamp(8px, 2vw, 12px);
        min-width: 75px;
        font-size: clamp(0.7rem, 1.2vw, 0.8rem);
    }
    
    .planet-emoji {
        font-size: clamp(1.2rem, 3vw, 1.5rem);
        margin-bottom: 4px;
    }
    
    .planet-name {
        font-size: clamp(0.65rem, 1vw, 0.75rem);
    }
    
    .planet-number {
        font-size: clamp(0.55rem, 0.8vw, 0.65rem);
        margin-top: 2px;
    }
}

.planet-node {
    padding: 12px;
    background: rgba(100, 50, 150, 0.3);
    border: 2px solid rgba(200, 100, 255, 0.3);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

@media (max-width: 480px) {
    .planet-node {
        padding: clamp(8px, 2vw, 10px);
        border-radius: clamp(8px, 2vw, 12px);
        min-height: 60px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

.planet-node:hover {
    border-color: rgba(200, 100, 255, 0.8);
    background: rgba(100, 50, 150, 0.6);
    transform: scale(1.05);
}

.planet-node.unlocked {
    border-color: rgba(255, 105, 180, 0.6);
    background: rgba(200, 80, 180, 0.4);
}

.planet-node.current {
    border-color: rgba(255, 215, 0, 0.8);
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

.planet-node.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.planet-emoji {
    font-size: 2.5rem;
    margin-bottom: 6px;
}

.planet-name {
    font-size: 0.85rem;
    color: #ffb8e6;
    font-weight: bold;
}

.planet-node.locked .planet-name {
    color: #999;
}

#planet-info {
    background: rgba(0, 0, 0, 0.4);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid rgba(200, 100, 255, 0.3);
    margin-top: 20px;
}

#planet-name {
    color: #ffb8e6;
    margin: 0 0 12px 0;
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#planet-desc {
    color: #e0c3ff;
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

#planet-stats {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 10px;
    margin: 16px 0;
    font-size: 0.95rem;
}

#inhabit-button {
    width: 100%;
    padding: clamp(10px, 2vw, 14px);
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    min-height: 50px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 480px) {
    #inhabit-button {
        min-height: 44px;
        padding: clamp(8px, 1.5vw, 10px);
        font-size: clamp(0.85rem, 1.8vw, 0.95rem);
    }
}

@media (max-width: 480px) {
    #inhabit-button {
        padding: clamp(10px, 2vw, 12px);
        font-size: clamp(0.95rem, 2vw, 1rem);
        min-height: 44px;
        border-radius: clamp(6px, 2vw, 8px);
        margin-top: clamp(10px, 2vw, 12px);
    }
}

#inhabit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(79, 70, 229, 0.4);
}

#inhabit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Easter Egg Styles */
.easter-egg-triggered {
    animation: easter-egg-pulse 0.6s ease;
}

@keyframes easter-egg-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.secret-revealed {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 105, 180, 0.3));
    border-color: rgba(255, 215, 0, 0.6);
    animation: secret-glow 0.8s ease infinite;
}

@keyframes secret-glow {
    0%, 100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
}

.rainbow-text {
    background: linear-gradient(90deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-shift 2s linear infinite;
}

@keyframes rainbow-shift {
    0% { filter: hue-rotate(0deg); }
    100% { filter: hue-rotate(360deg); }
}

/* ===== PLANET TOOLTIPS & ADVANCED STATISTICS ===== */

#planet-tooltip {
    position: fixed;
    background: linear-gradient(135deg, rgba(30, 30, 60, 0.95), rgba(50, 30, 80, 0.95));
    border: 2px solid rgba(100, 200, 255, 0.6);
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 280px;
    font-size: 0.9rem;
    z-index: 10000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    pointer-events: none;
    backdrop-filter: blur(10px);
    animation: tooltip-fade-in 0.2s ease;
}

#planet-tooltip.hidden {
    display: none;
}

@keyframes tooltip-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip-title {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #ffff00;
}

.tooltip-stat {
    margin: 6px 0;
    font-size: 0.85rem;
    color: #c2b8ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tooltip-divider {
    height: 1px;
    background: rgba(100, 200, 255, 0.3);
    margin: 8px 0;
}

/* Planet Statistics Modal */
#planet-stats-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: modal-fade-in 0.3s ease;
}

#planet-stats-modal.hidden {
    display: none;
}

@keyframes modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.planet-stats-panel {
    max-width: 900px;
    max-height: 85vh;
    width: 95%;
    background: linear-gradient(135deg, rgba(20, 10, 40, 0.98), rgba(40, 20, 60, 0.98));
    border: 2px solid rgba(100, 200, 255, 0.5);
    border-radius: 16px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.stats-head {
    background: linear-gradient(135deg, rgba(60, 30, 100, 0.6), rgba(30, 60, 100, 0.6));
    border-bottom: 2px solid rgba(100, 200, 255, 0.4);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.stats-head h3 {
    margin: 0;
    color: #ffff00;
    font-size: 1.3rem;
}

#closeStats {
    background: rgba(255, 50, 50, 0.3);
    border: 1px solid rgba(255, 50, 50, 0.6);
    color: #ff6666;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.2rem;
    transition: all 0.2s;
}

#closeStats:hover {
    background: rgba(255, 50, 50, 0.6);
    box-shadow: 0 0 15px rgba(255, 50, 50, 0.4);
}

.stats-container {
    overflow-y: auto;
    flex: 1;
    padding: 20px;
}

.stats-section {
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(50, 30, 80, 0.4);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 10px;
}

.stats-section h4 {
    margin: 0 0 12px 0;
    color: #ffff00;
    font-size: 1.1rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.stat-item {
    background: rgba(30, 30, 60, 0.5);
    border: 1px solid rgba(100, 200, 255, 0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.stat-label {
    font-size: 0.85rem;
    color: #aaaaaa;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00ff88;
}

.stat-value.unlocked {
    color: #00ff88;
}

.stat-value.locked {
    color: #ff6666;
}

.stat-description {
    margin-top: 12px;
    padding: 10px;
    background: rgba(60, 40, 100, 0.3);
    border-left: 3px solid rgba(100, 200, 255, 0.5);
    border-radius: 4px;
    font-size: 0.9rem;
    color: #c2b8ff;
    font-style: italic;
}

.stat-hierarchy {
    margin-top: 12px;
    padding: 10px;
    background: rgba(100, 60, 30, 0.3);
    border-left: 3px solid rgba(255, 150, 100, 0.5);
    border-radius: 4px;
    font-size: 0.9rem;
    color: #ffccaa;
}

/* Upgrades Styling */
.upgrade-item {
    background: rgba(40, 40, 70, 0.5);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    transition: all 0.2s;
}

.upgrade-item:hover:not(.purchased) {
    background: rgba(60, 50, 100, 0.6);
    border-color: rgba(100, 200, 255, 0.6);
    transform: translateX(4px);
}

.upgrade-item.purchased {
    background: rgba(40, 80, 40, 0.4);
    border-color: rgba(100, 255, 100, 0.4);
}

.upgrade-item.expensive {
    opacity: 0.6;
}

.upgrade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.upgrade-name {
    font-weight: bold;
    font-size: 1rem;
    color: #ffff99;
}

.upgrade-tier {
    background: rgba(100, 100, 255, 0.3);
    border: 1px solid rgba(100, 150, 255, 0.6);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #99ff99;
}

.upgrade-desc {
    font-size: 0.9rem;
    color: #b0b0ff;
    margin-bottom: 8px;
}

.upgrade-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.upgrade-cost {
    font-weight: bold;
}

.upgrade-bonus {
    font-weight: bold;
}

.upgrade-button {
    width: 100%;
    padding: 8px;
    background: rgba(100, 200, 255, 0.4);
    border: 1px solid rgba(100, 200, 255, 0.6);
    color: #00ffff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.upgrade-button.buyable:hover {
    background: rgba(100, 200, 255, 0.7);
    box-shadow: 0 0 15px rgba(100, 200, 255, 0.5);
    transform: scale(1.02);
}

.upgrade-button.expensive {
    background: rgba(255, 100, 100, 0.3);
    border-color: rgba(255, 100, 100, 0.5);
    color: #ff9999;
    cursor: not-allowed;
}

/* Achievements Styling */
.achievement-item {
    background: rgba(40, 40, 70, 0.5);
    border: 1px solid rgba(100, 200, 255, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.achievement-item.earned {
    background: rgba(200, 180, 50, 0.2);
    border-color: rgba(255, 215, 0, 0.5);
}

.achievement-item.locked {
    background: rgba(50, 50, 50, 0.3);
    border-color: rgba(80, 80, 80, 0.4);
    opacity: 0.7;
}

.achievement-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.achievement-name {
    font-weight: bold;
    color: #ffff99;
    margin-bottom: 4px;
}

.achievement-desc {
    font-size: 0.9rem;
    color: #b0b0ff;
}

.achievement-status {
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.achievement-item.earned .achievement-status {
    background: rgba(255, 215, 0, 0.3);
    color: #ffff00;
}

.achievement-item.locked .achievement-status {
    background: rgba(100, 100, 100, 0.3);
    color: #aaaaaa;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .planet-stats-panel {
        max-width: 100%;
        width: 98%;
        max-height: 90vh;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .stats-section {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .upgrade-button,
    #closeStats {
        min-height: 44px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .planet-stats-panel {
        width: 100%;
        max-height: 95vh;
        border-radius: 8px 8px 0 0;
    }
    
    #planet-tooltip {
        max-width: 200px;
        font-size: 0.8rem;
        padding: 10px 12px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-head {
        padding: 12px 16px;
    }
    
    .stats-head h3 {
        font-size: 1.1rem;
    }
}
