:root {
    --bg-color: #0f172a;
    --card-bg: rgba(0, 0, 0, 0.4);
    /* More transparent black for better contrast */
    --primary: #3b82f6;
    --accent: #10b981;
    --danger: #ef4444;
    --text-primary: #ffffff;
    /* Pure white for readability */
    --text-secondary: #cbd5e1;
    /* Lighter secondary text */
    --gold: #fbbf24;
    --font-main: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    /* Prevent text selection on rapid clicks */
}

body {
    background: url('cartoon_restaurant_bg.png') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    font-family: var(--font-main);
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    height: 95vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    /* Very transparent main container */
    /* Increased opacity for readability against bg */
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    /* Reduced blur to see bg better */
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-box.highlight .value {
    color: var(--gold);
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.value {
    font-size: 1.5rem;
    font-weight: 800;
}

/* Main Board */
.game-board {
    display: flex;
    flex: 1;
    gap: 1rem;
    min-height: 0;
    /* Fix flex overflow */
}

/* Click Section */
.click-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--card-bg);
    border-radius: 12px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.click-area {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, #fcd34d, #f59e0b);
    /* Cheesy colors */
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.4), inset 0 2px 5px rgba(255, 255, 255, 0.3);
    transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
    border: 8px solid #b45309;
    /* Crust color border */
}

.click-area:active {
    transform: scale(0.95);
}

.coin-icon {
    font-size: 6rem;
    /* Larger pizza */
    margin-bottom: 0.5rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.click-instruction {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* Auto Clicker Button */
.auto-clicker-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    z-index: 50;
    min-width: 100px;
}

.auto-clicker-btn:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

.auto-clicker-btn:active {
    transform: translateY(0);
}

.auto-clicker-btn.hidden {
    display: none;
}

.auto-clicker-btn.active {
    background: linear-gradient(135deg, #059669, #047857);
    border-color: #34d399;
    cursor: default;
}

.auto-clicker-btn .icon {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.auto-clicker-btn .label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
}

.auto-clicker-btn .cost {
    font-size: 0.8rem;
    color: var(--gold);
    font-weight: 600;
}

.auto-clicker-btn .timer {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auto-clicker-btn.active .cost {
    display: none;
}

.auto-clicker-btn.active .timer {
    display: block;
}

.auto-clicker-btn .timer.hidden {
    display: none;
}

/* Floating Numbers Animation */
.floating-number {
    position: absolute;
    color: var(--gold);
    font-weight: 800;
    font-size: 1.5rem;
    pointer-events: none;
    animation: floatUp 1s ease-out forwards;
    z-index: 20;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translateY(-100px) scale(1.2);
        opacity: 0;
    }
}

/* Upgrade Section */
.upgrade-section {
    flex: 0.8;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.upgrade-section h2,
.market-section h2 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.upgrade-list {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-right: 0.5rem;
}

.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.upgrade-item:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.1);
}

.upgrade-item .info {
    display: flex;
    flex-direction: column;
}

.upgrade-item .name {
    font-weight: 700;
    font-size: 1rem;
}

.upgrade-item .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.cost-btn {
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    min-width: 80px;
    text-align: center;
    transition: background 0.2s;
}

.cost-btn:hover {
    filter: brightness(1.1);
}

#interior-upgrade-item {
    background: linear-gradient(45deg, rgba(88, 28, 135, 0.4), rgba(124, 58, 237, 0.4));
    border: 1px solid rgba(139, 92, 246, 0.5);
    margin-top: 10px;
}

#interior-upgrade-item .name {
    color: #c4b5fd;
}

#interior-upgrade-item:hover {
    background: linear-gradient(45deg, rgba(88, 28, 135, 0.6), rgba(124, 58, 237, 0.6));
}

/* Market Section */
.market-section {
    height: 35%;
    /* Fixed height for bottom panel */
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.market-timer {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

#market-timer {
    color: var(--accent);
    font-weight: bold;
    width: 20px;
    display: inline-block;
}

.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    overflow-y: auto;
}

