/* Reset and Global Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* CSS Variables for Theming */
:root {
    --bg-primary: #e0f7fa;
    --bg-secondary: rgba(255, 255, 255, 0.5);
    --bg-panel: #81c784;
    --text-primary: #1b5e20;
    --text-secondary: #2e7d32;
    --button-bg: #4caf50;
    --button-hover: #45a049;
    --border-color: #4caf50;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-bg: white;
}

/* Dark Theme */
body.dark-theme {
    --bg-primary: #1a1a1a;
    --bg-secondary: rgba(40, 40, 40, 0.8);
    --bg-panel: #2d5a3d;
    --text-primary: #a5d6a7;
    --text-secondary: #66bb6a;
    --button-bg: #388e3c;
    --button-hover: #2e7d32;
    --border-color: #66bb6a;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --modal-bg: #2a2a2a;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #000000;
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.game-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0;
    background-color: #000000;
    position: relative;
    transition: background-color 0.3s ease;
}

h1 {
    color: var(--text-secondary);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px var(--shadow-color);
    transition: color 0.3s ease;
}

/* ========== GOLDEN HOUR LANDING PAGE ========== */
/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,700;1,500&family=Satisfy&family=Nunito:wght@600;800&display=swap');

/* Hide landing page when logged in */
.logged-in .landing-page {
    display: none !important;
}

/* ===== LANDING PAGE CONTAINER ===== */
.landing-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    overflow: hidden;
}

/* ===== SKY BACKDROP ===== */
.sky-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        #1a0a2e 0%,
        #2d1b4e 8%,
        #4a2c6a 16%,
        #7b4b8a 24%,
        #b86b7a 32%,
        #e8956b 42%,
        #f4b860 52%,
        #f9d576 62%,
        #fce588 72%,
        #fff0a0 82%,
        #fffacc 100%
    );
    animation: skyShift 30s ease-in-out infinite alternate;
}

@keyframes skyShift {
    0% { filter: brightness(1) saturate(1); }
    50% { filter: brightness(1.05) saturate(1.1); }
    100% { filter: brightness(0.95) saturate(0.95); }
}

/* Sun glow */
.sun-glow {
    position: absolute;
    bottom: 18%;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(
        circle,
        rgba(255, 255, 200, 0.9) 0%,
        rgba(255, 220, 100, 0.6) 25%,
        rgba(255, 180, 60, 0.3) 50%,
        rgba(255, 140, 40, 0.1) 75%,
        transparent 100%
    );
    border-radius: 50%;
    animation: sunPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes sunPulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.9; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}

/* Clouds */
.cloud {
    position: absolute;
    background: linear-gradient(
        180deg,
        rgba(255, 220, 180, 0.7) 0%,
        rgba(255, 200, 150, 0.4) 100%
    );
    border-radius: 50px;
    filter: blur(8px);
    animation: cloudDrift 60s linear infinite;
}

.cloud-1 {
    top: 8%;
    left: -200px;
    width: 180px;
    height: 50px;
    animation-duration: 80s;
}

.cloud-2 {
    top: 15%;
    left: -150px;
    width: 120px;
    height: 35px;
    animation-duration: 100s;
    animation-delay: -20s;
}

.cloud-3 {
    top: 5%;
    left: -180px;
    width: 200px;
    height: 45px;
    animation-duration: 90s;
    animation-delay: -40s;
}

@keyframes cloudDrift {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(100vw + 400px)); }
}

/* ===== PARTICLES ===== */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: particleFloat 15s ease-in-out infinite;
}

.leaf-1, .leaf-2, .leaf-3 {
    width: 8px;
    height: 12px;
    background: linear-gradient(135deg, #8B5A2B 0%, #6b4423 100%);
    border-radius: 0 50% 50% 50%;
    transform: rotate(45deg);
}

.leaf-1 { left: 10%; top: -20px; animation-duration: 18s; animation-delay: 0s; }
.leaf-2 { left: 70%; top: -20px; animation-duration: 22s; animation-delay: -5s; }
.leaf-3 { left: 40%; top: -20px; animation-duration: 16s; animation-delay: -10s; }

.sparkle-1, .sparkle-2 {
    width: 4px;
    height: 4px;
    background: rgba(255, 255, 200, 0.9);
    box-shadow: 0 0 10px rgba(255, 255, 150, 0.8);
}

.sparkle-1 { left: 25%; top: 20%; animation: sparkleFloat 12s ease-in-out infinite; }
.sparkle-2 { left: 75%; top: 30%; animation: sparkleFloat 15s ease-in-out infinite; animation-delay: -6s; }

.hay-1, .hay-2 {
    width: 3px;
    height: 20px;
    background: linear-gradient(180deg, #d4a853 0%, #b8923e 100%);
    border-radius: 2px;
}

.hay-1 { left: 85%; top: -30px; animation-duration: 20s; animation-delay: -3s; }
.hay-2 { left: 15%; top: -30px; animation-duration: 25s; animation-delay: -12s; }

@keyframes particleFloat {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.6; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

@keyframes sparkleFloat {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.5); opacity: 1; }
}

/* ===== LANDSCAPE SILHOUETTES ===== */
.landscape {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35%;
    pointer-events: none;
}

.hill {
    position: absolute;
    bottom: 0;
    width: 100%;
    border-radius: 100% 100% 0 0;
}

.hill-back {
    height: 70%;
    background: linear-gradient(180deg, #2a1a0a 0%, #1a0f05 100%);
    transform: scaleX(1.5);
    opacity: 0.4;
}

.hill-mid {
    height: 50%;
    background: linear-gradient(180deg, #3d2814 0%, #251508 100%);
    left: -10%;
    width: 120%;
    opacity: 0.6;
}

.hill-front {
    height: 25%;
    background: linear-gradient(180deg, #1a0f05 0%, #0d0803 100%);
    opacity: 0.9;
}

/* Barn silhouette */
.barn-silhouette {
    position: absolute;
    bottom: 20%;
    left: 15%;
    width: 80px;
    height: 60px;
    background: #1a0f05;
    clip-path: polygon(
        0% 100%,
        0% 40%,
        50% 0%,
        100% 40%,
        100% 100%
    );
    opacity: 0.7;
}

.barn-silhouette::after {
    content: '';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 20px;
    background: #1a0f05;
}

/* Trees */
.tree {
    position: absolute;
    bottom: 15%;
    width: 40px;
    height: 80px;
    background: #1a0f05;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    opacity: 0.6;
}

.tree::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 20px;
    background: #1a0f05;
}

.tree-1 { left: 75%; height: 70px; opacity: 0.5; }
.tree-2 { left: 82%; height: 90px; opacity: 0.65; }
.tree-3 { left: 5%; height: 60px; opacity: 0.45; }

/* Fence line */
.fence-line {
    position: absolute;
    bottom: 12%;
    left: 0;
    width: 100%;
    height: 20px;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 30px,
        #1a0f05 30px,
        #1a0f05 34px
    );
    opacity: 0.4;
}

.fence-line::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #1a0f05;
    opacity: 0.6;
}

/* Grass detail */
.grass-detail {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8%;
    background: linear-gradient(180deg, transparent 0%, #0d0803 100%);
}

/* ===== MAIN CONTENT ===== */
.landing-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
    animation: contentFadeIn 1.2s ease-out;
}

@keyframes contentFadeIn {
    0% { opacity: 0; transform: translate(-50%, -45%); }
    100% { opacity: 1; transform: translate(-50%, -50%); }
}

/* Flourishes */
.flourish-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    animation: flourishIn 1s ease-out 0.3s both;
}

