:root {
    --bg-primary: #faf8f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f2ed;
    --text-primary: #2d3a2e;
    --text-secondary: #5c6b5e;
    --text-muted: #8a9a8c;
    --accent: #6b9b5e;
    --accent-light: #8fbc7a;
    --accent-dark: #4a7a42;
    --gold: #d4a447;
    --gold-light: #f0d78a;
    --danger: #c75a5a;
    --success: #5a9b6b;
    --border: rgba(45, 58, 46, 0.1);
    --shadow: rgba(45, 58, 46, 0.08);
    --shadow-lg: rgba(45, 58, 46, 0.12);
    --card-radius: 16px;
    --btn-radius: 12px;
    --transition: 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1f1a;
        --bg-secondary: #242a24;
        --bg-tertiary: #2d352d;
        --text-primary: #e8efe8;
        --text-secondary: #b8c8ba;
        --text-muted: #7a8a7c;
        --accent: #7ab56a;
        --accent-light: #9cd08c;
        --accent-dark: #5a9548;
        --border: rgba(255, 255, 255, 0.08);
        --shadow: rgba(0, 0, 0, 0.2);
        --shadow-lg: rgba(0, 0, 0, 0.3);
    }
}

/* Force light mode override */
html.force-light-mode {
    --bg-primary: #faf8f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f5f2ed;
    --text-primary: #2d3a2e;
    --text-secondary: #5c6b5e;
    --text-muted: #8a9a8c;
    --accent: #6b9b5e;
    --accent-light: #8fbc7a;
    --accent-dark: #4a7a42;
    --gold: #d4a447;
    --gold-light: #f0d78a;
    --danger: #c75a5a;
    --success: #5a9b6b;
    --border: rgba(45, 58, 46, 0.1);
    --shadow: rgba(45, 58, 46, 0.08);
    --shadow-lg: rgba(45, 58, 46, 0.12);
}

/* Force light mode - scene overrides */
html.force-light-mode .fishing-scene {
    background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 40%, #4A90A4 40%, #2E6B7A 100%) !important;
}

html.force-light-mode .beach-grid {
    background: linear-gradient(180deg, #f4e4c1 0%, #e8d4a8 100%) !important;
}

html.force-light-mode .forest-grid {
    background: linear-gradient(180deg, #8fbc7a 0%, #6b9b5e 100%) !important;
}

/* Icon Images */
.icon {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
}

.icon-sm {
    width: 20px;
    height: 20px;
}

.icon-md {
    width: 28px;
    height: 28px;
}

.icon-lg {
    width: 40px;
    height: 40px;
}

.icon-xl {
    width: 56px;
    height: 56px;
}

.icon-profile {
    width: 72px;
    height: 72px;
}

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

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
}

/* Page System */
.page {
    display: none;
    padding: 20px;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    animation: fadeIn 0.25s ease;
}

.page.active {
    display: block;
}

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

/* Home Button - deprecated, hidden in favour of bottom nav */
.home-btn {
    display: none !important;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 448px;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    padding: 6px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    box-shadow: 0 8px 32px var(--shadow-lg), 0 2px 8px var(--shadow);
    z-index: 1000;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    .bottom-nav {
        background: rgba(36, 42, 36, 0.78);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
}

html.force-light-mode .bottom-nav {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.bottom-nav-item {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 4px;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition), transform var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item:active {
    transform: scale(0.92);
}

.bottom-nav-item.active {
    color: var(--accent);
    background: rgba(107, 155, 94, 0.14);
}

@media (prefers-color-scheme: dark) {
    .bottom-nav-item.active {
        background: rgba(122, 181, 106, 0.2);
    }
}

.bottom-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    opacity: 0.75;
    transition: opacity var(--transition), transform var(--transition);
}

.bottom-nav-item.active .bottom-nav-icon {
    opacity: 1;
    transform: translateY(-1px);
}

.bottom-nav-icon .icon {
    width: 26px;
    height: 26px;
}

.bottom-nav-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.bottom-nav-dot {
    position: absolute;
    top: 6px;
    right: calc(50% - 18px);
    width: 9px;
    height: 9px;
    background: var(--danger);
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(199, 90, 90, 0.5);
    pointer-events: none;
}

/* Header / Profile Section */
.profile-header {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

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

.profile-pic {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    overflow: hidden;
    border: 3px solid var(--accent-light);
}

.profile-pic img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    flex: 1;
}

.profile-name {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-level {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
}

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

.profile-actions button {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.profile-actions button:active {
    background: var(--border);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.stat-item {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
}

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

.stat-value {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

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

/* XP Bar */
.xp-bar-container {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.xp-bar-label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-bottom: 8px;
}

.xp-bar-label span:first-child {
    font-weight: 700;
    color: var(--accent);
}

.xp-bar-label span:last-child {
    color: var(--text-muted);
}

.xp-bar {
    height: 10px;
    background: var(--bg-tertiary);
    border-radius: 5px;
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 5px;
    transition: width 0.5s ease;
}

/* Navigation Menu */
.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 20px;
    cursor: pointer;
    box-shadow: 0 2px 12px var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.nav-item:active {
    transform: scale(0.98);
}

.nav-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.nav-text {
    flex: 1;
}

.nav-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
}

.nav-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

.nav-arrow {
    color: var(--text-muted);
    font-size: 18px;
}

.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 12px;
    font-weight: 700;
    min-width: 22px;
    height: 22px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    margin-right: 8px;
}

/* Page Headers */
.page-header {
    margin-bottom: 20px;
}

.page-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 4px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 14px;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 4px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
}

/* Farm Grid */
.farm-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.plot {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
    border: 2px solid transparent;
    overflow: hidden;
}

.plot:active {
    transform: scale(0.95);
}

.plot.empty {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
}

.plot.empty::after {
    content: '+';
    font-size: 24px;
    color: var(--text-muted);
}

.plot.growing {
    border-color: var(--accent);
}

.plot.harvestable {
    border-color: var(--gold);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(212, 164, 71, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(212, 164, 71, 0); }
}

.plot-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.plot-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--bg-tertiary);
}

.plot-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 1s linear;
}

