/* ===================== KEBAB TYCOON STYLES ===================== */

/* Base Styles */
body {
    margin: 0;
    padding: 0;
    padding-top: 20px;
}

/* ===================== TUTORIAL MODAL ===================== */
.tutorial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.tutorial-modal.hidden {
    display: none;
}

.tutorial-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.tutorial-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    padding: 20px;
    text-align: center;
}

.tutorial-header h2 {
    margin: 0;
    font-size: 28px;
}

.tutorial-step {
    margin: 5px 0 0 0;
    font-size: 14px;
    opacity: 0.9;
}

.tutorial-game-area {
    padding: 30px;
    background: #f8f9fa;
}

.tutorial-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 25px;
}

.tutorial-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    font-size: 24px;
}

.stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
}

.tutorial-resources {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
}

.tutorial-resource {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tutorial-resource span:first-child {
    font-size: 24px;
}

.tutorial-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.tutorial-btn {
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.cook-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

.cook-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.cook-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sell-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: white;
}

.sell-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.sell-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tutorial-message {
    text-align: center;
    padding: 15px;
    background: white;
    border-radius: 10px;
    font-size: 16px;
    color: #34495e;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tutorial-message.highlight {
    background: #fff3cd;
    border: 2px solid #f39c12;
    animation: pulse 1s ease-in-out;
}

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

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.tutorial-skip {
    background: none;
    border: none;
    color: #7f8c8d;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
}

.tutorial-skip:hover {
    color: #34495e;
}

.tutorial-next {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

.tutorial-next.hidden {
    display: none;
}

/* Additional tutorial elements */
.tutorial-extra {
    margin: 20px 0;
    padding: 15px;
    background: #e8f4f8;
    border-radius: 10px;
    border: 2px solid #3498db;
}

.tutorial-extra.hidden {
    display: none;
}

.tutorial-upgrade-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tutorial-upgrade-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.tutorial-upgrade-card.purchased {
    background: #d4edda;
    border: 2px solid #27ae60;
}

.tutorial-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 15px;
}

.tutorial-tab {
    padding: 12px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.tutorial-tab small {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.tutorial-tab:hover {
    background: #f8f9fa;
}

.tutorial-tab.highlight {
    background: #fff3cd;
    border-color: #f39c12;
    animation: pulse 1s ease-in-out 3;
}

.tutorial-achievement {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    color: white;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    margin: 10px 0;
    font-weight: bold;
}

.tutorial-minigame-btn {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

.tutorial-minigame-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.3);
}

.tutorial-quest-example {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
    margin: 10px 0;
}

.tutorial-skill-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.tutorial-skill {
    background: #ecf0f1;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
}

.tutorial-prestige-info {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin: 10px 0;
}

/* ===================== MAIN TAB BEAUTIFUL UI ===================== */
#main-section {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Shop Type Sub-Navigation */
.shop-type-nav {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    overflow-x: auto;
    scrollbar-width: thin;
}

.shop-type-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: white;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 70px;
}

.shop-type-btn:hover:not(.locked) {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.shop-type-btn.active {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border-color: #f39c12;
}

.shop-type-btn.locked {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.8;
}

.shop-type-btn .shop-icon {
    font-size: 24px;
}

.shop-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    flex: 1;
}

.shop-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.shop-name {
    font-size: 14px;
    font-weight: 600;
}

.wip-badge {
    font-size: 11px;
    color: #e67e22;
    font-weight: normal;
}

.shop-requirements {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.req-main {
    font-size: 12px;
    color: #333;
    font-weight: 600;
}

.req-sub {
    font-size: 10px;
    color: #666;
    font-weight: 400;
}

.shop-type-btn.active .req-main {
    color: white;
}

.shop-type-btn.active .req-sub {
    color: rgba(255, 255, 255, 0.8);
}

.shop-type-btn.active .wip-badge {
    color: #fff3cd;
}

.shop-type-btn .lock-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    font-size: 18px;
    background: #ff6b6b;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Shop Sections */
.shop-section {
    display: none;
}

.shop-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Drinks Hero */
.drinks-hero {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Drinks Stat Cards */
.drinks-inventory-card {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.drinks-rate-card {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.drinks-types-card {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
}

/* Drinks Resources */
.water-resource .resource-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.ice-resource .resource-icon {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.syrup-resource .resource-icon {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
}

.water-fill {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.ice-fill {
    background: linear-gradient(90deg, #a8edea 0%, #fed6e3 100%);
}

.syrup-fill {
    background: linear-gradient(90deg, #ffecd2 0%, #fcb69f 100%);
}

/* Drink Types Grid */
.drink-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.drink-type-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.drink-type-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #4facfe;
}

.drink-type-card.locked {
    opacity: 0.6;
    background: #f5f5f5;
}

.drink-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.drink-info h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.drink-recipe {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.drink-price {
    font-size: 16px;
    color: #27ae60;
    font-weight: bold;
    margin: 10px 0;
}

.make-drink-btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.make-drink-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.make-drink-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Drinks Notice */
.drinks-notice {
    background: #e3f2fd;
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    border: 2px solid #64b5f6;
}

.drinks-notice p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #1976d2;
}

.drinks-notice ul {
    margin: 0;
    padding-left: 20px;
}

.drinks-notice li {
    color: #424242;
    margin: 5px 0;
}

/* Drink card buttons */
.make-drink-btn, .auto-make-select-btn {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.make-drink-btn {
    background: #4facfe;
}

.make-drink-btn:hover:not(:disabled) {
    background: #3498db;
    transform: translateY(-2px);
}

.make-drink-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    opacity: 0.7;
}

.auto-make-select-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #666;
    font-size: 14px;
    padding: 8px;
    margin-top: 5px;
}

.auto-make-select-btn:hover:not(:disabled) {
    background: #555;
    transform: translateY(-1px);
}

.auto-make-select-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dark mode adjustments for drinks */
body.dark-mode .drink-type-card {
    background: #2c3e50;
}

body.dark-mode .drink-type-card.locked {
    background: #34495e;
}

body.dark-mode .drink-info h4 {
    color: #ecf0f1;
}

body.dark-mode .drink-recipe {
    color: #bdc3c7;
}

body.dark-mode .drinks-notice {
    background: #1e3a5f;
    border-color: #2980b9;
}

body.dark-mode .drinks-notice p {
    color: #64b5f6;
}

body.dark-mode .drinks-notice li {
    color: #ecf0f1;
}

/* Deep Fried Section Styles */
.fried-hero {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
}

/* Fried Stat Cards */
.fried-inventory-card {
    background: linear-gradient(135deg, #ff9ff3 0%, #feca57 100%);
}

.fried-rate-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
}

.oil-quality-card {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
}

/* Fried Resources */
.potato-resource .resource-icon {
    background: linear-gradient(135deg, #dfe6e9 0%, #b2bec3 100%);
}

.chicken-resource .resource-icon {
    background: linear-gradient(135deg, #fab1a0 0%, #e17055 100%);
}

.oil-resource .resource-icon {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
}

.seasoning-resource .resource-icon {
    background: linear-gradient(135deg, #fd79a8 0%, #a29bfe 100%);
}

.potato-fill {
    background: linear-gradient(90deg, #dfe6e9 0%, #b2bec3 100%);
}

.chicken-fill {
    background: linear-gradient(90deg, #fab1a0 0%, #e17055 100%);
}

.oil-fill {
    background: linear-gradient(90deg, #ffeaa7 0%, #fdcb6e 100%);
}

.seasoning-fill {
    background: linear-gradient(90deg, #fd79a8 0%, #a29bfe 100%);
}

/* Fried Items Grid */
.fried-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.fried-item-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.fried-item-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #ff6b6b;
}

.fried-item-card.locked {
    opacity: 0.6;
    background: #f5f5f5;
}

.item-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.item-info h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
}

.item-recipe {
    font-size: 14px;
    color: #666;
    margin: 5px 0;
}

.item-price {
    font-size: 16px;
    color: #27ae60;
    font-weight: bold;
    margin: 5px 0;
}

.item-time {
    font-size: 14px;
    color: #e67e22;
    margin: 5px 0;
}

.make-item-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.make-item-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.make-item-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Oil Button */
.oil-btn {
    background: linear-gradient(135deg, #f9ca24 0%, #f0932b 100%);
}

/* Oil Quality Indicator */
.oil-quality-indicator {
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
}

.oil-quality-indicator p {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 14px;
    text-align: center;
}

.oil-quality-bar {
    background: #e0e0e0;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
}

.oil-quality-fill {
    height: 100%;
    background: linear-gradient(90deg, #f9ca24 0%, #f0932b 100%);
    transition: width 0.3s ease;
}

/* Fried Notice */
.fried-notice {
    background: #ffe5e5;
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    border: 2px solid #ff6b6b;
}

.fried-notice p {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #c0392b;
}

.fried-notice ul {
    margin: 0;
    padding-left: 20px;
}

.fried-notice li {
    color: #424242;
    margin: 5px 0;
}

/* Dark mode adjustments for fried */
body.dark-mode .fried-item-card {
    background: #2c3e50;
}

body.dark-mode .fried-item-card.locked {
    background: #34495e;
}

body.dark-mode .item-info h4 {
    color: #ecf0f1;
}

body.dark-mode .item-recipe,
body.dark-mode .item-time {
    color: #bdc3c7;
}

body.dark-mode .oil-quality-indicator {
    background: #3d3d3d;
    border-color: #f9ca24;
}

body.dark-mode .oil-quality-indicator p {
    color: #ffeaa7;
}

body.dark-mode .oil-quality-bar {
    background: #555;
}

body.dark-mode .fried-notice {
    background: #3d2424;
    border-color: #e74c3c;
}

body.dark-mode .fried-notice p {
    color: #ff6b6b;
}

body.dark-mode .fried-notice li {
    color: #ecf0f1;
}

/* Pizza Section Styles */
.pizza-hero {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* Pizza Stat Cards */
.pizza-inventory-card {
    background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
}

.pizza-rate-card {
    background: linear-gradient(135deg, #d35400 0%, #e67e22 100%);
}

.oven-temp-card {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

/* Pizza Resources */
.dough-resource .resource-icon {
    background: linear-gradient(135deg, #f4e1c1 0%, #e6c9a8 100%);
}

.sauce-resource .resource-icon {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.cheese-resource .resource-icon {
    background: linear-gradient(135deg, #f9e79f 0%, #f4d03f 100%);
}

.toppings-resource .resource-icon {
    background: linear-gradient(135deg, #a93226 0%, #922b21 100%);
}

.dough-fill {
    background: linear-gradient(90deg, #f4e1c1 0%, #e6c9a8 100%);
}

.sauce-fill {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.cheese-fill {
    background: linear-gradient(90deg, #f9e79f 0%, #f4d03f 100%);
}

.toppings-fill {
    background: linear-gradient(90deg, #a93226 0%, #922b21 100%);
}

/* Pizza Items Grid */
.pizza-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.pizza-item-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pizza-item-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #e74c3c;
}

.pizza-item-card.locked {
    opacity: 0.6;
    background: #f5f5f5;
}

.make-pizza-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.make-pizza-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.make-pizza-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Dessert Section Styles */
.dessert-hero {
    background: linear-gradient(135deg, #ff6fa6 0%, #ee5a6f 100%);
}

/* Dessert Stat Cards */
.dessert-inventory-card {
    background: linear-gradient(135deg, #ffc3e1 0%, #ff6fa6 100%);
}

.dessert-rate-card {
    background: linear-gradient(135deg, #c56cf0 0%, #ff6fa6 100%);
}

.temp-control-card {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

/* Dessert Resources */
.flour-resource .resource-icon {
    background: linear-gradient(135deg, #f5f3f0 0%, #d1ccc0 100%);
}

.sugar-resource .resource-icon {
    background: linear-gradient(135deg, #ffcccc 0%, #ffb3b3 100%);
}

.cream-resource .resource-icon {
    background: linear-gradient(135deg, #ffffff 0%, #f1f2f6 100%);
}

.chocolate-resource .resource-icon {
    background: linear-gradient(135deg, #7d4f39 0%, #5d3a1a 100%);
}

.flour-fill {
    background: linear-gradient(90deg, #f5f3f0 0%, #d1ccc0 100%);
}

.sugar-fill {
    background: linear-gradient(90deg, #ffcccc 0%, #ffb3b3 100%);
}

.cream-fill {
    background: linear-gradient(90deg, #ffffff 0%, #f1f2f6 100%);
}

.chocolate-fill {
    background: linear-gradient(90deg, #7d4f39 0%, #5d3a1a 100%);
}

/* Dessert Items Grid */
.dessert-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.dessert-item-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.dessert-item-card:hover:not(.locked) {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #ff6fa6;
}

.dessert-item-card.locked {
    opacity: 0.6;
    background: #f5f5f5;
}

.make-dessert-btn {
    background: linear-gradient(135deg, #ff6fa6 0%, #ee5a6f 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.make-dessert-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(255, 111, 166, 0.4);
}

.make-dessert-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Coming Soon Notice for Desserts */
.coming-soon-notice {
    background: linear-gradient(135deg, #f8e5f0 0%, #ffe5f1 100%);
    border-radius: 15px;
    padding: 30px;
    margin-top: 30px;
    border: 2px solid #ff6fa6;
    text-align: center;
}

.coming-soon-notice p {
    margin: 10px 0;
    font-size: 18px;
    color: #c0392b;
}

/* Dark mode adjustments for pizza */
body.dark-mode .pizza-item-card {
    background: #2c3e50;
}

body.dark-mode .pizza-item-card.locked {
    background: #34495e;
}

/* Dark mode adjustments for dessert */
body.dark-mode .dessert-item-card {
    background: #2c3e50;
}

body.dark-mode .dessert-item-card.locked {
    background: #34495e;
}

body.dark-mode .coming-soon-notice {
    background: #3d2837;
    border-color: #ff6fa6;
}

body.dark-mode .coming-soon-notice p {
    color: #ffb3d1;
}

/* Coming Soon Card */
.coming-soon-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.coming-soon-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.coming-soon-card h3 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
}

.unlock-requirements {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.unlock-requirements li {
    padding: 10px;
    margin: 10px 0;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 10px;
    font-size: 18px;
}

.progress-info {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.requirement-progress {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.requirement-progress span {
    background: #f8f9fa;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    color: #666;
}

/* Dark mode adjustments */
body.dark-mode .shop-type-nav {
    background: rgba(0, 0, 0, 0.3);
}

body.dark-mode .shop-type-btn:not(.active) {
    background: #2c3e50;
    color: #ecf0f1;
}

body.dark-mode .shop-type-btn.locked {
    background: #34495e;
    color: #7f8c8d;
}

body.dark-mode .coming-soon-card {
    background: #2c3e50;
    color: #ecf0f1;
}

body.dark-mode .coming-soon-card h3 {
    color: #ecf0f1;
}

body.dark-mode .unlock-requirements li {
    background: rgba(52, 73, 94, 0.5);
}

body.dark-mode .requirement-progress span {
    background: #34495e;
    color: #bdc3c7;
}

body.dark-mode .req-main {
    color: #ecf0f1;
}

body.dark-mode .req-sub {
    color: #95a5a6;
}

body.dark-mode .wip-badge {
    color: #f39c12;
}

/* Responsive adjustments for shop nav */
@media (max-width: 1024px) {
    .shop-type-btn {
        padding: 10px 12px;
        min-height: 65px;
    }
    
    .shop-name {
        font-size: 13px;
    }
    
    .req-main {
        font-size: 11px;
    }
    
    .shop-type-nav {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .shop-type-nav {
        padding: 10px;
        gap: 8px;
    }
    
    .shop-type-btn {
        padding: 8px 10px;
        min-height: 60px;
    }
}

/* Main Hero Section */
.main-hero {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(243, 156, 18, 0.3);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

.main-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.main-hero .hero-icon {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
    z-index: 1;
}

.main-hero .hero-content {
    flex: 1;
    z-index: 1;
}

.main-hero h2 {
    font-size: 36px;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.main-hero .hero-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin: 0;
}

/* Stats Grid */
.main-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#main-section .stat-card {
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: none;
    color: white;
    position: relative;
    overflow: hidden;
}

#main-section .stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

#main-section .stat-card .stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Main tab stat card gradients */
#main-section .money-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#main-section .kebab-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

#main-section .kps-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

#main-section .multiplier-card {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Add shimmer effect */
#main-section .stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    transition: all 0.6s;
    opacity: 0;
}

#main-section .stat-card:hover::before {
    animation: shimmer 0.6s ease;
    opacity: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

.kebab-card .stat-icon {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.kps-card .stat-icon {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
}

.multiplier-card .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card .stat-info {
    flex: 1;
}

.stat-card .stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.stat-card .stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #2d3748;
}

/* Main tab stat card text colors - white on gradient backgrounds */
#main-section .stat-card .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

#main-section .stat-card .stat-value {
    color: white;
}

#main-section .stat-card .mult-item {
    color: white;
}

/* Ensure dark mode doesn't override Main tab gradient cards */
body.dark-mode #main-section .money-card,
body.dark-mode #main-section .kebab-card,
body.dark-mode #main-section .kps-card,
body.dark-mode #main-section .multiplier-card {
    /* Keep the gradient backgrounds */
}

body.dark-mode #main-section .stat-card .stat-label,
body.dark-mode #main-section .stat-card .stat-value,
body.dark-mode #main-section .stat-card .mult-item {
    color: white;
}

.mult-item {
    margin-right: 10px;
    font-size: 18px;
}

/* Resources Section */
.resources-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.section-title {
    font-size: 24px;
    margin: 0 0 20px 0;
    color: #2d3748;
    font-weight: 600;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.resource-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.resource-card:hover {
    background: #f0f4f8;
    transform: translateX(5px);
}

.resource-icon {
    font-size: 48px;
}

.resource-info {
    flex: 1;
}

.resource-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 5px;
}

.resource-amount {
    display: inline-block;
    font-size: 28px;
    font-weight: bold;
    color: #2d3748;
}

.resource-storage {
    display: inline-block;
    font-size: 18px;
    color: #718096;
    margin-left: 5px;
    margin-bottom: 5px;
}

.resource-rate {
    display: block;
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
    position: relative;
    cursor: help;
}

.resource-rate:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    pointer-events: none;
}

.resource-rate:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    margin-bottom: -5px;
    z-index: 1001;
    pointer-events: none;
}

.resource-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 10px;
}

.resource-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.meat-fill {
    background: linear-gradient(90deg, #e74c3c 0%, #c0392b 100%);
}

.veggie-fill {
    background: linear-gradient(90deg, #27ae60 0%, #229954 100%);
}

.bread-fill {
    background: linear-gradient(90deg, #f39c12 0%, #d68910 100%);
}

.production-status {
    padding: 20px;
    background: #f0f4f8;
    border-radius: 10px;
    text-align: center;
}

.production-breakdown {
    margin: 15px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    border: 1px solid rgba(52, 152, 219, 0.2);
}

.breakdown-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 700;
    color: #2980b9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.breakdown-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    border-left-width: 4px;
}

.breakdown-item:hover {
    transform: translateX(5px);
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.breakdown-icon {
    font-size: 24px;
    min-width: 35px;
    text-align: center;
    filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.2));
}

.breakdown-details {
    flex: 1;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0.5px 0.5px 1px rgba(0,0,0,0.1);
    letter-spacing: 0.3px;
}

.meat-breakdown {
    border-left: 3px solid #e74c3c;
}

.veggies-breakdown {
    border-left: 3px solid #27ae60;
}

.bread-breakdown {
    border-left: 3px solid #f39c12;
}

/* Production value styling */
.prod-value {
    color: #2980b9;
    font-weight: 800;
    font-size: 16px;
}

.prod-subtotal {
    color: #27ae60;
    font-weight: 800;
    font-size: 16px;
    padding: 0 2px;
}

.prod-multiplier {
    color: #8e44ad;
    font-weight: 800;
    font-size: 16px;
    font-style: italic;
}

.prod-total {
    color: #e74c3c;
    font-weight: 900;
    font-size: 18px;
    text-decoration: underline;
    text-decoration-style: wavy;
    text-decoration-color: rgba(231, 76, 60, 0.3);
}

body.dark-mode .prod-value {
    color: #5dade2;
}

body.dark-mode .prod-subtotal {
    color: #58d68d;
}

body.dark-mode .prod-multiplier {
    color: #bb8fce;
}

body.dark-mode .prod-total {
    color: #ec7063;
    text-decoration-color: rgba(236, 112, 99, 0.3);
}

/* Resource Status Indicators */
.resource-status {
    display: inline-block;
    padding: 4px 12px;
    margin-left: 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.resource-status:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Status Idle - Gray (No KPS demand) */
.resource-status.status-idle {
    background: #95a5a6;
    color: white;
    border: 1px solid #7f8c8d;
}

/* Status Critical - Dark Red (Production < 50% of demand) */
.resource-status.status-critical {
    background: #c0392b;
    color: white;
    border: 1px solid #a93226;
    animation: pulse-critical 1s infinite;
}

/* Status Deficit - Red (Production < demand) */
.resource-status.status-deficit {
    background: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
}

/* Status Bottleneck - Yellow (Production barely meets demand) */
.resource-status.status-bottleneck {
    background: #f39c12;
    color: white;
    border: 1px solid #d68910;
}

/* Status Balanced - Light Green (Production comfortably meets demand) */
.resource-status.status-balanced {
    background: #58d68d;
    color: white;
    border: 1px solid #27ae60;
}

/* Status OK - Green (Good surplus) */
.resource-status.status-ok {
    background: #27ae60;
    color: white;
    border: 1px solid #229954;
}

/* Status Surplus - Bright Green (Large surplus) */
.resource-status.status-surplus {
    background: #2ecc71;
    color: white;
    border: 1px solid #27ae60;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.3);
}

/* Dark mode adjustments */
body.dark-mode .resource-status {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-mode .resource-status.status-idle {
    background: #7f8c8d;
    border-color: #5d6d7e;
}

body.dark-mode .resource-status.status-critical {
    background: #a93226;
    border-color: #922b21;
}

body.dark-mode .resource-status.status-deficit {
    background: #c0392b;
    border-color: #a93226;
}

body.dark-mode .resource-status.status-bottleneck {
    background: #d68910;
    border-color: #b9770e;
}

body.dark-mode .resource-status.status-balanced {
    background: #27ae60;
    border-color: #229954;
}

body.dark-mode .resource-status.status-ok {
    background: #229954;
    border-color: #1e8449;
}

body.dark-mode .resource-status.status-surplus {
    background: #27ae60;
    border-color: #229954;
    box-shadow: 0 0 15px rgba(39, 174, 96, 0.4);
}

/* Pulse animation for critical status */
@keyframes pulse-critical {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.demand-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Mystery Box Reward Styling */
.delivery-results li {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: fadeInUp 0.5s ease-out;
}

.delivery-results li:nth-child(2) {
    animation-delay: 0.2s;
}

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

/* Mystery box specific styling */
.delivery-results li:has(🎁) {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

.demand-label {
    font-size: 16px;
    color: #666;
}

.demand-value {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

/* Action Center */
.action-center {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

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

.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.cook-btn {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

.sell-btn {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

.action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.action-btn:active {
    transform: translateY(-2px);
}

.btn-icon {
    font-size: 48px;
}

.btn-text {
    font-size: 20px;
    font-weight: bold;
    color: white;
}

.btn-hint {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Enhanced Auto Cook Toggle */
.auto-cook-toggle-container {
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.toggle-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.toggle-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.toggle-label {
    font-size: 18px;
    font-weight: bold;
    color: #2d3748;
}

.toggle-description {
    font-size: 14px;
    color: #666;
}

.cooking-bars-section {
    margin-top: 20px;
}

/* ===================== WELCOME MODAL ===================== */
.welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.welcome-modal.hidden {
    display: none;
}

.welcome-content {
    background: linear-gradient(135deg, #fff 0%, #fef5e7 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.5s ease-out;
}

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

.welcome-content h2 {
    color: #d35400;
    margin-bottom: 10px;
    font-size: 28px;
}

.welcome-subtitle {
    color: #666;
    font-style: italic;
    margin-bottom: 30px;
}

.name-input-container {
    margin-bottom: 30px;
}

.name-input-container label {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

#shopNameInput {
    width: 100%;
    padding: 15px;
    font-size: 20px;
    border: 2px solid #f39c12;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
}

#shopNameInput:focus {
    outline: none;
    border-color: #d35400;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.name-hint {
    font-size: 14px;
    color: #888;
    margin-top: 8px;
}

.name-suggestions {
    margin-bottom: 30px;
}

.name-suggestions p {
    margin-bottom: 15px;
    color: #666;
}

.suggestion-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.suggestion-btn {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.suggestion-btn:hover {
    background: #e9ecef;
    border-color: #f39c12;
    transform: translateY(-2px);
}

.start-game-btn {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.3);
}

.start-game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(243, 156, 18, 0.4);
}

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

/* Drinks Welcome Modal Styling */
.welcome-content.drinks-themed {
    background: linear-gradient(135deg, #fff 0%, #e3f2fd 100%);
    position: relative;
    overflow: hidden;
}

.welcome-content.drinks-themed::before {
    content: '🥤';
    position: absolute;
    top: -50px;
    right: -50px;
    font-size: 200px;
    opacity: 0.1;
    transform: rotate(-15deg);
}

.welcome-content.drinks-themed h2 {
    color: #0288d1;
    margin-bottom: 10px;
}

.welcome-content.drinks-themed .welcome-subtitle {
    color: #0277bd;
    font-size: 18px;
    margin-bottom: 30px;
}

.achievement-banner {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(224, 247, 250, 0.9) 100%);
    border: 2px solid #4fc3f7;
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.3);
}

.achievement-item {
    font-size: 16px;
    color: #0277bd;
    font-weight: bold;
    /* Force crisp text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

#drinksNameInput {
    background: white;
    border: 3px solid #4fc3f7;
    border-radius: 15px;
    padding: 20px;
    font-size: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(79, 195, 247, 0.2);
}

#drinksNameInput:focus {
    outline: none;
    border-color: #0288d1;
    box-shadow: 0 0 0 5px rgba(79, 195, 247, 0.3);
    transform: scale(1.02);
}

.drinks-start {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border: none;
    padding: 20px 40px;
    font-size: 22px;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(79, 195, 247, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto;
    margin-top: 20px;
}

.drinks-start:hover {
    background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(79, 195, 247, 0.4);
}

.drinks-start:active {
    transform: translateY(-1px);
}

.drinks-start .btn-icon {
    font-size: 24px;
}

.drinks-start .btn-text {
    font-size: 20px;
}

/* Dark mode for drinks welcome modal */
body.dark-mode .welcome-content.drinks-themed {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
}

body.dark-mode .welcome-content.drinks-themed::before {
    opacity: 0.05;
}

body.dark-mode .welcome-content.drinks-themed h2 {
    color: #4fc3f7;
}

body.dark-mode .welcome-content.drinks-themed .welcome-subtitle {
    color: #81c9f5;
}

body.dark-mode #drinksNameInput {
    background: #374151;
    color: #e0e0e0;
    border-color: #4fc3f7;
}

body.dark-mode #drinksNameInput::placeholder {
    color: #9ca3af;
}

body.dark-mode #drinksNameInput:focus {
    background: #4a5568;
    box-shadow: 0 0 0 5px rgba(79, 195, 247, 0.2);
}

body.dark-mode .drinks-start {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(79, 195, 247, 0.4);
}

body.dark-mode .drinks-start:hover {
    background: linear-gradient(135deg, #29b6f6 0%, #0288d1 100%);
    box-shadow: 0 8px 30px rgba(79, 195, 247, 0.5);
}

/* ===================== GLOBAL STYLES / RESET ===================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f2f2f2;
    color: #333;
    padding: 20px;
    text-align: center;
    transition: background 0.5s, color 0.5s;
}

h1 {
    color: #d35400;
    margin-bottom: 10px;
    font-size: 3em;
    margin-top: 0;
    text-align: center;
}

/* THEME (Dark/Light) */
body.dark-mode {
    background: #1e1e1e;
    color: #ccc;
}

/* Main Tab Dark Mode */
body.dark-mode .main-hero {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode .stat-card {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .stat-card .stat-label {
    color: #a0aec0;
}

body.dark-mode .stat-card .stat-value {
    color: #e2e8f0;
}

body.dark-mode .resources-section,
body.dark-mode .action-center {
    background: #2d3748;
}

body.dark-mode .section-title {
    color: #e2e8f0;
}

body.dark-mode .resource-card {
    background: #374151;
}

body.dark-mode .resource-card:hover {
    background: #4a5568;
}

body.dark-mode .resource-name {
    color: #cbd5e0;
}

body.dark-mode .resource-amount {
    color: #e2e8f0;
}

body.dark-mode .resource-storage {
    color: #a0aec0;
}

body.dark-mode .resource-bar {
    background: #4a5568;
}

body.dark-mode .production-status {
    background: #374151;
}

body.dark-mode .production-breakdown {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(52, 152, 219, 0.3);
}

body.dark-mode .breakdown-title {
    color: #5dade2;
}

body.dark-mode .breakdown-item {
    background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .breakdown-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Storage card styling */
.storage-card {
    background: linear-gradient(135deg, rgba(243, 156, 18, 0.1) 0%, rgba(230, 126, 34, 0.1) 100%);
    border: 2px solid #f39c12;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin-top: 20px;
}

.storage-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

body.dark-mode .storage-card {
    background: linear-gradient(135deg, rgba(214, 137, 16, 0.2) 0%, rgba(186, 111, 30, 0.2) 100%);
    border-color: #d68910;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.storage-icon {
    font-size: 48px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

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

.storage-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
    font-weight: 600;
}

.storage-value {
    font-size: 36px;
    font-weight: bold;
    color: #f39c12;
}

.storage-breakdown {
    font-size: 14px;
    color: #4a5568;
}

body.dark-mode .storage-label {
    color: #a0aec0;
}

body.dark-mode .storage-value {
    color: #f39c12;
}

body.dark-mode .storage-breakdown {
    color: #cbd5e0;
}

.storage-stat {
    font-weight: 700;
    color: #2d3748;
    background: rgba(243, 156, 18, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    margin: 0 2px;
}

body.dark-mode .storage-stat {
    color: #f39c12;
    background: rgba(243, 156, 18, 0.25);
}

body.dark-mode .breakdown-details {
    color: #f0f0f0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

body.dark-mode .demand-label {
    color: #a0aec0;
}

body.dark-mode .auto-cook-toggle-container {
    background: linear-gradient(135deg, #374151 0%, #4a5568 100%);
}

body.dark-mode .toggle-label {
    color: #e2e8f0;
}

body.dark-mode .toggle-description {
    color: #a0aec0;
}

/* GAME WRAPPER */
#game {
    background: #fff;
    width: 1000px;
    max-width: 95%;
    min-height: 1200px;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
    transition: background 0.5s;
}

body.dark-mode #game {
    background: #2a2a2a;
}

/* NAVIGATION TABS */
nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #fafafa;
    border-bottom: 1px solid #eee;
}

nav button {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    padding: 14px 20px;
    margin: 0 3px;
    transition: background 0.3s;
    border-radius: 8px 8px 0 0;
}

nav button:hover {
    background: #efefef;
}

nav button.active {
    background: #fff;
    border-bottom: 2px solid #d35400;
    font-weight: bold;
}

body.dark-mode nav button.active {
    background: #3a3a3a;
}

/* TABS/SECTIONS */
.section {
    display: none;
    padding: 20px;
    text-align: left;
    min-height: 600px;
}

.section.active {
    display: block;
}

/* MAIN SECTION */
#main-section {
    text-align: center;
}

.stats {
    margin-bottom: 15px;
    font-size: 16px;
}

.stat-row {
    margin: 4px 0;
}

.resources-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 10px;
}

/* Production info styling */
.production-info {
    margin-top: 10px;
    padding: 10px;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 8px;
    font-size: 14px;
}

.dark-mode .production-info {
    background: rgba(52, 152, 219, 0.2);
}

.production-rates {
    margin-bottom: 5px;
    color: #2980b9;
}

.dark-mode .production-rates {
    color: #5dade2;
}

.demand-status {
    font-weight: bold;
}

.demand-status.balanced {
    color: #27ae60;
}

.demand-status.shortage {
    color: #e74c3c;
}

.demand-status.surplus {
    color: #f39c12;
}

/* MANUAL COOK PROGRESS BARS */
.manual-cook-bar {
    margin: 10px auto;
    width: 60%;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    height: 20px;
    position: relative;
}

.manual-cook-progress {
    background: #d35400;
    height: 100%;
    width: 0%;
    transition: width 0.1s linear;
}

/* BUTTONS */
button.game-btn {
    padding: 8px 16px;
    margin: 10px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    transition: background 0.3s, transform 0.1s;
    background: #fdfdfd;
}

button.game-btn:hover {
    background: #efefef;
    transform: translateY(-2px);
}

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

.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* PARTICLE EFFECTS */
.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #d35400;
    border-radius: 50%;
    pointer-events: none;
    animation: flyUp 1s forwards ease-out;
}

@keyframes flyUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-80px) scale(0.5);
        opacity: 0;
    }
}

/* SCREEN SHAKE */
.shake {
    animation: shakeAnim 0.4s;
}

@keyframes shakeAnim {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(2px, -2px); }
    50% { transform: translate(-2px, 2px); }
    75% { transform: translate(2px, 2px); }
}

/* FLOATING TEXT */
.floating-text {
    position: absolute;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
    animation: floatUp 2s forwards ease-out;
    z-index: 1000;
}

.floating-text.gold {
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

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

/* UPGRADES */
.upgrade-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

body.dark-mode .upgrade-item {
    background: #2d2d2d;
    border-color: #444;
}

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

.upgrade-item.cant-afford {
    opacity: 0.6;
    cursor: not-allowed;
}

.upgrade-item.maxed {
    background: #e8f4ff;
    border-color: #a8c8ff;
}

body.dark-mode .upgrade-item.maxed {
    background: #2c3e50;
    border-color: #3498db;
}

/* TOWN SECTION (Building Grid) */
#townGridContainer {
    background: transparent;
}

.town-cell {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 1px dashed #ccc;
}

.building {
    background: #ecdcb0;
    border: 1px solid #bba;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    text-align: center;
}

/* Auto Cook Toggle */
.auto-cook-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(243, 156, 18, 0.3);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 30px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background-color: #f39c12;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(30px);
}

.toggle-label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

body.dark-mode .auto-cook-toggle-container {
    background: rgba(243, 156, 18, 0.15);
    border-color: rgba(243, 156, 18, 0.4);
}

body.dark-mode .toggle-label {
    color: #e0e0e0;
}

body.dark-mode .toggle-slider {
    background-color: #555;
}

body.dark-mode .toggle-switch input:checked + .toggle-slider {
    background-color: #f39c12;
}

/* ACHIEVEMENTS TAB BEAUTIFUL UI */
.achievement-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    /* Fix blurry text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
}

.dark-mode .achievement-stats-card {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
}

.stats-icon {
    font-size: 80px;
    animation: bounce 2s infinite;
}

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

.stats-info {
    flex: 1;
}

.stats-info h3 {
    margin: 0 0 20px 0;
    font-size: 28px;
}

.achievement-progress {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.progress-text {
    font-size: 20px;
    font-weight: bold;
}

.achievement-progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700, #ffed4e);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(255,215,0,0.5);
}

.percentage-text {
    font-size: 18px;
    opacity: 0.9;
}

/* Achievement Categories */
.achievement-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    background: #f0f0f0;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    color: #333;
}

.dark-mode .category-btn {
    background: #4a5568;
    color: #e2e8f0;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    /* Fix blurry text in grid */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.achievement-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    /* Fix blurry text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.dark-mode .achievement-item {
    background: #2d3748;
    color: #e2e8f0;
}

.achievement-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: #e0e0e0;
}

.achievement-item.completed::before {
    background: linear-gradient(90deg, #48bb78, #38a169);
}

.achievement-item:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.achievement-item.completed {
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border: 2px solid #48bb78;
}

.dark-mode .achievement-item.completed {
    background: linear-gradient(135deg, #1a442e 0%, #234e3c 100%);
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.achievement-icon {
    font-size: 40px;
    filter: grayscale(100%);
    opacity: 0.3;
    transition: all 0.3s ease;
}

.achievement-item.completed .achievement-icon {
    filter: grayscale(0%);
    opacity: 1;
    animation: sparkle 1s ease;
}

@keyframes sparkle {
    0% { transform: scale3d(1, 1, 1) rotate(0deg); }
    50% { transform: scale3d(1.2, 1.2, 1) rotate(180deg); }
    100% { transform: scale3d(1, 1, 1) rotate(360deg); }
}

.achievement-content {
    flex: 1;
}

.achievement-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    /* Fix blurry text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.dark-mode .achievement-name {
    color: #e2e8f0;
}

.achievement-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
    /* Fix blurry text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.dark-mode .achievement-description {
    color: #a0aec0;
}

.achievement-progress-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.progress-bar-mini {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.dark-mode .progress-bar-mini {
    background: #4a5568;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
}

.achievement-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.rarity-common {
    background: #e0e0e0;
    color: #333;
}

.rarity-rare {
    background: #3182ce;
    color: white;
}

.rarity-epic {
    background: #805ad5;
    color: white;
}

.rarity-legendary {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
}

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #333;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    z-index: 10000;
    text-align: center;
    transition: transform 0.5s ease-out;
}

.achievement-popup.show {
    transform: translate(-50%, -50%) scale(1);
}

.achievement-popup .achievement-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

/* SKILL TREE - Enhanced Design */
.skill-tree-section {
    margin-top: 30px;
    background: linear-gradient(135deg, #f5f7fa, #e9ecef);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

body.dark-mode .skill-tree-section {
    background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
}

.skill-tree-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

body.dark-mode .skill-tree-header {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.skill-icon {
    font-size: 60px;
    margin-right: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.skill-info {
    flex: 1;
}

.skill-info h3 {
    margin: 0;
    font-size: 28px;
    color: #333;
}

body.dark-mode .skill-info h3 {
    color: #fff;
}

.skill-subtitle {
    color: #666;
    margin: 5px 0 15px 0;
}

body.dark-mode .skill-subtitle {
    color: #aaa;
}

.skill-points-display {
    display: inline-flex;
    align-items: center;
    background: white;
    padding: 10px 20px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .skill-points-display {
    background: #3a3a3a;
}

.points-icon {
    font-size: 24px;
    margin-right: 10px;
}

.points-label {
    font-weight: 600;
    margin-right: 10px;
    color: #666;
}

body.dark-mode .points-label {
    color: #ccc;
}

.points-value {
    font-size: 24px;
    font-weight: bold;
    color: #f39c12;
}

/* Skill Filter Controls */
.skill-filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 30px 0;
    align-items: center;
}

.skill-filter-btn {
    padding: 10px 20px;
    border: 2px solid #e0e0e0;
    background: white;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-mode .skill-filter-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.skill-filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.skill-filter-btn.active {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border-color: #f39c12;
}

body.dark-mode .skill-filter-btn.active {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-color: #f39c12;
}

.skill-categories {
    display: grid;
    gap: 30px;
}

.skill-category {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

body.dark-mode .skill-category {
    background: #2a2a2a;
}

.category-title {
    font-size: 20px;
    margin: 0 0 20px 0;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

body.dark-mode .category-title {
    color: #fff;
    border-bottom-color: #444;
}

.skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

/* Individual Skill Nodes */
.skill-node {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark-mode .skill-node {
    background: linear-gradient(135deg, #3a3a3a, #2d2d2d);
    border-color: #555;
}

.skill-node:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.skill-node.can-buy {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-color: #28a745;
    animation: pulse-glow 2s infinite;
}

body.dark-mode .skill-node.can-buy {
    background: linear-gradient(135deg, #1a3a1a, #2d5a2d);
    border-color: #28a745;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2); }
    50% { box-shadow: 0 4px 25px rgba(40, 167, 69, 0.4); }
    100% { box-shadow: 0 4px 15px rgba(40, 167, 69, 0.2); }
}

.skill-node.maxed {
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    border-color: #f39c12;
    cursor: not-allowed;
}

body.dark-mode .skill-node.maxed {
    background: linear-gradient(135deg, #4a4a4a, #3a3a3a);
    border-color: #666;
}

.skill-node h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    color: #333;
}

body.dark-mode .skill-node h4 {
    color: #fff;
}

.skill-node p {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

body.dark-mode .skill-node p {
    color: #ccc;
}

.skill-level {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.skill-level-text {
    font-weight: 600;
    margin-right: 10px;
}

.skill-level-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

body.dark-mode .skill-level-bar {
    background: #444;
}

.skill-level-fill {
    height: 100%;
    background: linear-gradient(90deg, #f39c12, #e67e22);
    transition: width 0.3s ease;
}

.skill-cost {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
    color: #495057;
    display: inline-block;
}

body.dark-mode .skill-cost {
    background: #3a3a3a;
    color: #ccc;
}

.skill-node.can-buy .skill-cost {
    background: #28a745;
    color: white;
}

/* QUESTS SECTION - Beautiful Quest UI */
.quests-header-container {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.quests-hero {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
}

.quests-hero .hero-icon {
    font-size: 60px;
    margin-right: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
}

.quests-hero .hero-content h2 {
    color: white;
    margin: 0;
    font-size: 32px;
}

.quests-hero .hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    margin: 5px 0 0 0;
    font-size: 16px;
}

.quest-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quest-stat {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(10px);
}

.quest-stat-icon {
    font-size: 24px;
    margin-right: 12px;
}

.quest-stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin-right: auto;
}

.quest-stat-value {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.quests-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.quest-section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

body.dark-mode .quest-section-title {
    color: #fff;
    border-bottom-color: #444;
}

/* Quest Cards */
.quest-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.quest-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

body.dark-mode .quest-card {
    background: #2a2a2a;
}

.quest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.quest-card.completed {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border: 2px solid #28a745;
}

body.dark-mode .quest-card.completed {
    background: linear-gradient(135deg, #1a3a1a, #2d5a2d);
}

.quest-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.quest-icon {
    font-size: 32px;
    margin-right: 15px;
}

.quest-info {
    flex: 1;
}

.quest-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #333;
}

body.dark-mode .quest-title {
    color: #fff;
}

.quest-description {
    color: #666;
    font-size: 14px;
    margin: 0;
}

body.dark-mode .quest-description {
    color: #ccc;
}

.quest-progress {
    margin: 15px 0;
}

.quest-progress-bar {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

body.dark-mode .quest-progress-bar {
    background: #444;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease;
    position: relative;
}

.quest-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.quest-progress-text {
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

body.dark-mode .quest-progress-text {
    color: #ccc;
}

.quest-rewards {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.quest-reward {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

body.dark-mode .quest-reward {
    background: #3a3a3a;
}

.reward-icon {
    font-size: 16px;
}

/* Rewards Preview */
.rewards-grid {
    display: grid;
    gap: 15px;
}

.reward-preview-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

body.dark-mode .reward-preview-card {
    background: linear-gradient(135deg, #3a3a3a, #2d2d2d);
}

.reward-preview-card:hover {
    transform: scale(1.05);
}

.reward-preview-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.reward-preview-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

body.dark-mode .reward-preview-label {
    color: #ccc;
}

.reward-preview-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

body.dark-mode .reward-preview-value {
    color: #fff;
}

/* Quest Refresh Button */
.quest-refresh-container {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 16px;
}

body.dark-mode .quest-refresh-container {
    background: #2a2a2a;
}

.quest-refresh-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.quest-refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.refresh-icon {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.quest-refresh-btn:hover .refresh-icon {
    transform: rotate(180deg);
}

.refresh-cost {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
}

.refresh-hint {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

body.dark-mode .refresh-hint {
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quests-container {
        grid-template-columns: 1fr;
    }
    
    .quest-stats-summary {
        grid-template-columns: 1fr;
    }
}

/* STATS SECTION - Beautiful Dashboard UI */
#stats-section {
    padding: 30px;
}

/* Summary Cards */
.stats-summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    border-radius: 16px;
    padding: 20px;
    color: white;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: card-fade-in 0.6s ease-out;
}

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

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.stat-card:hover::before {
    right: -100%;
}

.gradient-orange {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8787 100%);
}

.gradient-green {
    background: linear-gradient(135deg, #51cf66 0%, #94d82d 100%);
}

.gradient-blue {
    background: linear-gradient(135deg, #339af0 0%, #74c0fc 100%);
}

.gradient-purple {
    background: linear-gradient(135deg, #845ef7 0%, #9775fa 100%);
}

.stat-card-icon {
    font-size: 48px;
    opacity: 0.3;
    position: absolute;
    right: 20px;
    top: 20px;
    animation: icon-float 3s ease-in-out infinite;
}

@keyframes icon-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.stat-card-content {
    position: relative;
    z-index: 1;
}

.stat-card-value {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-card-label {
    font-size: 14px;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Gradient backgrounds for stat cards */
#stats-section .stat-card.gradient-orange,
.gradient-orange {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
}

#stats-section .stat-card.gradient-green,
.gradient-green {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

#stats-section .stat-card.gradient-blue,
.gradient-blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
}

#stats-section .stat-card.gradient-purple,
.gradient-purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
}

/* Make sure stats section stat-card colors override main section styles */
#stats-section .stat-card {
    border: none;
}

/* Gradient text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

.gradient-text-gold {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: bold;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stats-panel {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-mode .stats-panel {
    background: #2d3748;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.stats-panel:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.stats-panel h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dark-mode .stats-panel h3 {
    color: #e0e0e0;
}

.panel-icon {
    font-size: 24px;
}

/* Metrics */
.stats-metrics {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.metric-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.dark-mode .metric-item {
    background: #1a202c;
}

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

.metric-value {
    font-weight: bold;
    color: #667eea;
}

.dark-mode .metric-value {
    color: #9f7aea;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.dark-mode .progress-bar-container {
    background: #4a5568;
}

.progress-bar-fill {
    height: 100%;
    transition: width 0.5s ease;
    border-radius: 4px;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.resource-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.2s ease;
}

.dark-mode .resource-item {
    background: #1a202c;
}

.resource-item:hover {
    transform: scale(1.05);
}

.resource-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.resource-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dark-mode .resource-label {
    color: #a0aec0;
}

.resource-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.dark-mode .resource-value {
    color: #e0e0e0;
}

/* Progression Stats */
.progression-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.progression-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.dark-mode .progression-item {
    background: #1a202c;
}

.progression-item:hover {
    background: #e9ecef;
}

.dark-mode .progression-item:hover {
    background: #2d3748;
}

.progression-icon {
    font-size: 24px;
}

.progression-info {
    flex: 1;
}

.progression-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.dark-mode .progression-label {
    color: #a0aec0;
}

.progression-value {
    font-size: 16px;
    font-weight: bold;
}

.mini-progress-bar {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 5px;
}

.dark-mode .mini-progress-bar {
    background: #4a5568;
}

.mini-progress-fill {
    height: 100%;
    transition: width 0.5s ease;
}

/* Multipliers */
.multiplier-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.dark-mode .multiplier-list {
    background: #1a202c;
}

.multiplier-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.multiplier-item.total {
    padding-top: 15px;
    font-size: 18px;
    font-weight: bold;
}

.multiplier-label {
    color: #666;
}

.dark-mode .multiplier-label {
    color: #a0aec0;
}

.multiplier-value {
    font-weight: bold;
    font-size: 16px;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-text-gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.multiplier-divider {
    height: 1px;
    background: #dee2e6;
    margin: 10px 0;
}

.dark-mode .multiplier-divider {
    background: #4a5568;
}

/* Milestones Timeline */
.milestones-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dark-mode .milestones-section {
    background: #2d3748;
}

.milestones-section h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.milestones-timeline {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.milestone-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
    animation: milestone-slide-in 0.5s ease-out;
}

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

.dark-mode .milestone-item {
    background: #1a202c;
}

.milestone-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.milestone-icon {
    font-size: 32px;
    min-width: 50px;
    text-align: center;
}

.milestone-content {
    flex: 1;
}

.milestone-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 3px;
}

.milestone-time {
    font-size: 12px;
    color: #666;
}

.dark-mode .milestone-time {
    color: #a0aec0;
}

.no-milestones {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.dark-mode .no-milestones {
    color: #a0aec0;
}

/* Animations for stats */
@keyframes number-change {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #667eea; }
    100% { transform: scale(1); }
}

.stat-card-value,
.metric-value,
.resource-value,
.progression-value {
    transition: all 0.3s ease;
}

/* Hover animations for interactive elements */
.stats-panel {
    cursor: default;
}

.metric-item:hover .metric-value {
    animation: number-change 0.5s ease;
}

.resource-item:hover .resource-value {
    color: #667eea;
}

/* Progress bar animations */
.progress-bar-fill,
.mini-progress-fill {
    position: relative;
    overflow: hidden;
}

.progress-bar-fill::after,
.mini-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #stats-section {
        padding: 20px;
    }
    
    .stats-summary-cards {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card-value {
        font-size: 22px;
    }
    
    .stat-card-icon {
        font-size: 36px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .progression-stats {
        grid-template-columns: 1fr;
    }
    
    .resource-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    
    .milestone-item {
        padding: 12px;
    }
    
    .milestone-icon {
        font-size: 24px;
        min-width: 40px;
    }
}

/* QUESTS */
.quest-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fafafa;
    margin: 6px 0;
    padding: 10px;
    transition: background 0.5s;
}

.quest-item.completed {
    background: #e3ffe3;
}

/* EVENT POPUP (GLOBAL) */
.event-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 300px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: 2px solid #444;
    padding: 16px;
    z-index: 9999;
    border-radius: 8px;
}

.hidden {
    display: none;
}

/* NOTIFICATIONS */
.notification-area {
    position: fixed;
    top: 10px;
    right: 10px;
    z-index: 9999;
    width: 300px;
    pointer-events: none;
}

.notification {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 10px;
    max-width: 300px;
    text-align: left;
    animation: slideIn 0.3s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    pointer-events: auto;
    transition: opacity 0.5s;
}

.notification.success {
    background: rgba(46, 204, 113, 0.9);
}

.notification.error {
    background: rgba(231, 76, 60, 0.9);
}

.notification.info {
    background: rgba(52, 152, 219, 0.9);
}

@keyframes slideIn {
    from { 
        transform: translateX(100%); 
        opacity: 0; 
    }
    to { 
        transform: translateX(0); 
        opacity: 1; 
    }
}

/* ===================== MINIGAME SECTION ===================== */
/* Minigame Header */
.minigame-header-container {
    margin-bottom: 40px;
}

.minigame-hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 20px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(245, 87, 108, 0.3);
    position: relative;
    overflow: hidden;
}

.minigame-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.minigame-hero .hero-icon {
    font-size: 72px;
    animation: bounce 2s ease-in-out infinite;
}

.minigame-hero .hero-content h2 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

/* Minigames Grid */
.minigames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Minigame Card */
.minigame-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
}

body.dark-mode .minigame-card {
    background: #2d3748;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.minigame-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #f093fb, #f5576c);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.minigame-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.minigame-card:hover::before {
    transform: scaleX(1);
}

/* Minigame Icon */
.minigame-icon {
    font-size: 64px;
    margin-bottom: 20px;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

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

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

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

/* Minigame Content */
.minigame-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
    font-weight: 700;
}

body.dark-mode .minigame-card h3 {
    color: #e0e0e0;
}

.minigame-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

body.dark-mode .minigame-description {
    color: #9ca3af;
}

/* Minigame Rewards */
.minigame-rewards {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.reward-badge {
    background: linear-gradient(135deg, #667eea20, #764ba220);
    color: #667eea;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

body.dark-mode .reward-badge {
    background: linear-gradient(135deg, #667eea30, #764ba230);
    color: #9ca3af;
}

/* Minigame Stats */
.minigame-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
}

body.dark-mode .minigame-stats {
    background: rgba(255, 255, 255, 0.05);
}

.minigame-stats .stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #667eea;
}

body.dark-mode .stat-value {
    color: #9ca3af;
}

/* Minigame Play Button */
.minigame-play-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.minigame-play-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

/* Active Minigame Container */
.minigame-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

body.dark-mode .minigame-container {
    background: #2d3748;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

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

/* MINIGAME - Preserved existing styles */
#minigameContainer p {
    margin: 10px 0;
}

/* Frenzy Mode Styles */
.frenzy-active {
    background: rgba(255, 0, 0, 0.1);
    border-radius: 8px;
    padding: 20px;
    transition: all 0.3s;
}

body.frenzy-mode {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { background-color: #f2f2f2; }
    50% { background-color: #ffe6e6; }
    100% { background-color: #f2f2f2; }
}

.frenzy-btn {
    font-size: 24px;
    padding: 20px 40px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.1s;
}

.frenzy-btn:hover {
    transform: scale(1.05);
    background: #ff6666;
}

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

.frenzy-score {
    font-size: 20px;
    font-weight: bold;
    color: #ff4444;
}

.frenzy-multiplier {
    font-size: 18px;
    color: #666;
    transition: all 0.2s;
}

.frenzy-multiplier.combo-active {
    color: #ff4444;
    transform: scale(1.1);
}

.frenzy-results {
    text-align: center;
    animation: fadeIn 0.5s;
}

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

.final-score {
    font-size: 24px;
    color: #ff4444;
    margin: 10px 0;
}

.final-reward {
    font-size: 20px;
    color: #2ecc71;
    margin: 10px 0;
}

.combo-stats {
    font-size: 18px;
    color: #666;
    margin: 10px 0;
}

/* Resource Warning Improvements */
#resourceWarning {
    padding: 10px;
    border-radius: 6px;
    margin: 10px 0;
    font-weight: bold;
    transition: all 0.3s;
}

#resourceWarning.warning {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff4444;
}

#resourceWarning.success {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid #2ecc71;
}

/* PRESTIGE & ASCENSION STYLES */
.tier-info {
    background: #f5f5f5;
    border-radius: 6px;
    padding: 10px;
    margin: 10px 0;
    border-left: 4px solid #d35400;
}

body.dark-mode .tier-info {
    background: #333;
    border-left: 4px solid #ff6600;
}

.points-counter {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0;
    color: #d35400;
}

.prestige-upgrade, .ascension-upgrade {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

body.dark-mode .prestige-upgrade,
body.dark-mode .ascension-upgrade {
    background: #2d2d2d;
    border-color: #444;
}

.prestige-upgrade:hover, .ascension-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.prestige-upgrade.can-buy {
    border-color: #d35400;
    background: #fff5f0;
}

body.dark-mode .prestige-upgrade.can-buy {
    background: #3a2a1a;
    border-color: #d35400;
}

.prestige-upgrade.unaffordable, .ascension-upgrade.unaffordable {
    opacity: 0.6;
    cursor: not-allowed;
}

.prestige-upgrade.maxed, .ascension-upgrade.maxed {
    background: #e8f4ff;
    border-color: #a8c8ff;
}

body.dark-mode .prestige-upgrade.maxed,
body.dark-mode .ascension-upgrade.maxed {
    background: #2c3e50;
    border-color: #3498db;
}

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

.upgrade-name {
    font-weight: bold;
    font-size: 16px;
}

.upgrade-level {
    background: #f0f0f0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 12px;
}

body.dark-mode .upgrade-level {
    background: #3a3a3a;
}

.upgrade-description {
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

body.dark-mode .upgrade-description {
    color: #aaa;
}

.upgrade-cost {
    font-size: 14px;
    font-weight: bold;
    color: #d35400;
}

.next-tier-info {
    margin-top: 20px;
    padding: 10px;
    background: #fffcf0;
    border: 1px dashed #ffd700;
    border-radius: 6px;
}

body.dark-mode .next-tier-info {
    background: #3c3a30;
    border-color: #9c8c00;
}

.prestige-tab, .ascension-tab {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.prestige-tab-content, .ascension-tab-content {
    flex: 1;
    min-width: 300px;
}

.prestige-info, .ascension-info {
    padding: 15px;
    background: rgba(211, 84, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

body.dark-mode .prestige-info,
body.dark-mode .ascension-info {
    background: rgba(255, 102, 0, 0.2);
}

.reset-button {
    background: linear-gradient(to bottom, #ff7e29, #d35400);
    color: white;
    border: none;
    padding: 15px 25px;
    font-size: 18px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: block;
    margin: 0 auto 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.reset-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.reset-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.reset-button.disabled {
    background: #999;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.progress-indicator {
    height: 6px;
    background: #eee;
    border-radius: 3px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: #d35400;
    width: 0%;
    transition: width 0.3s;
}

.bonus-label {
    font-size: 16px;
    color: #d35400;
    margin: 10px 0;
    font-weight: bold;
}

.bonus-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

body.dark-mode .bonus-description {
    color: #aaa;
}

/* Help Button and Popup */
.help-button {
    background: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 100;
}


/* Help Bot Menu Styles - Kebab Theme */
.help-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
}

.help-menu-content {
    background: linear-gradient(to bottom, #2c2416 0%, #1a1611 100%);
    border: 3px solid #f39c12;
    border-radius: 15px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 0 30px rgba(243, 156, 18, 0.5);
}

.help-menu-content h3 {
    color: #f39c12;
    font-size: 32px;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    font-weight: bold;
}

.help-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #d35400;
    color: white;
    border: 2px solid #e67e22;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.help-close-btn:hover {
    background: #e67e22;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5);
}

.help-search {
    margin: 15px 0 25px 0;
}

.help-search input {
    width: 100%;
    padding: 14px 24px;
    border: 2px solid #4a3f2a;
    border-radius: 25px;
    font-size: 16px;
    transition: all 0.3s;
    background: rgba(0,0,0,0.5);
    color: #f39c12;
}

.help-search input::placeholder {
    color: #8b6914;
}

.help-search input:focus {
    outline: none;
    border-color: #f39c12;
    background: rgba(0,0,0,0.7);
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.3);
}

.help-suggestions {
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(243, 156, 18, 0.1);
    border-radius: 12px;
    border: 2px solid #4a3f2a;
}

.help-categories {
    margin: 20px 0;
}

.help-suggestions h4, .help-categories h4 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.help-suggestion-btn {
    background: linear-gradient(135deg, #f39c12 0%, #d35400 100%);
    color: white;
    border: 2px solid #e67e22;
    padding: 12px 24px;
    margin: 5px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: bold;
    display: inline-block;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.help-topic-btn {
    background: #4a3f2a;
    color: #f39c12;
    border: 2px solid #6b5a3f;
    padding: 10px 18px;
    margin: 4px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    font-weight: 600;
}

.help-suggestion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.5);
    background: linear-gradient(135deg, #ffa500 0%, #ff6347 100%);
}

.help-topic-btn:hover {
    background: #6b5a3f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    border-color: #f39c12;
}

.help-category {
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(0,0,0,0.4);
    border-radius: 12px;
    border: 2px solid #4a3f2a;
}

.help-category h5 {
    color: #ffa500;
    margin-bottom: 15px;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.help-content-display {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 2px solid #4a3f2a;
}

.help-topic-display {
    animation: fadeIn 0.3s ease;
    background: rgba(0,0,0,0.5);
    padding: 25px;
    border-radius: 12px;
    border: 2px solid #4a3f2a;
}

.help-topic-display h4 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.help-topic-display p {
    color: #ffcc80;
    line-height: 1.7;
    margin-bottom: 20px;
    font-size: 16px;
}

.help-tips {
    background: rgba(243, 156, 18, 0.15);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #f39c12;
}

.help-tips h5 {
    color: #ffa500;
    margin-bottom: 12px;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.help-tips ul {
    margin-left: 20px;
    list-style-type: none;
}

.help-tips li {
    color: #ffcc80;
    margin: 10px 0;
    padding-left: 25px;
    position: relative;
}

.help-tips li:before {
    content: "▸";
    position: absolute;
    left: 0;
    font-size: 18px;
    color: #f39c12;
}

.help-back-btn {
    background: #4a3f2a;
    color: #f39c12;
    border: 2px solid #6b5a3f;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    font-weight: bold;
}

.help-back-btn:hover {
    background: #6b5a3f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.help-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #ffcc80;
}

.help-no-results p {
    margin: 10px 0;
}

.help-no-results strong {
    color: #f39c12;
}

.help-search-results h4 {
    color: #f39c12;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Dark mode maintains kebab theme colors */
body.dark-mode .help-menu-content {
    /* Keep the same dark brown kebab theme */
}

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

.version-button {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 100;
}

.help-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.version-button:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.important-button {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    animation: pulseRed 2s infinite;
}

.important-button:hover {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.5);
}

@keyframes pulseRed {
    0% { box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3); }
    50% { box-shadow: 0 2px 15px rgba(220, 38, 38, 0.6); }
    100% { box-shadow: 0 2px 5px rgba(220, 38, 38, 0.3); }
}

.help-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.help-popup.hidden {
    display: none;
}

.help-popup-content {
    background: white;
    border-radius: 10px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    position: relative;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

.dark-mode .help-popup-content {
    background: #2c3e50;
    color: #ecf0f1;
}

.close-help-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.dark-mode .close-help-btn {
    color: #ecf0f1;
}

.close-help-btn:hover {
    background: rgba(0,0,0,0.1);
}

.help-popup h2 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #e74c3c;
    text-align: center;
}

.help-popup h3 {
    color: #3498db;
    margin-top: 20px;
    margin-bottom: 10px;
}

.dark-mode .help-popup h3 {
    color: #5dade2;
}

.help-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.help-sections section {
    padding: 15px;
    background: rgba(52,152,219,0.1);
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.dark-mode .help-sections section {
    background: rgba(52,152,219,0.2);
}

.help-sections ul {
    margin: 10px 0;
    padding-left: 20px;
}

.help-sections li {
    margin: 5px 0;
    line-height: 1.6;
}

.help-sections strong {
    color: #e74c3c;
}

.dark-mode .help-sections strong {
    color: #e74c3c;
}

/* Enhanced help content styling */
.help-content {
    margin-top: 15px;
}

.help-content p {
    margin: 12px 0;
    line-height: 1.8;
    padding-left: 10px;
}

.help-note {
    display: block;
    font-size: 14px;
    color: #666;
    font-style: italic;
    padding-left: 25px;
    margin-top: 3px;
}

.dark-mode .help-note {
    color: #999;
}

.help-popup p strong {
    font-weight: 600;
    color: #2c3e50;
}

.dark-mode .help-popup p strong {
    color: #ecf0f1;
}

/* Remove default list styling in help sections */
.help-sections ul {
    list-style: none;
    padding-left: 0;
}

/* EVENTS TAB STYLING */
#eventsContainer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.event-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-mode .event-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
}

.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* Season Card */
.season-card {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.season-icon {
    font-size: 60px;
    animation: float 3s ease-in-out infinite;
}

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

.season-info {
    flex: 1;
}

.season-name {
    font-size: 24px;
    font-weight: bold;
    margin: 5px 0;
}

.season-effect {
    font-size: 16px;
    opacity: 0.9;
}

.season-timer {
    margin-top: 15px;
}

.timer-bar {
    width: 100%;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.timer-fill {
    height: 100%;
    background: white;
    transition: width 1s linear;
}

.timer-text {
    font-size: 14px;
    opacity: 0.8;
}

/* Active Event Card */
.active-event-card {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.active-event-card h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.event-active {
    animation: pulse 2s infinite;
}

.event-details {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 10px;
    margin-top: 10px;
}

.event-name {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.event-description {
    font-size: 14px;
    margin-bottom: 10px;
}

.event-timer-display {
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    background: rgba(255,255,255,0.3);
    padding: 10px;
    border-radius: 8px;
}

/* Upcoming Events */
.upcoming-events-card {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.upcoming-events-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.upcoming-event-item {
    background: rgba(255,255,255,0.2);
    padding: 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.upcoming-event-chance {
    background: rgba(255,255,255,0.3);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

/* History Card */
.history-card {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: #333;
}

.event-history-list {
    margin-top: 15px;
}

.history-item {
    background: rgba(255,255,255,0.6);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

.history-time {
    opacity: 0.7;
    font-size: 12px;
}

.no-event, .no-history {
    text-align: center;
    opacity: 0.7;
    font-style: italic;
    padding: 20px;
}

/* Event Cooldown Indicator */
.event-cooldown {
    margin-top: 10px;
    font-size: 14px;
    opacity: 0.8;
}

.cooldown-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.cooldown-fill {
    height: 100%;
    background: rgba(255,255,255,0.7);
    transition: width 1s linear;
}

/* ===================== UPGRADES SECTION ===================== */
/* Upgrades Header Container */
.upgrades-header-container {
    margin-bottom: 40px;
}

/* Upgrades Hero Section */
.upgrades-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.upgrades-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.hero-icon {
    font-size: 72px;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { 
        transform: scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    }
    50% { 
        transform: scale(1.1);
        filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
    }
}

.hero-content h2 {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 20px;
    opacity: 0.95;
    font-weight: 300;
}

/* Upgrade Highlights */
.upgrade-highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.highlight-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    gap: 20px;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

body.dark-mode .highlight-card {
    background: #2d3748;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.highlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #667eea;
}

.highlight-icon {
    font-size: 48px;
    min-width: 60px;
    text-align: center;
}

.highlight-info h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

body.dark-mode .highlight-info h4 {
    color: #e0e0e0;
}

.highlight-info p {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

body.dark-mode .highlight-info p {
    color: #9ca3af;
}

/* Upgrade Header (for the filter/bulk controls) */
.upgrade-header {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

/* Money Display in Upgrades */
.upgrade-money-display {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    transition: transform 0.3s ease;
}

body.dark-mode .upgrade-money-display {
    background: linear-gradient(135deg, #16a085 0%, #1abc9c 100%);
}

.upgrade-money-display:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
}

.money-icon {
    font-size: 24px;
    animation: coin-spin 3s linear infinite;
}

@keyframes coin-spin {
    0% { transform: rotateY(0deg); }
    100% { transform: rotateY(360deg); }
}

.money-label {
    font-weight: 500;
    opacity: 0.9;
}

.money-amount {
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

/* Upgrade Categories */
.upgrade-categories {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Bulk Buy Controls */
.bulk-buy-controls {
    display: flex;
    gap: 10px;
}

.bulk-btn {
    padding: 8px 16px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

body.dark-mode .bulk-btn {
    background: #2a2a2a;
    color: #9ca3af;
    border-color: #4a5568;
}

.bulk-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.2);
}

.bulk-btn.active {
    background: #667eea;
    color: white;
}

body.dark-mode .bulk-btn.active {
    background: #764ba2;
    color: white;
}

/* Upgrades Grid */
.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    animation: grid-fade-in 0.6s ease;
}

/* Upgrade Card */
.upgrade-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

body.dark-mode .upgrade-card {
    background: #2d3748;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.upgrade-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.upgrade-card.cant-afford {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(135deg, #fee 0%, #fdd 100%);
    border-color: #e74c3c;
}

body.dark-mode .upgrade-card.cant-afford {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.2) 0%, rgba(192, 57, 43, 0.2) 100%);
    border-color: #c0392b;
}

.upgrade-card.can-afford {
    background: linear-gradient(135deg, #e8f8e8 0%, #d4f1d4 100%);
    border-color: #27ae60;
}

body.dark-mode .upgrade-card.can-afford {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.2) 0%, rgba(46, 204, 113, 0.2) 100%);
    border-color: #27ae60;
}

.upgrade-card.can-afford:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
    border-color: #2ecc71;
}

.upgrade-card.maxed {
    background: linear-gradient(135deg, #fff9e6 0%, #ffeb99 100%);
    border-color: #ffc107;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

body.dark-mode .upgrade-card.maxed {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 235, 59, 0.2) 100%);
    border-color: #ffa000;
}

/* Tier styling */
.upgrade-card.tier-common {
    border-top: 4px solid #6b7280;
}

.upgrade-card.tier-uncommon {
    border-top: 4px solid #10b981;
}

.upgrade-card.tier-rare {
    border-top: 4px solid #3b82f6;
}

.upgrade-card.tier-epic {
    border-top: 4px solid #8b5cf6;
}

.upgrade-card.tier-legendary {
    border-top: 4px solid #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(251, 191, 36, 0.05) 100%);
}

/* Tier Badge */
.upgrade-tier-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tier-common .upgrade-tier-badge {
    background: #6b7280;
    color: white;
}

.tier-uncommon .upgrade-tier-badge {
    background: #10b981;
    color: white;
}

.tier-rare .upgrade-tier-badge {
    background: #3b82f6;
    color: white;
}

.tier-epic .upgrade-tier-badge {
    background: #8b5cf6;
    color: white;
}

.tier-legendary .upgrade-tier-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: white;
}

/* Upgrade Icon */
.upgrade-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 15px;
}

/* Upgrade Content */
.upgrade-content {
    text-align: center;
}

.upgrade-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

body.dark-mode .upgrade-name {
    color: #e0e0e0;
}

.upgrade-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.4;
}

body.dark-mode .upgrade-description {
    color: #9ca3af;
}

/* Upgrade Stats */
.upgrade-stats {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.stat-item {
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: #667eea;
}

body.dark-mode .stat-item {
    background: rgba(102, 126, 234, 0.2);
    color: #9ca3af;
}

/* Upgrade Progress */
.upgrade-progress {
    margin: 15px 0;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

body.dark-mode .progress-bar {
    background: #4a5568;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
    text-align: center;
}

body.dark-mode .progress-text {
    color: #9ca3af;
}

/* Owned Count */
.owned-count {
    font-size: 14px;
    color: #666;
    margin: 10px 0;
}

body.dark-mode .owned-count {
    color: #9ca3af;
}

/* Upgrade Footer */
.upgrade-footer {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

body.dark-mode .upgrade-footer {
    border-top-color: #4a5568;
}

/* Cost Display */
.cost-display {
    text-align: center;
}

.single-cost, .bulk-cost {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.upgrade-card.can-afford .single-cost,
.upgrade-card.can-afford .bulk-cost {
    color: #27ae60;
}

.upgrade-card.cant-afford .single-cost,
.upgrade-card.cant-afford .bulk-cost {
    color: #e74c3c;
}

body.dark-mode .single-cost,
body.dark-mode .bulk-cost {
    color: #e0e0e0;
}

body.dark-mode .upgrade-card.can-afford .single-cost,
body.dark-mode .upgrade-card.can-afford .bulk-cost {
    color: #2ecc71;
}

body.dark-mode .upgrade-card.cant-afford .single-cost,
body.dark-mode .upgrade-card.cant-afford .bulk-cost {
    color: #e74c3c;
}

.maxed-text {
    font-size: 16px;
    font-weight: 600;
    color: #f39c12;
    text-transform: uppercase;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* Hover effects for cards */
.upgrade-card:not(.cant-afford):not(.maxed):hover {
    border-color: #667eea;
}

.upgrade-card:not(.cant-afford):not(.maxed):hover .upgrade-icon {
    animation: bounce 0.5s ease;
}

/* Active/clicking state */
.upgrade-card:not(.cant-afford):not(.maxed):active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    #game {
        width: 100%;
        min-height: auto;
    }
    
    /* Upgrades header responsive */
    .upgrade-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .upgrade-categories,
    .bulk-buy-controls {
        width: 100%;
        justify-content: center;
    }
    
    nav button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .resources-row {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .help-popup-content {
        max-width: 95%;
        padding: 20px;
    }
}
/* ===================== ACHIEVEMENTS SECTION ===================== */
.achievements-container {
    padding: 20px;
    /* Fix blurry text for entire container */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Achievement Stats Card */
.achievement-stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 25px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.25);
    transition: transform 0.3s ease;
    /* Fix blurry text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
}

.achievement-stats-card:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.stats-icon {
    font-size: 64px;
    animation: medal-float 3s ease-in-out infinite;
}

@keyframes medal-float {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(0, -10px, 0); }
}

.stats-info {
    flex: 1;
}

.stats-info h3 {
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600;
}

.achievement-progress {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
}

.progress-text {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 10px;
    display: block;
}

.achievement-progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.achievement-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50 0%, #8bc34a 100%);
    transition: width 0.5s ease;
    border-radius: 10px;
}

.percentage-text {
    font-size: 24px;
    font-weight: bold;
    display: block;
    margin-top: 10px;
}

/* Category Buttons */
.achievement-categories {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

body.dark-mode .category-btn {
    background: #2a2a2a;
    color: #9ca3af;
    border-color: #4a5568;
}

.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.category-btn.active {
    background: #667eea;
    color: white;
}

body.dark-mode .category-btn.active {
    background: #764ba2;
    color: white;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    animation: grid-fade-in 0.6s ease;
    /* Prevent text blur */
    transform-style: preserve-3d;
    -webkit-transform-style: preserve-3d;
}

@keyframes grid-fade-in {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Achievement Items */
.achievement-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    padding-top: 40px; /* Add extra padding for rarity tag */
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    /* Fix blurry text */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    backface-visibility: hidden;
    transform: translateZ(0);
}

body.dark-mode .achievement-item {
    background: #3a3a3a;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.achievement-item:hover {
    transform: translate3d(0, -5px, 0);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.achievement-item.completed {
    border-color: #4caf50;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(139, 195, 74, 0.1) 100%);
}

body.dark-mode .achievement-item.completed {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(139, 195, 74, 0.2) 100%);
}

/* Achievement Rarity */
.achievement-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.rarity-common {
    background: #9e9e9e;
    color: white;
}

.rarity-uncommon {
    background: #4caf50;
    color: white;
}

.rarity-rare {
    background: #2196f3;
    color: white;
}

.rarity-legendary {
    background: linear-gradient(135deg, #ff9800 0%, #ff5722 100%);
    color: white;
}

/* Achievement Content */
.achievement-header {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.achievement-icon {
    font-size: 36px;
    min-width: 50px;
    text-align: center;
}

.achievement-content {
    flex: 1;
}

.achievement-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

body.dark-mode .achievement-name {
    color: #e0e0e0;
}

.achievement-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

body.dark-mode .achievement-description {
    color: #999;
}

/* Mini Progress Bar */
.achievement-progress-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.progress-bar-mini {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

body.dark-mode .progress-bar-mini {
    background: #4a4a4a;
}

.progress-fill-mini {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.5s ease;
}

.achievement-progress-mini span {
    font-size: 12px;
    font-weight: 600;
    color: #667eea;
}

/* Achievement Popup */
.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 20px;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
}

.achievement-popup.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.achievement-popup .achievement-icon {
    font-size: 48px;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-10px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-5px); }
}

.achievement-popup .achievement-text h3 {
    font-size: 24px;
    margin-bottom: 5px;
}

.achievement-popup .achievement-text p {
    font-size: 16px;
    opacity: 0.9;
}

/* ===================== TOWN BUILDING STYLES - BEAUTIFUL UI ===================== */
#town-section {
    padding: 20px;
    max-width: 1400px;
    margin: 0 auto;
    background: transparent;
}

/* Town Header */
.town-header {
    margin-bottom: 30px;
}

.town-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    margin-bottom: 25px;
    position: relative;
    overflow: hidden;
}

body.dark-mode .town-hero {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.town-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.town-hero .hero-icon {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
    z-index: 1;
}

.town-hero .hero-content {
    flex: 1;
    z-index: 1;
}

.town-hero h2 {
    font-size: 36px;
    color: white;
    margin: 0 0 10px 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.town-hero .hero-subtitle {
    font-size: 18px;
    color: rgba(255,255,255,0.9);
    margin: 0;
}

/* Production Stats Overview */
.town-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.production-stat {
    background: var(--card-bg, white);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.production-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.production-stat .stat-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.production-stat .stat-info {
    flex: 1;
}

.production-stat .stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.production-stat .stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #27ae60;
}

/* Money display in town tab */
.production-stat.money-display {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.production-stat.money-display .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.production-stat.money-display .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

.production-stat.money-display .stat-value {
    color: white;
    font-size: 28px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}


/* Town Content Layout */
.town-content {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.town-grid-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 580px;
    height: fit-content;
}

/* Building Selection Panel */
.building-selection-panel {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 450px;
    height: fit-content;
    flex-shrink: 0;
}

.panel-title {
    font-size: 20px;
    margin: 0 0 20px 0;
    color: #2d3748;
    font-weight: 600;
}

/* Building Filters */
.building-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    background: #e2e8f0;
    border: 1px solid #cbd5e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* Building Cards Container */
.building-cards-container {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.building-cards-container::-webkit-scrollbar {
    width: 6px;
}

.building-cards-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.building-cards-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.building-cards-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.building-cards-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Building Cards - Compact Style */
.building-card.compact {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 80px;
    overflow: visible;
}

.building-card.compact:hover:not(.disabled) {
    transform: translateX(3px);
    border-color: #667eea;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.building-card.compact.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.building-icon-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    margin-top: 5px;
}

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

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

.building-card.compact .building-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #2d3748;
}

.building-card.compact .building-count-badge {
    background: #27ae60;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 12px;
    line-height: 1;
}

.building-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    font-size: 12px;
    gap: 10px;
    margin-top: 4px;
}

.building-effect {
    color: #666;
    font-size: 11px;
    max-width: 280px;
    white-space: normal;
    line-height: 1.3;
    word-wrap: break-word;
}

.building-card.compact .building-cost {
    display: flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    color: #2d3748;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 8px;
}

.building-card.compact .building-cost.insufficient {
    color: #e74c3c;
}

.building-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.building-icon-wrapper {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.building-icon {
    font-size: 28px;
}

.building-count-badge {
    background: #27ae60;
    color: white;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
}

.building-card-body {
    margin-bottom: 15px;
}

.building-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 5px 0;
    color: #2d3748;
}

.building-desc {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.building-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.building-cost {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
}

.building-cost.insufficient {
    color: #e74c3c;
}

.cost-icon {
    font-size: 18px;
}

/* Town Grid Section */
.town-grid-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.town-grid-wrapper {
    margin-top: 20px;
    position: relative;
    overflow: visible;
}

.town-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 10px;
    background: #f0f4f8;
    padding: 20px;
    border-radius: 12px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
    width: 100%;
}

.grid-cell {
    aspect-ratio: 1;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.grid-cell.empty {
    cursor: pointer;
}

.grid-cell.empty:hover {
    background: #f7fafc;
    border-color: #667eea;
    transform: scale(1.05);
}

.grid-cell-placeholder {
    font-size: 24px;
    color: #cbd5e0;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.grid-cell.empty:hover .grid-cell-placeholder {
    opacity: 1;
    color: #667eea;
}

.grid-cell.occupied {
    background: linear-gradient(135deg, #f6f9fc 0%, #e9ecef 100%);
    border-color: #4a5568;
}

.grid-cell.occupied:hover {
    z-index: 5;
}

.building-in-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    justify-content: center;
    position: relative;
    padding: 4px;
}

.building-emoji {
    font-size: 28px;
}

.building-direction {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    z-index: 2;
}

.building-production {
    font-size: 9px;
    font-weight: 600;
    color: #27ae60;
    background: rgba(255,255,255,0.9);
    padding: 1px 4px;
    border-radius: 6px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 8px);
    white-space: nowrap;
    z-index: 3;
}

.remove-building-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(231, 76, 60, 0.3);
    z-index: 10;
}

.grid-cell.occupied:hover .remove-building-btn {
    opacity: 1;
}

.remove-building-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

/* Instant tooltip for remove button */
.remove-building-btn::before {
    content: 'Remove (50% refund)';
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
    margin-top: 5px;
}

.remove-building-btn:hover::before {
    opacity: 1;
}

/* Dark mode adjustment for panel title helper text */
body.dark-mode .panel-title span {
    color: #a0aec0 !important;
}

.selected-building-info {
    margin-top: 15px;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 8px;
    text-align: center;
}

.selected-building-info p {
    margin: 0 0 10px 0;
    color: #4a5568;
}

.cancel-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.cancel-btn:hover {
    background: #c0392b;
    transform: translateY(-1px);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .town-content {
        flex-direction: column;
    }
    
    .building-selection-panel {
        width: 100%;
        max-width: 600px;
    }
    
    .town-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 768px) {
    .town-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        padding: 10px;
    }
}

/* Stats Row - Compact and Visible */
.town-stats-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-box {
    flex: 1;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    min-width: 120px;
    border: 1px solid #e0e0e0;
}

.dark-mode .stat-box {
    background: #2a2a2a;
    border-color: #444;
}

.stat-title {
    display: block;
    font-size: 12px;
    color: #777;
    margin-bottom: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dark-mode .stat-title {
    color: #999;
}

.stat-number {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.dark-mode .stat-number {
    color: #fff;
}

/* Town Panels - Side by Side */
.town-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    height: calc(100vh - 300px);
    max-height: 500px;
}

@media (max-width: 900px) {
    .town-panels {
        grid-template-columns: 1fr;
        max-height: none;
        height: auto;
    }
}

.minimal-panel {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.dark-mode .minimal-panel {
    background: #2a2a2a;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.minimal-panel h3 {
    font-size: 16px;
    margin: 0 0 12px 0;
    color: #333;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0f0f0;
}

.dark-mode .minimal-panel h3 {
    color: #eee;
    border-bottom-color: #444;
}

/* Building List - Horizontal Cards */
.building-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.minimal-building {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e5e5e5;
    min-height: 60px;
}

.dark-mode .minimal-building {
    background: #1e1e1e;
    border-color: #444;
}

.minimal-building:hover:not(.disabled) {
    background: #f0f0f0;
    border-color: #d0d0d0;
    transform: translateX(2px);
}

.dark-mode .minimal-building:hover:not(.disabled) {
    background: #333;
    border-color: #555;
}

.minimal-building.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.building-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.building-icon {
    font-size: 24px;
    min-width: 30px;
}

.building-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.dark-mode .building-name {
    color: #eee;
}

.building-count {
    background: #e0e0e0;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

.dark-mode .building-count {
    background: #555;
    color: #ddd;
}

.building-cost {
    font-size: 15px;
    font-weight: 600;
    color: #e74c3c;
}

/* Active Buildings - Horizontal Cards */
.active-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    flex: 1;
    padding-right: 5px;
}

.minimal-active {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    border: 1px solid #e5e5e5;
}

.dark-mode .minimal-active {
    background: #1e1e1e;
    border-color: #444;
}

.active-icon {
    font-size: 22px;
    min-width: 28px;
}

.active-name {
    flex: 1;
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.dark-mode .active-name {
    color: #eee;
}

.active-prod {
    font-size: 15px;
    font-weight: 700;
    color: #27ae60;
    min-width: 60px;
    text-align: right;
}

.remove-btn {
    width: 28px;
    height: 28px;
    background: #fee5e5;
    color: #e74c3c;
    border: 1px solid #fcc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.remove-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.empty-msg {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
    font-style: italic;
}

/* Scrollbar Styling */
.building-list::-webkit-scrollbar,
.active-list::-webkit-scrollbar {
    width: 6px;
}

.building-list::-webkit-scrollbar-track,
.active-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.dark-mode .building-list::-webkit-scrollbar-track,
.dark-mode .active-list::-webkit-scrollbar-track {
    background: #333;
}

.building-list::-webkit-scrollbar-thumb,
.active-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.building-list::-webkit-scrollbar-thumb:hover,
.active-list::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.dark-mode .building-list::-webkit-scrollbar-thumb,
.dark-mode .active-list::-webkit-scrollbar-thumb {
    background: #555;
}

.dark-mode .building-list::-webkit-scrollbar-thumb:hover,
.dark-mode .active-list::-webkit-scrollbar-thumb:hover {
    background: #777;
}

/* Resource Selector Modal */
.resource-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.resource-selector-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
}

body.dark-mode .resource-selector-content {
    background: #4a4a4a;
    color: #e0e0e0;
    border: 2px solid #666;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.resource-selector-content h3 {
    margin-bottom: 15px;
    color: #333;
}

body.dark-mode .resource-selector-content h3 {
    color: #ccc;
}

.resource-selector-content p {
    margin-bottom: 20px;
    color: #666;
}

body.dark-mode .resource-selector-content p {
    color: #aaa;
}

.resource-options {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.resource-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

body.dark-mode .resource-option {
    background: #5a5a5a;
    border-color: #666;
    color: #e0e0e0;
}

body.dark-mode .resource-option:hover {
    background: #6a6a6a;
    border-color: #f39c12;
}

.resource-option:hover {
    transform: translateY(-3px);
    border-color: #f39c12;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.resource-icon {
    font-size: 36px;
}

.cancel-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.cancel-btn:hover {
    background: #c0392b;
}

body.dark-mode .cancel-btn {
    background: #e74c3c;
    color: white;
}

body.dark-mode .cancel-btn:hover {
    background: #c0392b;
}

/* ===================== TOWN DARK MODE STYLES ===================== */
body.dark-mode .production-stat {
    background: #2d3748;
    color: #e2e8f0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark-mode .production-stat:hover {
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(0,0,0,0.4);
}

body.dark-mode .production-stat .stat-label {
    color: #a0aec0;
}

/* Dark mode money display */
body.dark-mode .production-stat.money-display {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
}

body.dark-mode .production-stat.money-display .stat-label {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .production-stat.money-display .stat-value {
    color: white;
}

body.dark-mode .building-selection-panel,
body.dark-mode .town-grid-section {
    background: #2d3748;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark-mode .panel-title {
    color: #e2e8f0;
}

body.dark-mode .building-card {
    background: #374151;
    border-color: #4a5568;
}

body.dark-mode .building-card:hover:not(.disabled) {
    background: #4a5568;
    border-color: #667eea;
}

body.dark-mode .building-card.compact {
    background: #374151;
}

body.dark-mode .building-card.compact:hover:not(.disabled) {
    background: #4a5568;
}

body.dark-mode .building-effect {
    color: #9ca3af;
}

body.dark-mode .building-name {
    color: #e2e8f0;
}

body.dark-mode .building-desc {
    color: #a0aec0;
}

body.dark-mode .building-cost {
    color: #e2e8f0;
}

body.dark-mode .building-card-footer {
    border-top-color: #4a5568;
}

body.dark-mode .town-grid {
    background: #1a202c;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

body.dark-mode .grid-cell {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .grid-cell.empty:hover {
    background: #374151;
    border-color: #667eea;
}

body.dark-mode .grid-cell.occupied {
    background: linear-gradient(135deg, #374151 0%, #2d3748 100%);
    border-color: #667eea;
}

body.dark-mode .selected-building-info {
    background: #374151;
    color: #e2e8f0;
}

body.dark-mode .selected-building-info p {
    color: #cbd5e0;
}

/* Compact Building Cards Dark Mode */
body.dark-mode .filter-btn {
    background: #374151;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .filter-btn:hover {
    background: #4a5568;
}

body.dark-mode .filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.dark-mode .building-cards-container::-webkit-scrollbar-track {
    background: #374151;
}

body.dark-mode .building-cards-container::-webkit-scrollbar-thumb {
    background: #4a5568;
}

body.dark-mode .building-cards-container::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}

body.dark-mode .building-card.compact {
    background: #374151;
    border-color: #4a5568;
}

body.dark-mode .building-card.compact:hover:not(.disabled) {
    background: #4a5568;
    border-color: #667eea;
}

body.dark-mode .building-card.compact .building-name {
    color: #e2e8f0;
}

body.dark-mode .building-effect {
    color: #a0aec0;
}

body.dark-mode .building-card.compact .building-cost {
    color: #e2e8f0;
}

/* Drinks Upgrades Section */
.drinks-upgrades-section {
    margin-top: 30px;
}

.drinks-upgrades-section .upgrades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.drinks-upgrades-section .section-title {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 28px;
    margin: 0;
}

.drinks-money {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    padding: 10px 20px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(79, 195, 247, 0.3);
}

.drinks-money .money-icon {
    font-size: 24px;
    animation: spin 3s linear infinite;
}

.drinks-money .money-amount {
    color: white;
    font-size: 20px;
    font-weight: bold;
}

.drinks-upgrade-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.drinks-upgrade-filters .filter-btn {
    background: #f0f4f8;
    border: 2px solid #e0e0e0;
    color: #333;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drinks-upgrade-filters .filter-btn:hover {
    background: #e3f2fd;
    border-color: #4fc3f7;
    transform: translateY(-2px);
}

.drinks-upgrade-filters .filter-btn.active {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
    border-color: transparent;
}

/* Dark mode for drinks upgrades */
body.dark-mode .drinks-upgrades-section .section-title {
    background: linear-gradient(135deg, #4fc3f7 0%, #81c9f5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .drinks-money {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
}

body.dark-mode .drinks-upgrade-filters .filter-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .drinks-upgrade-filters .filter-btn:hover {
    background: #374151;
    border-color: #4fc3f7;
}

body.dark-mode .drinks-upgrade-filters .filter-btn.active {
    background: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
    color: white;
}

/* Bulk Sell Container */
.bulk-sell-container {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bulk-sell-container h4 {
  margin: 0 0 10px 0;
  color: #f39c12;
  text-align: center;
  font-size: 1.1em;
}

.bulk-sell-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.bulk-btn {
  padding: 10px 15px;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bulk-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, #e74c3c 0%, #d35400 100%);
}

.bulk-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.bulk-btn.bulk-max {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
  grid-column: span 1;
}

.bulk-btn.bulk-max:hover {
  background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
}

/* Dark mode adjustments */
body.dark-mode .bulk-sell-container {
  background: linear-gradient(135deg, #1a1a1a 0%, #2c2c2c 100%);
}


/* Rush Hour Container */
.rush-hour-container {
  margin: 20px auto;
  padding: 20px;
  background: linear-gradient(135deg, #e74c3c 0%, #f39c12 100%);
  border-radius: 15px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
  animation: rush-pulse 1s ease-in-out infinite;
  max-width: 400px;
}

@keyframes rush-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.6);
  }
}

.rush-hour-container h3 {
  margin: 0 0 10px 0;
  color: white;
  font-size: 1.5em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  animation: rush-flash 0.5s ease-in-out infinite alternate;
}

@keyframes rush-flash {
  0% { opacity: 0.8; }
  100% { opacity: 1; }
}

.rush-hour-container p {
  margin: 5px 0;
  color: white;
  font-size: 1.2em;
  font-weight: bold;
}

.rush-timer {
  margin-top: 15px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  font-size: 1.3em;
  color: #ffd700;
  font-weight: bold;
}

/* Dark mode adjustments */
body.dark-mode .rush-hour-container {
  background: linear-gradient(135deg, #c0392b 0%, #e67e22 100%);
}

/* ===================== TOWN BUILDING ENHANCEMENTS ===================== */
/* Building Level Indicator */
.building-level {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 2;
    flex-shrink: 0; /* Prevent level badge from affecting grid cell size */
}

.building-level.level-1 {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.building-level.level-2 {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.building-level.level-3 {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.building-level.level-4 {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.building-level.level-5 {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    animation: level-5-glow 2s ease-in-out infinite;
}

@keyframes level-5-glow {
    0%, 100% { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 0 15px rgba(241, 196, 15, 0.8); }
}

/* District Background Colors */
.grid-cell.district-industrial {
    background-color: #34495e20;
    border-color: #34495e;
}

.grid-cell.district-commercial {
    background-color: #e74c3c20;
    border-color: #e74c3c;
}

.grid-cell.district-research {
    background-color: #3498db20;
    border-color: #3498db;
}

.grid-cell.district-cultural {
    background-color: #9b59b620;
    border-color: #9b59b6;
}

/* Rotation Controls */
.rotation-controls {
    position: absolute;
    bottom: -5px;
    right: -5px;
    display: flex;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.grid-cell.occupied:hover .rotation-controls {
    opacity: 1;
}

.rotate-btn {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: #3498db;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.rotate-btn:hover {
    background: #2980b9;
    transform: scale(1.1);
}

/* Instant tooltip for rotate button */
.rotate-btn::before {
    content: 'Rotate';
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
    margin-bottom: 5px;
}

.rotate-btn:hover::before {
    opacity: 1;
}

/* Building Actions Container */
.building-actions {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.building-actions button {
    pointer-events: auto;
}

/* Fix upgrade button styling - target correct class */
.upgrade-btn {
    position: absolute;
    top: 2px;
    right: 24px;
    width: 20px;
    height: 20px;
    background: #27ae60;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
    z-index: 20;
    flex-shrink: 0; /* Prevent button from affecting grid cell size */
}

.grid-cell.occupied:hover .upgrade-btn {
    opacity: 1;
}

.upgrade-btn:hover {
    background: #229954;
    transform: scale(1.1);
}

/* Instant cost tooltip for upgrade button */
.upgrade-btn::before {
    content: 'Upgrade to Lv' attr(data-level) ' - ' attr(data-cost);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
    margin-bottom: 5px;
}

.upgrade-btn::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}

.upgrade-btn:hover::before,
.upgrade-btn:hover::after {
    opacity: 1;
}

/* Building Rotation Animation */
.building-emoji.rotating {
    animation: rotate-building 0.3s ease-in-out;
}

@keyframes rotate-building {
    from { transform: rotate(0deg); }
    to { transform: rotate(90deg); }
}

/* Directional Building Indicator */
.direction-indicator {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.direction-indicator::before {
    content: '→';
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    font-size: 20px;
    color: #e74c3c;
    opacity: 0.7;
}

.direction-indicator.north::before {
    content: '↑';
    top: -15px;
    right: 50%;
    transform: translateX(50%);
}

.direction-indicator.west::before {
    content: '←';
    right: auto;
    left: -15px;
}

.direction-indicator.south::before {
    content: '↓';
    top: auto;
    bottom: -15px;
    right: 50%;
    transform: translateX(50%);
}

/* Legendary Building Effects */
.grid-cell.legendary {
    background: linear-gradient(135deg, #f1c40f20, #e67e2220);
    border-color: #f39c12;
    box-shadow: 0 0 20px rgba(241, 196, 15, 0.3);
    animation: legendary-pulse 3s ease-in-out infinite;
}

@keyframes legendary-pulse {
    0%, 100% { 
        box-shadow: 0 0 20px rgba(241, 196, 15, 0.3);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 30px rgba(241, 196, 15, 0.5);
        transform: scale(1.02);
    }
}

/* Seasonal Building Styling */
.building-card.seasonal-inactive {
    opacity: 0.5;
    filter: grayscale(100%);
}

.building-card.seasonal-inactive::after {
    content: '🔒 Out of Season';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
}

.grid-cell.seasonal-inactive {
    opacity: 0.6;
    filter: grayscale(50%);
}

/* Building Upgrade Button */
.upgrade-building-btn {
    position: absolute;
    bottom: -5px;
    left: -5px;
    width: 22px;
    height: 22px;
    background: #27ae60;
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
    z-index: 10;
}

.grid-cell.occupied:hover .upgrade-building-btn {
    opacity: 1;
}

.upgrade-building-btn:hover {
    background: #229954;
    transform: scale(1.1);
}

.upgrade-building-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

/* District Labels */
.district-label {
    position: absolute;
    top: 5px;
    left: 5px;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    color: white;
    opacity: 0.8;
    z-index: 1;
}

.district-label.industrial {
    background: #34495e;
}

.district-label.commercial {
    background: #e74c3c;
}

.district-label.research {
    background: #3498db;
}

.district-label.cultural {
    background: #9b59b6;
}

/* Booster Effect Animation */
.grid-cell.booster-active {
    animation: booster-pulse 2s ease-in-out infinite;
}

@keyframes booster-pulse {
    0%, 100% {
        box-shadow: inset 0 0 10px rgba(52, 152, 219, 0.3);
    }
    50% {
        box-shadow: inset 0 0 20px rgba(52, 152, 219, 0.5);
    }
}

/* Building Type Filters */
.building-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: #ecf0f1;
    border: 2px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: #e0e0e0;
}

.filter-btn.active {
    background: #3498db;
    color: white;
    border-color: #2980b9;
}

body.dark-mode .filter-btn {
    background: #2c3e50;
    color: #ecf0f1;
}

body.dark-mode .filter-btn.active {
    background: #3498db;
    border-color: #2980b9;
}

/* District Labels Above and Below Grid */
.district-labels-top,
.district-labels-bottom {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin: 10px 0;
}

.district-info {
    flex: 1;
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 3px solid;
    transition: all 0.3s ease;
}

.district-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.district-info.industrial {
    background: linear-gradient(135deg, #34495e20, #2c3e5030);
    border-color: #34495e;
}

.district-info.commercial {
    background: linear-gradient(135deg, #e74c3c20, #c0392b30);
    border-color: #e74c3c;
}

.district-info.research {
    background: linear-gradient(135deg, #3498db20, #2980b930);
    border-color: #3498db;
}

.district-info.cultural {
    background: linear-gradient(135deg, #9b59b620, #8e44ad30);
    border-color: #9b59b6;
}

.district-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 5px;
}

.district-info.industrial .district-name {
    color: #34495e;
}

.district-info.commercial .district-name {
    color: #e74c3c;
}

.district-info.research .district-name {
    color: #3498db;
}

.district-info.cultural .district-name {
    color: #9b59b6;
}

.district-bonus {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

/* Dark Mode District Labels */
body.dark-mode .district-info {
    background: #2d3748;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .district-info.industrial {
    background: linear-gradient(135deg, #34495e60, #2c3e5070);
}

body.dark-mode .district-info.commercial {
    background: linear-gradient(135deg, #e74c3c60, #c0392b70);
}

body.dark-mode .district-info.research {
    background: linear-gradient(135deg, #3498db60, #2980b970);
}

body.dark-mode .district-info.cultural {
    background: linear-gradient(135deg, #9b59b660, #8e44ad70);
}

body.dark-mode .district-name {
    color: #e2e8f0;
}

body.dark-mode .district-info.industrial .district-name {
    color: #5a6c7d;
}

body.dark-mode .district-info.commercial .district-name {
    color: #fc6161;
}

body.dark-mode .district-info.research .district-name {
    color: #5dade2;
}

body.dark-mode .district-info.cultural .district-name {
    color: #bb8fce;
}

body.dark-mode .district-bonus {
    color: #a0aec0;
}

/* Make district grid cells more visually distinct */
.grid-cell.district-industrial {
    background-color: #34495e20 !important;
    border-color: #34495e !important;
    border-width: 2px;
}

.grid-cell.district-commercial {
    background-color: #e74c3c20 !important;
    border-color: #e74c3c !important;
    border-width: 2px;
}

.grid-cell.district-research {
    background-color: #3498db20 !important;
    border-color: #3498db !important;
    border-width: 2px;
}

.grid-cell.district-cultural {
    background-color: #9b59b620 !important;
    border-color: #9b59b6 !important;
    border-width: 2px;
}

/* Stronger colors for occupied cells */
.grid-cell.occupied.district-industrial {
    background-color: #34495e35 !important;
}

.grid-cell.occupied.district-commercial {
    background-color: #e74c3c35 !important;
}

.grid-cell.occupied.district-research {
    background-color: #3498db35 !important;
}

.grid-cell.occupied.district-cultural {
    background-color: #9b59b635 !important;
}

/* Dark Mode Adjustments for New Features */
body.dark-mode .grid-cell.district-industrial {
    background-color: #34495e40 !important;
}

body.dark-mode .grid-cell.district-commercial {
    background-color: #e74c3c40 !important;
}

body.dark-mode .grid-cell.district-research {
    background-color: #3498db40 !important;
}

body.dark-mode .grid-cell.district-cultural {
    background-color: #9b59b640 !important;
}

body.dark-mode .grid-cell.legendary {
    background: linear-gradient(135deg, #f1c40f40, #e67e2240);
}

/* ===================== SETTINGS SECTION STYLES ===================== */
.settings-header {
    text-align: center;
    margin-bottom: 40px;
}

.settings-header h2 {
    font-size: 36px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.settings-subtitle {
    font-size: 18px;
    color: #666;
    margin: 0;
}

.settings-container {
    max-width: 800px;
    margin: 0 auto;
}

.settings-group {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.settings-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.settings-group-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.settings-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

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

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

.settings-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.btn-text {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.btn-desc {
    font-size: 14px;
    color: #666;
}

/* Individual button styles */
.save-btn {
    border-color: #4caf50;
    background: linear-gradient(135deg, #f6fff7 0%, #e8f5e9 100%);
}

.save-btn:hover {
    border-color: #45a049;
    box-shadow: 0 10px 25px rgba(76, 175, 80, 0.2);
}

.load-btn {
    border-color: #2196f3;
    background: linear-gradient(135deg, #f3f9ff 0%, #e3f2fd 100%);
}

.load-btn:hover {
    border-color: #1976d2;
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.2);
}

.theme-btn {
    border-color: #9c27b0;
    background: linear-gradient(135deg, #faf3ff 0%, #f3e5f5 100%);
}

.theme-btn:hover {
    border-color: #7b1fa2;
    box-shadow: 0 10px 25px rgba(156, 39, 176, 0.2);
}

.reset-btn {
    border-color: #f44336;
    background: linear-gradient(135deg, #fff5f5 0%, #ffebee 100%);
}

.reset-btn:hover {
    border-color: #d32f2f;
    box-shadow: 0 10px 25px rgba(244, 67, 54, 0.2);
}

/* Dark mode settings styles */
body.dark-mode .settings-group {
    background: #2d3748;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .settings-group-title {
    color: #e2e8f0;
}

body.dark-mode .settings-subtitle {
    color: #a0aec0;
}

body.dark-mode .settings-btn {
    background: #374151;
    border-color: #4a5568;
}

body.dark-mode .btn-text {
    color: #e2e8f0;
}

body.dark-mode .btn-desc {
    color: #a0aec0;
}

body.dark-mode .save-btn {
    background: linear-gradient(135deg, #1a3a1a 0%, #2d5a2d 100%);
    border-color: #4caf50;
}

body.dark-mode .load-btn {
    background: linear-gradient(135deg, #1a3a5e 0%, #2d5a8f 100%);
    border-color: #2196f3;
}

body.dark-mode .theme-btn {
    background: linear-gradient(135deg, #3a1a5e 0%, #5a2d8f 100%);
    border-color: #9c27b0;
}

body.dark-mode .reset-btn {
    background: linear-gradient(135deg, #5e1a1a 0%, #8f2d2d 100%);
    border-color: #f44336;
}

/* Town Layout Management Styles */
.layout-btn {
    margin-left: 20px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.layout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
}

.layout-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.layout-modal {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.layout-modal h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.layout-modal h4 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 18px;
}

.current-layout-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
}

.save-layout-section {
    margin-bottom: 30px;
}

.save-layout-input {
    display: flex;
    gap: 10px;
}

.save-layout-input input {
    flex: 1;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
}

.save-layout-input button {
    padding: 10px 20px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.save-layout-input button:hover {
    background: #45a049;
}

.saved-layouts-list {
    max-height: 300px;
    overflow-y: auto;
}

.saved-layout-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 10px;
    margin-bottom: 10px;
}

.layout-info h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.layout-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.layout-actions {
    display: flex;
    gap: 10px;
}

.layout-actions .action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.layout-actions .action-btn:first-child {
    background: #2196f3;
    color: white;
}

.layout-actions .action-btn:first-child:hover {
    background: #1976d2;
}

.layout-actions .delete-btn {
    background: #f44336;
    color: white;
}

.layout-actions .delete-btn:hover {
    background: #d32f2f;
}

.close-modal-btn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 30px;
    background: #666;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal-btn:hover {
    background: #555;
}

/* Dark mode for layout modal */
body.dark-mode .layout-modal {
    background: #1a1a1a;
    color: #e2e8f0;
}

body.dark-mode .layout-modal h3,
body.dark-mode .layout-modal h4,
body.dark-mode .layout-info h4 {
    color: #e2e8f0;
}

body.dark-mode .current-layout-info {
    background: #2d3748;
}

body.dark-mode .save-layout-input input {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .saved-layout-item {
    background: #2d3748;
}

body.dark-mode .layout-info p {
    color: #a0aec0;
}

/* Layout settings buttons */
.layout-settings-btn {
    border-color: #f39c12;
    background: linear-gradient(135deg, #fff9f3 0%, #ffefdb 100%);
}

.layout-settings-btn:hover {
    border-color: #e67e22;
    box-shadow: 0 10px 25px rgba(243, 156, 18, 0.2);
}

.clear-layouts-btn {
    border-color: #ff9800;
    background: linear-gradient(135deg, #fff8f3 0%, #ffeedd 100%);
}

.clear-layouts-btn:hover {
    border-color: #f57c00;
    box-shadow: 0 10px 25px rgba(255, 152, 0, 0.2);
}

body.dark-mode .layout-settings-btn {
    background: linear-gradient(135deg, #3a2a1a 0%, #5a4a2a 100%);
    border-color: #f39c12;
}

body.dark-mode .clear-layouts-btn {
    background: linear-gradient(135deg, #3a2a1a 0%, #5a3a1a 100%);
    border-color: #ff9800;
}