@keyframes flourishIn {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.flourish-wing {
    font-size: 1.8rem;
    color: rgba(74, 45, 26, 0.8);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.flourish-wing.left { transform: scaleX(-1); }

.flourish-star {
    font-size: 1.2rem;
    color: #f4b860;
    text-shadow: 0 0 15px rgba(255, 200, 100, 0.8);
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
}

.flourish-bottom {
    margin-top: 20px;
    animation: flourishIn 1s ease-out 0.5s both;
}

.sun-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 15px rgba(255, 200, 50, 0.8));
    animation: sunIconPulse 3s ease-in-out infinite;
}

@keyframes sunIconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ===== TITLE CARD ===== */
.title-card {
    animation: cardSlideIn 0.8s ease-out 0.2s both;
}

@keyframes cardSlideIn {
    0% { opacity: 0; transform: scale(0.9) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.card-border {
    background: linear-gradient(
        135deg,
        #8B5A2B 0%,
        #a06830 25%,
        #c9a66b 50%,
        #a06830 75%,
        #8B5A2B 100%
    );
    padding: 6px;
    border-radius: 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 5px 20px rgba(139, 90, 43, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card-inner {
    background: linear-gradient(
        180deg,
        #fdf8e8 0%,
        #f5e6c8 30%,
        #ece0b6 70%,
        #e0d4a8 100%
    );
    border-radius: 14px;
    padding: 30px 50px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle paper texture */
.card-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 24px,
            rgba(139, 90, 43, 0.06) 24px,
            rgba(139, 90, 43, 0.06) 25px
        );
    pointer-events: none;
}

/* Chicken decorations */
.chicken-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.top-chickens {
    margin-bottom: 10px;
}

.bottom-chickens {
    margin-top: 20px;
    gap: 15px;
}

.chicken {
    font-size: 1.6rem;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.2));
}

.bounce-1 { animation: chickenBounce 2s ease-in-out infinite; }
.bounce-2 { animation: chickenBounce 2s ease-in-out infinite 0.3s; }
.bounce-3 { animation: chickenBounce 2s ease-in-out infinite 0.6s; }

@keyframes chickenBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.egg {
    font-size: 1rem;
    opacity: 0.7;
}

.established {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.9rem;
    font-style: italic;
    color: #6b5344;
    letter-spacing: 2px;
}

/* Main title */
.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 5px 0 10px;
    position: relative;
    z-index: 1;
}

.title-cursive {
    font-family: 'Satisfy', cursive;
    font-size: 2.8rem;
    color: #5a3d2b;
    text-shadow:
        2px 2px 0 rgba(255,255,255,0.5),
        -1px -1px 0 rgba(0,0,0,0.1);
    line-height: 1;
    letter-spacing: 3px;
}

.title-display {
    font-family: 'Nunito', sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: #3a1f10;
    text-transform: uppercase;
    letter-spacing: 8px;
    text-shadow:
        3px 3px 0 rgba(200, 160, 100, 0.6),
        0 0 20px rgba(139, 90, 43, 0.2);
    line-height: 1.2;
}

/* Subtitle */
.subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.1rem;
    font-style: italic;
    color: #6b5344;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.wheat-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* Card divider */
.card-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0;
    position: relative;
    z-index: 1;
}

.divider-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #8B5A2B, transparent);
}

.divider-icon {
    font-size: 1.4rem;
}

/* Welcome text */
.welcome-text {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.15rem;
    color: #5a4030;
    margin: 0 0 20px;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.farm-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    border: 3px solid;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.farm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s ease;
}

.farm-btn:hover::before {
    left: 100%;
}