.plot.harvestable .plot-progress-fill {
    background: var(--gold);
}

.plot-timer {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Seed Selector */
.seed-selector {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px var(--shadow);
}

.seed-selector-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 600;
}

.seed-selector-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}

.seed-selector-scroll::-webkit-scrollbar {
    display: none;
}

.seed-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 70px;
    transition: border-color var(--transition), background var(--transition);
}

.seed-option.selected {
    border-color: var(--accent);
    background: var(--bg-secondary);
}

.seed-option-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.seed-option-qty {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.seed-option.selected .seed-option-qty {
    color: var(--accent);
}

/* Animal Plots */
.animal-plot {
    aspect-ratio: 1;
    background: var(--bg-secondary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 8px var(--shadow);
    transition: transform var(--transition);
    border: 2px solid transparent;
    padding: 8px;
    overflow: hidden;
    min-width: 0;
}

.animal-plot:active {
    transform: scale(0.95);
}

.animal-plot.empty {
    background: var(--bg-tertiary);
    border: 2px dashed var(--border);
}

.animal-plot.empty::after {
    content: '+';
    font-size: 24px;
    color: var(--text-muted);
}

.animal-plot.ready {
    border-color: var(--gold);
    animation: pulse 1.5s infinite;
}

.animal-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.animal-info {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex-wrap: wrap;
}

.animal-info .icon {
    flex-shrink: 1;
    min-width: 0;
}

.animal-expiry {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 8px;
    background: var(--bg-tertiary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

/* Shop Items */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.shop-item {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
    transition: transform var(--transition);
    border: none;
    font-family: inherit;
    color: inherit;
    width: 100%;
}

.shop-item.clickable {
    cursor: pointer;
}

.shop-item.clickable:active {
    transform: scale(0.97);
}

.shop-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.shop-item-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.shop-item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--gold);
    font-weight: 700;
    font-size: 14px;
}

.shop-item-level {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.shop-qty-buttons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.shop-qty-buttons button {
    flex: 1;
    padding: 8px 4px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.shop-qty-buttons button:active {
    background: var(--accent-dark);
}

/* Inventory */
.inventory-status {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px var(--shadow);
}

.inventory-status-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.inventory-status-count {
    font-size: 18px;
    font-weight: 800;
}

.inventory-status-count.warning {
    color: var(--gold);
}

.inventory-status-count.full {
    color: var(--danger);
}

.inventory-status-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    margin: 0 16px;
    overflow: hidden;
}

.inventory-status-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.inventory-status-fill.warning {
    background: var(--gold);
}

.inventory-status-fill.full {
    background: var(--danger);
}

.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.inventory-item {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px var(--shadow);
}

.inventory-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.inventory-info {
    flex: 1;
}

.inventory-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.inventory-qty {
    font-size: 13px;
    color: var(--text-muted);
}

.inventory-value {
    color: var(--gold);
    font-weight: 700;
    font-size: 13px;
}

.inventory-actions {
    display: flex;
    gap: 6px;
}

.inventory-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.inventory-btn:active {
    background: var(--accent);
    color: white;
}

.inventory-btn.sell-all {
    background: var(--gold);
    color: white;
}

/* Workshop */
.recipe-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recipe-item {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    box-shadow: 0 2px 12px var(--shadow);
}

.recipe-item.locked {
    opacity: 0.5;
}

.recipe-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.recipe-icon {
    font-size: 32px;
}

.recipe-info {
    flex: 1;
}

.recipe-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.recipe-value {
    font-size: 13px;
    color: var(--gold);
    font-weight: 600;
}

.recipe-level {
    font-size: 11px;
    color: var(--text-muted);
}

.recipe-ingredients {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.ingredient {
    background: var(--bg-tertiary);
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ingredient.missing {
    color: var(--danger);
}

.craft-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
}

.craft-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.craft-btn:not(:disabled):active {
    background: var(--accent-dark);
}

/* Achievements */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.achievement {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 2px 12px var(--shadow);
}

.achievement.locked {
    opacity: 0.5;
}

.achievement.claimable {
    border: 2px solid var(--gold);
}

.achievement-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.achievement.claimed .achievement-icon {
    background: var(--accent);
}

.achievement-info {
    flex: 1;
}

.achievement-name {
    font-weight: 700;
    margin-bottom: 2px;
}

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

.achievement-progress {
    margin-top: 8px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.achievement-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
}

.claim-btn {
    padding: 10px 16px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--gold);
    color: white;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.claim-btn:active {
    opacity: 0.9;
}

/* Settings & Edit Profile */
.settings-section {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px var(--shadow);
}

.settings-title {
    font-weight: 700;
    margin-bottom: 16px;
    font-size: 15px;
}

.settings-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--btn-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color var(--transition);
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.settings-input:focus {
    outline: none;
    border-color: var(--accent);
}

.settings-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--btn-radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background var(--transition);
}

.settings-btn.primary {
    background: var(--accent);
    color: white;
}

.settings-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.settings-btn.danger {
    background: var(--danger);
    color: white;
}

.settings-btn:active {
    opacity: 0.9;
}

.settings-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 12px 0;
}

.settings-toggle input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.settings-toggle span {
    font-size: 15px;
    color: var(--text-primary);
    user-select: none;
}

/* Avatar Picker */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.avatar-option {
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color var(--transition);
    overflow: hidden;
    padding: 8px;
}

.avatar-option .icon-profile {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar-option.selected {
    border-color: var(--accent);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition);
    padding: 20px;
}

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

.modal {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform var(--transition);
}

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

.modal-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--btn-radius);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.modal-btn.primary {
    background: var(--accent);
    color: white;
}

.modal-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Quantity Selector */
.qty-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.qty-display {
    flex: 1;
    text-align: center;
    font-size: 24px;
    font-weight: 800;
}

.qty-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
}