.property-card {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.prop-name {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    justify-content: space-between;
}

.prop-owned {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.prop-price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-change {
    font-size: 0.8rem;
}

.price-up {
    color: var(--danger);
}

/* Red for price up (Korean stock market style usually Red/Pink for up, Blue for down, but western is Green Up, Red Down. Let's stick to Green Up for now or specific requests. Wait, usually in games Green is good/up. Let's use Green for cheap/good? No, Price Up means sell is good. Let's use simple colors.) */
/* Let's follow standard: Red = Down, Green = Up */
.trend-up {
    color: var(--accent);
}

.trend-down {
    color: var(--danger);
}

.prop-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.prop-btn {
    flex: 1;
    padding: 0.4rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.btn-buy {
    background: var(--accent);
    color: #fff;
}

.btn-sell {
    background: var(--danger);
    color: #fff;
}

.prop-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal Styling */
.modal-overlay {
    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: 100;
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.3s;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1e293b;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.modal-header h2 {
    color: var(--primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-primary);
}

.interior-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    overflow-y: auto;
    padding: 0.5rem;
}

.interior-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.interior-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.interior-card.active {
    border-color: var(--accent);
    background: rgba(16, 185, 129, 0.1);
}

.interior-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.interior-info {
    text-align: center;
    margin-bottom: 1rem;
}

.interior-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
    display: block;
}

.interior-cost {
    color: var(--gold);
    font-size: 0.9rem;
}

.btn-select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 6px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    background: var(--primary);
    color: white;
}

.btn-select.owned {
    background: #475569;
}

/* Start Screen */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(15, 23, 42, 0.85), rgba(30, 41, 59, 0.95)), url('bg_europe.png') no-repeat center center fixed;
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.start-screen.hidden {
    display: none;
}

.start-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 3rem;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(to right, #fcd34d, #f59e0b);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.icon-display {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.float-icon {
    animation: floatIcon 3s ease-in-out infinite;
    display: inline-block;
}

.float-icon:nth-child(2) {
    animation-delay: 0.5s;
}

.float-icon:nth-child(3) {
    animation-delay: 1s;
}

.float-icon:nth-child(4) {
    animation-delay: 1.5s;
}

.float-icon:nth-child(5) {
    animation-delay: 2s;
}

.float-icon:nth-child(6) {
    animation-delay: 2.5s;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.game-description {
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.game-description h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    color: var(--gold);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#nickname-input {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

#nickname-input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.3);
    transform: scale(1.02);
}

.start-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

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

.app-container.hidden {
    display: none;
}

/* Floating Control Buttons */
.floating-controls {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
    align-items: flex-end;
}

.float-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.float-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.4);
    border-color: #fff;
}

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

.float-btn.map-btn {
    /* Blue - Default */
    animation: pulseBtn 2s infinite;
}

.float-btn.map-btn:hover {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6);
}

.float-btn.skill-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    /* Violet */
}

.float-btn.skill-btn:hover {
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

.float-btn.social-btn {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    /* Rose */
}

.float-btn.social-btn:hover {
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.6);
}

@keyframes pulseBtn {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

/* Map Modal */
.map-modal-content {
    background: #1e293b;
    width: 90vw;
    height: 85vh;
    border-radius: 20px;
    border: 4px solid #fcd34d;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('cartoon_world_map_bg.png');
    /* Use generated image */
    background-size: cover;
    background-position: center;
}

.map-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: 2px solid white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s;
}

.map-close-btn:hover {
    background: #ef4444;
    transform: rotate(90deg);
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* City Nodes */
.city-node {
    position: absolute;
    transform: translate(-50%, -50%);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s;
    z-index: 10;
}

.city-node:hover {
    transform: translate(-50%, -50%) scale(1.2);
    z-index: 20;
}

.city-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.5));
    transition: all 0.3s;
}