.btn-login {
    background: linear-gradient(180deg, #6b9f48 0%, #5a8838 50%, #4a7030 100%);
    border-color: #3d5c28;
    box-shadow:
        0 4px 15px rgba(74, 112, 48, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-login:hover {
    background: linear-gradient(180deg, #7cb855 0%, #6b9f48 50%, #5a8838 100%);
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(74, 112, 48, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn-register {
    background: linear-gradient(180deg, #d4a853 0%, #c49545 50%, #b88a3d 100%);
    border-color: #8a6520;
    box-shadow:
        0 4px 15px rgba(180, 130, 50, 0.4),
        inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-register:hover {
    background: linear-gradient(180deg, #e0b860 0%, #d4a853 50%, #c49545 100%);
    transform: translateY(-3px);
    box-shadow:
        0 8px 25px rgba(180, 130, 50, 0.5),
        inset 0 1px 0 rgba(255,255,255,0.3);
}

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

.btn-emoji {
    font-size: 1.8rem;
    filter: drop-shadow(1px 2px 2px rgba(0,0,0,0.2));
    transition: transform 0.3s ease;
}

.farm-btn:hover .btn-emoji {
    transform: scale(1.15);
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.btn-main {
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

.btn-sub {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.85);
    font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .card-inner {
        padding: 25px 30px;
    }

    .title-cursive {
        font-size: 2.2rem;
    }

    .title-display {
        font-size: 1.6rem;
        letter-spacing: 4px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 12px;
    }

    .farm-btn {
        min-width: 200px;
        justify-content: center;
    }

    .flourish-wing {
        font-size: 1.4rem;
    }

    .chicken {
        font-size: 1.3rem;
    }

    .landscape {
        height: 25%;
    }
}

/* ========== RPG-STYLE HUD OVERLAY ========== */
/* Import Fonts for HUD */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700&family=Spectral:wght@400;600&display=swap');

/* Hide HUD when not logged in */
.not-logged-in .hud-panel,
.not-logged-in .hud-help-tooltip {
    display: none !important;
}

/* Canvas container - full screen when logged in */
.logged-in .canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

.logged-in .canvas-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ===== HUD PANEL BASE ===== */
.hud-panel {
    position: fixed;
    z-index: 100;
    font-family: 'Spectral', Georgia, serif;
}

.hud-top-left {
    top: 20px;
    left: 20px;
}

.hud-top-right {
    top: 20px;
    right: 20px;
}

.hud-bottom-left {
    bottom: 20px;
    left: 20px;
}

/* ===== COMPACT HUD (Always Visible) ===== */
.hud-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(
        180deg,
        rgba(62, 39, 22, 0.95) 0%,
        rgba(45, 28, 16, 0.98) 100%
    );
    border: 3px solid #8B5A2B;
    border-radius: 12px;
    padding: 8px 14px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 220, 180, 0.15),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

/* Wood grain texture overlay */
.hud-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 2px,
        rgba(139, 90, 43, 0.05) 2px,
        rgba(139, 90, 43, 0.05) 4px
    );
    border-radius: 10px;
    pointer-events: none;
}

.hud-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(139, 90, 43, 0.4);
}

.hud-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.hud-value {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #f5e6c8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 0.5px;
}

.hud-money .hud-value {
    color: #ffd700;
}

.hud-expand-btn,
.hud-menu-btn {
    background: linear-gradient(180deg, #6b4423 0%, #4a2f18 100%);
    border: 2px solid #8B5A2B;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hud-expand-btn:hover,
.hud-menu-btn:hover {
    background: linear-gradient(180deg, #7d5530 0%, #5a3a20 100%);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
}

.expand-arrow,
.menu-icon {
    color: #f5e6c8;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Character name in menu */
.hud-character-name {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
    border: 1px solid rgba(139, 90, 43, 0.4);
}

.hud-character-name span:last-child {
    font-family: 'Cinzel', serif;
    font-weight: 500;
    font-size: 0.9rem;
    color: #f5e6c8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== EXPANDED HUD PANELS ===== */
.hud-expanded {
    position: absolute;
    top: calc(100% + 10px);
    min-width: 260px;
    background: linear-gradient(
        180deg,
        rgba(62, 39, 22, 0.98) 0%,
        rgba(45, 28, 16, 0.99) 100%
    );
    border: 3px solid #8B5A2B;
    border-radius: 14px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 220, 180, 0.1);
    overflow: hidden;
    animation: hudSlideDown 0.25s ease-out;
}

.hud-top-left .hud-expanded {
    left: 0;
}

.hud-top-right .hud-expanded {
    right: 0;
}

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

.hud-expanded.hidden {
    display: none;
}

.hud-expanded-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(180deg, rgba(139, 90, 43, 0.3) 0%, transparent 100%);
    border-bottom: 2px solid rgba(139, 90, 43, 0.4);
}

.hud-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    font-size: 1rem;
    color: #f5e6c8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    letter-spacing: 1px;
}

.hud-collapse-btn {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 90, 43, 0.5);
    border-radius: 6px;
    color: #f5e6c8;
    font-size: 1rem;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hud-collapse-btn:hover {
    background: rgba(139, 90, 43, 0.4);
    color: #fff;
}

.hud-expanded-content {
    padding: 14px 16px;
}

/* Detail rows */
.hud-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
}

.hud-label {
    font-size: 0.9rem;
    color: #c9a66b;
}

.hud-detail-value {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #f5e6c8;
}

.hud-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 90, 43, 0.5), transparent);
    margin: 10px 0;
}

/* Status bars in expanded panel */
.hud-status-bars {
    margin: 8px 0;
}

.hud-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0;
}

.hud-bar-icon {
    font-size: 1rem;
    width: 24px;
    text-align: center;
}

.hud-bar {
    flex: 1;
    height: 14px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 7px;
    border: 1px solid rgba(139, 90, 43, 0.4);
    overflow: hidden;
}

.hud-bar-inner {
    height: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.hud-bar-inner.food-bar {
    background: linear-gradient(180deg, #8BC34A 0%, #689F38 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hud-bar-inner.water-bar {
    background: linear-gradient(180deg, #29B6F6 0%, #0288D1 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.hud-bar-text {
    font-family: 'Cinzel', serif;
    font-size: 0.75rem;
    color: #c9a66b;
    width: 30px;
    text-align: right;
}

/* Action buttons in expanded panel */
.hud-action-row {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.hud-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    background: linear-gradient(180deg, #5a8838 0%, #4a7030 100%);
    border: 2px solid #3d5c28;
    border-radius: 8px;
    color: #fff;
    font-family: 'Spectral', serif;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.hud-action-btn:hover {
    background: linear-gradient(180deg, #6b9f48 0%, #5a8838 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 112, 48, 0.4);
}

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

.hud-action-btn small {
    opacity: 0.8;
    font-size: 0.75rem;
}

/* ===== MENU PANEL ===== */
.hud-menu-content {
    padding: 8px;
}

.hud-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.hud-menu-item:hover {
    background: rgba(139, 90, 43, 0.3);
}

.menu-item-icon {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.menu-item-text {
    font-family: 'Spectral', serif;
    font-size: 0.95rem;
    color: #f5e6c8;
    font-weight: 600;
}

.hud-menu-item.hud-menu-danger .menu-item-text {
    color: #ff8a80;
}

.hud-menu-item.hud-menu-danger:hover {
    background: rgba(255, 82, 82, 0.2);
}

/* ===== BOTTOM TOOLBAR ===== */
.hud-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(
        180deg,
        rgba(62, 39, 22, 0.95) 0%,
        rgba(45, 28, 16, 0.98) 100%
    );
    border: 3px solid #8B5A2B;
    border-radius: 14px;
    padding: 10px 16px;
    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 220, 180, 0.15);
}

.hud-tool-mode {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(139, 90, 43, 0.4);
}

.tool-mode-icon {
    font-size: 1.1rem;
}

.tool-mode-text {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: #c9a66b;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hud-toolbar-actions {
    display: flex;
    gap: 8px;
}

.hud-tool-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #4a3020 0%, #3a2518 100%);
    border: 2px solid #6b4423;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 60px;
}

.hud-tool-btn:hover {
    background: linear-gradient(180deg, #5a3d28 0%, #4a3020 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

/* Active tool states */
.hud-tool-btn.planting-on {
    background: linear-gradient(180deg, #5a8838 0%, #4a7030 100%);
    border-color: #6b9f48;
    box-shadow: 0 0 15px rgba(107, 159, 72, 0.5);
}

.hud-tool-btn.harvesting-on {
    background: linear-gradient(180deg, #d4a853 0%, #b88a3d 100%);
    border-color: #e0b860;
    box-shadow: 0 0 15px rgba(212, 168, 83, 0.5);
}

.tool-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.tool-label {
    font-family: 'Spectral', serif;
    font-size: 0.7rem;
    color: #c9a66b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hud-tool-btn.planting-on .tool-label,
.hud-tool-btn.harvesting-on .tool-label {
    color: #fff;
}

/* ===== HELP TOOLTIP ===== */
.hud-help-tooltip {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: linear-gradient(
        180deg,
        rgba(62, 39, 22, 0.98) 0%,
        rgba(45, 28, 16, 0.99) 100%
    );
    border: 3px solid #8B5A2B;
    border-radius: 14px;
    padding: 16px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    animation: tooltipFadeIn 0.3s ease-out;
}

.hud-help-tooltip.hidden {
    display: none;
}

@keyframes tooltipFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.help-content p {
    font-family: 'Spectral', serif;
    font-size: 0.9rem;
    color: #f5e6c8;
    margin: 6px 0;
    text-align: center;
}

.help-content strong {
    color: #ffd700;
}

.help-tip {
    margin-top: 12px !important;
    padding-top: 10px;
    border-top: 1px solid rgba(139, 90, 43, 0.4);
    color: #c9a66b !important;
    font-style: italic;
}

/* ===== CHAT TOGGLE UPDATE ===== */
.logged-in .chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    background: linear-gradient(
        180deg,
        rgba(62, 39, 22, 0.95) 0%,
        rgba(45, 28, 16, 0.98) 100%
    );
    border: 3px solid #8B5A2B;
    border-radius: 12px;
    padding: 10px 16px;
    color: #f5e6c8;
    font-family: 'Spectral', serif;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.logged-in .chat-toggle:hover {
    background: linear-gradient(180deg, #4a3020 0%, #3a2518 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6);
}

/* ===== HUD RESPONSIVE ===== */
@media (max-width: 768px) {
    .hud-top-left,
    .hud-top-right,
    .hud-bottom-left {
        left: 10px;
        right: 10px;
        top: auto;
        bottom: auto;
    }

    .hud-top-left {
        top: 10px;
        right: auto;
    }

    .hud-top-right {
        top: 10px;
        left: auto;
    }

    .hud-bottom-left {
        bottom: 10px;
        right: auto;
    }

    .hud-compact {
        padding: 6px 10px;
        gap: 6px;
    }

    .hud-stat {
        padding: 3px 8px;
    }

    .hud-value {
        font-size: 0.85rem;
    }

    .hud-toolbar {
        padding: 8px 12px;
        gap: 8px;
    }

    .hud-tool-btn {
        padding: 6px 10px;
        min-width: 50px;
    }

    .tool-icon {
        font-size: 1.1rem;
    }

    .tool-label {
        font-size: 0.6rem;
    }

    .hud-expanded {
        min-width: 240px;
    }
}

/* ===== FLOATING VITAL STATS HUD ===== */
.hud-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.vital-stats-container {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(
        180deg,
        rgba(62, 39, 22, 0.92) 0%,
        rgba(45, 28, 16, 0.95) 100%
    );
    border: 3px solid #8B5A2B;
    border-radius: 16px;
    padding: 12px 20px;
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 220, 180, 0.15);
    backdrop-filter: blur(8px);
}

.vital-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vital-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vital-icon {
    font-size: 1rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    width: 20px;
    text-align: center;
}

.vital-bar {
    width: 100px;
    height: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    border: 1px solid rgba(139, 90, 43, 0.4);
    overflow: hidden;
}

.vital-bar-inner {
    height: 100%;
    border-radius: 5px;
    transition: width 0.4s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Health bar - Red gradient */
.vital-bar-inner.health-bar {
    background: linear-gradient(180deg, #ff6b6b 0%, #ee5a5a 50%, #d63031 100%);
}

/* Mana bar - Blue/Purple gradient */
.vital-bar-inner.mana-bar {
    background: linear-gradient(180deg, #a29bfe 0%, #6c5ce7 50%, #5f3dc4 100%);
}

/* Food bar - Green gradient */
.vital-bar-inner.food-bar {
    background: linear-gradient(180deg, #8BC34A 0%, #689F38 100%);
}

/* Water bar - Cyan gradient */
.vital-bar-inner.water-bar {
    background: linear-gradient(180deg, #29B6F6 0%, #0288D1 100%);
}

.vital-text {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.75rem;
    color: #f5e6c8;
    min-width: 28px;
    text-align: right;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.vital-divider {
    width: 2px;
    height: 40px;
    background: linear-gradient(180deg, transparent, rgba(139, 90, 43, 0.5), transparent);
    margin: 0 4px;
}

/* Responsive adjustments for vital stats */
@media (max-width: 600px) {
    .vital-stats-container {
        padding: 10px 14px;
        gap: 10px;
    }

    .vital-bar {
        width: 70px;
        height: 10px;
    }

    .vital-icon {
        font-size: 0.85rem;
        width: 18px;
    }

    .vital-text {
        font-size: 0.65rem;
        min-width: 22px;
    }

    .vital-divider {
        height: 32px;
    }
}

/* Hide old game layout */
.logged-in .game-layout {
    display: none;
}

.logged-in .game-instructions {
    display: none;
}

/* Hide old playerHUD */
#playerHUD {
    display: none !important;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* Auth Form */
.auth-form {
    background-color: var(--modal-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 8px var(--shadow-color);
    width: 90%;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
    transition: background-color 0.3s ease;
}

.auth-form h2 {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: bold;
    transition: color 0.3s ease;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background-color: var(--modal-bg);
    color: var(--text-primary);
    transition: border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--text-secondary);
    box-shadow: 0 0 0 2px var(--border-color);
}

.form-error {
    color: #f44336;
    margin: 0.5rem 0;
    min-height: 1.5rem;
    text-align: center;
}

.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-buttons button {
    flex: 1;
}

.cancel-button {
    background-color: #9e9e9e !important;
}

.cancel-button:hover {
    background-color: #757575 !important;
}

/* Legacy book styles (kept for backward compatibility, hidden) */
.book-container {
    display: none;
}

.book-image {
    display: none;
}

.book-button {
    display: none;
}


/* Theme Controls (Top Left, below auth) */
.theme-controls {
    position: absolute;
    top: 10px;
    left: 20px;
    z-index: 10;
}

.theme-button {
    background-color: var(--button-bg);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px var(--shadow-color);
    transition: all 0.3s ease;
    min-width: auto;
}

.theme-button:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

/* Character Name Box (Top Right) */
.character-name-box {
    position: absolute;
    top: 10px;
    right: 20px;
    background-color: var(--bg-panel);
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: bold;
    color: var(--text-primary);
    box-shadow: 0 2px 4px var(--shadow-color);
    z-index: 10;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Game Controls (Top Right, below character name) */
.game-controls {
    position: absolute;
    top: 50px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
}

/* Hide landing page elements when logged in */
.logged-in .landing-page {
    display: none !important;
}

/* Hide game content when not logged in */
.not-logged-in .game-layout,
.not-logged-in #chickenStatusContainer,
.not-logged-in .status-container,
.not-logged-in #chatToggle,
.not-logged-in .chat-panel,
.not-logged-in #playerHUD,
.not-logged-in #menuToggleBtnHUD,
.not-logged-in .theme-controls {
    display: none !important;
}

.action-button.warning {
    background-color: #ff5722;
}

.action-button.warning:hover:not(:disabled) {
    background-color: #f4511e;
}

/* Animation Keyframes */
@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Rest of your existing styles remain unchanged */
/* Chicken Status Section */
#chickenStatusContainer {
    width: 100%;
    max-width: 1400px;
    margin-bottom: 15px;
    background-color: rgba(255, 255, 255, 0.7);
    padding: 15px;
    border-radius: 10px;
}

.status-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 10px;
}

.bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-container .bar-label {
    min-width: 50px;
    font-weight: bold;
    color: #2e7d32;
}

.status-bar {
    flex-grow: 1;
    height: 25px;
    background-color: #e0e0e0;
    border: 2px solid #2196f3;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.status-bar-inner {
    height: 100%;
    width: 100%;
    transition: all 0.5s ease;
    color: white;
    font-size: 14px;
    line-height: 21px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.food-bar {
    background-color: #4caf50;
}

.water-bar {
    background-color: #2196f3;
}

#statusButtons {
    margin-top: 10px;
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Status and Layout */
.status-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 20px;
}

.status-item {
    background-color: #81c784;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #388e3c;
    min-width: 200px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.status-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Game Layout - Borderless fullscreen */
.game-layout {
    display: flex;
    gap: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background-color: #000000;
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 300px;
    flex-shrink: 0;
}

/* Canvas Container - Borderless, 16:9 aspect ratio, fills screen */
.canvas-container {
    flex-grow: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background-color: #000000;
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

/* Canvas - Borderless, 16:9 aspect ratio with scaling */
#farmCanvas {
    border: none;
    box-shadow: none;
    background-color: #000000;
    image-rendering: pixelated;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform: scale(1.5);
    transform-origin: center center;
    aspect-ratio: 16 / 9;
}

/* Viewport Resolution Classes - Dynamic scaling with aspect ratio constraints */
.canvas-container.viewport-720p #farmCanvas {
    max-width: min(100%, 1280px);
    max-height: min(100%, 720px);
}

.canvas-container.viewport-1080p #farmCanvas {
    max-width: min(100%, 1920px);
    max-height: min(100%, 1080px);
}

.canvas-container.viewport-2k #farmCanvas {
    max-width: min(100%, 2560px);
    max-height: min(100%, 1440px);
}

.canvas-container.viewport-4k #farmCanvas {
    max-width: min(100%, 3840px);
    max-height: min(100%, 2160px);
}

/* Fullscreen mode - True fullscreen with no borders */
:fullscreen .canvas-container,
:-webkit-full-screen .canvas-container,
:-moz-full-screen .canvas-container {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    padding: 0;
    background-color: #000000;
}

:fullscreen #farmCanvas,
:-webkit-full-screen #farmCanvas,
:-moz-full-screen #farmCanvas {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border: none;
    box-shadow: none;
}

/* Hide hamburger menu in fullscreen */
:fullscreen #playerHUD,
:-webkit-full-screen #playerHUD,
:-moz-full-screen #playerHUD {
    display: none;
}

/* Controls and Buttons */
.controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.buy-chicken-container {
    display: flex;
    gap: 10px;
}

#buyMaxChickenBtn {
    width: 80px;
    flex-shrink: 0;
}

.action-button {
    padding: 12px 20px;
    background-color: var(--button-bg);
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px var(--shadow-color);
    text-transform: uppercase;
    width: 100%;
}

.action-button:hover:not(:disabled) {
    background-color: var(--button-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.7;
}

/* Plant Mode Button States */
.planting-off {
    background-color: #4caf50;
}

.planting-on {
    background-color: #ff9800;
}

/* Harvest Mode Button States */
.harvesting-off {
    background-color: #8b4513;
}

.harvesting-on {
    background-color: #ff6347;
}

/* Game Instructions */
.game-instructions {
    margin-top: 20px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 1400px;
    width: 100%;
}

.game-instructions p {
    margin: 8px 0;
    color: #2e7d32;
    font-size: 16px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    background-color: #4caf50;
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateX(120%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notification.show {
    transform: translateX(0);
}

.notification.error {
    background-color: #f44336;
}

.notification.warning {
    background-color: #ff9800;
}

.notification.success {
    background-color: #4caf50;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-layout {
        flex-direction: column;
        align-items: center;
    }

    .side-panel {
        width: 100%;
        max-width: 500px;
        order: 2;
    }

    .canvas-container {
        width: 100%;
        order: 1;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding: 10px;
    }

    .game-layout {
        padding: 15px;
    }

    .status-container {
        flex-direction: column;
        align-items: center;
    }

    .status-item {
        width: 100%;
    }

    #farmCanvas {
        width: 100%;
        height: auto;
    }

    .auth-form {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .game-container {
        padding: 5px;
    }

    .action-button {
        font-size: 14px;
        padding: 10px 15px;
    }
}

/* ===== CHAT STYLES ===== */

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 999;
}

.chat-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
    background: linear-gradient(135deg, #66bb6a, #388e3c);
}

.chat-toggle:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Chat Panel */
.chat-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    transition: all 0.3s ease;
}

.chat-panel.hidden {
    display: none;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    padding: 12px 15px;
    font-weight: bold;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 18px;
    font-weight: bold;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages Container */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Individual Chat Message */
.chat-message {
    padding: 8px 12px;
    background: white;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    animation: slideIn 0.2s ease;
}

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

.chat-time {
    color: #999;
    font-size: 11px;
    margin-right: 6px;
}

.chat-user {
    color: #2e7d32;
    font-weight: bold;
    margin-right: 6px;
}

.chat-text {
    color: #333;
}

/* Chat Input Container */
.chat-input-container {
    display: flex;
    padding: 12px;
    background: white;
    border-top: 1px solid #ddd;
    gap: 8px;
}

.chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #4caf50;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.chat-send {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
    border: none;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-send:hover {
    background: linear-gradient(135deg, #66bb6a, #388e3c);
    transform: scale(1.05);
}

.chat-send:active {
    transform: scale(0.95);
}

/* Custom Scrollbar for Chat */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #4caf50;
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #2e7d32;
}

/* Responsive Chat Styles */
@media (max-width: 768px) {
    .chat-panel {
        width: 90%;
        right: 5%;
        bottom: 70px;
        height: 400px;
    }

    .chat-toggle {
        bottom: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .chat-panel {
        width: 95%;
        right: 2.5%;
        bottom: 60px;
        height: 350px;
    }

    .chat-message {
        font-size: 13px;
        padding: 6px 10px;
    }

    .chat-input {
        font-size: 13px;
        padding: 8px 10px;
    }

    .chat-send {
        padding: 8px 16px;
        font-size: 13px;
    }
}
/* Statistics and Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background-color: var(--modal-bg);
    border-radius: 15px;
    box-shadow: 0 8px 16px var(--shadow-color);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    transition: background-color 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    transition: border-color 0.3s ease;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #a5d6a7 0%, #81c784 100%);
    border-radius: 15px 15px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #1b5e20;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1b5e20;
    padding: 0.5rem;
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.2);
    color: #f44336;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.modal-body table {
    width: 100%;
    border-collapse: collapse;
}

.modal-body tr {
    border-bottom: 1px solid #e0e0e0;
}

.modal-body td {
    padding: 0.75rem;
    text-align: left;
}

.modal-body td:first-child {
    font-weight: bold;
    color: #2e7d32;
}

.modal-body td:last-child {
    text-align: right;
    color: #1b5e20;
}

.modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* Harvest Ready Alert */
.harvest-alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #1b5e20;
    padding: 1rem 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 1500;
    animation: pulse 1.5s ease-in-out infinite;
    border: 3px solid #ffa500;
}

.harvest-alert.hidden {
    display: none;
}

@keyframes pulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 16px rgba(255, 165, 0, 0.5);
    }
}

/* Fuel Warning */
#fuel-warning {
    color: #f44336;
    font-weight: bold;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Stats panel button styling */
.stats-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-panel button {
    width: 100%;
}

/* Incident Form Overlay */
.form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
    overflow-y: auto;
    padding: 20px;
}

/* Official Incident Form Styling */
.incident-form {
    background-color: #f5f5dc; /* Beige paper color */
    border: 3px solid #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 850px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    font-family: 'Courier New', 'Lucida Console', Monaco, monospace;
    color: #000;
    padding: 35px;
    position: relative;
    border-radius: 4px;
}

.form-header {
    text-align: center;
    border-bottom: 4px double #000;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.form-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.form-main-title {
    font-size: 26px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 10px 0 5px 0;
    color: #000;
    text-shadow: none;
    font-family: 'Arial Black', 'Helvetica Bold', sans-serif;
}

.form-subtitle {
    font-size: 12px;
    font-style: italic;
    margin: 0;
    color: #333;
}

.form-metadata {
    display: flex;
    justify-content: space-between;
    background-color: #e8e8d8;
    border: 2px solid #999;
    padding: 10px;
    margin-bottom: 20px;
    font-size: 11px;
    font-weight: bold;
}

.form-section-title {
    background-color: #333;
    color: #fff;
    padding: 10px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    border: 2px solid #000;
}

.official-form {
    background-color: #fff;
    padding: 20px;
    border: 2px solid #666;
}

.official-form .form-group {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #fafafa;
    border: 1px solid #ccc;
    border-left: 4px solid #666;
}

.official-form .form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #000;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.official-form input[type="text"] {
    width: 100%;
    padding: 8px;
    border: none;
    border-bottom: 2px solid #000;
    background-color: transparent;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    color: #000;
}

.official-form input[type="text"]:focus {
    outline: none;
    border-bottom: 2px solid #0066cc;
    background-color: #fffef0;
}

.radio-option,
.checkbox-option {
    display: flex;
    align-items: center;
    margin: 8px 0;
    padding: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
    transition: background-color 0.2s;
}

.radio-option:hover,
.checkbox-option:hover {
    background-color: #f0f0f0;
}

.radio-option input[type="radio"],
.checkbox-option input[type="checkbox"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option label,
.checkbox-option label {
    cursor: pointer;
    flex: 1;
    font-size: 13px;
    text-transform: none;
    letter-spacing: normal;
    font-weight: normal;
    margin: 0;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px double #000;
}

.form-navigation button {
    padding: 12px 30px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 3px solid #000;
    background-color: #fff;
    color: #000;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 3px 3px 0 #999;
}

.form-navigation button:hover {
    background-color: #333;
    color: #fff;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #999;
}

.form-navigation button:active {
    transform: translate(0, 0);
    box-shadow: 1px 1px 0 #999;
}

#submitForm {
    background-color: #d4af37;
    border-color: #8b7500;
    color: #000;
    font-weight: bold;
}

#submitForm:hover {
    background-color: #ffd700;
    border-color: #8b7500;
    color: #000;
}

/* Leaderboard Styles */
.leaderboard-modal .modal-content {
    max-width: 500px;
}

.leaderboard-body {
    padding: 1rem;
}

.leaderboard-entry {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-panel) 100%);
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leaderboard-entry:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.leaderboard-entry.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 50%, #ffd700 100%);
    border-color: #daa520;
}

.leaderboard-entry.rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 50%, #c0c0c0 100%);
    border-color: #a9a9a9;
}

.leaderboard-entry.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e6a872 50%, #cd7f32 100%);
    border-color: #b87333;
}

.leaderboard-trophy {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.leaderboard-info {
    flex: 1;
    text-align: left;
}

.leaderboard-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.leaderboard-wealth {
    margin-bottom: 0.5rem;
}

.wealth-total {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-secondary);
}

.leaderboard-entry.rank-1 .wealth-total,
.leaderboard-entry.rank-2 .wealth-total,
.leaderboard-entry.rank-3 .wealth-total {
    color: #1b5e20;
}

body.dark-theme .leaderboard-entry.rank-1 .wealth-total,
body.dark-theme .leaderboard-entry.rank-2 .wealth-total,
body.dark-theme .leaderboard-entry.rank-3 .wealth-total {
    color: #2e7d32;
}

.leaderboard-entry.rank-1 .leaderboard-name,
.leaderboard-entry.rank-2 .leaderboard-name,
.leaderboard-entry.rank-3 .leaderboard-name {
    color: #1b5e20;
}

body.dark-theme .leaderboard-entry.rank-1 .leaderboard-name,
body.dark-theme .leaderboard-entry.rank-2 .leaderboard-name,
body.dark-theme .leaderboard-entry.rank-3 .leaderboard-name {
    color: #2e7d32;
}

.leaderboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.leaderboard-entry.rank-1 .leaderboard-stats,
.leaderboard-entry.rank-2 .leaderboard-stats,
.leaderboard-entry.rank-3 .leaderboard-stats {
    color: #2e7d32;
}

body.dark-theme .leaderboard-entry.rank-1 .leaderboard-stats,
body.dark-theme .leaderboard-entry.rank-2 .leaderboard-stats,
body.dark-theme .leaderboard-entry.rank-3 .leaderboard-stats {
    color: #4a5f2c;
}

.leaderboard-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.leaderboard-error {
    text-align: center;
    padding: 2rem;
    color: #f44336;
    font-size: 1.1rem;
}

/* Store Modal Styles */
.store-modal .modal-content {
    max-width: 600px;
}

.store-body {
    padding: 1.5rem;
}

.store-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease;
}

.store-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.store-item-info {
    flex: 1;
}

.store-item-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.store-item-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.store-item-level {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

.store-button {
    padding: 0.75rem 1.5rem;
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.store-button:hover:not(.disabled) {
    background-color: var(--button-hover);
    transform: scale(1.05);
}

.store-button.disabled {
    background-color: #999;
    cursor: not-allowed;
    opacity: 0.6;
}

.store-section {
    margin-bottom: 2rem;
}

.store-section-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.store-info-box {
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* ========== RUSTIC STORE THEME (Land Office Style) ========== */
.rustic-store-modal .modal-content {
    background: linear-gradient(
        180deg,
        #3e2716 0%,
        #2d1c10 100%
    );
    border: 4px solid #8B5A2B;
    border-radius: 16px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.6),
        inset 0 2px 0 rgba(255, 220, 180, 0.1);
    max-width: 650px;
    overflow: hidden;
}

.rustic-store-modal .modal-header {
    background: linear-gradient(
        180deg,
        rgba(139, 90, 43, 0.4) 0%,
        rgba(139, 90, 43, 0.1) 100%
    );
    border-bottom: 3px solid #8B5A2B;
    padding: 20px 24px;
    position: relative;
}

.rustic-store-modal .modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 3px,
        rgba(139, 90, 43, 0.03) 3px,
        rgba(139, 90, 43, 0.03) 6px
    );
    pointer-events: none;
}

.rustic-store-modal .modal-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #f5e6c8;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
    margin: 0;
    text-align: center;
}

.rustic-store-modal .modal-close {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(139, 90, 43, 0.5);
    color: #f5e6c8;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rustic-store-modal .modal-close:hover {
    background: rgba(139, 90, 43, 0.4);
    color: #fff;
}

/* Rustic Store Body - Parchment Style */
.rustic-store-body {
    background: linear-gradient(
        180deg,
        #f5e6c8 0%,
        #e8d5b0 50%,
        #dcc9a0 100%
    );
    padding: 24px;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
}

/* Parchment texture overlay */
.rustic-store-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        repeating-linear-gradient(
            0deg,
            transparent 0px,
            transparent 28px,
            rgba(139, 90, 43, 0.04) 28px,
            rgba(139, 90, 43, 0.04) 29px
        );
    pointer-events: none;
}