.qty-btn:active {
    background: var(--accent);
    color: white;
}

.quick-qty {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.quick-qty button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.quick-qty button:active {
    background: var(--accent);
    color: white;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Tool Items */
.tool-item {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px var(--shadow);
}

.tool-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.tool-icon {
    font-size: 32px;
}

.tool-info {
    flex: 1;
}

.tool-name {
    font-weight: 700;
}

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

.tool-price {
    color: var(--gold);
    font-weight: 700;
}

.tool-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.tool-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* Active Effects */
.active-effects {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.effect-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.effect-icon {
    font-size: 20px;
}

.effect-name {
    flex: 1;
    font-weight: 600;
    font-size: 14px;
}

.effect-timer {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-text {
    font-size: 15px;
}

/* Use Item Button */
.use-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.use-btn:active {
    background: var(--accent-dark);
}

/* Textarea for import/export */
.settings-textarea {
    width: 100%;
    height: 120px;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: var(--btn-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: monospace;
    font-size: 12px;
    resize: none;
    margin-bottom: 12px;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.settings-textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Fishing Game */
.fishing-container {
    text-align: center;
}

.fishing-scene {
    background: linear-gradient(180deg, #87CEEB 0%, #87CEEB 40%, #4A90A4 40%, #2E6B7A 100%);
    border-radius: var(--card-radius);
    height: 300px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
    .fishing-scene {
        background: linear-gradient(180deg, #2a4a5a 0%, #2a4a5a 40%, #1a3a4a 40%, #0a2a3a 100%);
    }
}

.fishing-water {
    position: absolute;
    top: 40%;
    left: 0;
    right: 0;
    bottom: 0;
}

.fishing-line {
    position: absolute;
    top: -100px;
    left: 50%;
    width: 2px;
    height: 0;
    background: #333;
    transform: translateX(-50%);
    transition: height 0.5s ease;
}

.fishing-line.cast {
    height: 120px;
}

.fishing-bobber {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 32px;
    opacity: 0;
    transition: opacity 0.3s, transform 0.2s;
}

.fishing-bobber.visible {
    opacity: 1;
}

.fishing-bobber.bite {
    animation: bobberBite 0.15s infinite;
}

@keyframes bobberBite {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}

.fishing-splash {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 40px;
    opacity: 0;
    transition: opacity 0.2s;
}

.fishing-splash.visible {
    opacity: 1;
    animation: splashAnim 0.5s ease-out;
}

@keyframes splashAnim {
    0% { transform: translateX(-50%) scale(0.5); opacity: 1; }
    100% { transform: translateX(-50%) scale(1.5); opacity: 0; }
}

.fishing-catch {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 64px;
    opacity: 0;
    transition: opacity 0.3s;
}

.fishing-catch.visible {
    opacity: 1;
    animation: catchAnim 0.5s ease-out;
}

@keyframes catchAnim {
    0% { transform: translate(-50%, -50%) scale(0.5) rotate(-20deg); }
    50% { transform: translate(-50%, -50%) scale(1.2) rotate(10deg); }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}

.fishing-status {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-primary);
    min-height: 28px;
}

.fishing-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), transform var(--transition);
}

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

.fishing-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.fishing-btn.reel {
    background: var(--gold);
    animation: pulse 0.5s infinite;
}

/* Beach */
.beach-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    background: linear-gradient(180deg, #f5deb3 0%, #deb887 100%);
    border-radius: var(--card-radius);
    padding: 20px;
    min-height: 200px;
}

@media (prefers-color-scheme: dark) {
    .beach-grid {
        background: linear-gradient(180deg, #5a4a3a 0%, #4a3a2a 100%);
    }
}

.beach-item {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    transition: transform var(--transition), opacity var(--transition);
}

.beach-item:active {
    transform: scale(0.9);
}

.beach-item.collected {
    opacity: 0;
    pointer-events: none;
}

.beach-empty {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    grid-column: 1 / -1;
}

.mines-grid .beach-empty,
.forest-grid .beach-empty {
    color: rgba(255, 255, 255, 0.7);
}

/* Mines */
.mines-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border-radius: var(--card-radius);
    padding: 20px;
    min-height: 300px;
}

.mine-rock {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition);
    position: relative;
}

.mine-rock:active {
    transform: scale(0.95);
}

.mine-rock.mined {
    opacity: 0.3;
    pointer-events: none;
}

.mine-rock-icon {
    font-size: 36px;
}

.mine-rock-health {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
}

.mine-rock-health-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s;
}

.mine-reward {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    animation: rewardPop 0.6s ease-out forwards;
    pointer-events: none;
}

@keyframes rewardPop {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
    50% { transform: translate(-50%, -80%) scale(1.2); }
    100% { opacity: 0; transform: translate(-50%, -100%) scale(1); }
}

/* Farmshop Request */
.request-item {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px var(--shadow);
}

.request-item.completed {
    opacity: 0.5;
}

.request-item.ready {
    border: 2px solid var(--gold);
}

.request-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.request-icon {
    font-size: 32px;
}

.request-info {
    flex: 1;
}

.request-name {
    font-weight: 700;
}

.request-qty {
    font-size: 13px;
    color: var(--text-muted);
}

.request-reward {
    text-align: right;
}

.request-gold {
    color: var(--gold);
    font-weight: 700;
}

.request-xp {
    font-size: 12px;
    color: var(--accent);
}

.request-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--accent);
    color: white;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.request-btn:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
}

.request-btn.completed {
    background: var(--success);
}

.farmshop-refresh-btn {
    width: 100%;
    padding: 16px;
    margin-top: 16px;
    border: 2px dashed var(--accent);
    border-radius: var(--btn-radius);
    background: var(--bg-tertiary);
    color: var(--accent);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.farmshop-refresh-btn:active {
    background: var(--accent);
    color: white;
}

.farmshop-refresh-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

/* Back Button */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--accent);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-bottom: 12px;
}