.city-node.owned .city-icon {
    animation: bounce 1s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.city-label {
    background: rgba(0, 0, 0, 0.8);
    padding: 5px 10px;
    border-radius: 8px;
    text-align: center;
    margin-top: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.city-label .name {
    display: block;
    font-weight: bold;
    color: #fff;
    font-size: 0.9rem;
}

.city-label .cost {
    color: #fcd34d;
    font-size: 0.8rem;
}

.city-label .owned-tag {
    color: #10b981;
    font-weight: 800;
    font-size: 0.8rem;
}

/* Artifact Cards */
.artifact-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s;
}

.artifact-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.artifact-card.owned-card {
    border: 1px solid var(--gold);
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.art-icon {
    font-size: 2.5rem;
    background: rgba(0, 0, 0, 0.3);
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.art-info {
    flex: 1;
}

.art-name {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.art-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.3rem;
}

.art-cost {
    color: var(--gold);
    font-weight: 800;
}

.art-buy-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: white;
    font-weight: bold;
    cursor: pointer;
    min-width: 80px;
}

.art-buy-btn:hover {
    filter: brightness(1.1);
}

.art-buy-btn.disabled {
    background: #475569;
    cursor: not-allowed;
    opacity: 0.7;
}

.art-buy-btn.owned {
    background: transparent;
    border: 2px solid var(--gold);
    color: var(--gold);
}

/* Essential Mobile Optimization & UX Fixes */
canvas,
button,
.click-area,
.nav-item,
.float-btn,
.upgrade-item {
    touch-action: manipulation;
    /* Prevent double-tap zoom */
    user-select: none;
    /* Prevent text selection */
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    /* Remove blue tap box */
}

/* Base Mobile Overrides */
@media (max-width: 768px) {
    body {
        background-attachment: scroll;
        /* Mobile perf fix */
    }

    .app-container {
        height: 100dvh;
        min-height: 100vh;
        border-radius: 0;
        padding: 0.5rem;
        padding-bottom: 80px;
        /* Space for bottom nav */
        overflow-y: auto;
        display: block;
        /* Override flex for scrolling layout */
    }

    .game-header {
        padding: 0.8rem;
        margin-bottom: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .stat-box {
        flex: 1 1 45%;
        /* 2 columns */
    }

    .stat-box.highlight {
        order: -1;
        flex: 1 1 100%;
        /* Cash on top full width */
        margin-bottom: 0.5rem;
    }

    .game-board {
        flex-direction: column;
        display: block;
    }

    .click-section {
        min-height: 350px;
        margin-bottom: 1rem;
    }

    .click-area {
        width: 200px;
        height: 200px;
    }

    .coin-icon {
        font-size: 5rem;
    }

    .upgrade-section,
    .market-section {
        height: auto;
        max-height: none;
        margin-bottom: 1rem;
    }

    .floating-controls {
        display: none;
        /* Hide floating buttons, use bottom nav */
    }
}

/* Bottom Navigation */
.bottom-nav {
    display: none;
    /* Hidden on desktop */
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1000;
    justify-content: space-around;
    padding: 0.8rem 0.2rem;
    padding-bottom: max(0.8rem, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-item.home-btn {
    transform: translateY(-20px);
    background: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.5);
    color: white;
    border: 3px solid #0f172a;
}

.nav-item.home-btn .nav-icon {
    font-size: 1.5rem;
}

.nav-item .nav-icon {
    font-size: 1.2rem;
}

.nav-item.active,
.nav-item:active {
    color: var(--primary);
    transform: scale(1.1);
}

/* Settings Modal & Inputs */
.setting-input {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    margin: 10px 0;
}

.setting-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

.action-btn.outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.setting-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 15px;
    font-style: italic;
}

/* Skill Tree Styles */
.skill-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.point-display {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.highlight-text {
    color: var(--gold);
    font-weight: 800;
}

.buy-point-btn {
    display: block;
    margin: 0.5rem auto 0;
    padding: 0.5rem 1rem;
    background: var(--accent);
    border: none;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

.skill-tree {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
    margin-top: 1rem;
    overflow-y: auto;
}

@media (max-width: 600px) {
    .skill-tree {
        flex-direction: column;
    }
}

.skill-column {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.skill-icon {
    font-size: 3rem;
    margin: 1rem 0;
}

.skill-btn {
    width: 100%;
    padding: 0.8rem;
    background: var(--primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
}

.skill-btn:disabled {
    opacity: 0.5;
    background: #475569;
}

/* Rival List */
.rival-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 0.5rem;
}

.rival-item {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rival-rank {
    width: 30px;
    font-weight: bold;
    color: var(--gold);
}

.rival-name {
    flex: 1;
    text-align: left;
}

.rival-wealth {
    font-family: monospace;
}

.player-badge {
    background: var(--gold);
    color: #000;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 10px;
}