/* Store Header with Seal */
.rustic-store-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(139, 90, 43, 0.3);
    position: relative;
}

.rustic-store-seal {
    font-size: 3rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.rustic-store-title {
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #4a2f18;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
}

.rustic-store-subtitle {
    font-family: 'Spectral', serif;
    font-size: 0.95rem;
    font-style: italic;
    color: #6b5344;
    margin-top: 6px;
}

/* Property Stats Box */
.rustic-property-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    background: rgba(74, 47, 24, 0.08);
    border: 2px solid rgba(139, 90, 43, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.rustic-stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(139, 90, 43, 0.15);
}

.rustic-stat-icon {
    font-size: 1.3rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.rustic-stat-content {
    flex: 1;
}

.rustic-stat-label {
    font-family: 'Spectral', serif;
    font-size: 0.75rem;
    color: #8a7a6a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rustic-stat-value {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #4a2f18;
}

/* Section Headers */
.rustic-section {
    margin-bottom: 24px;
}

.rustic-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px dashed rgba(139, 90, 43, 0.3);
}

.rustic-section-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.rustic-section-title {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #4a2f18;
    letter-spacing: 1px;
}

/* Upgrade Cards */
.rustic-upgrade-card {
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(139, 90, 43, 0.25);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.rustic-upgrade-card:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(139, 90, 43, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.rustic-upgrade-card.locked {
    opacity: 0.6;
    filter: grayscale(30%);
}

.rustic-upgrade-card.locked:hover {
    transform: none;
    box-shadow: none;
}

.rustic-upgrade-info {
    flex: 1;
}

.rustic-upgrade-name {
    font-family: 'Cinzel', serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #3a1f10;
    margin-bottom: 4px;
}

.rustic-upgrade-desc {
    font-family: 'Spectral', serif;
    font-size: 0.9rem;
    color: #6b5344;
    line-height: 1.4;
}

.rustic-upgrade-unlock {
    font-size: 0.85rem;
    color: #8B5A2B;
    font-style: italic;
    margin-top: 6px;
}

/* Purchase Buttons */
.rustic-buy-btn {
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 12px 20px;
    border-radius: 10px;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-width: 140px;
    white-space: nowrap;
}

.rustic-buy-btn.available {
    background: linear-gradient(180deg, #5a8838 0%, #4a7030 100%);
    border-color: #3d5c28;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 3px 8px rgba(74, 112, 48, 0.3);
}

.rustic-buy-btn.available:hover {
    background: linear-gradient(180deg, #6b9f48 0%, #5a8838 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(74, 112, 48, 0.4);
}

.rustic-buy-btn.available:active {
    transform: translateY(0);
}

.rustic-buy-btn.disabled {
    background: linear-gradient(180deg, #8a7a6a 0%, #6b5a4a 100%);
    border-color: #5a4a3a;
    color: rgba(255, 255, 255, 0.7);
    cursor: not-allowed;
    box-shadow: none;
}

.rustic-buy-btn .price {
    display: block;
    font-size: 0.8rem;
    margin-top: 2px;
    opacity: 0.9;
}

.rustic-buy-btn .discount {
    color: #90EE90;
    font-size: 0.75rem;
}

/* Max Level Badge */
.rustic-max-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #d4a853 0%, #b88a3d 100%);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 8px rgba(180, 138, 61, 0.4);
}

/* Completed Section Message */
.rustic-complete-msg {
    text-align: center;
    padding: 20px;
    background: rgba(107, 159, 72, 0.1);
    border: 2px dashed rgba(107, 159, 72, 0.4);
    border-radius: 12px;
    font-family: 'Spectral', serif;
    font-size: 1rem;
    color: #4a7030;
    font-style: italic;
}

/* Info Note Box */
.rustic-info-note {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(139, 90, 43, 0.08);
    border-left: 4px solid #8B5A2B;
    padding: 12px 16px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
}

.rustic-info-note-icon {
    font-size: 1.2rem;
}

.rustic-info-note-text {
    font-family: 'Spectral', serif;
    font-size: 0.9rem;
    color: #5a4030;
    line-height: 1.5;
}

/* Scrollbar styling for rustic store */
.rustic-store-body::-webkit-scrollbar {
    width: 10px;
}

.rustic-store-body::-webkit-scrollbar-track {
    background: rgba(139, 90, 43, 0.1);
    border-radius: 5px;
}

.rustic-store-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #8B5A2B, #6b4423);
    border-radius: 5px;
    border: 2px solid rgba(245, 230, 200, 0.3);
}

.rustic-store-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #a06830, #8B5A2B);
}

/* AFK Report Modal Styles */
.afk-modal .modal-content {
    max-width: 700px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
}

.afk-modal .modal-header {
    background: linear-gradient(90deg, #4CAF50, #2196F3);
    color: white;
    padding: 1.5rem;
    border-radius: 12px 12px 0 0;
    text-align: center;
}

.afk-modal .modal-header h2 {
    margin: 0;
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.afk-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.afk-time-away {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-panel);
    border-radius: 8px;
}

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

.afk-stat-card {
    padding: 1.25rem;
    background: var(--bg-panel);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.afk-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.afk-stat-card.positive {
    border-color: #4CAF50;
    background: linear-gradient(135deg, var(--bg-panel), rgba(76, 175, 80, 0.1));
}

.afk-stat-card.negative {
    border-color: #f44336;
    background: linear-gradient(135deg, var(--bg-panel), rgba(244, 67, 54, 0.1));
}

.afk-stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.afk-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.25rem;
}

.afk-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.afk-summary {
    padding: 1.5rem;
    background: var(--bg-panel);
    border-radius: 10px;
    border: 2px solid var(--border-color);
    margin-bottom: 1rem;
}

.afk-summary-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-align: center;
}

.afk-summary-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.afk-summary-item:last-child {
    border-bottom: none;
}

.afk-modal .modal-footer {
    padding: 1rem 2rem;
    text-align: center;
}

.afk-modal .modal-footer button {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.afk-modal .modal-footer button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Collision Info Box Styling */
.collision-info-box {
    background: linear-gradient(135deg, #fff3cd 0%, #fff9e6 100%);
    border: 3px solid #ff6b6b;
    border-left: 8px solid #ff6b6b;
    padding: 15px 20px;
    margin: 15px 0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #000;
    box-shadow: inset 0 0 10px rgba(255, 107, 107, 0.1);
}

.collision-info-box strong {
    color: #d32f2f;
    font-weight: bold;
    text-transform: uppercase;
}