.back-btn:active {
    opacity: 0.7;
}

/* Forest */
.forest-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    background: linear-gradient(180deg, #228B22 0%, #1a6b1a 100%);
    border-radius: var(--card-radius);
    padding: 20px;
    min-height: 300px;
}

@media (prefers-color-scheme: dark) {
    .forest-grid {
        background: linear-gradient(180deg, #1a4a1a 0%, #0f2f0f 100%);
    }
}

.forest-tree {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition);
    position: relative;
}

.forest-tree:active {
    transform: scale(0.95);
}

.forest-tree.harvested {
    opacity: 0.3;
    pointer-events: none;
}

.forest-tree-icon {
    font-size: 36px;
}

.forest-tree-health {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    height: 4px;
    background: rgba(0,0,0,0.3);
    border-radius: 2px;
}

.forest-tree-health-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.1s;
}

/* Pet Page */
.pet-header {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.pet-icon {
    font-size: 72px;
    margin-bottom: 12px;
}

.pet-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.pet-level {
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
}

.pet-age {
    color: var(--text-muted);
    font-size: 13px;
}

.pet-stats {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.pet-stat {
    margin-bottom: 16px;
}

.pet-stat:last-child {
    margin-bottom: 0;
}

.pet-stat-label {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 6px;
}

.pet-stat-name {
    font-weight: 700;
}

.pet-stat-value {
    color: var(--text-muted);
}

.pet-stat-bar {
    height: 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    overflow: hidden;
}

.pet-stat-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.pet-stat-fill.hunger {
    background: linear-gradient(90deg, #e67e22, #f39c12);
}

.pet-stat-fill.happiness {
    background: linear-gradient(90deg, #e91e63, #ff6b9d);
}

.pet-stat-fill.cleanliness {
    background: linear-gradient(90deg, #3498db, #5dade2);
}

.pet-stat-fill.low {
    background: linear-gradient(90deg, var(--danger), #e57373);
}

.pet-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pet-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 12px var(--shadow);
    transition: background var(--transition), transform var(--transition);
}

.pet-action-btn:active {
    transform: scale(0.98);
}

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

.pet-action-btn.feed {
    background: linear-gradient(135deg, #e67e22, #f39c12);
    color: white;
}

.pet-action-btn.pet-btn {
    background: linear-gradient(135deg, #e91e63, #ff6b9d);
    color: white;
}

.pet-action-btn.play {
    background: linear-gradient(135deg, #9b59b6, #a66bbe);
    color: white;
}

.pet-action-btn.clean {
    background: linear-gradient(135deg, #3498db, #5dade2);
    color: white;
}

.pet-action-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.pet-action-progress-fill {
    height: 100%;
    background: white;
    border-radius: 2px;
    transition: width 0.1s linear;
}

/* Pet Selection Modal */
.pet-type-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.pet-type-option {
    aspect-ratio: 1;
    border-radius: 12px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color var(--transition);
}

.pet-type-option.selected {
    border-color: var(--accent);
}

.pet-xp-bar {
    margin-top: 12px;
}

.pet-xp-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    margin-bottom: 4px;
    color: var(--text-muted);
}

.pet-xp-bar-bg {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.pet-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.pet-status {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.pet-status.active {
    background: rgba(107, 155, 94, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.pet-status.inactive {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.pet-status-icon {
    margin-right: 6px;
}

/* Profile Page */
.profile-page-header {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.profile-page-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 12px;
    border: 4px solid var(--accent-light);
}

.profile-page-name {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 4px;
}

.profile-page-level {
    color: var(--accent);
    font-weight: 700;
    font-size: 16px;
}

.profile-page-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.profile-page-actions button {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}

.profile-page-actions button:active {
    background: var(--accent);
    color: white;
}

.profile-section {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.profile-section-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.stat-row-label {
    color: var(--text-secondary);
    font-size: 14px;
}

.stat-row-value {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.profile-pet-card {
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-pet-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.profile-pet-info {
    flex: 1;
}

.profile-pet-name {
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 4px;
}

.profile-pet-details {
    font-size: 13px;
    color: var(--text-muted);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.achievement-badge {
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    text-align: center;
}

.achievement-badge-icon {
    font-size: 24px;
    margin-bottom: 6px;
}

.achievement-badge-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
}

.achievement-badge.empty {
    opacity: 0.3;
}

.no-achievements {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-size: 14px;
}

/* Christmas Page */
.christmas-header {
    background: linear-gradient(135deg, #c41e3a 0%, #1a472a 100%);
    color: white;
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.christmas-header .page-title,
.christmas-header .page-subtitle {
    color: white;
}

.christmas-activity {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px var(--shadow);
    cursor: pointer;
    transition: transform var(--transition);
}

.christmas-activity:active {
    transform: scale(0.98);
}

.christmas-nav {
    background: linear-gradient(135deg, rgba(196, 30, 58, 0.1) 0%, rgba(26, 71, 42, 0.1) 100%);
    border: 2px solid rgba(196, 30, 58, 0.3);
}

.christmas-activity-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.christmas-activity-info {
    flex: 1;
}

.christmas-activity-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
}

.christmas-activity-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.christmas-activity-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.christmas-activity-status.ready {
    background: rgba(107, 155, 94, 0.15);
    color: var(--success);
}

.christmas-activity-status.claimed {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.christmas-stats {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.christmas-stat {
    flex: 1;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    text-align: center;
    box-shadow: 0 2px 12px var(--shadow);
}

.christmas-stat-label {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.christmas-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

/* Rudolph Game */
.reindeer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.reindeer-btn {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 3px solid transparent;
    border-radius: 16px;
    font-size: 36px;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition), background var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.reindeer-btn.selected {
    border-color: var(--accent);
}

.reindeer-btn.correct {
    background: rgba(107, 155, 94, 0.3);
    border-color: var(--success);
}

.reindeer-btn.wrong {
    background: rgba(231, 76, 60, 0.2);
    border-color: var(--danger);
}

.reindeer-btn.revealed {
    opacity: 0.5;
}

.reindeer-btn.rudolph-reveal {
    background: rgba(255, 215, 0, 0.3);
    border-color: gold;
}

.rudolph-chances {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Advent Gift Display */
.advent-gifts {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.advent-gift-item {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
}

.advent-gift-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.advent-gift-qty {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

/* School */
.school-header {
    background: linear-gradient(135deg, #4a7c59 0%, #2d5a3d 100%);
    color: white;
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.school-header .page-title,
.school-header .page-subtitle {
    color: white;
}

.school-activity {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 12px var(--shadow);
    cursor: pointer;
    transition: transform var(--transition);
}

.school-activity:active {
    transform: scale(0.98);
}

.school-activity-icon {
    width: 50px;
    height: 50px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.school-activity-info {
    flex: 1;
}

.school-activity-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
}

.school-activity-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.school-nav {
    background: linear-gradient(135deg, rgba(74, 124, 89, 0.1) 0%, rgba(45, 90, 61, 0.1) 100%);
    border: 2px solid rgba(74, 124, 89, 0.3);
}

.school-nav.locked {
    opacity: 0.5;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
}

/* Sudoku */
.sudoku-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: var(--text-primary);
    padding: 2px;
    border-radius: 8px;
    max-width: 360px;
    width: 100%;
    aspect-ratio: 1;
}

.sudoku-cell {
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
    aspect-ratio: 1;
}

.sudoku-cell.fixed {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    cursor: default;
}

.sudoku-cell.selected {
    background: var(--accent-light);
    color: var(--accent);
}

.sudoku-cell.error {
    background: rgba(231, 76, 60, 0.2);
    color: var(--danger);
}

.sudoku-cell.user-input {
    color: var(--accent);
}

/* Sudoku 3x3 box borders */
.sudoku-cell:nth-child(3n) {
    border-right: 2px solid var(--text-primary);
}
.sudoku-cell:nth-child(9n) {
    border-right: none;
}
.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--text-primary);
}

.sudoku-numpad {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 300px;
    width: 100%;
}

.numpad-btn {
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 2px 8px var(--shadow);
}

.numpad-btn:active {
    background: var(--accent);
    color: white;
    transform: scale(0.95);
}

.numpad-btn.erase {
    background: var(--bg-tertiary);
    color: var(--danger);
}

.sudoku-controls {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 360px;
}

.sudoku-controls .game-btn {
    flex: 1;
}

.game-btn.hint {
    background: var(--gold);
    color: #333;
}

/* Tavern */
.tavern-header {
    background: linear-gradient(135deg, #8B4513 0%, #5D3A1A 100%);
    color: white;
    border-radius: var(--card-radius);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.tavern-header .page-title,
.tavern-header .page-subtitle {
    color: white;
}

.tavern-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tavern-tab {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.tavern-tab.active {
    background: var(--accent);
    color: white;
}

.tavern-content {
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: 0 2px 12px var(--shadow);
}

.tavern-locked {
    text-align: center;
    padding: 40px 20px;
}

.tavern-locked-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.tavern-locked-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 8px;
}

.tavern-locked-desc {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.tavern-nav {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1) 0%, rgba(93, 58, 26, 0.1) 100%);
    border: 2px solid rgba(139, 69, 19, 0.3);
}

.tavern-nav.locked {
    opacity: 0.5;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
}

/* Card Games */
.game-area {
    padding: 10px 0;
}

.game-bet-area {
    text-align: center;
    margin-bottom: 20px;
}

.game-bet-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.game-bet-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bet-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.bet-btn:active {
    background: var(--accent);
    color: white;
}

.bet-amount {
    font-size: 24px;
    font-weight: 800;
    color: var(--gold);
    min-width: 80px;
}

.card-table {
    background: #1a5c3a;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.dealer-area, .player-area {
    margin-bottom: 16px;
}

.player-area {
    margin-bottom: 0;
}

.hand-label {
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.hand-label span {
    color: white;
    font-size: 14px;
}

.card-hand {
    display: flex;
    gap: 8px;
    min-height: 70px;
    flex-wrap: wrap;
}

.playing-card {
    width: 48px;
    height: 68px;
    background: white;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    position: relative;
}

.playing-card.red {
    color: #dc3545;
}

.playing-card.black {
    color: #212529;
}

.playing-card.face-down {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 100%);
    color: white;
}

.playing-card.face-down::after {
    content: '?';
    font-size: 24px;
}

.card-rank {
    font-size: 16px;
    line-height: 1;
}

.card-suit {
    font-size: 18px;
    line-height: 1;
}

.game-message {
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    min-height: 24px;
}

.game-message.win {
    color: var(--success);
}

.game-message.lose {
    color: var(--danger);
}

.game-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.game-btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--btn-radius);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
}

.game-btn.primary {
    background: var(--accent);
    color: white;
}

.game-btn.secondary {
    background: var(--bg-tertiary);
}

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

/* Poker specific */
.poker-table {
    background: #1a5c3a;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    text-align: center;
}

.poker-hand {
    display: flex;
    gap: 8px;
    justify-content: center;
    min-height: 90px;
    flex-wrap: wrap;
}

.poker-card {
    width: 56px;
    height: 80px;
    background: white;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
    position: relative;
}

.poker-card.red {
    color: #dc3545;
}

.poker-card.black {
    color: #212529;
}

.poker-card.held {
    transform: translateY(-10px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.4);
    border: 3px solid gold;
}

.poker-card.held::after {
    content: 'HELD';
    position: absolute;
    bottom: -20px;
    font-size: 10px;
    color: gold;
    font-weight: 800;
}

.poker-hand-name {
    margin-top: 24px;
    font-size: 18px;
    font-weight: 800;
    color: white;
}

.poker-hand-name.winning {
    color: gold;
}

.poker-paytable {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    font-size: 12px;
}

.paytable-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 4px;
}

.paytable-row:nth-child(odd) {
    background: var(--bg-secondary);
}

.paytable-row span:last-child {
    font-weight: 700;
    color: var(--gold);
}

/* ============ AUTH FORM ============ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.auth-form .settings-input {
    margin: 0;
}

/* ============ CLOUD SAVE STATUS ============ */
.cloud-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--btn-radius);
    font-size: 14px;
    margin-bottom: 10px;
}

.cloud-status.synced {
    background: rgba(90, 155, 107, 0.15);
    color: var(--success);
}

.cloud-status.offline {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.cloud-status-icon {
    font-size: 18px;
}

/* ============ SESSION MANAGEMENT ============ */
.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--btn-radius);
    margin-bottom: 8px;
}

.session-item.session-current {
    border: 1px solid var(--accent);
}

.session-info {
    flex: 1;
}

.session-device {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.session-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.session-revoke-btn {
    background: var(--danger);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* ============ DAILY LOGIN CALENDAR ============ */
.daily-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 16px 0;
}

.daily-day {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    position: relative;
    min-height: 60px;
    justify-content: center;
}

.daily-day.claimed {
    background: rgba(90, 155, 107, 0.2);
    opacity: 0.7;
}

.daily-day.today {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(107, 155, 94, 0.4);
}

.daily-day.locked {
    opacity: 0.4;
}

.daily-day-num {
    font-size: 10px;
    font-weight: 700;
}

.daily-day-reward {
    font-size: 9px;
    text-align: center;
    margin-top: 4px;
}

.daily-day-check {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: var(--success);
}

/* ============ OFFLINE EARNINGS ============ */
.offline-summary {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: var(--card-radius);
}

.offline-item {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ============ MARKET BANNER ============ */
.market-banner {
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
}

.market-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.market-items {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.market-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.market-item-icon {
    font-size: 16px;
}

.market-multiplier {
    font-size: 12px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
}

.market-multiplier.high {
    background: rgba(90, 155, 107, 0.2);
    color: var(--success);
}

.market-multiplier.boom {
    background: rgba(212, 164, 71, 0.2);
    color: var(--gold);
}

.market-multiplier.low {
    background: rgba(199, 90, 90, 0.15);
    color: var(--danger);
}

/* ============ ACHIEVEMENT MILESTONE ============ */
.achievement-milestone {
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.achievement-milestone-text {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.achievement-reward {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ============ PRESTIGE PAGE ============ */
.prestige-info {
    text-align: center;
    padding: 20px;
}

.prestige-season {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
}

.prestige-level {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 4px;
}

.prestige-bonuses {
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    margin: 0 20px 16px;
}

.prestige-bonus {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-primary);
}

.prestige-bonus-icon {
    font-size: 20px;
}

.prestige-next {
    padding: 16px;
    background: rgba(212, 164, 71, 0.1);
    border-radius: var(--card-radius);
    margin: 0 20px;
}

.prestige-next-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--gold);
    margin-bottom: 8px;
}

/* ============ AUTO TOGGLES ============ */
.auto-toggles {
    display: flex;
    gap: 8px;
    padding: 8px 20px;
    justify-content: center;
}

.auto-indicator {
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(107, 155, 94, 0.15);
    color: var(--accent);
}

/* ============ PROFILE LOGIN STATUS ============ */
.profile-login-status {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    margin-bottom: 16px;
    background: var(--bg-secondary);
    border-radius: var(--card-radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px var(--shadow);
}

.profile-login-status.synced {
    border-left: 4px solid var(--success);
}

.profile-login-status.offline {
    border-left: 4px solid var(--danger);
}

.profile-login-status-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.profile-login-status-info {
    flex: 1;
    min-width: 0;
}

.profile-login-status-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.profile-login-status-detail {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-login-status-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--btn-radius);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform var(--transition), background var(--transition);
}

.profile-login-status-btn:active {
    transform: scale(0.96);
}

.profile-login-status-btn.secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.profile-nav-menu {
    margin-bottom: 20px;
}
