/* Modern PDGames - Complete UI Overhaul */

/* Lucide icon base styles */
.lucide {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.action-icon .lucide {
    width: 16px;
    height: 16px;
}

.profile-icon .lucide {
    width: 18px;
    height: 18px;
}

.like-icon .lucide {
    width: 18px;
    height: 18px;
}

.dropdown-arrow .lucide {
    width: 12px;
    height: 12px;
}

@keyframes lucide-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.lucide-spin {
    animation: lucide-spin 1s linear infinite;
}

/* CSS Variables for consistent theming */
:root {
    --playdate-yellow: #ffad00;
    --playdate-yellow-dark: #ff9500;
    --playdate-yellow-light: #fffaeb;
    --playdate-black: #1a1a1a;
    --playdate-gray: #333333;
    --playdate-gray-light: #666666;
    --playdate-gray-lighter: #999999;
    --playdate-gray-lightest: #f8f9fa;
    --playdate-gray-dark: #2d3748;
    --playdate-white: #ffffff;
    --playdate-cream: #ffffff;
    --playdate-border: #e1e5e9;

    /* Surface elevation hierarchy (cards, modals, hovers) */
    --surface-card: #ffffff;
    --surface-elevated: #ffffff;
    --surface-hover: #f8f9fa;
    --surface-active: #e9ecef;
    --surface-overlay: rgba(0, 0, 0, 0.5);
    --surface-modal-backdrop: rgba(0, 0, 0, 0.5);

    /* Text hierarchy */
    --text-heading: #1a1a1a;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-subtle: #999999;
    --text-on-accent: #ffffff;

    /* Border variants */
    --border-light: #e1e5e9;
    --border-medium: #d1d5db;
    --border-heavy: #9ca3af;

    /* Status and semantic colors */
    --color-success: #22c55e;
    --color-success-dark: #16a34a;
    --color-success-bg: #f0fff4;
    --color-success-border: #9ae6b4;
    --color-error: #e74c3c;
    --color-error-dark: #c0392b;
    --color-error-bg: #fed7d7;
    --color-error-border: #feb2b2;
    --color-warning: #f97316;
    --color-warning-dark: #ea580c;
    --color-warning-bg: #fef3c7;
    --color-warning-border: #fde68a;
    --color-info: #3b82f6;
    --color-info-dark: #2563eb;
    --color-info-bg: #f0f9ff;
    --color-info-border: #60a5fa;

    /* Flash message colors */
    --flash-success-bg: #f0fff4;
    --flash-success-text: #16a34a;
    --flash-success-border: #9ae6b4;
    --flash-error-bg: #fed7d7;
    --flash-error-text: #c0392b;
    --flash-error-border: #feb2b2;
    --flash-info-bg: #f0f9ff;
    --flash-info-text: #2563eb;
    --flash-info-border: #60a5fa;

    --gradient-primary: linear-gradient(135deg, var(--playdate-yellow) 0%, var(--playdate-yellow-dark) 100%);
    --gradient-secondary: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --gradient-hero: var(--playdate-yellow-light);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 12px 60px rgba(0, 0, 0, 0.2);

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--playdate-gray);
    background: var(--gradient-secondary);
    min-height: 100vh;
    font-size: 16px;
    letter-spacing: -0.01em;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

main.container {
    padding-top: 1rem;
}

/* Enhanced Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Gabarito', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--playdate-black);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }

/* Apply display font to key UI elements */
.nav-links a,
.nav-link,
.dropdown-toggle,
.btn-primary,
.btn-secondary,
.search-btn,
.quick-link,
.randomiser-btn,
.filter-btn,
.season-badge,
.sale-badge,
.new-badge,
.itch-badge,
.combined-badge,
.coming-soon-badge,
.price,
.stat-badge,
.section-header .section-subtitle,
.auth-btn {
    font-family: 'Gabarito', -apple-system, BlinkMacSystemFont, sans-serif;
}

p {
    color: var(--playdate-gray);
    line-height: 1.7;
}

/* Modern Navigation */
.navbar {
    background: var(--playdate-white);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--playdate-border);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem; /* Add spacing between logo and nav links */
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
}

.logo:hover {
    transform: translateY(-2px);
}

.logo img {
    height: 3rem;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--playdate-gray);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--playdate-yellow-dark);
    background: var(--playdate-yellow-light);
    transform: translateY(-1px);
}

.nav-links a.active {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

/* Authentication Navigation */
.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-main {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-auth {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-md);
    font-weight: 600;
    color: var(--playdate-gray-dark);
}

.nav-profile:hover {
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
}

.profile-icon {
    display: inline-flex;
    align-items: center;
}

.nav-login, .nav-register {
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-normal);
}

.nav-login {
    color: var(--playdate-gray-dark);
    border: 2px solid var(--playdate-border);
}

.nav-login:hover {
    border-color: var(--playdate-yellow);
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
}

.nav-register {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.nav-register:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

/* Dark mode for logged-out nav buttons */
[data-theme="dark"] .nav-login {
    border-color: #444;
}

[data-theme="dark"] .nav-login:hover {
    background: rgba(255, 173, 0, 0.15);
    color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .nav-register {
    background: var(--playdate-yellow) !important;
    color: #1a1a1a !important;
}

[data-theme="dark"] .nav-register:hover {
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.3);
}

.nav-logout {
    color: var(--playdate-gray);
    font-size: 0.9rem;
    padding: 0.25rem 0.5rem;
}

.nav-logout:hover {
    color: var(--playdate-gray-dark);
}

/* User Dropdown Styles */
.user-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    background: var(--playdate-gray-lightest);
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.dropdown-toggle:hover {
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
}

.dropdown-arrow {
    font-size: 0.75rem;
    margin-left: 0.5rem;
    transition: transform var(--transition-fast);
    display: inline-flex;
    align-items: center;
}

.dropdown-toggle:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--playdate-white);
    border: 1px solid var(--playdate-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    padding: 0.5rem 0;
    display: none;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--playdate-gray-dark);
    text-decoration: none;
    transition: var(--transition-fast);
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
}

.dropdown-item.active {
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
    font-weight: 600;
}

.dropdown-divider {
    height: 1px;
    background: var(--playdate-border);
    margin: 0.5rem 0;
}

/* Wishlist Count Badge */
.wishlist-count-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Stats Summary on Most Wishlisted Page */
.stats-summary {
    margin-top: 0.5rem;
    color: var(--playdate-gray);
    font-size: 0.9rem;
}

.stat-item {
    font-weight: 500;
    color: var(--playdate-gray-light);
}

.stat-separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

@media (max-width: 768px) {
    .wishlist-count-badge {
        font-size: 0.7rem;
        padding: 3px 6px;
        bottom: 6px;
        left: 6px;
    }
}

/* Games Dropdown Styles */
.games-dropdown,
.community-dropdown,
.website-dropdown {
    position: relative;
    display: inline-block;
}

.games-dropdown .dropdown-toggle,
.community-dropdown .dropdown-toggle,
.website-dropdown .dropdown-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--playdate-gray);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.games-dropdown .dropdown-toggle:hover,
.community-dropdown .dropdown-toggle:hover,
.website-dropdown .dropdown-toggle:hover {
    color: var(--playdate-yellow-dark);
    background: var(--playdate-yellow-light);
    transform: translateY(-1px);
}

.games-dropdown .dropdown-toggle.active,
.community-dropdown .dropdown-toggle.active,
.website-dropdown .dropdown-toggle.active {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.games-dropdown .dropdown-arrow,
.community-dropdown .dropdown-arrow,
.website-dropdown .dropdown-arrow {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.games-dropdown .dropdown-toggle:hover .dropdown-arrow,
.community-dropdown .dropdown-toggle:hover .dropdown-arrow,
.website-dropdown .dropdown-toggle:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-link {
    font-family: inherit;
    font-size: inherit;
}

/* Wishlist Button Styles */
.wishlist-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    font-size: 1.2rem;
    color: var(--playdate-gray-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wishlist-btn:hover {
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
    transform: scale(1.1);
}

.wishlist-btn.in-wishlist {
    color: var(--color-success);
    background: rgba(34, 197, 94, 0.1);
}

.wishlist-btn.in-wishlist:hover {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-success-dark);
    transform: scale(1.1);
}

/* OLD - TO REMOVE: User Action Icons (Wishlist + Library) */
/*
.user-action-icons {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
}

.action-icon-container {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    transition: all 0.3s ease;
}

.action-icon-container .library-btn,
.action-icon-container .collections-btn {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.user-action-icons:hover .action-icon-container .library-btn,
.user-action-icons:focus-within .action-icon-container .library-btn,
.action-icon-container:hover .library-btn,
.action-icon-container:focus-within .library-btn,
.user-action-icons:hover .action-icon-container .collections-btn,
.user-action-icons:focus-within .action-icon-container .collections-btn,
.action-icon-container:hover .collections-btn,
.action-icon-container:focus-within .collections-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.user-action-icons.expanded .action-icon-container .library-btn,
.user-action-icons.expanded .action-icon-container .collections-btn {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.action-icon {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2rem;
}

.action-label-tooltip {
    position: fixed;
    z-index: 10000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: var(--playdate-black);
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
    padding: 0.25rem 0.55rem;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.action-label-tooltip.visible {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="dark"] .action-label-tooltip {
    background: rgba(40, 40, 40, 0.95);
    color: #e0e0e0;
    border-color: rgba(60, 60, 60, 0.8);
}

@media (max-width: 768px) {
    .action-label-tooltip {
        display: none !important;
    }
}

.action-icon.wishlist-btn:hover {
    background: rgba(255, 173, 0, 0.9);
    color: var(--playdate-white);
}

.action-icon.wishlist-btn.in-wishlist {
    background: rgba(34, 197, 94, 0.95);
    color: var(--playdate-white);
    border: 1px solid rgba(34, 197, 94, 0.8);
}

.action-icon.wishlist-btn.in-wishlist:hover {
    background: rgba(239, 68, 68, 0.9);
    color: var(--playdate-white);
}

.action-icon.library-btn:hover {
    background: rgba(59, 130, 246, 0.9);
    color: var(--playdate-white);
}

.action-icon.library-btn.in-library {
    background: rgba(168, 85, 247, 0.95);
    color: var(--playdate-white);
    border: 1px solid rgba(168, 85, 247, 0.8);
}

.action-icon.library-btn.in-library:hover {
    background: rgba(239, 68, 68, 0.9);
    color: var(--playdate-white);
}

.action-icon.collections-btn:hover {
    background: rgba(16, 185, 129, 0.9);
    color: var(--playdate-white);
}

.game-image:has(.itch-badge) .user-action-icons {
    top: 0.5rem;
    left: 0.5rem;
    right: auto;
}

.game-card .game-image .user-action-icons {
    top: 0.5rem;
    left: 0.5rem;
    right: auto;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.3);
    }
    50% {
        opacity: 1;
        transform: translateY(0) scale(1.05);
    }
    70% {
        transform: translateY(-5px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.action-icon.animate-add {
    animation: bounceIn 0.5s ease-out;
}
*/

/* === Card Action Button (+) === */
.card-action-btn {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    width: 2rem;
    height: 2rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 300;
    color: #555;
    z-index: 20;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}
.card-action-btn:hover {
    background: rgba(255,173,0,0.9);
    color: white;
}
.card-action-btn .status-dot {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid white;
}
.card-action-btn .status-dot.in-library {
    background: #22c55e;
}
.card-action-btn .status-dot.in-wishlist {
    background: #ffad00;
}

/* === Card Action Menu === */
.card-action-menu {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(12px);
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    border: 1px solid rgba(0,0,0,0.08);
    z-index: 30;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(-4px);
    transform-origin: top left;
    pointer-events: none;
    transition: all 0.15s ease;
    min-width: 160px;
}
.card-action-menu.open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}
/* Desktop: open menu on hover; mobile still uses click/tap (.open class) */
@media (hover: hover) and (pointer: fine) {
    .card-action-btn:hover + .card-action-menu,
    .card-action-menu:hover {
        opacity: 1;
        transform: scale(1) translateY(0);
        pointer-events: auto;
    }
}
.card-action-menu button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: #333;
    transition: background 0.15s;
    text-align: left;
}
.card-action-menu button:hover {
    background: rgba(255,173,0,0.12);
}
.card-action-menu button:not(:last-child) {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.card-action-menu button .icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}
.card-action-menu button.active {
    color: #22c55e;
    font-weight: 600;
}
.card-action-menu button.hidden {
    display: none;
}

/* === Inline Source Pills === */
.game-card .game-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.2rem;
    padding: 0;
    flex-wrap: wrap;
    border: none;
    background: none;
    border-radius: 0;
}
.game-card .game-meta .developer {
    margin-bottom: 0;
}
.source-pill {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    vertical-align: middle;
}
.source-pill.itch {
    background: #fa5c5c;
    color: white;
}
.source-pill.combined {
    background: linear-gradient(135deg, #ffad00 0%, #FF6B35 50%, #FA5C5C 100%);
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.2);
}
.source-pill.season {
    background: linear-gradient(135deg, #ffad00, #ff8c00);
    color: white;
}
.source-pill.demo {
    background: #3b82f6;
    color: white;
}

/* === Dark mode for card action button/menu === */
[data-theme="dark"] .card-action-btn {
    background: rgba(50, 50, 50, 0.92);
    border: 1px solid rgba(80, 80, 80, 0.8);
    color: #ccc;
}
[data-theme="dark"] .card-action-btn:hover {
    background: rgba(255,173,0,0.9);
    color: white;
}
[data-theme="dark"] .card-action-menu {
    background: rgba(40, 40, 40, 0.96);
    border: 1px solid rgba(80, 80, 80, 0.3);
}
[data-theme="dark"] .card-action-menu button {
    color: #e0e0e0;
}
[data-theme="dark"] .card-action-menu button:hover {
    background: rgba(255,173,0,0.15);
}

/* === Mobile card adjustments === */
@media (max-width: 768px) {
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 0.75rem;
    }
    .game-content {
        padding: 0.5rem 0.75rem 0.75rem;
    }
    .game-card h3 {
        font-size: 0.85rem;
    }
    .game-card .game-meta {
        gap: 0.3rem;
    }
    .developer {
        font-size: 0.75rem;
    }
    .source-pill {
        font-size: 0.55rem;
        padding: 0.05rem 0.3rem;
    }
    .price {
        font-size: 0.8rem;
    }
    .price-rating .rating {
        font-size: 0.7rem;
    }
    .card-action-btn {
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1rem;
    }
    .card-action-menu {
        min-width: 140px;
    }
    .card-action-menu button {
        padding: 0.5rem 0.65rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    .game-content {
        padding: 0.4rem 0.5rem 0.5rem;
    }
    .game-card h3 {
        font-size: 0.78rem;
    }
    .price-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
}

/* Legacy support for old wishlist-icon class */
.wishlist-icon {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
}

.wishlist-icon .wishlist-btn {
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Wishlist card styles */
.wishlist-card {
    position: relative;
}

.wishlist-card-content {
    padding: 1rem;
}

.wishlist-title-link {
    text-decoration: none;
    color: inherit;
}

.wishlist-title-link:hover h3 {
    color: var(--playdate-yellow-dark);
}

/* Wishlist card positioning */
.wishlist-card {
    position: relative;
}

/* Remove button in top right */
.wishlist-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    background: rgba(231, 76, 60, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.wishlist-remove-btn:hover {
    background: rgba(192, 57, 43, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.wishlist-game-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.wishlist-game-actions .btn {
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.wishlist-game-actions .btn-sm {
    padding: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.wishlist-game-actions .btn-primary {
    background: var(--playdate-yellow);
    border-color: var(--playdate-yellow);
    color: var(--playdate-black);
}

.wishlist-game-actions .btn-primary:hover {
    background: var(--playdate-yellow-dark);
    border-color: var(--playdate-yellow-dark);
    transform: translateY(-1px);
}

.wishlist-game-actions .btn-success {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

.wishlist-game-actions .btn-success:hover {
    background: #219a52;
    border-color: #219a52;
    transform: translateY(-1px);
}

.wishlist-game-actions .btn-danger {
    background: var(--color-error);
    border-color: var(--color-error);
    color: white;
}

.wishlist-game-actions .btn-danger:hover {
    background: #c0392b;
    border-color: #c0392b;
    transform: translateY(-1px);
}

/* Flash Messages */
.flash-messages {
    position: fixed;
    top: 5rem;
    right: 1rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 400px;
}

.flash-message {
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideInRight 0.3s ease;
    position: relative;
}

.flash-success {
    background: var(--color-success-bg);
    color: var(--color-success-dark);
    border: 1px solid var(--color-success-border);
}

.flash-info {
    background: #ebf8ff;
    color: var(--playdate-gray-dark);
    border: 1px solid #90cdf4;
}

.flash-error {
    background: var(--color-error-bg);
    color: var(--color-error-dark);
    border: 1px solid var(--color-error-border);
}

.flash-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    margin-left: 1rem;
}

.flash-close:hover {
    opacity: 1;
}

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

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--playdate-gray);
}

/* Hero Section */
.hero {
    background: var(--gradient-hero);
    padding: 4rem 0 5rem;
    text-align: center;
    margin-bottom: 4rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\"><defs><pattern id=\"grid\" width=\"10\" height=\"10\" patternUnits=\"userSpaceOnUse\"><path d=\"M 10 0 L 0 0 0 10\" fill=\"none\" stroke=\"%23ffad0020\" stroke-width=\"0.5\"/></pattern></defs><rect width=\"100\" height=\"100\" fill=\"url(%23grid)\"/></svg>');
    opacity: 0.3;
    pointer-events: none;
}

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

.hero h1 {
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--playdate-gray-light);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* User Ranks Display in Profile */
.profile-header-section {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: var(--playdate-yellow-light);
    border-radius: var(--radius-md);
}

.profile-header-section h1 {
    margin-bottom: 0.5rem;
    color: var(--playdate-black);
}

.user-ranks {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.user-rank {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.unofficial-disclaimer {
    font-size: 1em;
    font-weight: 400;
    color: var(--playdate-gray-lighter);
    opacity: 0.8;
    font-style: italic;
}

/* Enhanced Search */
.search-container {
    max-width: 600px;
    margin: 2rem auto 0;
    position: relative;
}

.search-box {
    display: flex;
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition-fast);
}

.search-box:focus-within {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: none;
    outline: none;
    background: transparent;
    color: var(--playdate-gray);
}

.search-input::placeholder {
    color: var(--playdate-gray-lighter);
}

.search-btn {
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover {
    filter: brightness(1.1);
    transform: translateX(-2px);
}

.search-btn .lucide {
    width: 18px;
    height: 18px;
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--playdate-white);
    border: 1px solid var(--playdate-border);
    border-top: none;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: var(--shadow-md);
    animation: fadeInDown 0.2s ease;
}

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

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--playdate-border);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s ease;
}

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

.autocomplete-item:hover {
    background: var(--playdate-yellow-light);
}

.autocomplete-item[data-type="title"]:hover {
    background: linear-gradient(135deg, var(--playdate-yellow-light) 0%, var(--playdate-yellow-light) 100%);
    cursor: pointer;
}

.autocomplete-item[data-type="developer"]:hover {
    background: var(--playdate-gray-lightest);
}

.autocomplete-item-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.autocomplete-item-content {
    flex: 1;
}

.autocomplete-item-title {
    font-weight: 500;
    color: var(--playdate-black);
    margin-bottom: 2px;
}

.autocomplete-item-label {
    font-size: 12px;
    color: var(--playdate-gray-lighter);
}

/* Mobile autocomplete adjustments */
@media (max-width: 768px) {
    .autocomplete-dropdown {
        max-height: 250px;
    }
    
    .autocomplete-item {
        padding: 16px;
    }
}

/* Recommendations Section */
.recommendations-section {
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid var(--playdate-border);
}

.recommendations-section h2 {
    margin-bottom: 1.5rem;
    color: var(--playdate-black);
    font-size: 1.75rem;
    font-weight: 600;
}

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

.recommendation-card {
    background: var(--playdate-white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid var(--playdate-border);
}

.recommendation-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--playdate-yellow);
}

.recommendation-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.recommendation-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--playdate-gray-lightest);
}

.recommendation-card .no-image {
    width: 100%;
    height: 160px;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--playdate-gray);
}

.recommendation-content {
    padding: 1.25rem;
}

.recommendation-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--playdate-black);
    line-height: 1.3;
}

.recommendation-content .developer {
    color: var(--playdate-gray);
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
}

.recommendation-content .price-info {
    margin-bottom: 0.5rem;
}

.recommendation-content .price {
    font-weight: 600;
    color: var(--playdate-black);
    font-size: 1rem;
}

.recommendation-content .current-price {
    font-weight: 600;
    color: var(--color-success);
    font-size: 1rem;
}

.recommendation-content .original-price {
    text-decoration: line-through;
    color: var(--playdate-gray-lighter);
    margin-right: 0.5rem;
    font-size: 0.9rem;
}

.recommendation-content .free {
    color: var(--color-success);
    font-weight: 600;
}

.recommendation-content .coming-soon {
    color: var(--playdate-gray);
    font-style: italic;
}

.recommendation-reasons {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--playdate-border);
}

.recommendation-reasons small {
    color: var(--playdate-gray-lighter);
    font-size: 0.8rem;
    font-style: italic;
}

/* Mobile adjustments for recommendations */
@media (max-width: 768px) {
    .recommendations-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    .recommendation-card img,
    .recommendation-card .no-image {
        height: 140px;
    }
    
    .recommendation-content {
        padding: 1rem;
    }
    
    .recommendation-content h3 {
        font-size: 1rem;
    }
    
    .recommendations-section {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }
}

/* Quick Links */
.quick-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.quick-link {
    padding: 0.75rem 1.5rem;
    background: var(--playdate-white);
    color: var(--playdate-gray);
    text-decoration: none;
    border-radius: var(--radius-xl);
    font-weight: 500;
    transition: var(--transition-fast);
    border: 2px solid transparent;
    font-size: 0.9rem;
}

.quick-link:hover {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Randomiser Section */
.randomiser-section {
    margin-top: 2rem;
    text-align: center;
}

.randomiser-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: var(--playdate-white);
    border: none;
    border-radius: var(--radius-xl);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.randomiser-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

.randomiser-icon {
    font-size: 1.2rem;
    animation: randomiser-bounce 2s infinite;
}

@keyframes randomiser-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

/* Randomiser Modal */
.randomiser-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.randomiser-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.randomiser-content {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 1001;
    box-shadow: var(--shadow-xl);
}

.randomiser-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--playdate-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.randomiser-header h2 {
    margin: 0;
    color: var(--playdate-gray-dark);
    font-size: 1.5rem;
}

.randomiser-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--playdate-gray);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}

.randomiser-close:hover {
    background: var(--playdate-gray-lightest);
    color: var(--playdate-gray-dark);
}

.randomiser-filters {
    padding: 1.5rem;
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-group h3 {
    margin-bottom: 1rem;
    color: var(--playdate-gray-dark);
    font-size: 1.1rem;
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    flex: 1;
    min-width: 120px;
    justify-content: center;
}

.filter-option:hover {
    border-color: var(--playdate-yellow);
    background: var(--playdate-yellow-light);
}

.filter-option input[type="radio"] {
    display: none;
}

.filter-option input[type="radio"]:checked + span {
    color: var(--playdate-white);
}

.filter-option:has(input[type="radio"]:checked) {
    background: var(--gradient-primary);
    border-color: var(--playdate-yellow-dark);
    color: var(--playdate-white);
}

.randomiser-actions {
    padding: 0 1.5rem 1.5rem;
    text-align: center;
}

.randomiser-start-btn {
    padding: 1rem 2rem;
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.randomiser-start-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Roulette Section */
.roulette-section {
    padding: 2rem 1.5rem;
    text-align: center;
}

.roulette-container {
    position: relative;
    margin: 2rem auto;
    width: 100%;
    max-width: 400px;
}

.roulette-wheel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    height: 120px;
    scroll-behavior: auto; /* Changed from smooth to auto for animation control */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
    position: relative;
}

.roulette-wheel::-webkit-scrollbar {
    display: none; /* WebKit */
}

.roulette-game {
    flex: 0 0 auto;
    width: 100px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: var(--playdate-gray-lightest);
    border-right: 1px solid var(--playdate-border);
    transition: var(--transition-fast);
}

.roulette-game.active {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    transform: scale(1.1) translateY(-5px);
    z-index: 10;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--playdate-yellow-dark);
}

.roulette-game img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    margin-bottom: 0.25rem;
}

.roulette-game span {
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.roulette-game .placeholder-image {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius-sm);
}

.roulette-pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5rem;
    color: var(--playdate-yellow-dark);
    z-index: 20;
}

.roulette-status {
    margin-top: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--playdate-gray-dark);
}

/* Loading Section */
.loading-section {
    padding: 3rem 1.5rem;
    text-align: center;
}

.loading-spinner {
    margin: 2rem auto;
    width: 60px;
    height: 60px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--playdate-gray-lightest);
    border-top: 4px solid var(--playdate-yellow);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--playdate-gray-dark);
    margin-bottom: 1.5rem;
}

.loading-progress {
    width: 100%;
    max-width: 350px;
    height: 12px;
    background: var(--playdate-gray-lightest);
    border-radius: 6px;
    margin: 0 auto;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--playdate-border);
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 6px;
    width: 0%;
    transition: width 0.2s ease;
    position: relative;
    overflow: hidden;
}

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

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

/* Result Section */
.result-section {
    padding: 2rem 1.5rem;
    text-align: center;
}

.result-game {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

.result-image img {
    max-width: 150px;
    max-height: 120px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

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

.result-info h3 {
    margin-bottom: 0.5rem;
    color: var(--playdate-gray-dark);
    font-size: 1.3rem;
}

.result-info p {
    margin: 0.25rem 0;
    color: var(--playdate-gray);
}

.result-image .placeholder-image {
    max-width: 150px;
    max-height: 120px;
    width: 150px;
    height: 120px;
    font-size: 3rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.result-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    font-size: 1rem;
    flex: 1;
    max-width: 150px;
}

.result-btn.view-btn {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.result-btn.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-btn.spin-btn {
    background: var(--playdate-white);
    color: var(--playdate-gray-dark);
    border: 2px solid var(--playdate-border);
}

.result-btn.spin-btn:hover {
    background: var(--playdate-gray-lightest);
    border-color: var(--playdate-gray);
}

/* Modern Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (min-width: 1600px) {
    .stats-grid {
        grid-template-columns: repeat(6, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    /* Mobile Randomiser Styles */
    .randomiser-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .randomiser-header {
        padding: 1rem 0.75rem;
    }
    
    .randomiser-header h2 {
        font-size: 1.2rem;
    }
    
    .randomiser-filters {
        padding: 1rem 0.75rem;
    }
    
    .filter-group {
        margin-bottom: 1.5rem;
    }
    
    .filter-options {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .filter-option {
        min-width: auto;
        padding: 0.75rem 1rem;
        width: 100%;
        justify-content: flex-start;
        margin: 0;
        flex: none;
    }
    
    .randomiser-actions {
        padding: 0 0.75rem 1rem;
    }
    
    .loading-section {
        padding: 2rem 1rem;
    }
    
    .loading-spinner {
        margin: 1.5rem auto;
        width: 50px;
        height: 50px;
    }
    
    .spinner {
        width: 50px;
        height: 50px;
    }
    
    .loading-text {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .loading-progress {
        max-width: 280px;
        height: 10px;
    }
    
    .roulette-section {
        padding: 1.5rem 1rem;
    }
    
    .roulette-container {
        max-width: 300px;
    }
    
    .roulette-wheel {
        height: 100px;
    }
    
    .roulette-game {
        width: 80px;
        height: 100px;
        padding: 0.25rem;
    }
    
    .roulette-game img {
        width: 50px;
        height: 50px;
    }
    
    .roulette-game span {
        font-size: 0.65rem;
    }
    
    .roulette-game .placeholder-image {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .result-section {
        padding: 1.5rem 1rem;
    }
    
    .result-game {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .result-info {
        text-align: center;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .result-btn {
        max-width: none;
    }
    
    .randomiser-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    
    .roulette-pointer {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Compact sale pricing for mobile */
    .sale-pricing {
        gap: 0.4rem;
    }
    
    .discount-badge {
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
}

.stat-card {
    background: var(--playdate-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--playdate-border);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.stat-card h3 {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.stat-card p {
    color: var(--playdate-gray-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.stat-card .sub-text {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--playdate-gray-lighter);
    text-transform: none;
    letter-spacing: normal;
}

/* Enhanced Games Section */
.games-section {
    margin-bottom: 5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    margin-top: 2.5rem;
    padding-bottom: 0.75rem;
}

.section-header h2 {
    font-size: 1.75rem;
    margin-bottom: 0;
    font-weight: 600;
}

.section-subtitle {
    color: var(--playdate-gray-light);
    font-size: 0.9rem;
    font-weight: 400;
    font-style: italic;
    text-decoration: none;
    transition: var(--transition-fast);
}

.section-subtitle:hover {
    color: var(--playdate-yellow-dark);
    text-decoration: underline;
}

/* Modern Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Horizontal Games Row */
.games-row {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 0.5rem 0 1.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.games-row::-webkit-scrollbar {
    height: 8px;
}

.games-row::-webkit-scrollbar-track {
    background: var(--playdate-cream);
    border-radius: 4px;
}

.games-row::-webkit-scrollbar-thumb {
    background: var(--playdate-yellow);
    border-radius: 4px;
}

.games-row::-webkit-scrollbar-thumb:hover {
    background: var(--playdate-yellow-dark);
}

.games-row .game-card {
    flex: 0 0 300px;
    width: 280px;
}

/* Collections Section Styles */
.collections-section {
    margin-bottom: 5rem;
}

.collections-row {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 0.5rem 0 1.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.collections-row::-webkit-scrollbar {
    height: 8px;
}

.collections-row::-webkit-scrollbar-track {
    background: var(--playdate-cream);
    border-radius: 4px;
}

.collections-row::-webkit-scrollbar-thumb {
    background: var(--playdate-yellow);
    border-radius: 4px;
}

.collections-row::-webkit-scrollbar-thumb:hover {
    background: var(--playdate-yellow-dark);
}

/* Home page collection cards use game card layout */
.home-collection-card {
    flex: 0 0 280px;
    width: 280px;
}

.home-collection-card .collection-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* Past Weekly Questions Section */
.past-questions-section {
    margin-bottom: 3rem;
}

/* Past question cards match home collection card styling */
.past-question-home-card {
    flex: 0 0 280px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px;
}

.past-question-home-card .collection-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.past-question-home-card .game-image,
.past-question-home-card .collection-image {
    position: relative;
    width: 100%;
    height: 200px !important;
    min-height: 200px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
    background: var(--playdate-gray-lightest);
}

.past-question-home-card .game-content {
    padding: 1rem;
}

.past-question-home-card .game-title {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--playdate-black);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.past-question-home-card .collection-author {
    margin: 0;
    font-size: 0.85rem;
    color: var(--playdate-gray-light);
}

/* Past Question Badge and Notice */
.past-question-badge {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%) !important;
}

.back-to-history-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--playdate-yellow-dark);
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: var(--playdate-yellow-lightest);
    border: 1px solid var(--playdate-yellow);
    border-radius: var(--radius-md);
    margin-left: 1rem;
    transition: all 0.2s ease;
}

.back-to-history-link:hover {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    text-decoration: none;
    transform: translateX(-2px);
}

.past-question-notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-md);
    margin-top: 1.5rem;
    border: 2px solid var(--playdate-yellow);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(255, 173, 0, 0.15);
}

.past-question-notice::before {
    content: "🏆";
    font-size: 1.5rem;
    flex-shrink: 0;
}

.past-question-notice p {
    margin: 0;
    color: var(--playdate-black);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Dark mode past question notice */
[data-theme="dark"] .past-question-notice {
    background: linear-gradient(135deg, #422006 0%, #713f12 100%);
    border-color: var(--playdate-yellow-dark);
}

[data-theme="dark"] .past-question-notice p {
    color: var(--playdate-cream);
}

[data-theme="dark"] .back-to-history-link {
    background: rgba(255, 173, 0, 0.15);
    border-color: var(--playdate-yellow-dark);
    color: var(--playdate-yellow);
}

[data-theme="dark"] .back-to-history-link:hover {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
}

.home-collection-card .collection-image {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
    background: var(--playdate-gray-lightest);
}

.collection-games-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 100%;
    gap: 1px;
}

.preview-game-tile {
    background: var(--playdate-gray-lightest);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-game-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-game-tile.empty-tile {
    background: var(--playdate-gray-lightest);
}

.games-count-overlay {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
}

.empty-collection-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--playdate-gray-lightest);
    color: var(--playdate-gray-light);
}

.empty-icon {
    font-size: 2rem;
    font-weight: 600;
}

.home-collection-card .collection-content {
    padding: 1.5rem;
}

.collection-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--playdate-black);
    line-height: 1.3;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
}

.collection-creator {
    margin: 0 0 0.75rem 0;
    font-size: 0.85rem;
    color: var(--playdate-gray-light);
    font-weight: 500;
}

.home-collection-card .collection-description {
    margin: 0 0 1rem 0;
    font-size: 0.85rem;
    color: var(--playdate-gray);
    line-height: 1.4;
}

.collection-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--playdate-gray-light);
    font-weight: 500;
}

/* Tabs Container */
.tabs-container {
    margin: 1rem 0 2rem 0;
}

.tabs {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.tab-button {
    background: var(--playdate-white);
    border: 2px solid var(--playdate-border);
    padding: 1rem 2rem;
    cursor: pointer;
    font-size: 1rem;
    color: var(--playdate-gray);
    border-radius: 50px;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    box-shadow: var(--shadow-sm);
    min-width: 140px;
}

.tab-button:hover {
    color: var(--playdate-black);
    background: var(--playdate-yellow-light);
    border-color: var(--playdate-yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tab-button.active {
    color: var(--playdate-white);
    background: var(--playdate-yellow);
    border-color: var(--playdate-yellow);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Filter buttons */
.filter-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--playdate-white);
    border: 2px solid var(--playdate-border);
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 25px;
    transition: all 0.3s ease;
    color: var(--playdate-gray-dark);
}

.filter-btn:hover {
    background: var(--playdate-gray-lightest);
    transform: translateY(-1px);
}

.filter-btn.active {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    border-color: var(--playdate-yellow-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.filter-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
}

.sale-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
    z-index: 2;
    display: inline-block;
    width: auto;
    max-width: none;
    box-shadow: var(--shadow-sm);
}

/* OLD - TO REMOVE: .itch-badge absolute positioning */
.itch-badge {
    /* position: absolute;
    top: 1rem;
    right: 1rem; */
    background: #fa5c5c;
    color: var(--playdate-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
    white-space: nowrap;
    width: auto;
    max-width: none;
}

/* OLD - TO REMOVE: .combined-badge absolute positioning */
.combined-badge {
    /* position: absolute;
    top: 1rem;
    right: 1rem; */
    background: linear-gradient(135deg, var(--playdate-yellow) 0%, #FF6B35 50%, #FA5C5C 100%);
    color: var(--playdate-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
    white-space: nowrap;
    width: auto;
    max-width: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.sale-countdown {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--playdate-gray);
}

.countdown-timer {
    font-weight: bold;
    color: var(--playdate-yellow-dark);
}

.rating {
    font-size: 0.9rem;
    color: #B8860B;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--playdate-gray);
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: var(--playdate-black);
}

.game-card {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    border: 1px solid var(--playdate-border);
}

.game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.game-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.game-image {
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: var(--gradient-secondary);
    position: relative;
}

.game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.game-card:hover .game-image img {
    transform: scale(1.1);
}

.placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 4rem;
    background: var(--gradient-secondary);
    color: var(--playdate-gray-lighter);
    filter: grayscale(0.3);
}

.game-content {
    padding: 0.75rem 1rem 1rem;
}

.game-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    color: var(--playdate-black);
    line-height: 1.3;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
    font-weight: 700;
}

.developer {
    color: var(--playdate-gray-light);
    font-size: 0.8rem;
    margin-bottom: 0;
    font-weight: 500;
}

.price {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--playdate-yellow-dark);
    display: flex;
    align-items: center;
    margin: 0;
    gap: 0.35rem;
}

.sale-price {
    color: var(--color-error);
}

.sale-price s {
    color: var(--playdate-gray-lighter);
    font-weight: 400;
    margin-right: 0.5rem;
}

.discount {
    background: var(--color-error);
    color: var(--playdate-white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* OLD - TO REMOVE: .season-badge absolute positioning (now inline pill) */
.season-badge {
    /* position: absolute;
    top: 1rem;
    right: 1rem; */
    background: var(--gradient-primary);
    color: var(--playdate-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.coming-soon-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    color: var(--playdate-white);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.7rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    /* Override any .badge class that makes it full-width */
    width: auto;
    display: inline-block;
    top: auto;
    left: auto;
}

.free-badge {
    background: var(--color-success);
    color: var(--playdate-white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Enhanced View All Button */
.view-all {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--playdate-gray-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
    background: transparent;
    font-size: 0.9rem;
}

.view-all:hover {
    color: var(--playdate-yellow-dark);
    background: var(--playdate-yellow-light);
}

.view-all::after {
    content: '→';
    transition: var(--transition-fast);
}

.view-all:hover::after {
    transform: translateX(4px);
}

/* Modern Filters */
.browse-header {
    text-align: center;
    margin: 3rem 0 1rem 0;
    padding: 2rem;
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.browse-header h1 {
    margin-bottom: 0.5rem;
}

.browse-header p {
    color: var(--playdate-gray-light);
    font-size: 1.1rem;
}

/* Special Browse Headers */
.browse-header-special {
    background: var(--gradient-hero);
    border: 2px solid var(--playdate-yellow);
    box-shadow: var(--shadow-md);
    padding: 3rem 2rem;
    position: relative;
    overflow: hidden;
}

.browse-header-special::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--playdate-yellow) 0%, transparent 70%);
    opacity: 0.1;
    border-radius: 50%;
}

.browse-header-special h1 {
    position: relative;
    z-index: 1;
}

.browse-header-special p {
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    font-weight: 500;
}

/* Animated background pattern for special headers */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.browse-header-special::after {
    content: '';
    position: absolute;
    bottom: -10%;
    left: -5%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--playdate-yellow-dark) 0%, transparent 70%);
    opacity: 0.08;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.browse-header-special h1 {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.browse-header-special p {
    font-size: 1.25rem;
    color: var(--playdate-gray);
    font-weight: 500;
}

/* Sort controls */
.sort-controls {
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 250px;
}

.sort-dropdown {
    width: 100%;
    padding: 0.75rem 1.25rem;
    padding-right: 2.5rem;
    border: 2px solid var(--playdate-gray-lighter);
    border-radius: var(--radius-lg);
    background: var(--playdate-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--playdate-gray-dark);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.sort-dropdown:hover {
    border-color: var(--playdate-gray);
    background-color: var(--playdate-gray-lightest);
}

.sort-dropdown:focus {
    outline: none;
    border-color: var(--playdate-yellow);
    box-shadow: 0 0 0 3px rgba(255, 173, 0, 0.1);
}

.filters {
    background: var(--playdate-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--playdate-border);
}

.filter-form {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

/* Advanced Filters Panel — flex layout with explicit child widths.
   Predictable across browsers: each section claims a min flex-basis and
   wraps cleanly. On narrow viewports the basis goes to 100% so each
   section spans its own row. Avoids cross-browser quirks of auto-fit grids
   with min() track sizes. */
.advanced-filters {
    width: 100%;
    box-sizing: border-box;
    margin-top: 1rem;
    padding: 1rem 1.25rem 1.1rem;
    background: rgba(0, 0, 0, 0.025);
    border: 1px solid var(--playdate-border);
    border-radius: var(--radius-md);
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.5rem;
    align-items: stretch;
}

.advanced-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
    flex: 1 1 280px;
}

.advanced-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--playdate-gray);
}

.advanced-section-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    min-width: 0;
}

/* Selects and dates fill the section width, but never get absurdly small */
.advanced-section-controls > .advanced-select,
.advanced-section-controls > .advanced-date {
    flex: 1 1 140px;
    min-width: 0;
}

.advanced-select {
    min-width: 0;
}

.advanced-date {
    min-width: 0;
}

/* Mobile / tablet — single-column stack via flex-basis 100% */
@media (max-width: 768px) {
    .advanced-filters {
        padding: 0.85rem 0.85rem 0.95rem;
        gap: 0.85rem;
    }
    .advanced-filters > .advanced-section {
        flex: 1 1 100%;
        min-width: 0;
    }
    .advanced-section-controls {
        gap: 0.4rem;
    }
    /* On mobile each form control fills its row */
    .advanced-section-controls > .filter-select,
    .advanced-section-controls > .advanced-select,
    .advanced-section-controls > .advanced-date {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
    }
    /* Date Range: From/To stay on one row, separator centred between them */
    .advanced-date-range {
        flex-wrap: nowrap;
        align-items: center;
    }
    .advanced-date-range > .advanced-date {
        flex: 1 1 0;
        min-width: 0;
    }
    .advanced-date-sep {
        flex: 0 0 auto;
    }
    /* Display toggle pills: one per row with consistent width on narrow screens */
    .advanced-toggle {
        flex: 1 1 100%;
    }
    .advanced-toggle .advanced-toggle-pill {
        display: block;
        text-align: center;
    }
}

.advanced-date-sep {
    color: var(--playdate-text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0 0.125rem;
}

/* Toggle pill buttons for checkboxes */
.advanced-toggle {
    cursor: pointer;
    user-select: none;
}

.advanced-toggle input[type="checkbox"] {
    display: none;
}

.advanced-toggle-pill {
    display: inline-block;
    padding: 0.5rem 1rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--playdate-gray);
    background: var(--playdate-white);
    transition: var(--transition-fast);
}

.advanced-toggle-pill:hover {
    border-color: var(--playdate-gray);
    color: var(--playdate-black);
}

.advanced-toggle input[type="checkbox"]:checked + .advanced-toggle-pill {
    background: var(--playdate-yellow-light);
    border-color: var(--playdate-yellow);
    color: var(--playdate-yellow-dark);
}

[data-theme="dark"] .advanced-filters {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .advanced-section-label {
    color: rgba(255, 255, 255, 0.55);
}

[data-theme="dark"] .advanced-toggle-pill {
    background: var(--playdate-gray-lightest);
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .advanced-toggle-pill:hover {
    color: var(--playdate-white);
}

[data-theme="dark"] .advanced-toggle input[type="checkbox"]:checked + .advanced-toggle-pill {
    background: rgba(255, 173, 0, 0.15);
    border-color: var(--playdate-yellow);
    color: var(--playdate-yellow);
}

/* Legacy class kept for backward compatibility */
.ai-filter-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-form .search-input {
    flex: 1;
    min-width: 300px;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    background: var(--playdate-cream);
    transition: var(--transition-fast);
}

.filter-form .search-input:focus {
    border-color: var(--playdate-yellow);
    background: var(--playdate-white);
    box-shadow: 0 0 0 3px var(--playdate-yellow-light);
}

/* Unified custom-styled select — replaces native browser chevrons with a single
   themed indicator that matches the rest of the form controls. */
.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.875rem 2.4rem 0.875rem 1rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    background-color: var(--playdate-white);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px 12px;
    color: var(--playdate-black);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.2;
    min-width: 160px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.filter-select:hover {
    border-color: var(--playdate-gray);
}

.filter-select:focus,
.filter-select:focus-visible {
    border-color: var(--playdate-yellow);
    box-shadow: 0 0 0 3px var(--playdate-yellow-light);
    outline: none;
}

/* Date inputs — match select sizing/border so the row feels uniform */
.advanced-date {
    appearance: none;
    -webkit-appearance: none;
    padding: 0.85rem 0.85rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    background: var(--playdate-white);
    color: var(--playdate-black);
    font: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.advanced-date:hover { border-color: var(--playdate-gray); }
.advanced-date:focus,
.advanced-date:focus-visible {
    border-color: var(--playdate-yellow);
    box-shadow: 0 0 0 3px var(--playdate-yellow-light);
    outline: none;
}

/* Date Range: keep the two date inputs glued to the "to" separator on a single
   visual row (they wrap as a group, not individually) */
.advanced-date-range {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    flex: 1 1 100%;
    min-width: 0;
}
.advanced-date-range > .advanced-date {
    flex: 1 1 130px;
    min-width: 0;
}

/* Legacy date-filters class kept for any remaining references */
.date-filters {
    width: 100%;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--playdate-border);
}

.filter-btn {
    padding: 0.875rem 2rem;
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover {
    background: var(--gradient-primary);
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}
.filter-btn:active {
    transform: translateY(0);
    filter: brightness(0.98);
}
.filter-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--playdate-yellow-light);
}

.filter-btn.secondary {
    background: var(--playdate-white);
    color: var(--playdate-black);
    border: 2px solid var(--playdate-border);
}

.filter-btn.secondary:hover {
    background: var(--playdate-light);
    border-color: var(--playdate-yellow);
    color: var(--playdate-black);
    filter: none;
}

/* Removed sparkle emoji */

/* Modern Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin: 3rem 0;
    padding: 2rem;
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.page-link {
    padding: 0.75rem 1.5rem;
    background: var(--playdate-cream);
    color: var(--playdate-gray);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.page-link:hover {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.page-link.active {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border-color: var(--playdate-yellow-dark);
}

.page-info {
    color: var(--playdate-gray-light);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    background: var(--playdate-cream);
    border-radius: var(--radius-md);
}

/* Enhanced Game Detail Page */
.game-detail {
    background: var(--playdate-white);
    padding: 3rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid var(--playdate-border);
}

.game-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.game-info-left {
    grid-column: span 2;
}

.game-media-section {
    grid-column: span 1;
}

.game-image-large {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--gradient-secondary);
    box-shadow: var(--shadow-md);
}

.game-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image-large {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 6rem;
    color: var(--playdate-gray-lighter);
    background: var(--gradient-secondary);
}

.game-info h1 {
    margin-bottom: 1rem;
    font-size: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.season-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 50%;
    flex-shrink: 0;
}

.season-icon svg {
    width: 20px;
    height: 20px;
    color: var(--playdate-white);
}

.game-info .developer {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--playdate-gray-light);
}

.price-box {
    margin: 0.5rem 0;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--playdate-yellow-light) 0%, rgba(255, 173, 0, 0.1) 100%);
    border-radius: var(--radius-md);
    border: 2px solid var(--playdate-yellow);
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.price-box .price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--playdate-black);
}

.price-box .free {
    font-size: 1.25rem;
    font-weight: 700;
    color: #27ae60;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.price-box .coming-soon {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--playdate-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-box .season-1-included {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--playdate-yellow-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-box .no-price {
    font-size: 1rem;
    color: var(--playdate-gray-light);
}

/* Price with action icons container */
.price-actions-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.action-icons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Action button tooltips */
.action-tooltip {
    position: relative;
}

.action-tooltip::before,
.action-tooltip::after {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.action-tooltip::before {
    content: attr(data-tooltip);
    bottom: calc(100% + 8px);
    background: #1f2937;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    transform: translateX(-50%) translateY(4px);
}

.action-tooltip::after {
    content: '';
    bottom: calc(100% + 4px);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    transform: translateX(-50%) translateY(4px);
}

@media (hover: hover) {
    .action-tooltip:hover::before,
    .action-tooltip:hover::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Round action buttons for detail page */
.library-btn-detail,
.wishlist-btn-detail,
.collections-btn-detail {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
    font-size: 1.2rem;
    color: var(--playdate-gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.library-btn-detail {
    background: rgba(76, 175, 80, 0.1);
    border-color: rgba(76, 175, 80, 0.3);
}

.library-btn-detail:hover {
    background: rgba(76, 175, 80, 0.9);
    border-color: rgba(76, 175, 80, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4);
}

.library-btn-detail.in-library {
    background: rgba(76, 175, 80, 0.9);
    border-color: rgba(76, 175, 80, 1);
}

.library-btn-detail.in-library:hover {
    background: rgba(244, 67, 54, 0.9);
    border-color: rgba(244, 67, 54, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.4);
}

.wishlist-btn-detail {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

.wishlist-btn-detail:hover {
    background: rgba(255, 193, 7, 0.9);
    border-color: rgba(255, 193, 7, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
}

.wishlist-btn-detail.in-wishlist {
    background: rgba(233, 30, 99, 0.9);
    border-color: rgba(233, 30, 99, 1);
}

.wishlist-btn-detail.in-wishlist:hover {
    background: rgba(233, 30, 99, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(233, 30, 99, 0.4);
}

.collections-btn-detail {
    background: rgba(63, 81, 181, 0.1);
    border-color: rgba(63, 81, 181, 0.3);
}

.collections-btn-detail:hover {
    background: rgba(63, 81, 181, 0.9);
    border-color: rgba(63, 81, 181, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(63, 81, 181, 0.4);
    color: white;
}

.share-btn-detail {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: var(--transition-fast);
    font-size: 1.2rem;
    color: var(--playdate-gray-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.share-btn-detail:hover {
    background: rgba(33, 150, 243, 0.9);
    border-color: rgba(33, 150, 243, 1);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.4);
}

/* Share Popup */
.share-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.share-popup {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.share-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e5e7eb;
}

.share-popup-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.share-popup-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    line-height: 1;
}

.share-popup-close:hover {
    color: #111;
}

.share-popup-body {
    padding: 1.25rem;
}

.share-url-group {
    margin-bottom: 1.25rem;
}

.share-url-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.share-url-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.share-url-row:last-child {
    margin-bottom: 0;
}

.share-url-input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #374151;
    background: #f9fafb;
    outline: none;
}

.share-url-input:focus {
    border-color: var(--playdate-yellow);
}

.share-copy-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    background: var(--playdate-yellow);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    color: #000;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.share-copy-btn:hover {
    background: var(--playdate-yellow-dark, #e6b800);
    transform: translateY(-1px);
}

.share-embed-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.share-embed-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
}

.share-embed-image {
    width: 100%;
    display: block;
}

.share-embed-info {
    padding: 0.75rem;
}

.share-embed-url {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.15rem;
}

.share-embed-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.share-embed-desc {
    font-size: 0.8rem;
    color: #6b7280;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Season Info for game detail pages */
.season-info {
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.season-info .season-badge {
    display: inline-block;
    background: var(--gradient-primary);
    color: var(--playdate-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

/* Enhanced Sale Pricing */
.sale-pricing {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.original-price {
    font-size: 1.1rem;
    color: var(--playdate-gray-lighter);
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    font-weight: 500;
}

.current-price {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-error);
}

.discount-badge {
    background: var(--color-error);
    color: var(--playdate-white);
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Price note for combined games with different platform prices */
.price-note {
    font-size: 0.8rem;
    color: var(--playdate-gray-light);
    margin-top: 0.25rem;
    text-align: center;
    font-weight: 500;
    font-style: italic;
}

/* Sale Countdown Timers */
.sale-countdown {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(231, 76, 60, 0.1);
    border-radius: var(--radius-sm);
    border-left: 3px solid #e74c3c;
    display: block;
    font-size: 0.85rem;
    width: fit-content;
}

.countdown-text {
    color: var(--playdate-gray-light);
    font-size: 0.85rem;
    font-weight: 500;
}

.countdown-timer {
    color: var(--color-error);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Sale badge on image overlay (bottom-left) */
.sale-badge-compact {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: #e74c3c;
    color: white;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.sale-badge-compact .countdown-timer-compact {
    background: none;
    padding: 0;
    color: white;
    font-size: inherit;
    letter-spacing: normal;
    text-transform: none;
}

.sale-countdown-compact {
    margin-top: 0.5rem;
    text-align: center;
}

.countdown-timer-compact {
    display: inline-block;
    background: var(--color-error);
    color: var(--playdate-white);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-expired {
    background: var(--playdate-gray-lighter);
    color: var(--playdate-white);
}

.coming-soon {
    color: var(--playdate-gray-lighter);
    font-style: italic;
}

.free {
    color: #27ae60;
    font-weight: 800;
}

/* Game Actions */
.game-actions {
    display: flex;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--playdate-cream);
    color: var(--playdate-gray);
    border: 2px solid var(--playdate-border);
}

.btn-secondary:hover {
    background: var(--playdate-white);
    border-color: var(--playdate-yellow);
    transform: translateY(-2px);
}

/* Library Management Buttons */
.btn-library {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.btn-library:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-library-remove {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.btn-library-remove:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: var(--playdate-white);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-actions {
    display: flex !important;
    gap: 1rem !important;
    align-items: center !important;
    margin-bottom: 1rem;
    flex-wrap: nowrap !important;
    flex-direction: row !important;
}

.library-actions {
    display: inline-block !important;
    margin-right: 1rem;
}

.wishlist-actions {
    display: inline-block !important;
}

.btn-wishlist {
    background: var(--playdate-gray-lightest);
    color: var(--playdate-gray-dark);
    border: 2px solid var(--playdate-border);
}

.btn-wishlist:hover {
    background: var(--playdate-yellow-light);
    color: var(--playdate-yellow-dark);
    border-color: var(--playdate-yellow);
}

.btn-wishlist-remove {
    background: var(--color-error-bg);
    color: var(--color-error-dark);
    border: 2px solid #f5c6cb;
}

.btn-wishlist-remove:hover {
    background: #f1b0b7;
    border-color: #e2a7ac;
    color: #491217;
}

.library-stats {
    margin-top: 1rem;
}

.stat-badge {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
}

/* Profile Page Styles */
.profile-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

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

.stat-card {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition-fast);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 2.5rem;
    width: 4rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--playdate-yellow-light);
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--playdate-black);
    margin: 0 0 0.25rem 0;
}

.stat-info p {
    color: var(--playdate-gray-light);
    margin: 0;
    font-weight: 500;
}

.profile-section {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.profile-section h2 {
    color: var(--playdate-black);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

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

.section-header h2 {
    margin-bottom: 0;
}

.source-distribution {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.source-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-md);
    flex: 1;
    min-width: 200px;
}

.source-count {
    font-weight: 600;
    color: var(--playdate-gray);
}

.recent-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.recent-game-card {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition-fast);
    position: relative;
    border: 1px solid var(--playdate-border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.recent-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.recent-game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--playdate-yellow-light);
}

.recent-game-card:hover::before {
    opacity: 1;
}

.recent-game-card .game-image {
    width: 100%;
    height: 140px;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.recent-game-card .game-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.recent-game-card .game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.recent-game-card:hover .game-image img {
    transform: scale(1.05);
}

.recent-game-card .placeholder-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--playdate-gray-light);
    border-radius: var(--radius-md);
}

.recent-game-card .game-info h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--playdate-black);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.recent-game-card .game-info p {
    color: var(--playdate-gray-light);
    font-size: 0.9rem;
    margin: 0 0 0.75rem 0;
    font-weight: 500;
}

.recent-game-card .price {
    font-weight: 600;
    color: var(--playdate-black);
    font-size: 1rem;
    padding: 0.375rem 0.625rem;
    background: var(--playdate-yellow-light);
    border-radius: var(--radius-sm);
    display: inline-block;
    border: 1px solid var(--playdate-yellow);
    margin-bottom: 0.5rem;
}

.recent-game-card .game-link {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: var(--transition-fast);
}

.recent-game-card .game-link:hover {
    background: var(--playdate-yellow-dark);
    color: var(--playdate-white);
}

.account-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-sm);
}

.info-label {
    font-weight: 600;
    color: var(--playdate-gray);
}

.info-value {
    color: var(--playdate-black);
    font-weight: 500;
}

.status-verified {
    color: var(--color-success);
    font-weight: 600;
}

.status-unverified {
    color: var(--color-error);
    font-weight: 600;
}
.status-enabled {
    color: var(--color-success);
    font-weight: 600;
}
.status-disabled {
    color: var(--color-error);
    font-weight: 600;
}

.form-control-disabled {
    background-color: var(--playdate-gray-lightest);
    color: var(--playdate-gray-light);
    cursor: not-allowed;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .profile-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .profile-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .section-header {
        flex-direction: row;
        align-items: center;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .section-header h2 {
        margin-right: auto;
    }
    
    .source-distribution {
        flex-direction: column;
    }
    
    .recent-games-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Rating System Styles */
.user-rating-section {
    background: var(--playdate-yellow-light);
    border: 1px solid var(--playdate-yellow);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.game-actions {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Override for game cards (not game detail page) */
.game-card .game-actions {
    flex-direction: row;
    gap: 0.75rem;
    margin-bottom: 0;
    align-items: center;
    flex-wrap: wrap;
}

.library-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.library-actions .btn {
    min-width: 180px;
}

.external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.external-links .btn {
    flex: 0 1 auto;
    min-width: 140px;
    max-width: 220px;
    text-align: center;
    justify-content: center;
}

/* Special case for single primary button */
.external-links .btn:only-child {
    max-width: 300px;
}

.user-rating-section h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.125rem;
    color: var(--playdate-black);
    font-weight: 600;
    text-align: center;
}

.star-rating {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    justify-content: center;
}

.star {
    font-size: 1.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    opacity: 0.3;
    line-height: 1;
    color: #ffad00 !important;
}

.star:hover,
.star.highlighted {
    opacity: 0.7;
    transform: scale(1.1);
}

.star.rated {
    opacity: 1;
    transform: scale(1);
}

.rating-text {
    margin: 0;
    color: var(--playdate-gray);
    font-size: 0.875rem;
    text-align: center;
    font-weight: 500;
}

.rating-distribution-section {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.rating-distribution-section h2 {
    margin-bottom: 1.5rem;
    color: var(--playdate-black);
}

.rating-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.rating-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-label {
    width: 80px;
    font-size: 0.875rem;
    color: var(--playdate-gray);
    text-align: right;
}

.rating-progress {
    flex: 1;
    height: 20px;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.rating-fill {
    height: 100%;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.rating-count {
    width: 30px;
    text-align: center;
    font-weight: 600;
    color: var(--playdate-gray);
}

.ratings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.rating-card {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
}

.rating-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.rating-card .game-image {
    width: 100%;
    height: 200px;
    margin-bottom: 1rem;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.rating-card .game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--playdate-black);
}

.rating-info p {
    margin: 0 0 1rem 0;
    color: var(--playdate-gray-light);
}

.user-rating {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--playdate-yellow-light);
    border-radius: var(--radius-sm);
}

.stars-display {
    display: flex;
    gap: 0.25rem;
}

.stars-display .star {
    font-size: 1.2rem;
    opacity: 0.3;
}

.stars-display .star.rated {
    opacity: 1;
}

.rating-value {
    font-weight: 600;
    color: var(--playdate-black);
    font-size: 1.1rem;
}

.rating-meta {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-date {
    color: var(--playdate-gray-light);
    font-size: 0.875rem;
}

.rating-updated {
    color: var(--playdate-gray-lighter);
    font-size: 0.75rem;
    font-style: italic;
}

.rating-actions {
    margin-top: 1rem;
}

.rating-summary {
    margin-top: 1rem;
}

/* Library Game Actions */
.library-game-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.library-game-actions form {
    display: inline;
}

/* Library Rating Display */
.library-user-rating {
    margin: 0.75rem 0;
    padding: 1rem;
    background: var(--playdate-yellow-light);
    border-radius: var(--radius-md);
    border: 1px solid var(--playdate-yellow);
    box-shadow: var(--shadow-sm);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--playdate-gray);
    min-width: 80px;
}

.stars-small {
    display: flex;
    gap: 0.25rem;
}

.star-small {
    font-size: 1.125rem;
    opacity: 0.3;
    transition: var(--transition-fast);
    line-height: 1;
}

.star-small.rated {
    opacity: 1;
    color: var(--playdate-yellow-dark);
}

.no-rating {
    font-size: 0.875rem;
    color: var(--playdate-gray-light);
    font-style: italic;
}

/* Library Card Styling */
.library-card {
    display: flex;
    flex-direction: column;
    height: auto;
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
    border: 1px solid var(--playdate-border);
    overflow: hidden;
    position: relative;
}

.library-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition-fast);
}

.library-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--playdate-yellow-light);
}

.library-card:hover::before {
    opacity: 1;
}

.library-card-image {
    flex-shrink: 0;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.library-card-image .game-image {
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition-fast);
    aspect-ratio: 16/9;
    width: 100%;
    position: relative;
}

.library-card-image:hover .game-image img {
    transform: scale(1.05);
}

.library-card-image .game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

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

.library-title-link {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-bottom: 0.75rem;
}

.library-title-link:hover {
    text-decoration: none;
}

.library-title-link h3 {
    margin: 0 0 0.25rem 0;
    transition: color 0.2s ease;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.library-title-link:hover h3 {
    color: var(--playdate-yellow-dark);
}

.library-title-link .developer {
    margin: 0;
    color: var(--playdate-gray-light);
    font-size: 0.9375rem;
}

.library-card-content .price {
    margin: 0 0 1rem 0;
    font-weight: 600;
    font-size: 1.125rem;
    padding: 0.5rem 0.75rem;
    background: var(--playdate-yellow-light);
    border-radius: var(--radius-sm);
    display: inline-block;
    border: 1px solid var(--playdate-yellow);
}

.library-card-content .price.sale-price {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-color: #f44336;
    color: #d32f2f;
}

.library-game-actions {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--playdate-border);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.library-game-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 0.625rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.library-game-actions .btn-primary {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.library-game-actions .btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border: none;
    color: white;
}

/* Library User Rating Display */
.library-user-rating {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-sm);
    border: 1px solid var(--playdate-border);
}

.library-user-rating .rating-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.library-user-rating .rating-label {
    color: var(--playdate-gray-light);
    font-weight: 500;
}

.library-user-rating .stars-small {
    display: flex;
    gap: 0.125rem;
}

.library-user-rating .star-small {
    font-size: 0.875rem;
    opacity: 0.3;
    transition: var(--transition-fast);
}

.library-user-rating .star-small.rated {
    opacity: 1;
    color: var(--playdate-yellow-dark);
}

.library-user-rating .no-rating {
    color: var(--playdate-gray-lighter);
    font-style: italic;
}

/* Authentication Pages Styling */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 2rem 1rem;
}

.auth-card {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    border: 1px solid var(--playdate-border);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--playdate-gray-dark);
    margin-bottom: 0.5rem;
    font-size: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-header p {
    color: var(--playdate-gray);
    margin: 0;
    font-size: 1.1rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: var(--playdate-gray-dark);
    font-size: 0.9rem;
}

.form-group input {
    padding: 0.875rem 1rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: var(--transition-fast);
    background: var(--playdate-white);
}

.form-group input:focus {
    outline: none;
    border-color: var(--playdate-yellow);
    box-shadow: 0 0 0 3px rgba(255, 173, 0, 0.1);
}

.form-group input:disabled,
.form-control-disabled {
    background: var(--playdate-gray-lightest);
    color: var(--playdate-gray-light);
    cursor: not-allowed;
}

.form-group small,
.form-help {
    color: var(--playdate-gray-lighter);
    font-size: 0.8rem;
    margin-top: -0.25rem;
}

.checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 0.75rem;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 400;
    line-height: 1.4;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin: 0;
    margin-top: 0.125rem;
}

.auth-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    text-transform: none;
}

.auth-btn.primary {
    background: var(--gradient-primary);
    color: var(--playdate-white);
}

.auth-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--playdate-border);
}

.auth-footer p {
    margin: 0.5rem 0;
}

.auth-footer a {
    color: var(--playdate-yellow-dark);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

.error-message {
    background: var(--color-error-bg);
    color: #c53030;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-error-border);
    font-size: 0.9rem;
}

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

.form-actions .btn {
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
}

.form-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--playdate-border);
}

.additional-options h3 {
    color: var(--playdate-gray-dark);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.action-links {
    margin-top: 1rem;
}

.link-secondary {
    color: var(--playdate-gray-light);
    text-decoration: none;
    font-weight: 500;
}

.link-secondary:hover {
    color: var(--playdate-yellow-dark);
    text-decoration: underline;
}

/* Mobile Responsive for Ratings */
@media (max-width: 768px) {
    .game-actions {
        gap: 1rem;
    }
    
    .library-actions {
        flex-direction: column;
    }
    
    .library-actions .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .external-links {
        justify-content: center;
    }
    
    .external-links .btn {
        flex: 0 1 auto;
        min-width: 120px;
        max-width: 200px;
    }
    
    .user-rating-section {
        padding: 1rem;
    }
    
    .star-rating {
        justify-content: center;
    }
    
    .ratings-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .rating-card {
        padding: 1rem;
    }
    
    .rating-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .rating-label {
        width: auto;
        text-align: left;
    }
    
    .user-rating {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .library-game-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .library-game-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    .library-card {
        padding: 1rem;
    }
    
    .library-title-link h3 {
        font-size: 1.125rem;
    }
    
    .library-card-content .price {
        font-size: 1rem;
    }
    
    .rating-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .rating-label {
        min-width: auto;
    }
    
    /* Auth pages mobile responsive */
    .auth-card {
        padding: 2rem 1.5rem;
        margin: 1rem;
        max-width: 100%;
    }
    
    .auth-header h1 {
        font-size: 1.75rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
}

/* Special Grid Layouts */
.games-grid-special {
    gap: 2.5rem;
}

.games-grid-new-releases {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 3rem;
}

/* Season Collections Grid */
.games-grid[data-filter="season1"],
.games-grid[data-filter="season2"] {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

/* Coming Soon Grid */
.games-grid[data-filter="coming"] {
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

.games-grid-coming-soon {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 3rem;
}

/* Special Game Cards */
.game-card-special {
    transform: scale(1);
}

.game-card-special:hover {
    transform: translateY(-10px) scale(1.03);
}

.games-grid-new-releases .game-card {
    background: var(--gradient-secondary);
    border: 2px solid var(--playdate-border);
}

.games-grid-new-releases .game-card:hover {
    border-color: var(--playdate-yellow);
    background: var(--playdate-white);
}

.games-grid-new-releases .game-image {
    aspect-ratio: 16 / 10;
}

/* Release Date Badge */
.release-date-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--playdate-white);
    color: var(--playdate-gray);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
    border: 2px solid var(--playdate-yellow);
    display: none;
}

/* Show date badges when container has the class or in weekly/new views */
.show-release-dates .release-date-badge,
.games-grid-new-releases .release-date-badge,
.release-week-games .release-date-badge {
    display: block;
}

/* Coming Soon Badge - uses rule at line ~2923 (bottom-right positioning) */

/* Bonus Badge for Blippo+ */
.bonus-badge {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: var(--playdate-white);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.75rem;
    box-shadow: var(--shadow-md);
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s infinite;
}

/* Game Tagline */
.game-tagline {
    font-size: 0.9rem;
    color: var(--playdate-gray-light);
    line-height: 1.4;
    margin: 0.75rem 0;
    font-style: italic;
    min-height: 2.5rem;
}

.game-card-special .game-content {
    padding: 2rem 1.5rem;
}

.game-card-special h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.game-card-special .developer {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.game-card-special .price {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Season 1 Cards - Special styling */
.game-card[data-filter-type="season1"] {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #60a5fa;
}

.game-card[data-filter-type="season1"]:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 30px rgba(59, 130, 246, 0.15);
}

/* Season 2 Cards - Special styling */
.game-card[data-filter-type="season2"] {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid var(--playdate-yellow);
}

.game-card[data-filter-type="season2"]:hover {
    border-color: var(--playdate-yellow-dark);
    box-shadow: 0 8px 30px rgba(255, 173, 0, 0.2);
}

/* Coming Soon Cards */
.game-card[data-filter-type="coming"] {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border: 2px solid #c084fc;
}

.game-card[data-filter-type="coming"]:hover {
    border-color: #a855f7;
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.15);
}

/* Enhanced Season Badge for special pages */
.games-grid-special .season-badge {
    background: linear-gradient(135deg, var(--playdate-yellow) 0%, var(--playdate-yellow-dark) 100%);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Season 1 specific badge */
.game-card[data-filter-type="season1"] .season-badge {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

/* Season 2 specific badge */
.game-card[data-filter-type="season2"] .season-badge {
    background: linear-gradient(135deg, var(--playdate-yellow) 0%, var(--playdate-yellow-dark) 100%);
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.3);
}

/* Seasons Page */
.seasons-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.season-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    border-bottom: 2px solid var(--playdate-border);
}

.season-tab {
    padding: 1rem 2rem;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--playdate-gray-light);
    cursor: pointer;
    transition: var(--transition-normal);
    border-bottom: 3px solid transparent;
    position: relative;
    bottom: -2px;
}

.season-tab:hover {
    color: var(--playdate-yellow-dark);
    background: var(--playdate-yellow-light);
}

.season-tab.active {
    color: var(--playdate-yellow-dark);
    border-bottom-color: var(--playdate-yellow);
    background: var(--playdate-white);
}

.season-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

.season-header {
    text-align: center;
    margin-bottom: 3rem;
}

.season-header h2 {
    font-size: 2.5rem;
    color: var(--playdate-yellow-dark);
    margin-bottom: 1rem;
}

.season-header p {
    font-size: 1.2rem;
    color: var(--playdate-gray-light);
}

/* Add All to Library Button */
.btn-add-all-season {
    margin-top: 2rem;
    padding: 1rem 2rem;
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    border: 2px solid var(--playdate-yellow-dark);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-all-season:hover:not(:disabled) {
    background: var(--playdate-yellow-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.3);
}

.btn-add-all-season:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-add-all-season.success {
    background: var(--playdate-green);
    border-color: var(--playdate-green-dark);
    color: white;
}

/* Small version for game detail pages */
.btn-add-all-season-small {
    padding: 0.5rem 1rem;
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    border: 2px solid var(--playdate-yellow-dark);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: normal;
}

.btn-add-all-season-small:hover:not(:disabled) {
    background: var(--playdate-yellow-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 173, 0, 0.3);
}

.btn-add-all-season-small:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-add-all-season-small.success {
    background: var(--playdate-green);
    border-color: var(--playdate-green-dark);
    color: white;
}

.season-badge-small {
    display: inline-block;
    background: var(--gradient-primary);
    color: var(--playdate-white);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.5rem;
}

/* Season Games Weekly Layout */
.season-games-container {
    margin: 2rem 0;
}

.season-week-section {
    margin-bottom: 3rem;
    background: var(--playdate-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--playdate-border);
}

.week-header {
    font-size: 1.5rem;
    color: var(--playdate-yellow-dark);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--playdate-border);
    position: relative;
}

.week-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--gradient-primary);
}

.season-week-games {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

/* Special case for Week 1 of Season 2 with 3 games (includes Blippo+) */
.season-games-container[data-filter="season2"] .season-week-section:first-child .season-week-games {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1024px) {
    .season-games-container[data-filter="season2"] .season-week-section:first-child .season-week-games {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Ensure exactly 2 games per row for season layout */
.season-week-games .game-card {
    margin: 0;
}

/* Release week grouped layout - matches standard games-grid sizing */
.release-week-games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.release-week-games .game-card {
    margin: 0;
}

/* Season game card styling for new seasons page */
.season-game-card {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    border: 1px solid var(--playdate-border);
}

.season-game-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.season-game-card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.season-game-card .game-image {
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    background: var(--gradient-secondary);
    position: relative;
}

.season-game-card .game-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.season-game-card:hover .game-image img {
    transform: scale(1.1);
}

.season-game-card .placeholder-image {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 4rem;
    background: var(--gradient-secondary);
    color: var(--playdate-gray-lighter);
    filter: grayscale(0.3);
}

.season-game-card .game-content {
    padding: 1.5rem;
}

.season-game-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--playdate-black);
    line-height: 1.3;
}

.season-game-card .developer {
    color: var(--playdate-gray-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Special styling for season cards in weekly view */
.season-week-games .game-card-special {
    height: 100%;
}

.season-week-games .game-card-special .game-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.season-week-games .game-card-special .game-tagline {
    flex-grow: 1;
}

/* Mobile layout for season weeks */
@media (max-width: 768px) {
    .season-week-games {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .season-week-section {
        padding: 1.5rem;
    }
    
    .week-header {
        font-size: 1.25rem;
    }
    
    /* Season tabs mobile */
    .season-tabs {
        flex-direction: column;
        gap: 0;
    }
    
    .season-tab {
        text-align: center;
        padding: 0.75rem 1rem;
        border-bottom: 1px solid var(--playdate-border);
        border-radius: 0;
    }
    
    .season-tab.active {
        background: var(--playdate-yellow-light);
        border-bottom-color: var(--playdate-yellow);
    }
    
    .seasons-container {
        padding: 0 1rem;
    }
}

/* Categories */
.categories {
    margin-top: 2rem;
}

.category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.category-tag {
    background: var(--playdate-cream);
    color: var(--playdate-gray);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-xl);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 2px solid transparent;
}

.category-tag:hover {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Dark mode styling for category tags */
[data-theme="dark"] .category-tag {
    background: rgba(255, 173, 0, 0.1);
    color: var(--playdate-yellow);
    border: 2px solid rgba(255, 173, 0, 0.3);
}

[data-theme="dark"] .category-tag:hover {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    border-color: var(--playdate-yellow);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.3);
}

/* AI Tag Styling */
.category-tag.ai-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(102, 126, 234, 0.3);
    cursor: default;
    pointer-events: none;
}

.category-tag.ai-tag:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: none;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

[data-theme="dark"] .category-tag.ai-tag {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    border: 2px solid rgba(139, 92, 246, 0.4);
}

[data-theme="dark"] .category-tag.ai-tag:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* Enhanced Description */
.description {
    margin: 1.5rem 0 2rem;
    padding: 2rem;
    background: var(--playdate-cream);
    border-radius: var(--radius-lg);
    border: 1px solid var(--playdate-border);
}

.description h2 {
    margin-bottom: 1.5rem;
    color: var(--playdate-yellow-dark);
}

.description-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--playdate-gray);
    position: relative;
    overflow: hidden;
    transition: max-height var(--transition-slow) ease-out;
}

.description-content.collapsed {
    max-height: 12.6em; /* ~10-12 lines with line-height 1.8 */
}

.description-content.collapsed::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3em;
    background: linear-gradient(to bottom, transparent, var(--playdate-cream));
    pointer-events: none;
}

.description-content p {
    margin-bottom: 1.5rem;
}

.expand-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--playdate-white);
    color: var(--playdate-gray);
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    width: 100%;
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.expand-toggle:hover {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border-color: var(--playdate-yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.expand-toggle .arrow {
    font-size: 1.2rem;
    transition: transform var(--transition-fast);
}

.expand-toggle.expanded .arrow {
    transform: rotate(180deg);
}

/* More Info Links as Buttons */
.more-info-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    max-width: 100%;
}

.info-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, var(--playdate-yellow-light) 0%, var(--playdate-yellow) 100%);
    color: var(--playdate-black);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: var(--transition-normal);
    border: 2px solid var(--playdate-yellow);
    box-shadow: var(--shadow-sm);
    min-height: 50px;
    line-height: 1.3;
}

.info-link-btn:hover {
    background: var(--playdate-yellow);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--playdate-black);
    text-decoration: none;
}

/* Dark mode styling for info link buttons */
[data-theme="dark"] .info-link-btn {
    background: rgba(255, 173, 0, 0.15);
    color: var(--playdate-yellow);
    border: 2px solid rgba(255, 173, 0, 0.5);
}

[data-theme="dark"] .info-link-btn:hover {
    background: rgba(255, 173, 0, 0.25);
    color: #ffcc00;
    border-color: var(--playdate-yellow);
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.2);
}

.info-link-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* Responsive: 4 per row on large screens, fewer on smaller screens */
@media (min-width: 1200px) {
    .more-info-links {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .more-info-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .info-link-btn {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
        min-height: 45px;
    }
}

.description-content ul,
.description-content ol {
    margin: 1rem 0 1.5rem 2rem;
}

.description-content li {
    margin-bottom: 0.5rem;
}

.description-content strong {
    color: var(--playdate-black);
    font-weight: 600;
}

.description-content em {
    font-style: italic;
    color: var(--playdate-gray-light);
}

/* Game Meta Information */
.game-meta {
    margin-top: 3rem;
    padding: 2rem;
    background: var(--playdate-cream);
    border-radius: var(--radius-lg);
    border-top: 1px solid var(--playdate-border);
}

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

.meta-item {
    background: var(--playdate-white);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.meta-item h4 {
    color: var(--playdate-yellow-dark);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.meta-item p {
    color: var(--playdate-gray);
    font-weight: 500;
}

/* Screenshots Carousel */
.screenshots-carousel {
    margin: 2rem 0;
}

.screenshots-row {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.screenshots-row::-webkit-scrollbar {
    height: 6px;
}

.screenshots-row::-webkit-scrollbar-track {
    background: var(--playdate-cream);
    border-radius: 3px;
}

.screenshots-row::-webkit-scrollbar-thumb {
    background: var(--playdate-yellow);
    border-radius: 3px;
}

.screenshots-row::-webkit-scrollbar-thumb:hover {
    background: var(--playdate-yellow-dark);
}

.screenshot-item {
    flex: 0 0 280px;
    width: 280px;
    height: 160px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--playdate-black);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--playdate-border);
}

.screenshot-item:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--playdate-yellow);
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--playdate-black);
    transition: var(--transition-normal);
    /* Playdate screen effect: Game Boy style - muted but bright and reflective */
    filter: saturate(0.6) contrast(1.1) brightness(1.05) sepia(0.2) hue-rotate(10deg);
}

/* New Game Carousel */
.game-carousel {
    width: 100%;
    height: 100%;
}

.carousel-main {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 3;
    overflow: hidden;
    border-radius: var(--radius-lg);
    background: var(--playdate-black);
    box-shadow: var(--shadow-lg);
    margin-bottom: 1rem;
    cursor: pointer;
}

/* Auto-rotate progress bar at the bottom edge of the main image. */
.carousel-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.28);
    overflow: hidden;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 2;
}
.carousel-progress.is-active { opacity: 1; }

.carousel-progress-fill {
    width: 100%;
    height: 100%;
    background: var(--playdate-yellow);
    transform-origin: left center;
    transform: scaleX(0);
    will-change: transform;
}
.carousel-progress.is-running .carousel-progress-fill {
    animation: carousel-progress-anim var(--carousel-duration, 5s) linear forwards;
}
@keyframes carousel-progress-anim {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}
@media (prefers-reduced-motion: reduce) {
    /* Still useful as a visual indicator, but skip the smooth fill */
    .carousel-progress.is-running .carousel-progress-fill {
        animation: none;
        transform: scaleX(0.05); /* a small fixed nub so users still see "active" */
    }
}

[data-theme="dark"] .carousel-progress {
    background: rgba(255, 255, 255, 0.18);
}

.carousel-main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform var(--transition-slow);
}

.carousel-main:hover img {
    transform: scale(1.02);
}

.carousel-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 0.5rem;
    max-height: 180px;
    overflow-x: hidden;       /* never show a horizontal scrollbar from hover scale / box-shadow spillage */
    overflow-y: auto;
    /* Reserve space for the y-scrollbar so the grid doesn't reflow when it appears,
       which otherwise causes a brief horizontal-scroll flash on hover. */
    scrollbar-gutter: stable;
    /* A pinch of padding gives the active thumb's outline shadow room to render
       without being clipped by the scroll container. */
    padding: 2px;
}

.carousel-thumb {
    aspect-ratio: 5 / 3;
    overflow: hidden;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    border: 2px solid transparent;
    opacity: 0.6;
    transform-origin: center;
}

.carousel-thumb.active {
    border-color: var(--playdate-yellow);
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(255, 173, 0, 0.3);
}

.carousel-thumb:hover {
    opacity: 1;
    transform: scale(1.04);
}

.carousel-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Playdate screen effect: Game Boy style - muted but bright and reflective */
    filter: saturate(0.6) contrast(1.1) brightness(1.05) sepia(0.2) hue-rotate(10deg);
}

/* Carousel Rating */
.carousel-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--playdate-gray-light);
}

.carousel-rating .rating-score {
    color: var(--playdate-yellow-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

.carousel-rating .rating-count {
    color: var(--playdate-gray-lighter);
    font-size: 0.9rem;
}

.carousel-rating .rating-breakdown,
.image-rating .rating-breakdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--playdate-gray-lighter);
    flex-wrap: wrap;
    justify-content: center;
}

.rating-breakdown .rating-source {
    color: var(--playdate-gray-light);
}

.rating-breakdown .rating-separator {
    color: var(--playdate-gray-lighter);
    margin: 0 0.25rem;
}

/* Image Rating (for single images) */
.image-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 1rem;
    color: var(--playdate-gray-light);
}

.image-rating .rating-score {
    color: var(--playdate-yellow-dark);
    font-weight: 600;
    font-size: 1.1rem;
}

.image-rating .rating-count {
    color: var(--playdate-gray-lighter);
    font-size: 0.9rem;
}

/* Categories Page */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-card {
    background: var(--playdate-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    border: 1px solid var(--playdate-border);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.category-card h3 {
    color: var(--playdate-yellow-dark);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.category-card .game-count {
    color: var(--playdate-gray-light);
    font-size: 1.1rem;
    font-weight: 600;
}

/* Statistics Page Enhancements */
.statistics-page h1 {
    text-align: center;
    margin-bottom: 3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.statistics-page section {
    background: var(--playdate-white);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--playdate-border);
}

.statistics-page section h2 {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--playdate-border);
    position: relative;
}

.statistics-page section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--gradient-primary);
}

/* Enhanced Cost Cards */
.cost-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1200px) {
    .cost-cards {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.25rem;
    }
}

.cost-card {
    background: var(--gradient-secondary);
    padding: 2rem 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 2px solid var(--playdate-border);
    transition: var(--transition-normal);
    position: relative;
    overflow: visible;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cost-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.cost-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.cost-card.primary {
    background: var(--playdate-yellow-light);
    border-color: var(--playdate-yellow);
}

.cost-card.highlight {
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border-color: var(--playdate-yellow-dark);
    box-shadow: var(--shadow-md);
}

.big-number {
    font-size: 2.8rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0.75rem 0;
    word-break: keep-all;
    white-space: nowrap;
}

.cost-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.cost-card p {
    margin: 0.5rem 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.cost-card small {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--playdate-gray-light);
    line-height: 1.3;
}

.cost-card.highlight .big-number {
    color: var(--playdate-white);
    background: none;
    -webkit-text-fill-color: white;
}

/* Statistics Page Components */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--playdate-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    border: 1px solid var(--playdate-border);
    transition: var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--playdate-yellow-dark);
    margin-bottom: 0.5rem;
}

.stat-card p {
    color: var(--playdate-gray);
    font-size: 1rem;
    margin: 0;
}

.sub-text {
    font-size: 0.85rem;
    color: var(--playdate-gray-light);
    margin-top: 0.5rem;
}

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

.price-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-lg);
}

.price-stat .label {
    font-size: 1rem;
    color: var(--playdate-gray);
}

.price-stat .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--playdate-yellow-dark);
}

.price-distribution {
    margin-top: 2rem;
}

.price-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.bar-label {
    font-size: 1rem;
    color: var(--playdate-gray);
    min-width: 80px;
    text-align: right;
}

.bar-container {
    flex: 1;
    height: 30px;
    background: var(--playdate-gray-lightest);
    border-radius: 15px;
    overflow: hidden;
}

.bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 15px;
    transition: width 0.5s ease;
    min-width: 2px; /* Ensure bars show even for small percentages */
}

.bar-count {
    font-size: 1rem;
    font-weight: 600;
    color: var(--playdate-yellow-dark);
    min-width: 40px;
    text-align: center;
}

.sale-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.sale-stat {
    flex: 1;
    text-align: center;
    padding: 2rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-lg);
}

.sale-stat .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--playdate-yellow-dark);
    margin-bottom: 0.5rem;
}

.sale-stat .stat-label {
    font-size: 1rem;
    color: var(--playdate-gray);
}

.dev-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-box {
    flex: 1;
    text-align: center;
    padding: 2rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-lg);
}

.stat-box .stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--playdate-yellow-dark);
    margin-bottom: 0.5rem;
}

.stat-box .stat-label {
    font-size: 1rem;
    color: var(--playdate-gray);
}

.top-developers {
    margin-top: 2rem;
}

.developer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    margin-bottom: 0.5rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-md);
    transition: var(--transition-normal);
}

.developer-row:hover {
    background: var(--playdate-gray-lighter);
}

.dev-name {
    font-size: 1rem;
    color: var(--playdate-gray-dark);
    font-weight: 500;
}

.dev-count {
    font-size: 0.9rem;
    color: var(--playdate-gray);
    font-weight: 600;
}

.tech-stats {
    display: flex;
    gap: 2rem;
}

.tech-stats .stat-box {
    flex: 1;
}

.tech-stats .stat-box small {
    display: block;
    font-size: 0.85rem;
    color: var(--playdate-gray-light);
    margin-top: 0.5rem;
}

.bundle-info {
    text-align: center;
    padding: 1.5rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-lg);
    margin-top: 2rem;
}

.bundle-info p {
    font-size: 1rem;
    color: var(--playdate-gray);
    margin: 0;
}

/* Enhanced Footer */
footer {
    background: var(--playdate-black);
    color: var(--playdate-white);
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

footer p {
    color: var(--playdate-white);
    opacity: 0.8;
    font-size: 1.1rem;
}

footer p:last-child {
    font-size: 0.9rem;
    opacity: 0.6;
    margin-top: 1rem;
    font-style: italic;
}

.footer-links {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--playdate-yellow);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    background: rgba(255, 173, 0, 0.1);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .footer-links {
        gap: 1rem;
    }
    
    /* Compact sale pricing for mobile and tablets */
    .sale-pricing {
        gap: 0.4rem;
    }
    
    .discount-badge {
        padding: 0.15rem 0.4rem;
        font-size: 0.7rem;
        letter-spacing: 0.3px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.8; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .game-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Mobile navigation - activate hamburger menu earlier to prevent cutoff */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: block;
        position: relative;
        z-index: 1001;
    }
    
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--playdate-white);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        z-index: 1000;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav-links.mobile-open {
        display: flex;
    }
    
    /* Mobile nav structure */
    .nav-main {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .nav-main > a,
    .nav-main > div {
        width: 100%;
    }
    
    .nav-main > a {
        padding: 0.75rem 1rem;
        border-radius: var(--radius-sm);
        text-align: left;
    }
    
    .nav-main > a:hover {
        background: var(--playdate-yellow-light);
    }
    
    /* Mobile dropdowns */
    .games-dropdown,
    .community-dropdown {
        width: 100%;
    }
    
    .dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        background: none;
        border: none;
        font-size: 1rem;
        font-weight: 500;
        color: var(--playdate-gray-dark);
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-radius: var(--radius-sm);
    }
    
    .dropdown-toggle:hover {
        background: var(--playdate-yellow-light);
    }
    
    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        background: var(--playdate-gray-lightest);
        box-shadow: none;
        border-radius: var(--radius-sm);
        margin-top: 0.25rem;
        padding: 0.5rem;
    }
    
    .dropdown-menu.show {
        display: block;
    }
    
    .dropdown-item {
        padding: 0.5rem 1rem;
        margin: 0.125rem 0;
    }
    
    /* Mobile auth section */
    .nav-auth {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        padding-top: 1rem;
        border-top: 1px solid var(--playdate-gray-light);
    }
    
    .nav-auth > a {
        width: 100%;
        text-align: center;
        padding: 0.75rem 1rem;
    }
    
    /* Mobile user dropdown */
    .user-dropdown {
        width: 100%;
    }
    
    .nav-profile {
        width: 100%;
        justify-content: space-between;
    }
    
    .theme-toggle {
        margin-top: 0.5rem;
    }
}

@media (max-width: 768px) {
    /* Navbar adjustments for smaller screens */
    .navbar .container {
        padding: 0 0.5rem;
    }
    
    .logo img {
        height: 40px;
    }
    
    .mobile-menu-toggle {
        font-size: 1.25rem;
        padding: 0.5rem;
    }
    
    /* Force mobile badge display for all mobile sizes */
    .itch-badge-inline, .combined-badge-inline {
        display: none !important;
    }
    
    .itch-badge-mobile, .combined-badge-mobile {
        display: inline-block !important;
        font-size: 0.7rem;
        padding: 0.25rem 0.75rem;
        margin: 0;
        vertical-align: middle;
        position: absolute;
        right: 0;
        top: 0;
    }
    
    .hero {
        padding: 3rem 0 4rem;
        margin-bottom: 2rem;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    /* Compact mobile games sections */
    .games-section {
        margin-bottom: 2.5rem;
    }
    
    .section-header {
        margin-bottom: 0.75rem;
        padding-bottom: 0.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .view-all {
        padding: 0.25rem 0.5rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .section-subtitle {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    .games-row {
        gap: 1.25rem;
        padding: 0.5rem 1rem 1rem 1rem;
        margin: 0 -1rem;
    }
    
    .games-row .game-card {
        flex: 0 0 220px;
        width: 220px;
    }
    
    .collections-section {
        margin-bottom: 2.5rem;
    }
    
    .collections-row {
        gap: 1rem;
        padding: 0.25rem 0 0.75rem;
    }
    
    .home-collection-card {
        flex: 0 0 180px;
        width: 180px;
    }
    
    .home-collection-card .collection-image {
        height: 120px;
    }
    
    .home-collection-card .collection-content {
        padding: 0.75rem;
    }
    
    .collection-title {
        font-size: 1rem;
        margin-bottom: 0.25rem;
    }
    
    .collection-creator {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .home-collection-card .collection-description {
        font-size: 0.8rem;
        margin-bottom: 0.75rem;
    }

    .collection-stats {
        font-size: 0.75rem;
    }

    /* Responsive past question cards - tablet */
    .past-question-home-card {
        flex: 0 0 200px !important;
        width: 200px !important;
        min-width: 200px !important;
    }

    .past-question-home-card .game-image,
    .past-question-home-card .collection-image {
        height: 140px !important;
        min-height: 140px;
    }

    .past-question-home-card .game-content {
        padding: 0.75rem;
    }

    .past-question-home-card .game-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .past-question-home-card .collection-author {
        font-size: 0.8rem;
    }

    .games-row .game-card .game-content {
        padding: 1rem;
    }
    
    .games-row .game-card .game-content h3 {
        font-size: 1rem;
        margin-bottom: 0.25rem;
        line-height: 1.3;
    }
    
    .games-row .game-card .game-content .developer {
        font-size: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    .games-row .game-card .game-content .price {
        font-size: 0.9rem;
        margin-bottom: 0.25rem;
    }
    
    .games-row .game-card .game-image {
        height: 140px;
    }
    
    .games-row .game-card .game-image img {
        height: 140px;
    }
    
    .game-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .game-info-left {
        grid-column: span 1;
    }
    
    .game-media-section {
        grid-column: span 1;
    }
    
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-form .search-input {
        min-width: auto;
        width: 100%;
    }
    
    .filter-select {
        min-width: auto;
    }
    
    .advanced-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .advanced-section-controls {
        width: 100%;
    }

    .advanced-select,
    .advanced-date {
        width: 100%;
        min-width: unset;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cost-cards {
        grid-template-columns: 1fr;
    }
    
    .game-detail {
        padding: 1.5rem;
    }
    
    .screenshot-item {
        flex: 0 0 240px;
        width: 240px;
        height: 140px;
    }
    
    .games-grid-new-releases {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 2rem;
    }
    
    .browse-header-special {
        padding: 2.5rem 1.5rem;
    }
    
    .browse-header-special h1 {
        font-size: 2rem;
    }
    
    /* Mobile improvements for game detail page */
    .game-detail h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .game-info-left {
        overflow: hidden;
        width: 100%;
    }
    
    .itch-badge-inline, .combined-badge-inline {
        display: none !important;
    }
    
    .itch-badge-mobile, .combined-badge-mobile {
        display: inline-block !important;
        margin: 0;
        width: fit-content;
        max-width: calc(100% - 200px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
        position: absolute;
        right: 0;
        top: 0;
    }
    
    .developer {
        position: relative;
        width: 100%;
    }
    
    .developer-text {
        flex-shrink: 0;
    }
    
    .price-box {
        margin: 1rem 0;
    }
    
    .game-actions {
        margin: 1.5rem 0;
        gap: 0.75rem;
    }
    
    .btn {
        min-height: 44px;
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .categories {
        margin-top: 1.5rem;
    }
    
    .category-tags {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }
    
    .category-tag {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        min-height: 36px;
        display: flex;
        align-items: center;
    }
    
    .description {
        margin: 1rem 0 2rem;
        padding: 1.5rem;
    }
    
    .description-content {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .game-meta {
        padding: 1.5rem;
    }
    
    .meta-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .meta-item {
        padding: 1rem;
        text-align: center;
    }
    
    /* Mobile carousel improvements */
    .game-carousel {
        margin: 1rem 0;
    }
    
    .carousel-thumbnails {
        gap: 0.4rem;
        max-height: 150px;
    }
    
    .carousel-thumb {
        aspect-ratio: 5 / 3;
        min-width: 60px;
    }
    
    .carousel-rating {
        margin-top: 0.75rem;
        font-size: 0.95rem;
    }
    
    .carousel-rating .rating-score {
        font-size: 1.05rem;
    }
    
    .image-rating {
        margin-top: 0.75rem;
        font-size: 0.95rem;
    }
    
    .image-rating .rating-score {
        font-size: 1.05rem;
    }
    
    /* Mobile badge positioning improvements */
    .badge {
        position: relative;
        top: auto;
        left: auto;
        right: auto;
        margin: 0.25rem 0;
    }
    
    .season-icon {
        display: inline-block;
        vertical-align: middle;
        margin-left: 0.5rem;
    }
    
    .season-icon svg {
        width: 20px;
        height: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }
    
    .hero {
        padding: 2.5rem 0 3rem;
        margin-bottom: 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .search-container {
        margin: 2rem auto 0;
        padding: 0 1rem;
    }
    
    .search-box {
        flex-direction: column;
        border-radius: var(--radius-lg);
    }
    
    .search-input {
        padding: 1rem 1.25rem;
        font-size: 1rem;
        border-bottom: 1px solid var(--playdate-border);
    }
    
    .search-btn {
        padding: 1rem;
        justify-content: center;
        font-size: 1rem;
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    .quick-links {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 2rem;
        padding: 0 1rem;
    }
    
    .quick-link {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
        border-radius: var(--radius-lg);
    }
    
    .games-grid {
        grid-template-columns: 1fr;
    }
    
    /* Ultra-compact mobile games sections */
    .games-section {
        margin-bottom: 2rem;
    }
    
    .section-header {
        margin-bottom: 0.5rem;
        padding-bottom: 0.25rem;
    }
    
    .section-header h2 {
        font-size: 1.25rem;
    }
    
    .view-all {
        padding: 0.2rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .section-subtitle {
        font-size: 0.75rem;
    }
    
    .games-row {
        gap: 1rem;
        padding: 0.5rem 0.75rem 0.75rem 0.75rem;
        margin: 0 -0.75rem;
    }
    
    .games-row .game-card {
        flex: 0 0 180px;
        width: 180px;
    }
    
    .collections-section {
        margin-bottom: 2rem;
    }
    
    .collections-row {
        gap: 0.75rem;
        padding: 0.25rem 0 0.5rem;
    }
    
    .home-collection-card {
        flex: 0 0 160px;
        width: 160px;
    }
    
    .home-collection-card .collection-image {
        height: 100px;
    }
    
    .home-collection-card .collection-content {
        padding: 0.5rem;
    }
    
    .collection-title {
        font-size: 0.9rem;
        margin-bottom: 0.15rem;
    }
    
    .collection-creator {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    
    .home-collection-card .collection-description {
        font-size: 0.7rem;
        margin-bottom: 0.5rem;
    }

    .collection-stats {
        font-size: 0.65rem;
    }

    /* Responsive past question cards - mobile */
    .past-question-home-card {
        flex: 0 0 160px !important;
        width: 160px !important;
        min-width: 160px !important;
    }

    .past-question-home-card .game-image,
    .past-question-home-card .collection-image {
        height: 110px !important;
        min-height: 110px;
    }

    .past-question-home-card .game-content {
        padding: 0.5rem;
    }

    .past-question-home-card .game-title {
        font-size: 0.85rem;
        margin-bottom: 0.15rem;
    }

    .past-question-home-card .collection-author {
        font-size: 0.7rem;
    }

    .games-row .game-card .game-content {
        padding: 0.75rem;
    }

    .games-row .game-card .game-content h3 {
        font-size: 0.9rem;
        margin-bottom: 0.15rem;
        line-height: 1.2;
    }
    
    .games-row .game-card .game-content .developer {
        font-size: 0.7rem;
        margin-bottom: 0.25rem;
    }
    
    .games-row .game-card .game-content .price {
        font-size: 0.8rem;
        margin-bottom: 0.15rem;
    }
    
    .games-row .game-card .game-image {
        height: 115px;
    }
    
    .games-row .game-card .game-image img {
        height: 115px;
    }
    
    .tabs {
        flex-direction: column;
        gap: 0.75rem;
        align-items: center;
    }
    
    .tab-button {
        padding: 0.75rem 1.5rem;
        min-width: 200px;
        border-radius: 50px;
        font-size: 0.95rem;
    }
    
    .tab-button:hover {
        transform: translateY(-1px);
    }
    
    .quick-links {
        gap: 0.5rem;
        margin-top: 1.5rem;
        grid-template-columns: repeat(2, 1fr);
        display: grid;
    }
    
    .quick-link {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        min-width: 120px;
        text-align: center;
    }
    
    .game-actions {
        flex-direction: column;
    }
    
    .btn {
        text-align: center;
        justify-content: center;
    }
    
    .screenshot-item {
        flex: 0 0 200px;
        width: 200px;
        height: 120px;
    }
    
    .sale-pricing {
        gap: 0.75rem;
    }
    
    /* Very small screen improvements */
    .game-detail {
        padding: 1rem;
    }
    
    .game-detail h1 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .itch-badge-inline, .combined-badge-inline {
        display: none !important;
    }
    
    .itch-badge-mobile, .combined-badge-mobile {
        display: inline-block !important;
        font-size: 0.65rem;
        padding: 0.2rem 0.6rem;
        margin: 0;
        max-width: calc(100% - 150px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: middle;
        position: absolute;
        right: 0;
        top: 0;
    }
    
    .developer {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        position: relative;
        width: 100%;
    }
    
    .developer-text {
        flex-shrink: 0;
    }
    
    .price-box {
        margin: 0.75rem 0;
    }
    
    .game-actions {
        margin: 1rem 0;
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .categories {
        margin-top: 1rem;
    }
    
    .category-tag {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    .description {
        margin: 0.75rem 0 1.5rem;
        padding: 1rem;
    }
    
    .description h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .description-content {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    .game-meta {
        padding: 1rem;
    }
    
    .meta-item {
        padding: 0.75rem;
    }
    
    .meta-item h4 {
        font-size: 0.85rem;
    }
    
    .meta-item p {
        font-size: 0.8rem;
    }
    
    /* Very small screen carousel */
    .carousel-thumbnails {
        gap: 0.25rem;
        max-height: 120px;
    }
    
    .carousel-thumb {
        min-width: 50px;
    }
    
    .carousel-rating {
        margin-top: 0.5rem;
        font-size: 0.9rem;
    }
    
    .carousel-rating .rating-score {
        font-size: 1rem;
    }
    
    .image-rating {
        margin-top: 0.5rem;
        font-size: 0.9rem;
    }
    
    .image-rating .rating-score {
        font-size: 1rem;
    }
    
    .season-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .original-price {
        font-size: 1.1rem;
    }
    
    .current-price {
        font-size: 1.5rem;
    }
    
    .discount-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .countdown-timer-compact {
        font-size: 0.65rem;
        padding: 0.2rem 0.4rem;
    }
    
    .sale-countdown {
        padding: 0.4rem 0.6rem;
    }
    
    .countdown-text {
        font-size: 0.8rem;
    }
    
    .countdown-timer {
        font-size: 0.85rem;
    }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus states for accessibility */
button:focus,
input:focus,
select:focus,
a:focus {
    outline: 3px solid var(--playdate-yellow);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .navbar,
    .search-container,
    .filters,
    .pagination,
    .game-actions,
    footer {
        display: none;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .game-card,
    .stat-card,
    .cost-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Lightbox/Modal Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

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

.lightbox-content {
    position: relative;
    width: 95%;
    max-width: 1600px;
    height: 95vh;
    margin: 2.5vh auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lightbox-img {
    width: auto;
    height: 80vh;
    max-width: 90%;
    object-fit: contain;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    /* Playdate screen effect: Game Boy style - muted but bright and reflective */
    filter: saturate(0.6) contrast(1.1) brightness(1.05) sepia(0.2) hue-rotate(10deg);
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--playdate-white);
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition-fast);
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: var(--playdate-yellow);
    transform: scale(1.1);
}

.prev,
.next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: var(--playdate-white);
    border: none;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: var(--transition-fast);
    border-radius: var(--radius-md);
    z-index: 1001;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

.prev:hover,
.next:hover {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
}

.lightbox-caption {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--playdate-white);
    background: rgba(0, 0, 0, 0.7);
    padding: 0.5rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

/* Mobile adjustments for lightbox */
@media (max-width: 768px) {
    .lightbox-content {
        width: 100%;
        height: 100vh;
        margin: 0;
    }
    
    .close {
        top: 10px;
        right: 20px;
        font-size: 2rem;
    }
    
    .prev,
    .next {
        font-size: 1.5rem;
        padding: 0.75rem 1rem;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
}

/* Badge positioning and styling */
.sale-badge {
    position: absolute;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sale-badge {
    bottom: 1rem;
    right: 1rem;
    background: #ff5252;
    color: white;
}

.demo-badge {
    /* OLD - TO REMOVE: removed from image context, now inline pill */
    /* bottom: 1rem;
    left: 1rem;
    position: absolute; */
    background: #4CAF50;
    color: white;
}

.price-rating {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.3rem 0 0;
}

.price-note {
    font-size: 0.75rem;
    color: var(--playdate-gray-light);
    font-style: italic;
    margin-left: 0.25rem;
}

.rating {
    color: #B8860B;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Specific rating styles for game cards */
.price-rating .rating {
    color: #B8860B;
    font-weight: 500;
    font-size: 0.8rem;
}

.price-rating .combined-rating,
.price-rating .itch-rating,
.price-rating .user-ratings-display,
.price-rating .monthly-rating {
    color: #B8860B;
    font-weight: 500;
    font-size: 0.85rem;
}

.game-meta {
    font-size: 0.85rem;
    color: var(--playdate-gray-light);
    margin: 0.5rem 0;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    background: var(--playdate-cream);
    color: var(--playdate-gray);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Dark mode styling for tags */
[data-theme="dark"] .tag {
    border: 1px solid rgba(255, 173, 0, 0.3);
}

/* Filter Bar Styles */
.filter-bar {
    background: var(--playdate-white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--playdate-border);
}

.filter-row {
    margin-top: 1rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-group label {
    font-weight: 600;
    color: var(--playdate-gray);
}

/* Empty State Styling */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--playdate-border);
}

.empty-state h2 {
    color: var(--playdate-gray);
    margin-bottom: 1rem;
}

.empty-state p {
    color: var(--playdate-gray-light);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.empty-state pre {
    background: var(--playdate-cream);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 2px solid var(--playdate-border);
    margin: 1rem auto;
    display: inline-block;
}

.empty-state code {
    color: var(--playdate-gray);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 0.9rem;
}

/* Button styles */
.button {
    padding: 0.875rem 2rem;
    background: var(--gradient-primary);
    color: var(--playdate-white);
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.button:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.button.primary {
    background: var(--gradient-primary);
}

/* Browse subtitle styling */
.browse-subtitle {
    color: var(--playdate-gray-light);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Stat number and label styling */
.stat-number {
    font-size: 2.5rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    font-weight: 800;
}

.stat-label {
    color: var(--playdate-gray-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

/* itch.io badge inline with title */
.itch-badge-inline {
    display: inline-block;
    background: linear-gradient(135deg, #FA5C5C 0%, #FF1744 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.7rem;
    margin-left: 1rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Combined (Playdate + itch.io) badge inline with title */
.combined-badge-inline {
    display: inline-block;
    background: linear-gradient(135deg, var(--playdate-yellow) 0%, #FF6B35 50%, #FA5C5C 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.7rem;
    margin-left: 1rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* itch.io badge beside developer name (mobile only) */
.itch-badge-mobile {
    display: none;
    background: linear-gradient(135deg, #FA5C5C 0%, #FF1744 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.7rem;
    margin-left: 0.75rem;
    vertical-align: middle;
    text-transform: uppercase;
}

/* Combined badge beside developer name (mobile only) */
.combined-badge-mobile {
    display: none;
    background: linear-gradient(135deg, var(--playdate-yellow) 0%, #FF6B35 50%, #FA5C5C 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.7rem;
    margin-left: 0.75rem;
    vertical-align: middle;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    letter-spacing: 0.5px;
}

/* itch.io specific image handling */
.game-image img[src*="itch.zone"] {
    object-fit: contain !important;
    background: var(--playdate-cream);
}

/* itch.io page specific aspect ratio */
.games-grid .game-card .game-image:has(img[src*="itch.zone"]) {
    aspect-ratio: 315 / 250;
}

/* Fallback for browsers without :has() support */
@supports not selector(:has(*)) {
    /* For the itch.io specific page, all images will be itch.io images */
    body[data-page="itchio"] .game-image {
        aspect-ratio: 315 / 250;
    }
}

/* itch.io stats section */
.itch-stats {
    margin: 2rem 0;
}

.itch-stats h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--playdate-yellow-dark);
}

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

.itch-stats .stat-card {
    background: var(--playdate-white);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--playdate-border);
    transition: var(--transition-normal);
}

.itch-stats .stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

/* Mobile adjustments for itch.io elements */
@media (max-width: 768px) {
    .itch-stats .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Sidebar itch.io stats - positioned in right column below image carousel */
.itch-stats-sidebar {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--playdate-border);
    text-align: center;
}

.stats-vertical {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stats-vertical .stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stats-vertical .stat-value {
    font-weight: 600;
    font-size: 1.2rem;
    color: var(--playdate-yellow-dark);
}

.stats-vertical .stat-label {
    color: var(--playdate-gray);
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .itch-stats-sidebar {
        margin-top: 1rem;
        padding: 0.75rem;
    }
    
    .stats-vertical {
        gap: 0.75rem;
    }
    
    .stats-vertical .stat-value {
        font-size: 1.1rem;
    }
    
    /* Statistics page mobile improvements */
    .statistics-page section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .cost-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cost-card {
        padding: 1.5rem;
    }
    
    .big-number {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
        text-align: center;
    }
    
    .stat-card h3 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
        color: var(--playdate-yellow-dark);
        font-weight: 800;
    }
    
    .stat-card p {
        font-size: 0.9rem;
        color: var(--playdate-gray);
        margin: 0;
    }
    
    .sub-text {
        font-size: 0.75rem;
        color: var(--playdate-gray-light);
        margin-top: 0.25rem;
    }
    
    .price-stats {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .price-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        background: var(--playdate-gray-lightest);
        border-radius: var(--radius-md);
    }
    
    .price-stat .label {
        font-size: 0.9rem;
        color: var(--playdate-gray);
    }
    
    .price-stat .value {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--playdate-yellow-dark);
    }
    
    .price-distribution {
        margin-top: 1.5rem;
    }
    
    .price-bar {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .bar-label {
        font-size: 0.85rem;
        color: var(--playdate-gray);
        min-width: 70px;
        text-align: right;
    }
    
    .bar-container {
        flex: 1;
        height: 24px;
        background: var(--playdate-gray-lightest);
        border-radius: 12px;
        overflow: hidden;
    }
    
    .bar {
        height: 100%;
        background: var(--gradient-primary);
        border-radius: 12px;
        transition: width 0.5s ease;
        min-width: 2px; /* Ensure bars show even for small percentages */
    }
    
    .bar-count {
        font-size: 0.9rem;
        font-weight: 600;
        color: var(--playdate-yellow-dark);
        min-width: 30px;
        text-align: center;
    }
    
    .sale-stats {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }
    
    .sale-stat {
        flex: 1;
        min-width: 100px;
        text-align: center;
        padding: 1rem;
        background: var(--playdate-gray-lightest);
        border-radius: var(--radius-lg);
    }
    
    .sale-stat .stat-number {
        font-size: 1.8rem;
        font-weight: 800;
        color: var(--playdate-yellow-dark);
        margin-bottom: 0.5rem;
    }
    
    .sale-stat .stat-label {
        font-size: 0.85rem;
        color: var(--playdate-gray);
    }
    
    .dev-stats {
        display: flex;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .stat-box {
        flex: 1;
        text-align: center;
        padding: 1rem;
        background: var(--playdate-gray-lightest);
        border-radius: var(--radius-lg);
    }
    
    .stat-box .stat-number {
        font-size: 1.8rem;
        font-weight: 800;
        color: var(--playdate-yellow-dark);
        margin-bottom: 0.5rem;
    }
    
    .stat-box .stat-label {
        font-size: 0.85rem;
        color: var(--playdate-gray);
    }
    
    .top-developers {
        margin-top: 1rem;
    }
    
    .developer-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.75rem;
        margin-bottom: 0.5rem;
        background: var(--playdate-gray-lightest);
        border-radius: var(--radius-md);
    }
    
    .dev-name {
        font-size: 0.9rem;
        color: var(--playdate-gray-dark);
        font-weight: 500;
    }
    
    .dev-count {
        font-size: 0.85rem;
        color: var(--playdate-gray);
        font-weight: 600;
    }
    
    .tech-stats {
        display: flex;
        gap: 1rem;
    }
    
    .tech-stats .stat-box {
        flex: 1;
    }
    
    .tech-stats .stat-box small {
        display: block;
        font-size: 0.75rem;
        color: var(--playdate-gray-light);
        margin-top: 0.25rem;
    }
    
    .bundle-info {
        text-align: center;
        padding: 1rem;
        background: var(--playdate-gray-lightest);
        border-radius: var(--radius-lg);
        margin-top: 1rem;
    }
    
    .bundle-info p {
        font-size: 0.9rem;
        color: var(--playdate-gray);
        margin: 0;
    }
}

/* Bug Report Modal Styles */
.bug-report-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.bug-report-modal-content {
    background-color: var(--surface-elevated);
    margin: 2% auto;
    padding: 0;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: bugReportFadeIn 0.3s ease-out;
}

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

.bug-report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--playdate-border);
    background: linear-gradient(135deg, var(--playdate-yellow-light), var(--playdate-yellow-lighter));
}

.bug-report-header h2 {
    margin: 0;
    color: var(--playdate-black);
    font-size: 1.5rem;
    font-weight: 700;
}

.bug-report-close {
    color: var(--playdate-gray);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color var(--transition-fast);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.bug-report-close:hover {
    color: var(--playdate-black);
    background: rgba(0, 0, 0, 0.1);
}

.bug-report-body {
    padding: 2rem;
}

.bug-report-notice {
    background: var(--playdate-yellow-light);
    border: 1px solid var(--playdate-yellow);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.bug-report-notice p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--playdate-gray-dark);
}

.bug-type-selection h3 {
    margin: 0 0 1.5rem 0;
    color: var(--playdate-black);
    font-size: 1.2rem;
    font-weight: 600;
}

.bug-type-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.bug-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border: 2px solid var(--playdate-border);
    background: var(--surface-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
    min-height: 100px;
}

.bug-type-btn:hover {
    border-color: var(--playdate-yellow);
    background: var(--playdate-yellow-lightest);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.bug-type-btn.selected {
    border-color: var(--playdate-yellow-dark);
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.bug-type-icon {
    font-size: 2rem;
    line-height: 1;
}

.bug-type-text {
    font-weight: 600;
    font-size: 0.95rem;
}

.bug-type-section {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--playdate-yellow);
}

.bug-type-section h4 {
    margin: 0 0 0.75rem 0;
    color: var(--playdate-black);
    font-size: 1.1rem;
    font-weight: 600;
}

.bug-type-section p {
    margin: 0 0 0.75rem 0;
    color: var(--playdate-gray);
    line-height: 1.5;
}

.bug-type-section ul {
    margin: 0;
    padding-left: 1.5rem;
    color: var(--playdate-gray);
}

.bug-type-section li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.bug-description-section {
    margin-bottom: 1.5rem;
}

.bug-description-section label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--playdate-black);
    font-size: 1rem;
}

.bug-description-section textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.bug-description-section textarea:focus {
    outline: none;
    border-color: var(--playdate-yellow-dark);
    box-shadow: 0 0 0 3px rgba(255, 221, 51, 0.2);
}

.character-count {
    text-align: right;
    font-size: 0.875rem;
    color: var(--playdate-gray);
    margin-top: 0.5rem;
}

.bug-report-messages {
    margin: 1.5rem 0;
    min-height: 1rem;
}

.bug-report-error {
    display: none;
    padding: 1rem;
    background: var(--color-error-bg);
    border: 1px solid #fcc;
    color: #c33;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.4;
}

.bug-report-success {
    display: none;
    padding: 1rem;
    background: var(--color-success-bg);
    border: 1px solid var(--color-success-border);
    color: #363;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    line-height: 1.4;
}

.bug-report-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid var(--playdate-border);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .bug-report-modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: calc(100vh - 2rem);
    }
    
    .bug-report-header {
        padding: 1rem 1.5rem;
    }
    
    .bug-report-header h2 {
        font-size: 1.25rem;
    }
    
    .bug-report-body {
        padding: 1.5rem;
    }
    
    .bug-type-buttons {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .bug-type-btn {
        padding: 1rem;
        min-height: 80px;
    }
    
    .bug-type-icon {
        font-size: 1.5rem;
    }
    
    .bug-type-text {
        font-size: 0.875rem;
    }
    
    .bug-report-actions {
        flex-direction: column-reverse;
    }
    
    .bug-report-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bug-type-buttons {
        grid-template-columns: 1fr;
    }
}

/* Red danger button for bug reports */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
    transition: all var(--transition-fast);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
    color: white;
    text-decoration: none;
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(231, 76, 60, 0.3);
}

.report-bug-btn {
    position: relative;
    overflow: hidden;
}

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

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

/* ============================================================================ */
/* COLLECTIONS MODAL STYLES (using randomiser modal classes) */
/* ============================================================================ */

.collections-modal.randomiser-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.collections-content.randomiser-content {
    background: var(--surface-elevated);
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    position: relative;
    animation: slideInUp 0.4s ease;
    display: flex;
    flex-direction: column;
}

.collections-header.randomiser-header {
    background: linear-gradient(135deg, #ffad00 0%, #ff8f00 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.collections-header.randomiser-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.collections-close.randomiser-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s ease;
    line-height: 1;
}

.collections-close.randomiser-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.collections-body.randomiser-filters {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.collections-body h3 {
    margin: 0 0 1rem 0;
    color: var(--text-heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.collections-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface-hover);
    border: 2px solid var(--surface-active);
    border-radius: 12px;
    transition: all 0.2s ease;
}

.collection-item:hover {
    border-color: #ffad00;
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.1);
}

.collection-item.already-added {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f9f0 100%);
    border-color: #22c55e;
}

.collection-info {
    flex: 1;
    margin-right: 1rem;
}

.collection-name {
    font-weight: 600;
    color: var(--text-heading);
    display: block;
    font-size: 1rem;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
}

.collection-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
    line-height: 1.4;
}

.collection-actions-buttons {
    display: flex;
    gap: 0.5rem;
}

.collection-add-btn,
.collection-remove-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.collection-add-btn {
    background: #ffad00;
    color: white;
}

.collection-add-btn:hover {
    background: #e09900;
    transform: translateY(-1px);
}

.collection-remove-btn {
    background: #ef4444;
    color: white;
}

.collection-remove-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.no-collections {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
    background: var(--surface-hover);
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 2px dashed var(--border-medium);
}

.create-collection-section {
    border-top: 2px solid var(--border-light);
    padding-top: 2rem;
    margin-top: 1rem;
}

.create-collection-section h3 {
    margin-bottom: 1.5rem;
}

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

.create-collection-section input,
.create-collection-section textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface-card);
    color: var(--text-heading);
    transition: border-color 0.2s ease;
    resize: vertical;
    box-sizing: border-box;
    font-family: inherit;
}

.create-collection-section input:focus,
.create-collection-section textarea:focus {
    outline: none;
    border-color: #ffad00;
    box-shadow: 0 0 0 3px rgba(255, 173, 0, 0.1);
}

.create-btn {
    background: linear-gradient(135deg, #ffad00 0%, #ff8f00 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.create-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 173, 0, 0.3);
}

.collections-footer {
    padding: 1.5rem 2rem;
    background: var(--surface-hover);
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}

.collections-footer .btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.collections-footer .btn-secondary {
    background: #6b7280;
    color: white;
}

.collections-footer .btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-1px);
}

.collections-modal-content {
    background: var(--surface-elevated);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalSlideIn 0.3s ease-out;
    position: relative;
}

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

.collections-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: #ffad00;
    color: white;
}

.collections-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.collections-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.collections-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

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

.collections-modal-body h4 {
    margin: 0 0 1rem 0;
    color: var(--playdate-black);
    font-size: 1.1rem;
    font-weight: 600;
}

.existing-collections {
    margin-bottom: 2rem;
}

.collections-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.collection-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface-hover);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.collection-item:hover {
    background: var(--surface-card);
    border-color: #ffad00;
}

.collection-item.already-added {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.collection-info {
    flex: 1;
    margin-right: 1rem;
}

.collection-name {
    font-weight: 600;
    color: var(--playdate-black);
    display: block;
}

.collection-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    display: block;
    margin-top: 0.25rem;
}

.collection-add-btn {
    background: #ffad00;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.collection-add-btn:hover:not(:disabled) {
    background: #e09900;
    transform: translateY(-1px);
}

.collection-add-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    opacity: 0.7;
}

.no-collections {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    padding: 2rem;
    background: var(--surface-hover);
    border-radius: 8px;
    margin-bottom: 2rem;
}

.create-collection-section {
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
}

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

.create-collection-section input,
.create-collection-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--surface-card);
    color: var(--playdate-black);
    transition: border-color 0.2s ease;
    resize: vertical;
    box-sizing: border-box;
}

.create-collection-section input:focus,
.create-collection-section textarea:focus {
    outline: none;
    border-color: #ffad00;
}

.create-collection-section .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.create-collection-section .btn-primary {
    background: #ffad00;
    color: white;
}

.create-collection-section .btn-primary:hover {
    background: #e09900;
    transform: translateY(-1px);
}

.collections-modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface-hover);
}

.collections-modal-footer .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.collections-modal-footer .btn-secondary {
    background: var(--surface-card);
    color: var(--playdate-black);
    border: 2px solid var(--border-light);
}

.collections-modal-footer .btn-secondary:hover {
    background: var(--surface-hover);
    border-color: #9ca3af;
}

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

/* Mobile: move toast notifications to bottom-center to avoid covering modal close buttons */
@media (max-width: 768px) {
    .show-message-toast {
        top: auto !important;
        right: auto !important;
        bottom: 20px !important;
        left: 50% !important;
        transform: translateX(-50%);
        animation: slideUpMessage 0.3s ease !important;
    }
}

@keyframes slideUpMessage {
    from {
        transform: translateX(-50%) translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownMessage {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Mobile responsive adjustments */
/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .collections-modal.randomiser-modal {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }
    
    .collections-content.randomiser-content {
        max-height: 90vh;
        width: 95%;
        margin-top: 1rem;
    }
    
    .collections-header.randomiser-header,
    .collections-body.randomiser-filters,
    .collections-footer {
        padding: 1.5rem;
    }
    
    .collection-item {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .collection-info {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .collection-actions-buttons {
        align-self: stretch;
    }
    
    .collection-add-btn,
    .collection-remove-btn {
        flex: 1;
        justify-content: center;
    }
    
    .collections-footer {
        flex-direction: column;
        gap: 1rem;
    }
    
    .collections-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-height: 600px) {
    .collections-content.randomiser-content {
        max-height: 95vh;
    }
    
    .collections-header.randomiser-header {
        padding: 1rem 1.5rem;
    }
    
    .collections-body.randomiser-filters {
        padding: 1rem 1.5rem;
    }
    
    .collections-footer {
        padding: 1rem 1.5rem;
    }
}

/* Theme toggle button */
.theme-toggle {
    background: transparent;
    border: 2px solid var(--playdate-yellow);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 1rem;
    color: var(--playdate-yellow);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    background: var(--playdate-yellow);
    transform: scale(1.1);
    color: var(--playdate-black);
}

.theme-toggle.disabled {
    border-color: var(--playdate-gray-lighter) !important;
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    filter: grayscale(100%);
}

.theme-toggle.disabled:hover {
    background: transparent !important;
    transform: none !important;
    border-color: var(--playdate-gray-lighter) !important;
}

/* Theme toggle icons - show/hide based on current theme */
.theme-icon-light,
.theme-icon-dark {
    transition: opacity var(--transition-fast);
}

/* Light theme: show sun, hide moon */
.theme-icon-dark {
    display: none;
}

/* Dark theme: show moon, hide sun */
[data-theme="dark"] .theme-icon-light {
    display: none;
}

[data-theme="dark"] .theme-icon-dark {
    display: inline;
}

/* Manual dark mode (when toggled) */
[data-theme="dark"] {
    /* Primary colors - yellow stays vibrant for brand consistency */
    --playdate-yellow: #ffad00;
    --playdate-yellow-dark: #ff9500;
    --playdate-yellow-light: #2D2D2D;

    /* Background colors - avoid pure black per WCAG guidelines */
    --playdate-white: #121212;      /* Primary background - Material Design standard */
    --playdate-cream: #1E1E1E;      /* Elevated surface */
    --playdate-gray-lightest: #2D2D2D; /* Cards and elevated components */

    /* Text colors - 87%/60% white for proper contrast */
    --playdate-black: #E0E0E0;      /* Primary text (87% white) */
    --playdate-gray: #B0B0B0;       /* Secondary text */
    --playdate-gray-light: #9CA3AF; /* Tertiary text */
    --playdate-gray-lighter: #6B7280; /* Disabled/placeholder */
    --playdate-gray-dark: #E0E0E0;

    /* Borders */
    --playdate-border: #3A3A3A;

    /* Surface elevation hierarchy */
    --surface-card: #1E1E1E;
    --surface-elevated: #2a2a2a;
    --surface-hover: #333333;
    --surface-active: #3a3a3a;
    --surface-overlay: rgba(0, 0, 0, 0.8);
    --surface-modal-backdrop: rgba(0, 0, 0, 0.85);

    /* Text hierarchy */
    --text-heading: #f0f0f0;
    --text-primary: #e0e0e0;
    --text-secondary: #d0d0d0;
    --text-muted: #b0b0b0;
    --text-subtle: #a0a0a0;
    --text-on-accent: #1a1a1a;

    /* Border variants */
    --border-light: #3A3A3A;
    --border-medium: #404040;
    --border-heavy: #555555;

    /* Gradients */
    --gradient-secondary: linear-gradient(135deg, #1E1E1E 0%, #2D2D2D 100%);
    --gradient-hero: #1E1E1E;

    /* Semantic colors - desaturated for dark mode per guidelines */
    --color-success: #4ADE80;
    --color-success-dark: #22C55E;
    --color-success-bg: #064E3B;
    --color-success-border: #065F46;

    --color-error: #F87171;
    --color-error-dark: #EF4444;
    --color-error-bg: #7F1D1D;
    --color-error-border: #991B1B;

    --color-warning: #FCD34D;
    --color-warning-dark: #F59E0B;
    --color-warning-bg: #78350F;
    --color-warning-border: #92400E;

    --color-info: #60A5FA;
    --color-info-dark: #3B82F6;
    --color-info-bg: #1E3A8A;
    --color-info-border: #1D4ED8;

    /* Flash messages */
    --flash-success-bg: #1a2a1a;
    --flash-success-text: #68d391;
    --flash-success-border: #2a4a2a;
    --flash-error-bg: #2a1a1a;
    --flash-error-text: #fc8181;
    --flash-error-border: #4a2a2a;
    --flash-info-bg: #1a2a3a;
    --flash-info-text: #90cdf4;
    --flash-info-border: #2d4a6a;

    /* Shadows - increased opacity for visibility on dark backgrounds */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 12px 60px rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] body {
    background: #121212;  /* Material Design standard dark background */
    color: var(--playdate-black);
}

[data-theme="dark"] .game-card,
[data-theme="dark"] .category-card,
[data-theme="dark"] .collection-card,
[data-theme="dark"] .navbar,
[data-theme="dark"] .footer-section,
[data-theme="dark"] .game-detail-container,
[data-theme="dark"] .stats-container,
[data-theme="dark"] .developer-page-container,
[data-theme="dark"] .profile-container,
[data-theme="dark"] .auth-container,
[data-theme="dark"] .collections-content,
[data-theme="dark"] .randomiser-content {
    background: var(--playdate-cream) !important;
    color: var(--playdate-black) !important;
}

[data-theme="dark"] .hero,
[data-theme="dark"] .hero-section,
[data-theme="dark"] .game-hero,
[data-theme="dark"] .developer-hero,
[data-theme="dark"] .category-hero {
    background: var(--gradient-secondary);
    color: var(--playdate-black);
}

[data-theme="dark"] .btn-primary,
[data-theme="dark"] .quick-link,
[data-theme="dark"] .randomiser-btn,
[data-theme="dark"] .cta-button {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
}

[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .quick-link:hover,
[data-theme="dark"] .randomiser-btn:hover,
[data-theme="dark"] .cta-button:hover {
    background: var(--playdate-yellow-dark);
    color: #1a1a1a;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] textarea,
[data-theme="dark"] select,
[data-theme="dark"] .search-input,
[data-theme="dark"] .sort-select {
    background: var(--playdate-gray-lightest);
    color: var(--playdate-black);
    border-color: var(--playdate-border);
}

/* Filter elements dark mode */
[data-theme="dark"] .filter-group h3,
[data-theme="dark"] .filter-label {
    color: var(--playdate-black) !important;
}

[data-theme="dark"] .filter-option {
    background: var(--playdate-gray-lightest);
    border-color: var(--playdate-border);
    color: var(--playdate-black);
}

[data-theme="dark"] .filter-option:hover {
    background: var(--playdate-yellow);
    color: #1a1a1a;
}

[data-theme="dark"] .filter-option:has(input:checked),
[data-theme="dark"] .filter-option.active {
    background: var(--playdate-yellow);
    color: #1a1a1a;
}

[data-theme="dark"] .filter-select,
[data-theme="dark"] .advanced-date {
    background-color: var(--playdate-gray-lightest);
    color: var(--playdate-black);
    border-color: var(--playdate-border);
}
/* Re-assert no-repeat / position / size against the generic [data-theme="dark"] select
   shorthand rule earlier in the cascade that otherwise resets background-repeat to default. */
[data-theme="dark"] .filter-select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23cbd5e1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 12px 12px;
}
[data-theme="dark"] .filter-select:hover,
[data-theme="dark"] .advanced-date:hover {
    border-color: rgba(255, 255, 255, 0.35);
}
/* Date picker icon visibility in dark mode */
[data-theme="dark"] .advanced-date::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
}

[data-theme="dark"] .filter-btn {
    background: var(--gradient-primary);
    color: #1a1a1a;
}

[data-theme="dark"] .filter-btn:hover {
    background: var(--gradient-primary);
    filter: brightness(1.08);
    box-shadow: 0 6px 18px rgba(255, 173, 0, 0.25);
}

[data-theme="dark"] .filter-btn.secondary {
    background: var(--playdate-gray-lightest);
    color: rgba(255, 255, 255, 0.92);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .filter-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--playdate-yellow);
    color: var(--playdate-yellow);
    filter: none;
}

[data-theme="dark"] .game-price,
[data-theme="dark"] .price-tag {
    background: #2a2a2a;
    color: var(--playdate-gray);
}

[data-theme="dark"] .sale-badge,
[data-theme="dark"] .new-badge,
[data-theme="dark"] .season-badge {
    background: var(--playdate-yellow);
    color: #ffffff;
}

[data-theme="dark"] a {
    color: var(--playdate-yellow);
}

[data-theme="dark"] a:hover {
    color: var(--playdate-yellow-dark);
}

[data-theme="dark"] .dropdown-content {
    background: var(--playdate-white);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .flash-messages {
    background: #2a2a2a;
}

[data-theme="dark"] table {
    background: var(--playdate-white);
}

[data-theme="dark"] th {
    background: #2a2a2a;
    color: var(--playdate-gray);
}

[data-theme="dark"] td {
    border-color: var(--playdate-border);
    color: var(--playdate-gray);
}

[data-theme="dark"] .modal,
[data-theme="dark"] .collections-modal {
    background: rgba(0, 0, 0, 0.8);
}

/* Collections Modal Dark Mode Styles */
[data-theme="dark"] .collections-modal-content {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .collections-modal-header {
    background: #2a2a2a !important;
    border-bottom-color: #404040 !important;
}

[data-theme="dark"] .collections-modal-body {
    background: #1a1a1a !important;
}

[data-theme="dark"] .collections-modal-body h3,
[data-theme="dark"] .collections-modal-body h4,
[data-theme="dark"] .collections-section h3,
[data-theme="dark"] .collections-section h4,
[data-theme="dark"] .existing-collections h3,
[data-theme="dark"] .existing-collections h4,
[data-theme="dark"] .create-collection h3,
[data-theme="dark"] .create-collection h4,
[data-theme="dark"] .create-collection-section h3,
[data-theme="dark"] .create-collection-section h4 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .collection-item {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .collection-item .collection-description,
[data-theme="dark"] .collection-info p,
[data-theme="dark"] .collection-item p {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .collection-item:hover {
    background: #333 !important;
}

[data-theme="dark"] .collection-item.already-added {
    background: rgba(34, 197, 94, 0.15) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
}

[data-theme="dark"] .collection-item.user-added {
    background: rgba(255, 173, 0, 0.1) !important;
    border-color: rgba(255, 173, 0, 0.3) !important;
}

[data-theme="dark"] .collection-name {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .collection-description,
[data-theme="dark"] .collection-creator {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .community-collections-list .collection-item {
    background: #252525 !important;
    border: 1px solid #404040 !important;
}

[data-theme="dark"] .collections-modal-footer {
    background: #2a2a2a !important;
    border-top-color: #404040 !important;
}

[data-theme="dark"] .collections-modal-footer .btn-secondary {
    background: #333 !important;
    border-color: #555 !important;
}

[data-theme="dark"] .collections-modal-footer .btn-secondary:hover {
    background: #404040 !important;
    border-color: #666 !important;
}

[data-theme="dark"] .create-collection-form input[type="text"],
[data-theme="dark"] .create-collection-form textarea {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .create-collection-form input[type="text"]:focus,
[data-theme="dark"] .create-collection-form textarea:focus {
    border-color: #ffad00 !important;
    outline-color: #ffad00 !important;
}

[data-theme="dark"] .create-collection-form label {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .create-collection-section {
    border-top-color: #404040 !important;
}

[data-theme="dark"] .collections-section-header {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .collection-add-btn {
    color: #1a1a1a !important;
}

[data-theme="dark"] .collection-remove-btn {
    background: #dc3545 !important;
}

/* Bug report modal dark mode */
[data-theme="dark"] .bug-report-modal-content {
    background-color: var(--playdate-cream) !important;
    color: var(--playdate-black) !important;
}

[data-theme="dark"] .bug-report-modal-content h2,
[data-theme="dark"] .bug-report-modal-content h3,
[data-theme="dark"] .bug-report-modal-content label {
    color: var(--playdate-black) !important;
}

[data-theme="dark"] .bug-type-btn {
    background: var(--playdate-gray-lightest) !important;
    color: var(--playdate-black) !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .bug-type-btn:hover,
[data-theme="dark"] .bug-type-btn.selected {
    background: var(--playdate-yellow) !important;
    color: #1a1a1a !important;
    border-color: var(--playdate-yellow) !important;
}

/* Wishlist button dark mode */
[data-theme="dark"] .btn-wishlist {
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .btn-wishlist:hover {
    background: var(--playdate-yellow) !important;
    color: #1a1a1a !important;
}

/* No collections empty state dark mode */
[data-theme="dark"] .no-collections {
    background: var(--playdate-gray-lightest) !important;
    color: var(--playdate-gray) !important;
    border-color: var(--playdate-border) !important;
}

/* Secondary buttons dark mode */
[data-theme="dark"] .btn-secondary {
    background: var(--playdate-gray-lightest) !important;
    color: var(--playdate-black) !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .btn-secondary:hover {
    background: var(--playdate-yellow) !important;
    color: #1a1a1a !important;
}

/* Collection text elements dark mode */
[data-theme="dark"] .collection-name,
[data-theme="dark"] .collection-desc {
    color: var(--playdate-black) !important;
}

/* Form elements in modals dark mode */
[data-theme="dark"] .collections-modal-content input,
[data-theme="dark"] .collections-modal-content textarea,
[data-theme="dark"] .collections-modal-content select {
    background: var(--playdate-gray-lightest) !important;
    color: var(--playdate-black) !important;
    border-color: var(--playdate-border) !important;
}

/* All the specific page dark mode styles */
[data-theme="dark"] .about-page {
    background: transparent !important;
}

[data-theme="dark"] .about-header {
    border-bottom-color: var(--playdate-border);
}

[data-theme="dark"] .about-header h1 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .about-header p {
    color: #cccccc !important;
}

[data-theme="dark"] .about-content {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .about-section h2,
[data-theme="dark"] .about-section h3 {
    color: #f0f0f0 !important;
    border-bottom-color: var(--playdate-border);
}

[data-theme="dark"] .about-section p {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .about-section a {
    color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .about-section del {
    color: #999999 !important;
}

/* Footer dark mode */
[data-theme="dark"] footer {
    background: #1a1a1a !important;
    border-top-color: var(--playdate-border) !important;
}

[data-theme="dark"] footer p,
[data-theme="dark"] footer strong {
    color: #cccccc !important;
}

[data-theme="dark"] .footer-links a,
[data-theme="dark"] footer a {
    color: #bbbbbb !important;
}

[data-theme="dark"] .footer-links a:hover,
[data-theme="dark"] footer a:hover {
    color: var(--playdate-yellow) !important;
}

/* Apply all other dark mode styles for specific pages */
[data-theme="dark"] .coming-soon-hero {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%) !important;
}

[data-theme="dark"] .coming-soon-hero h1,
[data-theme="dark"] .coming-soon-hero p {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .collection-info-card {
    background: #2a2a2a !important;
    border-color: var(--playdate-border) !important;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .collection-title,
[data-theme="dark"] .collection-owner,
[data-theme="dark"] .collection-description {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .theme-toggle:hover {
    color: #1a1a1a;
}

/* Privacy Policy and Terms of Service dark mode */
[data-theme="dark"] .privacy-policy,
[data-theme="dark"] .terms-page,
[data-theme="dark"] .legal-page {
    background: transparent !important;
}

[data-theme="dark"] .policy-header,
[data-theme="dark"] .terms-header,
[data-theme="dark"] .legal-header {
    background: transparent !important;
}

[data-theme="dark"] .policy-header h1,
[data-theme="dark"] .terms-header h1,
[data-theme="dark"] .legal-header h1,
[data-theme="dark"] .policy-header p,
[data-theme="dark"] .terms-header p,
[data-theme="dark"] .legal-header p {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .policy-content,
[data-theme="dark"] .terms-content,
[data-theme="dark"] .legal-content {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .policy-section h2,
[data-theme="dark"] .policy-section h3,
[data-theme="dark"] .policy-section h4,
[data-theme="dark"] .terms-section h2,
[data-theme="dark"] .terms-section h3,
[data-theme="dark"] .terms-section h4,
[data-theme="dark"] .legal-section h2,
[data-theme="dark"] .legal-section h3 {
    color: #f0f0f0 !important;
    border-bottom-color: #444 !important;
}

[data-theme="dark"] .policy-section p,
[data-theme="dark"] .policy-section li,
[data-theme="dark"] .policy-section strong,
[data-theme="dark"] .terms-section p,
[data-theme="dark"] .terms-section li,
[data-theme="dark"] .terms-section strong,
[data-theme="dark"] .legal-section p,
[data-theme="dark"] .legal-section li {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .policy-content a,
[data-theme="dark"] .terms-content a,
[data-theme="dark"] .legal-content a {
    color: var(--playdate-yellow) !important;
}

/* Browse headers dark mode (including Top 10 header) */
[data-theme="dark"] .browse-header {
    background: #1e1e1e !important;
    color: #f0f0f0 !important;
}

[data-theme="dark"] .browse-header h1 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .browse-header p {
    color: #d0d0d0 !important;
}

[data-theme="dark"] .browse-header-special {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%) !important;
    border-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .browse-header-special p {
    color: #d0d0d0 !important;
}

[data-theme="dark"] .concept-credit {
    color: #a0a0a0 !important;
}

/* Top 10 popup dark mode */
[data-theme="dark"] .top10-modal,
[data-theme="dark"] .top10-popup {
    background: rgba(0, 0, 0, 0.9) !important;
}

[data-theme="dark"] .top10-modal-content,
[data-theme="dark"] .top10-popup-content {
    background: #2a2a2a !important;
    border-color: var(--playdate-border) !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .top10-modal-header,
[data-theme="dark"] .top10-popup-header {
    background: #333333 !important;
    border-bottom-color: var(--playdate-border) !important;
}

[data-theme="dark"] .top10-modal-header h2,
[data-theme="dark"] .top10-popup-header h2,
[data-theme="dark"] .top10-modal-header h3,
[data-theme="dark"] .top10-popup-header h3 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .top10-modal-body,
[data-theme="dark"] .top10-popup-body {
    background: transparent !important;
}

[data-theme="dark"] .top10-slots,
[data-theme="dark"] .top10-slot {
    background: #333333 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .top10-slot:hover {
    background: #3a3a3a !important;
    border-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .top10-slot.filled {
    background: #2a2a2a !important;
}

[data-theme="dark"] .slot-number {
    color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .slot-game-title,
[data-theme="dark"] .slot-game-developer {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .top10-search-input,
[data-theme="dark"] .top10-search {
    background: #333333 !important;
    color: #e0e0e0 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .top10-search-results {
    background: #333333 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .search-result-item {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .search-result-item:hover {
    background: #3a3a3a !important;
}

/* Price box dark mode */
[data-theme="dark"] .price-box {
    background: linear-gradient(135deg, #2a2a2a 0%, rgba(255, 173, 0, 0.15) 100%) !important;
    border-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .price-box .price {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .price-box .free {
    color: #4ADE80 !important;
}

[data-theme="dark"] .price-box .coming-soon,
[data-theme="dark"] .price-box .no-price {
    color: #a0a0a0 !important;
}

[data-theme="dark"] .price-box .season-1-included {
    color: var(--playdate-yellow) !important;
}

/* Randomiser content dark mode */
[data-theme="dark"] .collections-content.randomiser-content {
    background: #1e1e1e !important;
}

[data-theme="dark"] .collections-footer {
    background: #252525 !important;
    border-top-color: #444 !important;
}

/* Bug type section dark mode */
[data-theme="dark"] .bug-type-section {
    background: #2a2a2a !important;
    border-left-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .bug-type-section h4 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .bug-type-section p,
[data-theme="dark"] .bug-type-section ul,
[data-theme="dark"] .bug-type-section li {
    color: #d0d0d0 !important;
}

/* Bug description section dark mode */
[data-theme="dark"] .bug-description-section label {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .bug-description-section textarea {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

[data-theme="dark"] .bug-description-section textarea:focus {
    border-color: var(--playdate-yellow) !important;
}

/* Game info sections dark mode */
[data-theme="dark"] .game-info-section,
[data-theme="dark"] .game-description,
[data-theme="dark"] .game-details {
    background: #1e1e1e !important;
}

[data-theme="dark"] .game-info-section h2,
[data-theme="dark"] .game-info-section h3 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .game-info-section p {
    color: #d0d0d0 !important;
}

/* Stats and detail pages dark mode */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .detail-card,
[data-theme="dark"] .info-card {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

[data-theme="dark"] .stat-card h3,
[data-theme="dark"] .stat-card h4,
[data-theme="dark"] .detail-card h3,
[data-theme="dark"] .info-card h3 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .stat-card p,
[data-theme="dark"] .stat-value,
[data-theme="dark"] .detail-card p,
[data-theme="dark"] .info-card p {
    color: #d0d0d0 !important;
}

/* Library/profile page elements dark mode */
[data-theme="dark"] .library-section,
[data-theme="dark"] .profile-section,
[data-theme="dark"] .profile-card {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

[data-theme="dark"] .library-section h2,
[data-theme="dark"] .profile-section h2,
[data-theme="dark"] .profile-card h2 {
    color: #f0f0f0 !important;
}

/* Game card text elements dark mode */
[data-theme="dark"] .game-card-title,
[data-theme="dark"] .game-card-developer,
[data-theme="dark"] .card-title,
[data-theme="dark"] .card-subtitle {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .game-card-description {
    color: #b0b0b0 !important;
}

/* Weekly question page dark mode */
[data-theme="dark"] .weekly-question-container,
[data-theme="dark"] .question-section,
[data-theme="dark"] .answer-section {
    background: #1e1e1e !important;
}

[data-theme="dark"] .question-text,
[data-theme="dark"] .question-title {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .answer-content,
[data-theme="dark"] .comment-text {
    color: #d0d0d0 !important;
}

/* Tabs and navigation dark mode */
[data-theme="dark"] .tab-button,
[data-theme="dark"] .nav-tab {
    background: #2a2a2a !important;
    color: #d0d0d0 !important;
    border-color: #444 !important;
}

[data-theme="dark"] .tab-button:hover,
[data-theme="dark"] .nav-tab:hover {
    background: #333 !important;
    color: #f0f0f0 !important;
}

[data-theme="dark"] .tab-button.active,
[data-theme="dark"] .nav-tab.active {
    background: var(--gradient-primary) !important;
    color: #1a1a1a !important;
}

/* Pagination dark mode */
[data-theme="dark"] .pagination a,
[data-theme="dark"] .pagination span,
[data-theme="dark"] .page-link {
    background: #2a2a2a !important;
    color: #d0d0d0 !important;
    border-color: #444 !important;
}

[data-theme="dark"] .pagination a:hover,
[data-theme="dark"] .page-link:hover {
    background: #333 !important;
    color: #f0f0f0 !important;
    border-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .pagination .active,
[data-theme="dark"] .pagination .current,
[data-theme="dark"] .page-link.active {
    background: var(--playdate-yellow) !important;
    color: #1a1a1a !important;
}

/* Awards page dark mode */
[data-theme="dark"] .award-card,
[data-theme="dark"] .nomination-card,
[data-theme="dark"] .voting-section {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

[data-theme="dark"] .award-card h3,
[data-theme="dark"] .nomination-card h3,
[data-theme="dark"] .award-title {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .award-card p,
[data-theme="dark"] .nomination-card p,
[data-theme="dark"] .award-description {
    color: #d0d0d0 !important;
}

/* Tour/welcome modal dark mode */
[data-theme="dark"] .tour-modal,
[data-theme="dark"] .welcome-modal {
    background: rgba(0, 0, 0, 0.9) !important;
}

[data-theme="dark"] .tour-content,
[data-theme="dark"] .welcome-content {
    background: #1e1e1e !important;
}

[data-theme="dark"] .tour-content h2,
[data-theme="dark"] .tour-content h3,
[data-theme="dark"] .welcome-content h2 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .tour-content p,
[data-theme="dark"] .welcome-content p {
    color: #d0d0d0 !important;
}

/* Game detail page dark mode */
[data-theme="dark"] .game-detail {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

[data-theme="dark"] .game-meta {
    border-top-color: #333 !important;
}

[data-theme="dark"] .meta-item {
    background: #2a2a2a !important;
}

[data-theme="dark"] .description {
    border-color: #333 !important;
}

[data-theme="dark"] .description-fade {
    background: linear-gradient(to bottom, transparent, #1e1e1e) !important;
}

[data-theme="dark"] .expand-toggle {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* Recommendation cards dark mode */
[data-theme="dark"] .recommendation-card {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

[data-theme="dark"] .recommendation-content h3 {
    color: #f0f0f0 !important;
}

/* Auth card dark mode */
[data-theme="dark"] .auth-card {
    background: #1e1e1e !important;
    border-color: #333 !important;
}

/* Developer claim info box */
.developer-claim-info {
    background: var(--playdate-cream, #f9fafb);
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* User rank badges */
.rank-developer {
    color: #22c55e !important;
}

.rank-early-adopter {
    color: #ffcc00 !important;
}

[data-theme="dark"] .rank-developer {
    color: #4ade80 !important;
}

[data-theme="dark"] .rank-early-adopter {
    color: #fcd34d !important;
}

/* Email Settings Popup */
.email-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.email-popup-content {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: popupFadeIn 0.3s ease-out;
}

.email-popup-content h2 {
    color: var(--playdate-black);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.email-popup-content p {
    color: var(--playdate-gray);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.email-popup-content ul {
    margin: 1rem 0 1.5rem 1.5rem;
    color: var(--playdate-gray);
}

.email-popup-content li {
    margin-bottom: 0.5rem;
}

.email-popup-content li strong {
    color: var(--playdate-black);
}

.popup-note {
    font-size: 0.9rem;
    color: var(--playdate-gray-light);
    font-style: italic;
    margin-top: 1.5rem;
}

.popup-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.popup-buttons .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    border: none;
    font-size: 1rem;
}

.popup-buttons .btn-primary {
    background: var(--gradient-primary);
    color: var(--playdate-white);
}

.popup-buttons .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.popup-buttons .btn-secondary {
    background: var(--playdate-gray-lighter);
    color: var(--playdate-gray);
}

.popup-buttons .btn-secondary:hover {
    background: var(--playdate-gray-light);
}

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

/* Mobile responsive for popup */
@media (max-width: 768px) {
    .email-popup-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .email-popup-content h2 {
        font-size: 1.25rem;
    }
    
    .popup-buttons {
        flex-direction: column;
    }
    
    .popup-buttons .btn {
        width: 100%;
        text-align: center;
    }
}

/* Dark mode for email popup - consolidated */
[data-theme="dark"] .email-popup-content {
    background: #1e1e1e !important;
    color: #f0f0f0 !important;
    border: 1px solid #333 !important;
}

[data-theme="dark"] .email-popup-content h2 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .email-popup-content p,
[data-theme="dark"] .email-popup-content ul,
[data-theme="dark"] .email-popup-content ol {
    color: #d0d0d0 !important;
}

[data-theme="dark"] .email-popup-content li strong,
[data-theme="dark"] .email-popup-content strong {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .popup-buttons .btn-secondary {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

[data-theme="dark"] .popup-buttons .btn-secondary:hover {
    background: #3a3a3a !important;
}

[data-theme="dark"] .developer-claim-info {
    background: #2a2a2a !important;
    border: 1px solid #444 !important;
}

/* ============================================================================
   COMMUNITY COLLECTIONS
   ============================================================================ */

/* Collection Type Tabs */
.collection-tabs {
    display: flex;
    gap: 1rem;
    margin: 2rem auto;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 600px;
}

.collection-tab {
    padding: 0.75rem 1.5rem;
    background: var(--playdate-white);
    border: 2px solid var(--playdate-border);
    border-radius: var(--radius-md);
    color: var(--playdate-text);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.collection-tab:hover {
    background: var(--playdate-light);
    border-color: var(--playdate-yellow);
    transform: translateY(-2px);
}

.collection-tab.active {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
    border-color: var(--playdate-yellow);
    font-weight: 600;
}

/* Community Tag */
.community-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #7c4dff;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Community Collections Dropdown */
.community-collections-dropdown {
    margin-top: 1rem;
    border-top: 1px solid var(--playdate-border);
    padding-top: 1rem;
}

.community-collections-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    cursor: pointer;
    user-select: none;
}

.community-collections-header:hover {
    color: var(--playdate-yellow-dark);
}

.community-collections-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.community-collections-header .dropdown-arrow {
    font-size: 0.875rem;
    color: var(--playdate-gray);
    transition: transform 0.2s ease;
}

.community-collections-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--playdate-text);
}

.community-collections-toggle {
    font-size: 0.875rem;
    transition: transform 0.2s ease;
}

.community-collections-header.expanded .community-collections-toggle {
    transform: rotate(180deg);
}

.community-collections-list {
    display: none;
    margin-top: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}

.community-collections-list.expanded {
    display: block;
}

.community-collections-list .collection-item {
    padding: 0.75rem;
    background: var(--playdate-gray-lightest);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.community-collections-list .collection-creator {
    display: block;
    font-size: 0.85rem;
    color: var(--playdate-gray);
    margin-top: 0.25rem;
}

.already-in-collection {
    font-size: 0.85rem;
    color: var(--playdate-gray);
    font-style: italic;
}

.checkbox-group {
    margin-top: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 0.25rem;
}

/* Dark mode support */
[data-theme="dark"] .collection-tab {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #f0f0f0;
}

[data-theme="dark"] .collection-tab:hover {
    background: #3a3a3a;
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .collection-tab.active {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
}

[data-theme="dark"] .community-tag {
    background: #9c27b0;
}

[data-theme="dark"] .community-collections-header {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .community-collections-header h3 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .community-collections-header:hover {
    color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .community-collections-header:hover h3 {
    color: var(--playdate-yellow) !important;
}

/* Price History Section */
.price-history-section {
    background: var(--playdate-white);
    border: 1px solid var(--playdate-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-sm);
}

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

.price-history-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--playdate-black);
}

.last-sale-info {
    background: var(--color-info-bg);
    color: var(--color-info-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
}

.current-sale-badge {
    background: var(--color-success-bg);
    color: var(--color-success-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
}

.price-chart-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-sm);
}

.price-chart-container canvas {
    max-width: 100%;
    height: auto;
}

.price-history-details {
    margin-top: 1rem;
}

.price-history-details summary {
    cursor: pointer;
    color: var(--playdate-gray);
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
}

.price-history-details summary:hover {
    background: var(--playdate-gray-lightest);
}

.price-history-list {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--playdate-border);
}

.price-history-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-bottom: 1px solid var(--playdate-border);
}

.price-history-item:last-child {
    border-bottom: none;
}

.price-date {
    flex: 1;
    color: var(--playdate-gray);
    font-size: 0.875rem;
}

.price-value {
    font-weight: 600;
    color: var(--playdate-black);
    min-width: 60px;
    text-align: right;
}
.price-value .sale-badge {
    display: inline-block;
    position: static;
    background: #ff5252;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    margin-left: 0.5rem;
    vertical-align: middle;
}
.price-value .sale-event-name {
    display: inline-block;
    position: static;
    background: rgba(255, 173, 0, 0.1);
    color: var(--playdate-yellow);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 0.5rem;
    vertical-align: middle;
    border: 1px solid rgba(255, 173, 0, 0.3);
}

.price-change {
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.price-change.sale {
    background: var(--color-success-bg);
    color: var(--color-success-dark);
}

.price-change.increase {
    background: var(--color-warning-bg);
    color: var(--color-warning-dark);
}

/* Dark mode support */
[data-theme="dark"] .price-history-section {
    background: #2a2a2a;
    border-color: #3a3a3a;
}

[data-theme="dark"] .price-history-header h3 {
    color: #f0f0f0;
}

[data-theme="dark"] .price-chart-container {
    background: #1a1a1a;
}

[data-theme="dark"] .price-history-details summary {
    color: #b0b0b0;
}

[data-theme="dark"] .price-history-details summary:hover {
    background: #3a3a3a;
}

[data-theme="dark"] .price-history-list {
    border-top-color: #3a3a3a;
}

[data-theme="dark"] .price-history-item {
    border-bottom-color: #3a3a3a;
}

[data-theme="dark"] .price-date {
    color: #b0b0b0;
}

[data-theme="dark"] .price-value {
    color: #f0f0f0;
}
[data-theme="dark"] .price-value .sale-event-name {
    background: rgba(255, 173, 0, 0.15);
    color: #ffcc00;
    border-color: rgba(255, 173, 0, 0.4);
}
EOF < /dev/null
/* Current price info when no history available */
.current-price-info {
    padding-top: 0.5rem;
}

.current-price-info .price-history-item {
    background: var(--playdate-gray-lightest);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.current-price-info .price-history-item:last-child {
    margin-bottom: 0;
}

[data-theme="dark"] .current-price-info .price-history-item {
    background: #1a1a1a;
}

/* ==============================
   COMPREHENSIVE DARK MODE FIXES v1.0.2
   Mobile & Desktop Coverage
   ============================== */

/* Featured Developers Cards - Mobile & Desktop */
[data-theme="dark"] .featured-developers-section {
    background: #1a1a1a !important;
}

[data-theme="dark"] .featured-developer-card {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .featured-developer-card h3,
[data-theme="dark"] .featured-developer-card .developer-name {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .featured-developer-card p,
[data-theme="dark"] .featured-developer-card .developer-bio,
[data-theme="dark"] .featured-developer-card .developer-stats {
    color: #cccccc !important;
}

[data-theme="dark"] .featured-developer-card:hover {
    background: #333333 !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.7) !important;
}

/* Developer Page - All sections */
[data-theme="dark"] .developer-hero {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* Developer info - only set text color, not background */
[data-theme="dark"] .developer-info {
    color: #e0e0e0 !important;
}

/* Developer header - only apply background if no custom background is set */
[data-theme="dark"] .developer-header:not([style*="background"]) {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .developer-name,
[data-theme="dark"] .developer-title {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .developer-stats-grid {
    background: #1a1a1a !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .developer-stat-item {
    background: #2a2a2a !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .developer-stat-item .stat-value {
    color: #ffad00 !important;
}

[data-theme="dark"] .developer-stat-item .stat-label {
    color: #b0b0b0 !important;
}

/* Edit Profile Sections */
[data-theme="dark"] .edit-profile-container,
[data-theme="dark"] .profile-edit-section {
    background: #2a2a2a !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .edit-profile-header,
[data-theme="dark"] .profile-edit-header {
    background: #1a1a1a !important;
    color: #f0f0f0 !important;
    border-bottom-color: #404040 !important;
}

[data-theme="dark"] .edit-profile-form label,
[data-theme="dark"] .profile-form label {
    color: #cccccc !important;
}

[data-theme="dark"] .edit-profile-form input,
[data-theme="dark"] .edit-profile-form textarea,
[data-theme="dark"] .edit-profile-form select,
[data-theme="dark"] .profile-form input,
[data-theme="dark"] .profile-form textarea,
[data-theme="dark"] .profile-form select {
    background: #333333 !important;
    color: #e0e0e0 !important;
    border-color: #555555 !important;
}

[data-theme="dark"] .edit-profile-form input:focus,
[data-theme="dark"] .edit-profile-form textarea:focus,
[data-theme="dark"] .edit-profile-form select:focus,
[data-theme="dark"] .profile-form input:focus,
[data-theme="dark"] .profile-form textarea:focus,
[data-theme="dark"] .profile-form select:focus {
    border-color: #ffad00 !important;
    outline-color: #ffad00 !important;
}

/* Coming Soon Games Cards */
[data-theme="dark"] .coming-soon-section {
    background: #1a1a1a !important;
}

[data-theme="dark"] .coming-soon-card,
[data-theme="dark"] .coming-soon-game-card {
    background: #2a2a2a !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .coming-soon-card .game-title,
[data-theme="dark"] .coming-soon-game-card .game-title {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .coming-soon-card .game-developer,
[data-theme="dark"] .coming-soon-game-card .game-developer,
[data-theme="dark"] .coming-soon-card .release-date,
[data-theme="dark"] .coming-soon-game-card .release-date {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .coming-soon-card:hover,
[data-theme="dark"] .coming-soon-game-card:hover {
    background: #333333 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
}

/* Weekly Question Components - Already fixed but reinforcing */
[data-theme="dark"] .weekly-question-section,
[data-theme="dark"] .weekly-question-container {
    background: #2a2a2a !important;
}

[data-theme="dark"] .weekly-question-banner {
    background: linear-gradient(135deg, #333333 0%, #2a2a2a 100%) !important;
}

[data-theme="dark"] .weekly-question-banner .banner-label,
[data-theme="dark"] .weekly-question-banner .banner-title,
[data-theme="dark"] .weekly-question-banner .banner-arrow,
[data-theme="dark"] .weekly-question-banner h2,
[data-theme="dark"] .weekly-question-banner p {
    color: white !important;
}

/* Mobile-specific dark mode fixes */
@media (max-width: 768px) {
    [data-theme="dark"] .mobile-menu {
        background: #1a1a1a !important;
        border-color: #404040 !important;
    }
    
    [data-theme="dark"] .mobile-menu-item {
        color: #e0e0e0 !important;
        border-bottom-color: #333333 !important;
    }
    
    [data-theme="dark"] .mobile-menu-item:hover {
        background: #2a2a2a !important;
    }
    
    [data-theme="dark"] .game-card {
        background: #2a2a2a !important;
    }
    
    [data-theme="dark"] .game-card .game-title {
        color: #f0f0f0 !important;
    }
    
    [data-theme="dark"] .game-card .game-developer {
        color: #b0b0b0 !important;
    }
    
    /* Mobile navigation dropdown */
    [data-theme="dark"] .mobile-dropdown {
        background: #2a2a2a !important;
        border-color: #404040 !important;
    }
    
    [data-theme="dark"] .mobile-dropdown a {
        color: #e0e0e0 !important;
    }
    
    [data-theme="dark"] .mobile-dropdown a:hover {
        background: #333333 !important;
    }
}

/* Additional universal dark mode text fixes */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] p,
[data-theme="dark"] span,
[data-theme="dark"] div {
    color: #e0e0e0;
}

/* Ensure text is visible on all backgrounds */
[data-theme="dark"] .text-muted {
    color: #999999 !important;
}

[data-theme="dark"] .text-secondary {
    color: #b0b0b0 !important;
}

/* Fix any potential white-on-white or black-on-black issues */
[data-theme="dark"] *:not(input):not(textarea) {
    text-shadow: none !important;
}

/* Ensure inputs maintain readability */
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #888888 !important;
    opacity: 1 !important;
}

/* Dropdown menus dark mode */
[data-theme="dark"] .dropdown-menu {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #333333 !important;
    color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .dropdown-item.active {
    background: #333333 !important;
    color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .dropdown-divider {
    background: #404040 !important;
}

/* Info rows dark mode (profile/settings pages) */
[data-theme="dark"] .info-row {
    background: #333333 !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .info-value {
    color: #f0f0f0 !important;
}

/* Form groups dark mode */
[data-theme="dark"] .form-group label {
    color: #d0d0d0 !important;
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-control {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    color: #e0e0e0 !important;
}

[data-theme="dark"] .form-group input:focus,
[data-theme="dark"] .form-control:focus {
    border-color: var(--playdate-yellow) !important;
    box-shadow: 0 0 0 3px rgba(255, 173, 0, 0.2) !important;
}

[data-theme="dark"] .form-group input:disabled,
[data-theme="dark"] .form-control-disabled {
    background: #1a1a1a !important;
    color: #666666 !important;
}

[data-theme="dark"] .form-group small,
[data-theme="dark"] .form-help {
    color: #888888 !important;
}

/* Checkbox and radio labels */
[data-theme="dark"] .checkbox-group label {
    color: #e0e0e0 !important;
}

/* Popup buttons dark mode */
[data-theme="dark"] .popup-note {
    color: #d0d0d0 !important;
    background: #2a2a2a !important;
    border-color: #404040 !important;
}

/* Additional informational elements */
[data-theme="dark"] .error-message {
    color: #ffcccc !important;
    background: #2a1a1a !important;
    border-color: #661a1a !important;
}

[data-theme="dark"] .flash-message {
    background: #2a2a2a !important;
    color: #f0f0f0 !important;
    border-color: #404040 !important;
}

[data-theme="dark"] .flash-info {
    background: #1a2a3a !important;
    color: #90cdf4 !important;
    border-color: #2d4a6a !important;
}

[data-theme="dark"] .flash-success {
    background: #1a2a1a !important;
    color: #68d391 !important;
    border-color: #2a4a2a !important;
}

[data-theme="dark"] .flash-error {
    background: #2a1a1a !important;
    color: #fc8181 !important;
    border-color: #4a2a2a !important;
}

/* Profile sections dark mode (includes email notifications) */
[data-theme="dark"] .profile-section {
    background: #2a2a2a !important;
    color: #f0f0f0 !important;
}

[data-theme="dark"] .profile-section h2 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .profile-section h3 {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .profile-section p {
    color: #d0d0d0 !important;
}

[data-theme="dark"] .profile-section label {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .profile-section small,
[data-theme="dark"] .profile-section .help-text {
    color: #b0b0b0 !important;
}

/* Section headers dark mode */
[data-theme="dark"] .section-header h2 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .section-subtitle {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .section-subtitle:hover {
    color: var(--playdate-yellow) !important;
}

/* Admin Dashboard dark mode (manual toggle) */
[data-theme="dark"] .admin-header {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%) !important;
}

[data-theme="dark"] .admin-header h1,
[data-theme="dark"] .admin-header p {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .admin-container {
    background: #1a1a1a !important;
}

[data-theme="dark"] .admin-card {
    background: #2a2a2a !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .admin-card h2,
[data-theme="dark"] .admin-card h3 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .admin-card p,
[data-theme="dark"] .admin-stats {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .admin-table {
    background: #2a2a2a !important;
}

[data-theme="dark"] .admin-table th {
    background: #333333 !important;
    color: #f0f0f0 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .admin-table td {
    color: #e0e0e0 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .admin-table tr:hover {
    background: #333333 !important;
}

[data-theme="dark"] .admin-form input,
[data-theme="dark"] .admin-form textarea,
[data-theme="dark"] .admin-form select {
    background: #333333 !important;
    color: #e0e0e0 !important;
    border-color: var(--playdate-border) !important;
}

[data-theme="dark"] .admin-form label {
    color: #e0e0e0 !important;
}

/* Admin stat cards dark mode */
[data-theme="dark"] .stat-card {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    color: #f0f0f0 !important;
}

[data-theme="dark"] .stat-card h3,
[data-theme="dark"] .stat-card h4 {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .stat-card p,
[data-theme="dark"] .stat-card span {
    color: #d0d0d0 !important;
}

/* Email notification checkboxes dark mode */
[data-theme="dark"] input[type="checkbox"] {
    background: #333333 !important;
    border-color: #555555 !important;
}

[data-theme="dark"] input[type="checkbox"]:checked {
    background: var(--playdate-yellow) !important;
    border-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] input[type="checkbox"]:disabled {
    background: #2a2a2a !important;
    border-color: #404040 !important;
    opacity: 0.5;
}

/* Auth container dark mode */
[data-theme="dark"] .auth-container {
    background: #1a1a1a !important;
    color: #f0f0f0 !important;
}

[data-theme="dark"] .auth-form {
    /* No background - form is transparent, inherits from .auth-card */
}

[data-theme="dark"] .auth-form h1,
[data-theme="dark"] .auth-form h2,
[data-theme="dark"] .auth-form p,
[data-theme="dark"] .auth-form a,
[data-theme="dark"] .auth-form .auth-links {
    color: #f0f0f0 !important;
}

[data-theme="dark"] .auth-form label {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .auth-form input {
    background: #333333 !important;
    border-color: #555555 !important;
    color: #f0f0f0 !important;
}

[data-theme="dark"] .auth-form input:focus {
    border-color: var(--playdate-yellow) !important;
}

/* Error messages within auth forms need specific styling - must override .auth-form color */
[data-theme="dark"] .auth-form .error-message {
    background: #ffc9c9 !important;
    color: #1a0000 !important;
    border-color: #ff6b6b !important;
}

/* Ensure text nodes inside error message are also dark */
[data-theme="dark"] .auth-form .error-message::before,
[data-theme="dark"] .auth-form .error-message::after,
[data-theme="dark"] .auth-form > .error-message {
    color: #1a0000 !important;
}

/* Auth header and footer dark mode */
[data-theme="dark"] .auth-header h1 {
    -webkit-text-fill-color: var(--playdate-yellow) !important;
}

[data-theme="dark"] .auth-footer {
    border-top-color: #333 !important;
}

[data-theme="dark"] .auth-footer p {
    color: #a0a0a0 !important;
}

[data-theme="dark"] .auth-footer a {
    color: var(--playdate-yellow) !important;
}

/* Auth button dark mode */
[data-theme="dark"] .auth-btn.primary {
    background: var(--playdate-yellow) !important;
    color: #1a1a1a !important;
    -webkit-text-fill-color: #1a1a1a !important;
}

[data-theme="dark"] .auth-btn.secondary {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* Form small/help text dark mode */
/* Developer Edit Button */
.btn-developer-edit {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: 2px solid #6d28d9;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-developer-edit:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(139, 92, 246, 0.4);
    color: white;
    text-decoration: none;
}

.btn-developer-edit:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

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

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

/* Unsubscribe page red button dark mode */
[data-theme="dark"] .auth-btn.primary[style*="background: #dc3545"] {
    background: #dc3545 !important;
}

/* Email preferences page dark mode */
[data-theme="dark"] .success-message {
    background: var(--flash-success-bg);
    color: var(--flash-success-text);
}

[data-theme="dark"] .email-prefs-section {
    background: var(--surface-elevated);
}

[data-theme="dark"] .email-prefs-section h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .checkbox-group span {
    color: var(--text-subtle);
}

[data-theme="dark"] .checkbox-group strong {
    color: var(--text-heading);
}

/* Unsubscribe auth-footer link override for red color */
[data-theme="dark"] .auth-footer a[style*="color: #dc3545"] {
    color: #ff6b6b !important;
}

/* Account benefits (register page) dark mode */
[data-theme="dark"] .account-benefits {
    background: var(--surface-elevated);
}

[data-theme="dark"] .benefits-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .benefits-header h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .benefits-section h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .benefits-section li {
    color: var(--text-muted);
}

[data-theme="dark"] .benefits-highlight {
    background: rgba(255, 173, 0, 0.15);
    color: var(--text-heading);
}

/* Profile page dark mode */
[data-theme="dark"] .developer-link-hero {
    background: var(--playdate-yellow);
    color: var(--playdate-black);
}

[data-theme="dark"] .developer-link-hero:hover {
    background: var(--playdate-yellow-dark);
    color: var(--playdate-black);
}

[data-theme="dark"] .developer-link-account {
    color: inherit;
}

[data-theme="dark"] .developer-link-account:hover {
    color: inherit;
    opacity: 0.7;
}

/* Toggle switch dark mode */
[data-theme="dark"] .toggle-slider {
    background: #555;
}

[data-theme="dark"] .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: var(--playdate-yellow);
}

/* Featured developers section dark mode (home page) */
[data-theme="dark"] .developer-card {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .developer-card:hover {
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .developer-games-preview {
    background: var(--surface-card);
}

[data-theme="dark"] .developer-games-grid .preview-game-tile {
    background: var(--surface-elevated);
}

[data-theme="dark"] .developer-games-grid .empty-tile {
    background: var(--surface-hover);
}

[data-theme="dark"] .developer-name {
    color: var(--text-heading);
}

[data-theme="dark"] .developer-game-count {
    color: var(--text-muted);
}

/* Weekly question banner dark mode */
[data-theme="dark"] .weekly-question-banner {
    box-shadow: 0 4px 16px rgba(255, 149, 0, 0.3);
}

[data-theme="dark"] .weekly-question-banner:hover {
    box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

/* Email popup overlay dark mode */
[data-theme="dark"] .email-popup-overlay {
    background: rgba(0, 0, 0, 0.9);
}

/* Hero section dark mode */
[data-theme="dark"] .hero h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .hero p {
    color: var(--text-primary);
}

/* Quick links dark mode */
[data-theme="dark"] .quick-link {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--playdate-border);
}

/* Randomiser modal dark mode */
[data-theme="dark"] .randomiser-modal {
    background: rgba(0, 0, 0, 0.9);
}

[data-theme="dark"] .randomiser-header h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .randomiser-filters h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .filter-option span {
    color: var(--text-primary);
}

[data-theme="dark"] .result-info h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .result-info p {
    color: var(--text-primary);
}

/* Section headers dark mode */
/* Collection cards dark mode (home page) */
[data-theme="dark"] .collection-stats {
    color: var(--text-muted);
}

/* Empty collection state dark mode */
[data-theme="dark"] .empty-icon {
    color: #666;
}

/* Autocomplete dropdown dark mode */
[data-theme="dark"] .autocomplete-dropdown {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .autocomplete-item {
    border-color: var(--playdate-border);
}

[data-theme="dark"] .autocomplete-item:hover {
    background: rgba(255, 173, 0, 0.15);
}

/* Feeds page dark mode */
[data-theme="dark"] .feeds-header h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .feeds-header p {
    color: var(--text-subtle);
}

[data-theme="dark"] .feed-card {
    background: var(--surface-card);
    border-color: var(--surface-hover);
}

[data-theme="dark"] .feed-card:hover {
    border-color: #ffd800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .feed-card.featured {
    border-color: #ffd800;
    background: linear-gradient(135deg, #2a2500 0%, var(--surface-card) 100%);
}

[data-theme="dark"] .feed-content h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .feed-description {
    color: var(--text-subtle);
}

[data-theme="dark"] .feed-meta {
    color: #888;
}

[data-theme="dark"] .btn-feed {
    background: #ffd800;
    color: var(--text-on-accent);
}

[data-theme="dark"] .btn-feed:hover {
    background: #ffed4e;
}

[data-theme="dark"] .feeds-help {
    background: var(--surface-elevated);
}

[data-theme="dark"] .feeds-help h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .help-item h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .help-item p {
    color: var(--text-subtle);
}

[data-theme="dark"] .help-item a {
    color: var(--playdate-yellow);
}

/* Pair/pairing page dark mode */
[data-theme="dark"] .code-segment {
    background: #1f2937;
    border-color: #374151;
    color: #f9fafb;
}

[data-theme="dark"] .code-segment:focus {
    border-color: var(--playdate-yellow);
    box-shadow: 0 0 0 3px rgba(255, 173, 0, 0.2);
}

[data-theme="dark"] .code-segment.filled {
    background: #292524;
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .pairing-instructions h3,
[data-theme="dark"] .pairing-instructions ol {
    color: #9ca3af;
}

/* Device settings page dark mode */
[data-theme="dark"] .settings-header h1 {
    color: #f9fafb;
}

[data-theme="dark"] .settings-subtitle {
    color: #9ca3af;
}

[data-theme="dark"] .settings-form {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .settings-section {
    border-color: #374151;
}

[data-theme="dark"] .section-title {
    color: #f9fafb;
}

[data-theme="dark"] .section-description,
[data-theme="dark"] .device-meta {
    color: #9ca3af;
}

[data-theme="dark"] .device-count {
    background: #374151;
    color: #9ca3af;
}

[data-theme="dark"] .device-item {
    background: #111827;
    border-color: #374151;
}

[data-theme="dark"] .device-item:hover {
    background: #1f2937;
    border-color: #4b5563;
}

[data-theme="dark"] .device-icon {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .device-name {
    color: #f9fafb;
}

[data-theme="dark"] .empty-text {
    color: #9ca3af;
}

[data-theme="dark"] .empty-hint {
    color: #6b7280;
}

[data-theme="dark"] .security-notice {
    background: #292524;
    border-left-color: var(--playdate-yellow);
}

[data-theme="dark"] .notice-content {
    color: #fcd34d;
}

[data-theme="dark"] .settings-actions {
    background: #111827;
    border-color: #374151;
}

[data-theme="dark"] .btn-danger-outline {
    border-color: var(--color-error-bg);
    color: var(--color-error);
}

[data-theme="dark"] .btn-danger-outline:hover {
    background: var(--color-error-bg);
    border-color: var(--color-error-border);
}

[data-theme="dark"] .modal-header h3 {
    color: #f9fafb;
}

[data-theme="dark"] .modal-body p {
    color: #d1d5db;
}

[data-theme="dark"] .modal-hint {
    color: #9ca3af;
}

[data-theme="dark"] .modal-actions {
    background: #111827;
    border-color: #374151;
}

/* Public collections listing dark mode */
[data-theme="dark"] .collection-card .collection-image {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
}

[data-theme="dark"] .preview-game-tile {
    background: var(--surface-hover);
}

[data-theme="dark"] .preview-game-tile .placeholder-image {
    background: var(--surface-elevated);
    color: #888;
}

[data-theme="dark"] .empty-tile {
    background: var(--surface-elevated);
    border-color: #555;
}

[data-theme="dark"] .empty-collection-image {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
    color: #888;
}

[data-theme="dark"] .collection-card-content {
    background: var(--surface-card);
}

[data-theme="dark"] .collection-stats-row {
    color: var(--text-muted);
}

[data-theme="dark"] .like-btn {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .like-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .filter-dropdown {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .collection-card-title {
    color: var(--text-heading);
}

[data-theme="dark"] .collection-card-creator {
    color: var(--text-muted);
}

[data-theme="dark"] .collection-card-description {
    color: var(--text-subtle);
}

/* Admin game video generator dark mode */
[data-theme="dark"] .generator-controls,
[data-theme="dark"] .game-search-section {
    background: var(--surface-card);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .selected-games-list,
[data-theme="dark"] .selected-game-item {
    background: var(--surface-card);
}

/* Admin banners page dark mode */
[data-theme="dark"] .banner-item {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .banner-item.active {
    border-color: #22c55e;
}

[data-theme="dark"] .banner-details {
    background: var(--surface-card);
}

[data-theme="dark"] .banner-type {
    background: var(--playdate-border);
    color: var(--text-primary);
}

[data-theme="dark"] .banner-created {
    color: #6b7280;
}

[data-theme="dark"] .empty-state {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .empty-state h3 {
    color: var(--text-heading);
}

/* Admin IP limits page dark mode */
[data-theme="dark"] .admin-card h2,
[data-theme="dark"] table tr:hover td {
    background: var(--surface-elevated);
}

[data-theme="dark"] .modal-content h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .modal-content label {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-content input,
[data-theme="dark"] .modal-content select,
[data-theme="dark"] .modal-content textarea {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* Admin developer groups dark mode */
[data-theme="dark"] .admin-section {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .developer-selector {
    background: var(--surface-card);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .developer-group {
    background: var(--surface-card);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .group-actions {
    border-color: var(--playdate-border);
}

/* Developer game editor dark mode */
[data-theme="dark"] .editor-section {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .description-textarea {
    background: var(--surface-card);
    border-color: #8b5cf6;
    color: var(--text-heading);
}

[data-theme="dark"] .description-textarea:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

[data-theme="dark"] .screenshot-item {
    border-color: var(--playdate-border);
}

[data-theme="dark"] .screenshot-controls {
    background: var(--surface-elevated);
}

[data-theme="dark"] .upload-dropzone {
    border-color: var(--playdate-border);
    background: var(--surface-card);
}

[data-theme="dark"] .upload-dropzone:hover {
    border-color: var(--playdate-yellow);
    background: var(--surface-elevated);
}

/* Top 10 title customization dark mode */
[data-theme="dark"] .title-customization {
    background: var(--surface-elevated);
}

[data-theme="dark"] .title-customization label {
    color: var(--text-heading);
}

[data-theme="dark"] .custom-title-input {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .custom-title-input:focus {
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .char-counter {
    color: var(--text-subtle);
}

[data-theme="dark"] .show-numbers-option {
    background: var(--surface-hover);
}

[data-theme="dark"] .show-numbers-option label {
    color: var(--text-primary);
}

/* Awards page dark mode */
[data-theme="dark"] .unofficial-disclaimer {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    color: #ffc107;
}

[data-theme="dark"] .unofficial-disclaimer a {
    color: #ffda6a;
}

[data-theme="dark"] .best-effort-note {
    background: rgba(23, 162, 184, 0.15);
    border-color: rgba(23, 162, 184, 0.4);
    color: #6dd5ed;
}

[data-theme="dark"] .definitions {
    background: var(--playdate-gray-dark);
}

[data-theme="dark"] .definitions p {
    color: var(--playdate-gray-light);
}

[data-theme="dark"] .admin-stats-link .admin-btn {
    background: var(--playdate-gray-dark);
    color: var(--playdate-gray-light);
}

[data-theme="dark"] .admin-stats-link .admin-btn:hover {
    background: var(--playdate-gray);
}

[data-theme="dark"] .admin-remove-btn {
    background: #dc3545;
    color: white;
}

[data-theme="dark"] .admin-remove-btn:hover {
    background: #ff6b6b;
}

[data-theme="dark"] .admin-search-item-source {
    background: var(--playdate-gray-dark);
    color: var(--playdate-gray-light);
}

[data-theme="dark"] .admin-controls {
    background: rgba(255, 193, 7, 0.1);
    border-color: rgba(255, 193, 7, 0.3);
}

[data-theme="dark"] .admin-nomination-item {
    background: var(--playdate-gray-dark);
}

[data-theme="dark"] .admin-modal {
    background: var(--playdate-black);
}

[data-theme="dark"] .admin-modal-header {
    border-color: var(--playdate-gray-dark);
}

[data-theme="dark"] #adminGameSearch {
    background: var(--playdate-gray-dark);
    border-color: var(--playdate-gray);
    color: var(--playdate-white);
}

[data-theme="dark"] .admin-search-item {
    border-color: var(--playdate-gray-dark);
    background: var(--playdate-black);
}

[data-theme="dark"] .admin-search-item:hover {
    background: var(--playdate-gray-dark);
}

[data-theme="dark"] .intro-card {
    background: var(--surface-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .intro-card h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .intro-card p {
    color: var(--text-muted);
}

[data-theme="dark"] .eligibility-info {
    background: rgba(255, 173, 0, 0.15);
}

[data-theme="dark"] .eligibility-info h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .eligibility-info ul {
    color: var(--text-muted);
}

[data-theme="dark"] .awards-filters {
    background: var(--surface-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .awards-filters h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .source-filter-buttons .filter-btn {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .source-filter-buttons .filter-btn:hover {
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .source-filter-buttons .filter-btn.active {
    background: var(--playdate-yellow);
    color: var(--text-on-accent);
}

[data-theme="dark"] .award-category {
    background: var(--surface-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .award-category-header {
    background: var(--surface-card);
}

[data-theme="dark"] .award-category-header:hover:not(.empty-category) {
    background: rgba(255, 173, 0, 0.15);
}

[data-theme="dark"] .category-title h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .game-count {
    color: var(--text-subtle);
}

[data-theme="dark"] .category-description {
    color: var(--text-subtle);
    border-bottom-color: var(--surface-hover);
}

[data-theme="dark"] .award-category-content {
    background: #252525;
}

/* Developer blog editor dark mode */
[data-theme="dark"] .portal-header {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
}

[data-theme="dark"] #autosave-indicator {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .editor-main,
[data-theme="dark"] .sidebar-section {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .editor-toolbar {
    background: var(--surface-card);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .toolbar-btn {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
    color: var(--text-heading);
}

[data-theme="dark"] .content-editor {
    background: var(--surface-card);
    border-color: var(--playdate-border);
    color: var(--text-heading);
}

[data-theme="dark"] .content-editor a[data-tooltip]:hover::after {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-on-accent);
}

[data-theme="dark"] .content-editor a[data-tooltip]:hover::before {
    border-top-color: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .image-manager {
    background: var(--surface-elevated);
}

[data-theme="dark"] .tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .selected-image-details {
    background: var(--surface-card);
}

[data-theme="dark"] .content-editor hr.blog-divider {
    border-top-color: var(--playdate-border);
}

[data-theme="dark"] .content-editor figure.blog-figure figcaption {
    color: #999;
}

/* Developer blog view dark mode */
[data-theme="dark"] .blog-post-view {
    background: #0a0a0a;
}

[data-theme="dark"] .blog-hero {
    background: var(--surface-card);
}

[data-theme="dark"] .blog-header-simple {
    background: var(--surface-card);
    border-bottom-color: var(--surface-elevated);
}

[data-theme="dark"] .blog-header {
    border-bottom-color: var(--playdate-border);
}

[data-theme="dark"] .author-name {
    color: var(--text-heading);
}

[data-theme="dark"] .post-date {
    color: #999;
}

[data-theme="dark"] .post-views {
    color: #999;
}

[data-theme="dark"] .blog-title {
    color: var(--text-heading);
}

[data-theme="dark"] .share-button {
    border-color: var(--border-medium);
    color: #999;
}

[data-theme="dark"] .share-button:hover {
    background: var(--surface-elevated);
    border-color: #666;
    color: #ddd;
}

[data-theme="dark"] .tag {
    background: var(--surface-elevated);
    color: #ccc;
}

[data-theme="dark"] .tag:hover {
    background: var(--playdate-yellow);
    color: black;
}

[data-theme="dark"] .blog-main {
    background: var(--surface-card);
}

[data-theme="dark"] .blog-content {
    color: var(--text-primary);
}

[data-theme="dark"] .blog-content h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .blog-content h3 {
    color: var(--text-primary);
}

[data-theme="dark"] .blog-content blockquote {
    color: #aaa;
}

[data-theme="dark"] .blog-content hr,
[data-theme="dark"] .blog-content hr.blog-divider {
    border-top-color: var(--playdate-border);
}

[data-theme="dark"] .blog-content figure figcaption,
[data-theme="dark"] .blog-content figure.blog-figure figcaption {
    color: #999;
}

[data-theme="dark"] .blog-actions {
    border-top-color: var(--playdate-border);
}

[data-theme="dark"] .other-posts {
    background: #0a0a0a;
}

[data-theme="dark"] .other-posts h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .other-post-card {
    background: var(--surface-card);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .other-post-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .other-post-content h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .other-post-date {
    color: #999;
}

/* ============================================
   Developer Profile - Dark Mode
   ============================================ */

/* Developer header with better contrast */
[data-theme="dark"] .developer-header {
    background: linear-gradient(135deg, #0f0f0f 0%, #050505 100%);
}

[data-theme="dark"] .header-pattern {
    opacity: 0.05;
}

[data-theme="dark"] .developer-name,
[data-theme="dark"] .developer-bio {
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

[data-theme="dark"] .developer-profile-placeholder {
    background: rgba(0,0,0,0.7);
    color: #ffdb4d;
    border: 5px solid rgba(255,255,255,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

[data-theme="dark"] .stat-item {
    background: rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
    box-shadow: none;
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .stat-number {
    color: #ffcc00;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

[data-theme="dark"] .stat-label {
    color: white;
    font-weight: 700;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    opacity: 1;
    font-size: 0.95rem;
}

[data-theme="dark"] .social-link {
    background: rgba(0,0,0,0.7);
    border-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

[data-theme="dark"] .social-link:hover {
    background: rgba(0,0,0,0.8);
    box-shadow: 0 6px 20px rgba(0,0,0,0.6);
    border-color: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
}

/* Developer layout main content areas */
[data-theme="dark"] .developer-layout {
    background: #0a0a0a;
}

[data-theme="dark"] .activities-section,
[data-theme="dark"] .games-sidebar {
    background: var(--surface-card);
    border-color: var(--playdate-border);
    color: #e5e5e5;
}

[data-theme="dark"] .activities-header h2,
[data-theme="dark"] .sidebar-header h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .activities-header p {
    color: var(--text-muted);
}

[data-theme="dark"] .activities-header,
[data-theme="dark"] .sidebar-header {
    border-bottom-color: var(--playdate-border);
}

/* Activity items */
[data-theme="dark"] .activity-item {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
    border-left-color: var(--playdate-yellow);
}

[data-theme="dark"] .activity-item:hover {
    border-color: var(--playdate-yellow);
    box-shadow: 0 2px 8px rgba(255, 204, 0, 0.1);
}

[data-theme="dark"] .activity-date {
    color: #888;
}

[data-theme="dark"] .activity-type {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .activity-game-info {
    background: var(--playdate-border);
    border-color: #4a4a4a;
}

[data-theme="dark"] .activity-link:hover .activity-game-info {
    border-color: var(--playdate-yellow);
    box-shadow: 0 4px 16px rgba(255, 204, 0, 0.15);
}

[data-theme="dark"] .activity-game-title {
    color: var(--text-heading);
}

[data-theme="dark"] .activity-game-description {
    color: var(--text-muted);
}

[data-theme="dark"] .activity-game-placeholder {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .activity-price {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .activity-price.free {
    color: #6ee7b7;
}

/* Sidebar games */
[data-theme="dark"] .games-count {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .sidebar-filters .filter-btn {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
    color: var(--text-muted);
}

[data-theme="dark"] .sidebar-filters .filter-btn.active {
    background: var(--playdate-yellow);
    color: var(--surface-card);
    border-color: var(--playdate-yellow);
    font-weight: 600;
}

[data-theme="dark"] .sidebar-filters .filter-btn:hover:not(.active) {
    background: var(--playdate-border);
    border-color: #4a4a4a;
    color: #e5e5e5;
}

[data-theme="dark"] .sidebar-game-content {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .sidebar-game-content:hover {
    background: var(--playdate-border);
    border-color: var(--playdate-yellow);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.15);
}

[data-theme="dark"] .sidebar-game-title {
    color: var(--text-heading);
}

[data-theme="dark"] .sidebar-game-placeholder {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .sidebar-game-price {
    color: var(--text-muted);
}

[data-theme="dark"] .sidebar-game-price .price {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .sidebar-game-price .price.free {
    color: #6ee7b7;
}

[data-theme="dark"] .sidebar-game-rating {
    color: #fbbf24;
}

/* Scrollbar for dark mode */
[data-theme="dark"] .sidebar-games::-webkit-scrollbar-track {
    background: var(--surface-elevated);
}

[data-theme="dark"] .sidebar-games::-webkit-scrollbar-thumb {
    background: #4a4a4a;
}

[data-theme="dark"] .sidebar-games::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Source badges */
[data-theme="dark"] .activity-source.catalog {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .activity-source.itch {
    background: #fa5c5c;
    color: white;
}

[data-theme="dark"] .activity-source.season {
    background: #6ee7b7;
    color: var(--surface-card);
}

[data-theme="dark"] .activity-source.combined {
    background: linear-gradient(135deg, var(--playdate-yellow) 0%, #FF6B35 50%, #FA5C5C 100%);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Description section */
[data-theme="dark"] .developer-description-section {
    background: #0a0a0a;
}

[data-theme="dark"] .description-content {
    background: var(--surface-card);
    border-color: var(--playdate-border);
    color: #e5e5e5;
}

[data-theme="dark"] .description-content h1 {
    color: var(--text-heading);
    border-bottom-color: var(--playdate-yellow);
}

[data-theme="dark"] .description-content h2,
[data-theme="dark"] .description-content h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .description-content p {
    color: #d1d1d1;
}

[data-theme="dark"] .description-content a {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .description-content a:hover {
    color: #ffdb4d;
    border-bottom-color: #ffdb4d;
}

[data-theme="dark"] .description-content blockquote {
    background: var(--surface-elevated);
    border-left-color: var(--playdate-yellow);
    color: #d1d1d1;
}

[data-theme="dark"] .description-content code {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
    color: var(--text-heading);
}

[data-theme="dark"] .description-content pre {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
    color: var(--text-heading);
}

[data-theme="dark"] .description-content strong {
    color: var(--text-heading);
}

[data-theme="dark"] .description-content em {
    color: var(--text-muted);
}

/* Mobile dark mode specific */
@media (max-width: 768px) {
    [data-theme="dark"] .sidebar-game-content {
        background: var(--surface-elevated);
        border-color: var(--playdate-border);
    }
    
    [data-theme="dark"] .sidebar-game-content:hover {
        background: var(--playdate-border);
        border-color: var(--playdate-yellow);
    }
    
    [data-theme="dark"] .activity-item {
        background: var(--surface-elevated);
        border-color: var(--playdate-border);
    }
    
    [data-theme="dark"] .activity-game-info {
        background: var(--playdate-border);
        border-color: #4a4a4a;
    }
    
    [data-theme="dark"] .sidebar-games::-webkit-scrollbar-track {
        background: var(--surface-elevated);
    }
    
    [data-theme="dark"] .sidebar-games::-webkit-scrollbar-thumb {
        background: #4a4a4a;
    }
}

/* Sidebar action icons */
[data-theme="dark"] .sidebar-action-icon {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .sidebar-action-icon:hover {
    background: var(--playdate-yellow);
    color: black;
    border-color: var(--playdate-yellow-dark);
}

[data-theme="dark"] .sidebar-action-icon.in-library,
[data-theme="dark"] .sidebar-action-icon.in-wishlist {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    color: #10b981;
}

/* ============================================
   Developer Pages - Dark Mode Fixes
   ============================================ */

/* --- Claim Profile Modal (developer_profile.html) --- */
[data-theme="dark"] .modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme="dark"] .modal-content {
    background: var(--surface-card);
    border: 1px solid var(--border-medium);
}

[data-theme="dark"] .modal-header {
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .modal-header h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .modal-close {
    color: var(--text-muted);
}

[data-theme="dark"] .modal-close:hover {
    color: var(--text-heading);
}

[data-theme="dark"] .modal-body p {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-body li {
    color: var(--text-primary);
}

[data-theme="dark"] .modal-body strong {
    color: var(--text-heading);
}

[data-theme="dark"] .form-actions {
    border-top-color: var(--border-medium);
}

/* --- Blog Activity Items on Developer Profile --- */
[data-theme="dark"] .activity-blog-info {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    box-shadow: none;
}

[data-theme="dark"] .activity-link:hover .activity-blog-info {
    border-color: var(--color-error);
    box-shadow: 0 4px 16px rgba(250, 92, 92, 0.15);
}

[data-theme="dark"] .activity-blog-title {
    color: var(--text-heading);
}

[data-theme="dark"] .activity-blog-excerpt {
    color: var(--text-muted);
}

[data-theme="dark"] .activity-blog-placeholder {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

/* --- Developer Game Editor (developer_game_editor.html) --- */
[data-theme="dark"] .game-editor-container {
    color: var(--text-primary);
}

[data-theme="dark"] .editor-header {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
}

[data-theme="dark"] .editor-header .header-left h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .editor-header .game-title {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .editor-header .back-btn {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .editor-header .back-btn:hover {
    color: white;
}

[data-theme="dark"] .btn-save {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .btn-save:hover {
    background: var(--playdate-yellow-dark);
}

[data-theme="dark"] .btn-cancel {
    color: var(--text-heading);
    border-color: var(--border-medium);
}

[data-theme="dark"] .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

[data-theme="dark"] .editor-section h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .section-description {
    color: var(--text-muted);
}

[data-theme="dark"] .toolbar-btn {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .toolbar-btn:hover {
    background: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .control-btn {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .control-btn:hover {
    background: var(--playdate-yellow);
    border-color: var(--playdate-yellow);
    color: var(--surface-card);
}

[data-theme="dark"] .delete-btn {
    background: rgba(250, 92, 92, 0.15);
    border-color: rgba(250, 92, 92, 0.3);
    color: #fa5c5c;
}

[data-theme="dark"] .delete-btn:hover {
    background: rgba(250, 92, 92, 0.25);
    border-color: rgba(250, 92, 92, 0.5);
    color: #ff7777;
}

[data-theme="dark"] .screenshot-controls {
    background: rgba(30, 30, 30, 0.95);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .upload-limit-message {
    background: var(--surface-elevated);
    color: var(--text-muted);
}

/* --- Blog Editor Form Controls (developer_blog_editor.html) --- */
[data-theme="dark"] .blog-editor-form .form-control {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    color: var(--text-heading);
}

[data-theme="dark"] .blog-editor-form .form-control::placeholder {
    color: #666;
}

[data-theme="dark"] .blog-editor-form textarea.form-control {
    color: var(--text-heading);
}

[data-theme="dark"] .blog-editor-form .sidebar-section h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .blog-editor-form .form-text {
    color: var(--text-muted);
}

[data-theme="dark"] .blog-editor-form .checkbox-label span {
    color: var(--text-primary);
}

[data-theme="dark"] .content-editor h2,
[data-theme="dark"] .content-editor h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .content-editor p {
    color: var(--text-primary);
}

[data-theme="dark"] .content-editor * {
    color: var(--text-primary);
}

[data-theme="dark"] .content-editor a {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .tab-btn {
    color: var(--text-primary);
}

[data-theme="dark"] .tab-btn.active {
    color: var(--text-heading);
}

[data-theme="dark"] .remove-image-btn {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
    color: var(--text-primary);
}

[data-theme="dark"] .remove-image-btn:hover {
    background: #ff4444;
    color: white;
    border-color: #ff4444;
}

[data-theme="dark"] .cover-preview {
    border-color: var(--border-medium);
}

[data-theme="dark"] .color-picker {
    border-color: var(--border-medium);
}

[data-theme="dark"] .color-text {
    background: var(--surface-elevated);
    color: var(--text-heading);
    border-color: var(--border-medium);
}

/* Blog editor link editor popup */
[data-theme="dark"] #linkEditorPopup {
    background: var(--surface-elevated) !important;
    border-color: var(--border-medium) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] #linkEditorPopup label {
    color: var(--text-muted) !important;
}

[data-theme="dark"] #linkEditorPopup input {
    background: var(--surface-card) !important;
    border-color: var(--border-medium) !important;
    color: var(--text-heading) !important;
}

/* Blog editor image manager dark mode */
[data-theme="dark"] .image-dialog-overlay .image-manager {
    background: var(--surface-card);
}

[data-theme="dark"] .image-dialog-overlay .manager-header {
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .image-dialog-overlay .manager-header h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .image-dialog-overlay .close-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .image-dialog-overlay .close-btn:hover {
    background: var(--surface-hover);
}

[data-theme="dark"] .image-dialog-overlay .manager-tabs {
    background: var(--surface-elevated);
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .image-dialog-overlay .upload-box {
    border-color: var(--border-medium);
}

[data-theme="dark"] .image-dialog-overlay .upload-box:hover {
    border-color: var(--playdate-yellow);
    background: var(--surface-elevated);
}

[data-theme="dark"] .image-dialog-overlay .library-item {
    border-color: var(--border-medium);
}

[data-theme="dark"] .image-dialog-overlay .library-item-info {
    background: var(--surface-elevated);
    color: var(--text-muted);
}

[data-theme="dark"] .image-dialog-overlay .insertion-options {
    background: var(--surface-elevated);
    border-top-color: var(--border-medium);
}

[data-theme="dark"] .image-dialog-overlay .insertion-options h4 {
    color: var(--text-heading);
}

[data-theme="dark"] .image-dialog-overlay .radio-option span {
    color: var(--text-primary);
}

/* ============================================================
   Dark mode overrides for remaining pages
   Moved from inline <style> blocks and added for hardcoded colors
   ============================================================ */

/* --- Quiz Results (moved from quiz_results.html) --- */
[data-theme="dark"] .quiz-results-header h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .results-subtitle {
    color: var(--text-muted);
}

[data-theme="dark"] .answer-tag {
    background: rgba(255, 173, 0, 0.2);
    color: var(--text-heading);
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .slot-title {
    color: var(--text-heading);
}

[data-theme="dark"] .slot-subtitle {
    color: var(--text-muted);
}

[data-theme="dark"] .slot-empty {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .empty-slot-content {
    color: #888;
}

[data-theme="dark"] .quiz-results-actions {
    border-color: var(--playdate-border);
}

/* --- Weekly Question (moved from weekly_question.html) --- */
[data-theme="dark"] .question-header {
    background: var(--surface-card);
    border-color: var(--playdate-border);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .countdown-container {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .requirements-section {
    background: #2d1f0a;
    border-color: #5a3f0a;
}

[data-theme="dark"] .requirements-section h3 {
    color: #f59e0b;
}

[data-theme="dark"] .requirements-list li {
    color: #fbbf24;
}

[data-theme="dark"] .submission-status {
    background: #064e3b;
    border-color: #059669;
}

[data-theme="dark"] .submission-status,
[data-theme="dark"] .view-submission-link {
    color: #6ee7b7;
}

[data-theme="dark"] .weekly-question-container .login-prompt {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .submission-card {
    background: var(--surface-card);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .submission-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .preview-images {
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-card) 100%);
}

[data-theme="dark"] .preview-image {
    background: #0a0a0a;
}

[data-theme="dark"] .preview-image.empty {
    background: var(--surface-card);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .weekly-question-container .placeholder-image {
    background: var(--surface-elevated);
    color: #888;
}

[data-theme="dark"] .history-link-section {
    border-top-color: var(--playdate-border);
}

[data-theme="dark"] .weekly-question-container .empty-icon {
    opacity: 0.8;
}

[data-theme="dark"] .top-game-card .game-stats {
    background: var(--surface-card);
    border: 1px solid var(--playdate-border);
}

[data-theme="dark"] .info-modal-content {
    background: var(--surface-card);
    color: var(--text-primary);
}

[data-theme="dark"] .info-modal-body {
    background: var(--surface-card);
}

[data-theme="dark"] .highlight-box {
    background: var(--surface-elevated);
    border-color: var(--playdate-border);
}

[data-theme="dark"] .info-button {
    background: var(--surface-elevated);
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .info-button:hover {
    background: var(--playdate-yellow);
    color: #1a1a1a;
}

[data-theme="dark"] .submissions-section h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .top-games-section h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .submission-info h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .submission-author {
    color: var(--text-muted);
}

[data-theme="dark"] .past-question-notice {
    color: var(--text-muted);
}

/* --- Games page: skeleton loader --- */
[data-theme="dark"] .game-card-skeleton {
    background: linear-gradient(90deg, var(--surface-elevated) 25%, var(--surface-hover) 50%, var(--surface-elevated) 75%);
    background-size: 200% 100%;
}

/* --- Quiz page --- */
[data-theme="dark"] .quiz-header h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .quiz-header p {
    color: var(--text-muted);
}

[data-theme="dark"] .quiz-container .question-title {
    color: var(--text-heading);
}

[data-theme="dark"] .option-card {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .option-card:hover {
    border-color: var(--playdate-yellow);
    background: rgba(255, 173, 0, 0.1);
}

[data-theme="dark"] .option-card.selected {
    border-color: var(--playdate-yellow-dark);
    background: rgba(255, 173, 0, 0.15);
}

[data-theme="dark"] .option-title {
    color: var(--text-heading);
}

[data-theme="dark"] .option-description {
    color: var(--text-muted);
}

[data-theme="dark"] .quiz-container .btn-secondary {
    background: var(--surface-card);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .quiz-container .btn-secondary:hover {
    background: var(--surface-hover);
}

/* --- Awards page --- */
[data-theme="dark"] .unofficial-disclaimer {
    background: #3d2e00;
    border-color: #6b5000;
    color: #fbbf24;
}

[data-theme="dark"] .unofficial-disclaimer a {
    color: #fcd34d;
}

[data-theme="dark"] .best-effort-note {
    background: #0c2d3e;
    border-color: #1a4a5e;
    color: #7dd3fc;
}

[data-theme="dark"] .intro-card {
    background: var(--surface-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .intro-card h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .intro-card p {
    color: var(--text-primary);
}

[data-theme="dark"] .definitions {
    background: var(--surface-elevated);
}

[data-theme="dark"] .award-category {
    background: var(--surface-card);
}

[data-theme="dark"] .award-category-header {
    background: var(--surface-card);
}

[data-theme="dark"] .award-category-header:hover:not(.empty-category) {
    background: rgba(255, 173, 0, 0.1);
}

[data-theme="dark"] .category-title h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .category-description {
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .award-category-content {
    background: var(--surface-elevated);
}

[data-theme="dark"] .awards-filters {
    background: var(--surface-card);
}

[data-theme="dark"] .awards-filters h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .admin-controls {
    background: #3d2e00;
    border-color: #6b5000;
}

[data-theme="dark"] .admin-nomination-item {
    background: var(--surface-card);
}

[data-theme="dark"] .admin-modal {
    background: var(--surface-card);
}

[data-theme="dark"] .admin-search-item-source {
    background: var(--surface-elevated);
    color: var(--text-muted);
}

[data-theme="dark"] .intro-card .nomination-btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-primary) !important;
    border-color: var(--border-medium);
}

/* --- About page --- */
[data-theme="dark"] .about-content {
    background: var(--surface-card);
}

[data-theme="dark"] .about-header h1 {
    color: var(--text-heading);
}

/* --- Statistics page --- */
[data-theme="dark"] .statistics-page h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .statistics-page h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .statistics-page h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .cost-card {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .cost-card h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .cost-card p,
[data-theme="dark"] .cost-card small {
    color: var(--text-muted);
}

[data-theme="dark"] .statistics-page .stat-card {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .stat-box {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .stat-box .stat-label {
    color: var(--text-muted);
}

[data-theme="dark"] .developer-row {
    border-color: var(--border-medium);
}

[data-theme="dark"] .dev-name {
    color: var(--text-primary);
}

[data-theme="dark"] .price-stat .label {
    color: var(--text-muted);
}

[data-theme="dark"] .price-stat .value {
    color: var(--text-heading);
}

[data-theme="dark"] .bar-label {
    color: var(--text-primary);
}

[data-theme="dark"] .bar-container {
    background: var(--surface-elevated);
}

[data-theme="dark"] .bar-count {
    color: var(--text-muted);
}

[data-theme="dark"] .bundle-info {
    color: var(--text-muted);
}

[data-theme="dark"] .analysis-note {
    color: var(--text-muted);
}

/* --- Top 10 page: hardcoded light colors --- */
[data-theme="dark"] .top10-card {
    background: var(--surface-card);
}

[data-theme="dark"] .top10-card .game-content h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .top10-card .game-content .developer {
    color: var(--text-muted);
}

[data-theme="dark"] .top10-card .game-notes-preview {
    background: rgba(59, 130, 246, 0.12);
}

[data-theme="dark"] .top10-list-item {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .top10-list-item .list-game-title {
    color: var(--text-heading);
}

[data-theme="dark"] .top10-list-item .list-game-developer {
    color: var(--text-muted);
}

[data-theme="dark"] .list-game-notes {
    background: var(--surface-elevated);
}

[data-theme="dark"] .list-game-notes .notes-text {
    color: var(--text-muted);
}

[data-theme="dark"] .list-game-image .placeholder-image {
    background: var(--surface-elevated);
    color: var(--text-muted);
}

[data-theme="dark"] .list-drag-handle {
    color: var(--text-muted);
    background: rgba(30, 30, 30, 0.9);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .list-action-btn {
    background: var(--surface-elevated);
    color: var(--text-muted);
}

[data-theme="dark"] .top10-page .view-toggle {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .view-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .view-btn:hover {
    background: var(--surface-elevated);
    color: var(--text-primary);
}

[data-theme="dark"] .view-btn.active {
    background: var(--playdate-yellow);
    color: black;
}

[data-theme="dark"] .top10-content {
    background: var(--surface-card);
}

[data-theme="dark"] .clickable-empty-slot {
    border-color: var(--border-medium);
    background: linear-gradient(135deg, var(--surface-card) 0%, var(--surface-elevated) 100%);
}

[data-theme="dark"] .clickable-empty-slot:hover {
    border-color: var(--playdate-yellow);
    background: linear-gradient(135deg, rgba(255, 173, 0, 0.08) 0%, var(--surface-elevated) 100%);
}

[data-theme="dark"] .clickable-empty-slot .empty-content p {
    color: var(--text-muted);
}

[data-theme="dark"] .top10-card.sortable-ghost {
    background: var(--surface-elevated);
}

[data-theme="dark"] .top10-list-item.sortable-ghost {
    background: var(--surface-elevated);
}

[data-theme="dark"] .drag-handle-corner {
    background: rgba(30, 30, 30, 0.95);
    border-color: var(--border-medium);
    color: var(--text-muted);
}

[data-theme="dark"] .top10-card-actions .action-btn {
    background: rgba(30, 30, 30, 0.95);
    border-color: rgba(60, 60, 60, 0.8);
}

[data-theme="dark"] .download-image-container {
    background: var(--surface-card);
}

[data-theme="dark"] .download-image-header h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .mobile-download-instructions {
    background: var(--surface-elevated);
}

[data-theme="dark"] .mobile-download-instructions h4 {
    color: var(--text-heading);
}

[data-theme="dark"] .mobile-download-instructions ol {
    color: var(--text-muted);
}

[data-theme="dark"] .btn-close-modal {
    background: var(--surface-elevated);
    color: var(--text-muted);
}

[data-theme="dark"] .btn-close-modal:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

[data-theme="dark"] .top10-list-item.empty-slot {
    border-color: var(--border-medium);
    background: rgba(30, 30, 30, 0.5);
}

[data-theme="dark"] .list-empty-content {
    color: var(--text-muted);
}

/* --- Categories page --- */
[data-theme="dark"] .category-search-input {
    background: var(--surface-card);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .category-search-input:focus {
    border-color: var(--playdate-yellow);
}

/* ==============================
   GAME DETAIL PAGE - Moved from inline styles
   ============================== */

/* Description tabs styling */
.description-tabs-container {
    margin-bottom: 1rem;
}

.description-tabs {
    display: flex;
    border-bottom: 2px solid var(--playdate-border);
    margin-bottom: 1.5rem;
}

.description-tab-button {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: var(--playdate-gray);
    border-bottom: 3px solid transparent;
    transition: all var(--transition-fast);
    position: relative;
}

.description-tab-button:hover {
    color: var(--playdate-black);
    background: var(--playdate-gray-lightest);
}

.description-tab-button.active {
    color: var(--playdate-yellow-dark);
    border-bottom-color: var(--playdate-yellow);
    background: var(--playdate-yellow-light);
}

.description-tab-content {
    display: none;
}

.description-tab-content.active {
    display: block;
}

/* Ensure tabbed descriptions inherit expand/collapse styling */
.description-tab-content .description-content {
    max-height: 200px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.description-tab-content .description-content:not(.collapsed) {
    max-height: none;
}

.description-tab-content .expand-toggle {
    background: none;
    border: none;
    color: var(--playdate-yellow-dark);
    cursor: pointer;
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    margin-top: 1rem;
    transition: var(--transition-fast);
}

.description-tab-content .expand-toggle:hover {
    color: var(--playdate-black);
}

.description-tab-content .expand-toggle .arrow {
    transition: transform var(--transition-fast);
}

.description-tab-content .expand-toggle.expanded .arrow {
    transform: rotate(180deg);
}

@media (max-width: 768px) {
    .description-tabs {
        flex-direction: column;
        border-bottom: none;
    }

    .description-tab-button {
        border-bottom: 1px solid var(--playdate-border);
        border-radius: 0;
        text-align: left;
    }

    .description-tab-button.active {
        border-bottom-color: var(--playdate-border);
        border-left: 3px solid var(--playdate-yellow);
    }
}

/* Developer link styling (game detail page) */
.developer-link {
    color: var(--playdate-yellow-dark);
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.developer-link:hover {
    color: var(--playdate-orange);
    border-bottom-color: var(--playdate-orange);
    text-decoration: none;
}

.developer-link:visited {
    color: var(--playdate-yellow-dark);
}

.developer-link:visited:hover {
    color: var(--playdate-orange);
}

/* Fix for recommendation card backgrounds */
.recommendation-card .game-image {
    background: none;
}

.recommendation-card img {
    background: none !important;
}

/* Quick Buy Modal */
.quick-buy-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.quick-buy-modal-content {
    background: var(--playdate-white);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.quick-buy-modal-content h3 {
    margin-top: 0;
    color: var(--playdate-black);
}

.qb-game-info {
    margin: 8px 0;
    color: var(--playdate-black);
}

.qb-disclaimer {
    font-size: 0.85em;
    color: var(--playdate-gray);
}

.qb-result {
    display: none;
    padding: 8px 0;
    font-weight: 500;
}

.qb-result-success {
    color: var(--color-success-dark, #2e7d32);
}

.qb-result-error {
    color: var(--color-error-dark, #c62828);
}

.qb-reconnect-link {
    color: var(--color-info-dark, #1565c0);
}

.qb-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

/* Quick Buy button and confirm */
.quick-buy-btn {
    background: #4caf50;
    color: white;
    border: none;
}

.quick-buy-btn:hover {
    background: #43a047;
}

.quick-buy-confirm-btn {
    background: #4caf50;
    color: white;
    border: none;
}

.quick-buy-confirm-btn:hover {
    background: #43a047;
}

/* ==============================
   GAME DETAIL PAGE - Dark Mode Fixes
   ============================== */

/* Description tabs dark mode */
[data-theme="dark"] .description-tab-button {
    color: var(--text-muted);
}

[data-theme="dark"] .description-tab-button:hover {
    color: var(--text-heading);
    background: var(--surface-hover);
}

[data-theme="dark"] .description-tab-button.active {
    color: var(--playdate-yellow);
    border-bottom-color: var(--playdate-yellow);
    background: rgba(255, 173, 0, 0.1);
}

/* Description tab expand toggle dark mode */
[data-theme="dark"] .description-tab-content .expand-toggle {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .description-tab-content .expand-toggle:hover {
    color: var(--text-heading);
}

/* Description collapsed fade for dark mode */
[data-theme="dark"] .description-content.collapsed::after {
    background: linear-gradient(to bottom, transparent, var(--playdate-cream));
}

/* Developer link dark mode */
[data-theme="dark"] .developer-link {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .developer-link:hover {
    color: #ffdb4d;
    border-bottom-color: #ffdb4d;
}

[data-theme="dark"] .developer-link:visited {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .developer-link:visited:hover {
    color: #ffdb4d;
}

/* Game detail page headings and text dark mode */
[data-theme="dark"] .game-detail h1 {
    color: var(--text-heading);
}

[data-theme="dark"] .game-detail h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .game-detail .developer {
    color: var(--text-muted);
}

/* Share popup dark mode */
[data-theme="dark"] .share-popup {
    background: #1e1e1e;
    color: #e0e0e0;
}

[data-theme="dark"] .share-popup-header {
    border-bottom-color: #333;
}

[data-theme="dark"] .share-popup-header h3 {
    color: #f0f0f0;
}

[data-theme="dark"] .share-popup-close {
    color: #999;
}

[data-theme="dark"] .share-popup-close:hover {
    color: #fff;
}

[data-theme="dark"] .share-url-input {
    background: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .share-url-label {
    color: #999;
}

[data-theme="dark"] .share-embed-card {
    background: #2a2a2a;
    border-color: #444;
}

[data-theme="dark"] .share-embed-title {
    color: #f0f0f0;
}

[data-theme="dark"] .share-embed-desc {
    color: #999;
}

[data-theme="dark"] .share-embed-url {
    color: #666;
}

[data-theme="dark"] .share-embed-label {
    color: #777;
}

/* Share button dark mode */
[data-theme="dark"] .share-btn-detail {
    background: rgba(40, 40, 40, 0.95);
    border-color: rgba(255, 255, 255, 0.15);
    color: #ccc;
}

[data-theme="dark"] .share-btn-detail:hover {
    background: rgba(33, 150, 243, 0.9);
    border-color: rgba(33, 150, 243, 1);
    color: white;
}

[data-theme="dark"] .action-tooltip::before {
    background: #e5e7eb;
    color: #111;
}

[data-theme="dark"] .action-tooltip::after {
    border-top-color: #e5e7eb;
}

[data-theme="dark"] .description h2 {
    color: var(--playdate-yellow);
}

/* Game meta section dark mode */
[data-theme="dark"] .game-meta {
    background: var(--surface-card);
}

[data-theme="dark"] .meta-item h4 {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .meta-item p {
    color: var(--text-primary);
}

/* Action icons dark mode */
[data-theme="dark"] .library-btn-detail,
[data-theme="dark"] .wishlist-btn-detail,
[data-theme="dark"] .collections-btn-detail {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .library-btn-detail {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
}

[data-theme="dark"] .wishlist-btn-detail {
    background: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
}

[data-theme="dark"] .collections-btn-detail {
    background: rgba(63, 81, 181, 0.15);
    border-color: rgba(63, 81, 181, 0.4);
}

/* User rating section dark mode */
[data-theme="dark"] .user-rating-section {
    background: rgba(255, 173, 0, 0.1);
    border-color: rgba(255, 173, 0, 0.3);
}

[data-theme="dark"] .user-rating-section h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .rating-text {
    color: var(--text-muted);
}

[data-theme="dark"] .star {
    color: #ffad00 !important;
}

/* Carousel and image rating dark mode */
[data-theme="dark"] .carousel-rating {
    color: var(--text-muted);
}

[data-theme="dark"] .carousel-rating .rating-score {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .carousel-rating .rating-count {
    color: var(--text-muted);
}

[data-theme="dark"] .image-rating {
    color: var(--text-muted);
}

[data-theme="dark"] .image-rating .rating-score {
    color: var(--playdate-yellow);
}

[data-theme="dark"] .image-rating .rating-count {
    color: var(--text-muted);
}

/* Sale countdown dark mode */
[data-theme="dark"] .sale-countdown {
    background: rgba(239, 68, 68, 0.15);
    border-left-color: var(--color-error);
}

[data-theme="dark"] .countdown-text {
    color: var(--text-muted);
}

/* Featured in section dark mode */
[data-theme="dark"] .featured-in {
    color: var(--text-primary);
}

[data-theme="dark"] .featured-in h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .featured-in li {
    color: var(--text-primary);
}

/* Last sale info dark mode */
[data-theme="dark"] .last-sale-info {
    background: var(--color-info-bg);
    color: var(--color-info);
}

/* Recommendation cards dark mode - extended */
[data-theme="dark"] .recommendation-content .developer {
    color: var(--text-muted);
}

[data-theme="dark"] .recommendation-content .price {
    color: var(--text-heading);
}

[data-theme="dark"] .recommendation-content .free {
    color: var(--color-success);
}

[data-theme="dark"] .recommendation-content .coming-soon {
    color: var(--text-muted);
}

[data-theme="dark"] .recommendation-content .no-price {
    color: var(--text-muted);
}

[data-theme="dark"] .recommendation-reasons {
    color: var(--text-muted);
}

[data-theme="dark"] .recommendation-reasons small {
    color: var(--text-muted);
}

[data-theme="dark"] .recommendations-section h2 {
    color: var(--text-heading);
}

/* Quick Buy modal dark mode */
[data-theme="dark"] .quick-buy-modal-content {
    background: var(--surface-card);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .quick-buy-modal-content h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .qb-game-info {
    color: var(--text-primary);
}

[data-theme="dark"] .qb-disclaimer {
    color: var(--text-muted);
}

[data-theme="dark"] .qb-result-success {
    color: var(--color-success);
}

[data-theme="dark"] .qb-result-error {
    color: var(--color-error);
}

[data-theme="dark"] .qb-reconnect-link {
    color: var(--color-info);
}

/* Expand toggle dark mode (non-tabbed) */
[data-theme="dark"] .expand-toggle {
    background: var(--surface-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .expand-toggle:hover {
    background: var(--playdate-yellow);
    color: var(--text-on-accent);
    border-color: var(--playdate-yellow);
}

/* Description section background dark mode */
[data-theme="dark"] .description {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

/* ============================================================================
   CONSOLIDATED DARK MODE FIXES - Auth, Profile, Library, Collections, Admin
   ============================================================================ */

/* --- Profile page toast notifications --- */
.profile-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem;
    border-radius: 8px;
    z-index: 1001;
    max-width: 400px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.profile-toast-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.profile-toast-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

[data-theme="dark"] .profile-toast-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

[data-theme="dark"] .profile-toast-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

/* --- Edit Profile: notification options dark mode --- */
[data-theme="dark"] .edit-profile-form-section,
[data-theme="dark"] .form-section {
    border-top-color: var(--border-medium);
}

[data-theme="dark"] .master-toggle {
    background: var(--surface-elevated);
    border-color: var(--border-medium);
}

[data-theme="dark"] .master-toggle:hover {
    background: var(--surface-hover);
    border-color: var(--border-heavy);
}

[data-theme="dark"] .master-toggle strong {
    color: var(--text-heading);
}

[data-theme="dark"] .notification-option {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .notification-option:hover {
    background: var(--surface-elevated);
    border-color: var(--border-heavy);
}

[data-theme="dark"] .option-content strong {
    color: var(--text-heading);
}

[data-theme="dark"] .option-content small {
    color: var(--text-muted);
}

[data-theme="dark"] .checkbox-custom {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

/* --- Library page: share button dark mode --- */
[data-theme="dark"] .library-share-btn {
    color: var(--text-muted);
    border-color: var(--border-medium);
}

[data-theme="dark"] .library-share-btn:hover {
    background: var(--surface-elevated);
    border-color: var(--border-heavy);
    color: var(--text-heading);
}

/* --- Collections page: tabs and submissions dark mode --- */
[data-theme="dark"] .tab-nav {
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .tab-link {
    color: var(--text-muted);
}

[data-theme="dark"] .tab-link:hover {
    color: var(--text-primary);
}

[data-theme="dark"] .submissions-info p {
    color: var(--text-muted);
}

[data-theme="dark"] .submission-question-badge {
    background: rgba(254, 243, 199, 0.15);
    color: #fcd34d;
}

[data-theme="dark"] .submission-date {
    color: var(--text-subtle);
}

/* Collections page: action buttons dark mode */
[data-theme="dark"] .action-btn {
    background: rgba(42, 42, 42, 0.95);
    border-color: rgba(68, 68, 68, 0.8);
    color: var(--text-primary);
}

[data-theme="dark"] .delete-btn {
    background: rgba(42, 42, 42, 0.95);
}

/* --- Admin dashboard dark mode --- */
[data-theme="dark"] .stat-card {
    background: var(--surface-card);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .stat-content h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .stat-content p {
    color: var(--text-secondary);
}

[data-theme="dark"] .stat-content small {
    color: var(--text-subtle);
}

[data-theme="dark"] .admin-section {
    background: var(--surface-card);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .admin-section h2 {
    color: var(--text-heading);
}

[data-theme="dark"] .admin-table th {
    background: var(--surface-elevated);
    color: var(--text-heading);
}

[data-theme="dark"] .admin-table td {
    color: var(--text-primary);
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .admin-table tr:hover td {
    background: var(--surface-elevated);
}

[data-theme="dark"] .tab-button {
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .tab-button:hover {
    background: var(--surface-hover);
    color: var(--text-heading);
}

[data-theme="dark"] .tab-button.active {
    background: var(--playdate-yellow);
    color: #1a1a1a;
}

[data-theme="dark"] .tool-section {
    background: var(--surface-elevated);
}

[data-theme="dark"] .tool-section h3 {
    color: var(--text-heading);
}

[data-theme="dark"] .tool-section p {
    color: var(--text-muted);
}

[data-theme="dark"] .tool-section h4 {
    color: var(--text-heading);
    border-top-color: var(--border-medium);
}

[data-theme="dark"] .admin-nav .btn-secondary {
    background: var(--surface-elevated);
    color: var(--text-secondary);
    border-color: var(--border-medium);
}

[data-theme="dark"] .admin-nav .btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--playdate-yellow);
}

[data-theme="dark"] .email-tools-subtitle {
    color: var(--text-muted);
}

[data-theme="dark"] .test-status.success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

[data-theme="dark"] .test-status.error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

[data-theme="dark"] .blacklist-item {
    background: var(--surface-card);
    border-color: var(--border-medium);
}

[data-theme="dark"] .blacklist-item-info h5 {
    color: var(--text-heading);
}

[data-theme="dark"] .blacklist-item-info small {
    color: var(--text-muted);
}

[data-theme="dark"] .screenshot-info {
    background: var(--surface-card);
}

[data-theme="dark"] .screenshot-info small {
    color: var(--text-muted);
}

[data-theme="dark"] .game-title-display {
    background: var(--surface-elevated);
}

[data-theme="dark"] .game-title-display h4 {
    color: var(--text-heading);
}

[data-theme="dark"] .game-title-display p {
    color: var(--text-muted);
}

[data-theme="dark"] .status-badge.verified {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

[data-theme="dark"] .status-badge.unverified {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

/* Admin modal dark mode */
[data-theme="dark"] .modal-content {
    background: var(--surface-card);
}

[data-theme="dark"] .modal-header {
    background: var(--surface-elevated);
    border-bottom-color: var(--border-medium);
}

[data-theme="dark"] .modal-header h2 {
    color: var(--text-heading);
}

/* --- Pair page: flash messages dark mode --- */
[data-theme="dark"] .flash-success {
    background: var(--color-success-bg);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

[data-theme="dark"] .flash-success .flash-icon {
    background: var(--color-success-dark);
}

[data-theme="dark"] .flash-error {
    background: var(--color-error-bg);
    color: var(--color-error);
    border-color: var(--color-error-border);
}

[data-theme="dark"] .flash-error .flash-icon {
    background: var(--color-error-dark);
}

/* --- Loading skeleton dark mode (home page) --- */
[data-theme="dark"] .game-card-skeleton {
    background: linear-gradient(90deg, var(--surface-card) 25%, var(--surface-elevated) 50%, var(--surface-card) 75%);
    background-size: 200% 100%;
}

/* ============================================================================
   PDFonts - Playdate Font Sharing Page
   ============================================================================ */

.fonts-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

.fonts-hero {
    text-align: center;
    margin-bottom: 30px;
}

.pdfonts-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0 0 6px;
    text-align: center;
}

.fonts-subtitle {
    color: #666;
    font-size: 1.05rem;
    margin: 0;
}

/* Upload Section */
.fonts-upload-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

.fonts-upload-form {
    max-width: 600px;
    margin: 20px auto 0;
    text-align: left;
}

.fonts-upload-form .form-group {
    margin-bottom: 16px;
}

.fonts-upload-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.fonts-upload-form input[type="text"],
.fonts-upload-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
}

.fonts-upload-form input[type="file"] {
    display: block;
    margin-top: 4px;
}

.fonts-upload-form small {
    display: block;
    color: #888;
    font-size: 0.82rem;
    margin-top: 4px;
}

.font-dropzone {
    position: relative;
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.font-dropzone:hover,
.font-dropzone.dragover {
    border-color: #FFC736;
    background: rgba(255, 199, 54, 0.05);
}

.font-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.font-dropzone-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #888;
    font-size: 0.9rem;
    pointer-events: none;
}

.font-dropzone-filename {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.upload-drop-hint {
    font-size: 0.82rem;
    color: #999;
    margin: 6px 0 0;
}

.fonts-upload-section.dragover {
    border-color: #FFC736;
    border-style: dashed;
    background: rgba(255, 199, 54, 0.06);
}

[data-theme="dark"] .fonts-upload-section.dragover {
    border-color: #FFC736;
    background: rgba(255, 199, 54, 0.08);
}

[data-theme="dark"] .upload-drop-hint {
    color: var(--text-secondary, #777);
}

[data-theme="dark"] .font-dropzone {
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .font-dropzone:hover,
[data-theme="dark"] .font-dropzone.dragover {
    border-color: #FFC736;
    background: rgba(255, 199, 54, 0.08);
}

[data-theme="dark"] .font-dropzone-label {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .font-dropzone-filename {
    color: var(--text-primary, #e0e0e0);
}

.upload-preview {
    margin: 16px 0;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow-x: auto;
}

.upload-preview h4 {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.upload-preview canvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    display: block;
    margin-bottom: 8px;
}

.upload-preview-info {
    font-size: 0.85rem;
    color: #666;
}

/* Sort Controls */
.fonts-sort {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.fonts-sort-label {
    font-size: 0.85rem;
    color: #888;
    margin-right: 2px;
}

.fonts-sort-btn {
    font-size: 0.85rem;
    padding: 4px 10px;
    border-radius: 6px;
    color: #555;
    text-decoration: none;
    border: 1px solid #ddd;
    transition: all 0.15s;
}

.fonts-sort-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.fonts-sort-btn.active {
    background: #FFC736;
    color: #1a1a1a;
    border-color: #FFC736;
    font-weight: 600;
}

[data-theme="dark"] .fonts-sort-btn {
    color: var(--text-secondary, #aaa);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .fonts-sort-btn:hover {
    background: var(--surface-elevated, #2a2a3a);
    color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .fonts-sort-btn.active {
    background: #FFC736;
    color: #1a1a1a;
    border-color: #FFC736;
}

/* Font Grid */
.fonts-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 30px;
}

.font-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.font-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.font-card-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}

.font-card-info {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.font-card-header-actions {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.font-card-preview-inline {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Grow naturally to fit whatever integer-scaled canvas the renderer
       picks for this font; never scroll horizontally. */
    overflow: visible;
    min-height: 0;
}

.font-preview-canvas,
.font-expanded-canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
    display: block;
}

.font-card-name {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.2;
}

.font-download-count {
    font-weight: 400;
    font-size: 0.78rem;
    color: #999;
    margin-left: 6px;
}

[data-theme="dark"] .font-download-count {
    color: var(--text-secondary, #888);
}

.font-card-meta-inline {
    display: block;
    font-size: 0.82rem;
    color: #777;
    line-height: 1.3;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}


.fonts-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.93rem;
}

.fonts-alert-success {
    background: #f0fff4;
    color: #276749;
    border: 1px solid #c6f6d5;
}

.fonts-alert-error {
    background: #fed7d7;
    color: #9b2c2c;
    border: 1px solid #feb2b2;
}

.fonts-alert-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    padding: 0 0 0 12px;
}

.fonts-alert-close:hover {
    opacity: 1;
}

[data-theme="dark"] .fonts-alert-success {
    background: #064e3b;
    color: #6ee7b7;
    border-color: #065f46;
}

[data-theme="dark"] .fonts-alert-error {
    background: #7f1d1d;
    color: #fca5a5;
    border-color: #991b1b;
}

.font-scale-badge {
    font-size: 0.68rem;
    color: #bbb;
    font-weight: 500;
    flex-shrink: 0;
}

[data-theme="dark"] .font-scale-badge {
    color: var(--text-secondary, #666);
}

.font-license-badge {
    font-size: 0.72rem;
    color: #888;
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
}

[data-theme="dark"] .font-license-badge {
    background: var(--surface-elevated, #2a2a3a);
    color: var(--text-secondary, #aaa);
}

.font-expand-arrow {
    font-size: 0.7rem;
    color: #999;
    transition: transform 0.2s;
}

.font-card-expanded {
    padding: 0 14px 14px;
    border-top: 1px solid #eee;
}

.font-card-desc {
    font-size: 0.9rem;
    color: #555;
    margin: 10px 0;
    line-height: 1.4;
}

.font-card-sample {
    margin-bottom: 10px;
}

.font-sample-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
    box-sizing: border-box;
}

.font-card-expanded-preview {
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
}

.font-expanded-scale {
    position: absolute;
    top: 4px;
    right: 4px;
}

.font-card-admin {
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.upload-agreement {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
}

.upload-agreement input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
}

[data-theme="dark"] .upload-agreement {
    color: var(--text-secondary, #aaa);
}

.fonts-disclaimer {
    margin-top: 20px;
    padding: 14px 18px;
    font-size: 0.82rem;
    color: #888;
    line-height: 1.5;
    background: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    position: relative;
    z-index: 1;
}

.fonts-disclaimer p {
    margin: 0 0 8px;
}

.fonts-disclaimer p:last-child {
    margin-bottom: 0;
}

.fonts-disclaimer a {
    color: #FFC736;
}

[data-theme="dark"] .fonts-disclaimer {
    color: var(--text-secondary, #777);
    background: var(--surface-card, #1e1e2e);
    border-color: var(--border-color, #333);
}

.fonts-empty {
    text-align: center;
    padding: 30px 20px;
    color: #888;
}

/* Usage Guide */
.fonts-guide {
    margin-top: 30px;
    padding: 16px 20px;
    background: #f8f8f8;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}

.fonts-guide h2 {
    margin: 0;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fonts-guide-toggle {
    padding: 4px 0;
}

.guide-arrow {
    font-size: 0.7rem;
    color: #999;
}

.fonts-guide-content {
    margin-top: 16px;
}

.guide-section {
    margin-bottom: 24px;
}

.guide-section:last-child {
    margin-bottom: 0;
}

.guide-section h3 {
    font-size: 1.05rem;
    margin: 0 0 8px;
}

.guide-section p,
.guide-section ul {
    font-size: 0.93rem;
    line-height: 1.5;
    color: #444;
}

.guide-section ul {
    padding-left: 20px;
}

.guide-section pre {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.5;
}

.guide-section code {
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}

.guide-section p code {
    background: #eee;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.88rem;
}

.guide-section a {
    color: #FFC736;
}

/* Responsive */
@media (max-width: 600px) {
    .fonts-page {
        padding: 10px 0;
    }
    .fonts-hero {
        margin-bottom: 16px;
    }
    .pdfonts-title {
        font-size: 1.8rem;
    }
    .fonts-subtitle {
        font-size: 0.9rem;
    }
    .fonts-guide {
        padding: 14px;
    }
    /* Stack card vertically: info → preview → download (centred) */
    .font-card-header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 6px;
        padding: 10px 12px;
    }
    .font-card-info {
        grid-column: 1;
        grid-row: 1;
    }
    .font-card-preview-inline {
        grid-column: 1;
        grid-row: 2;
    }
    .font-card-header-actions {
        grid-column: 1;
        grid-row: 3;
        justify-content: center;
    }
    .font-card-name {
        font-size: 0.88rem;
    }
    .font-card-meta-inline {
        font-size: 0.75rem;
    }
    .font-expand-arrow {
        display: none;
    }
    .font-card-expanded {
        padding: 0 12px 12px;
    }
    .font-sample-input {
        font-size: 0.85rem;
    }
    .fonts-upload-section {
        padding: 14px;
    }
    .fonts-disclaimer {
        padding: 12px 14px;
        font-size: 0.78rem;
    }
    .fonts-sort {
        flex-wrap: wrap;
    }
}

/* ============================================================================
   PDFonts - Dark Mode
   ============================================================================ */

[data-theme="dark"] .fonts-upload-section {
    background: var(--surface-card, #1e1e2e);
    border-color: var(--border-color, #333);
}

[data-theme="dark"] .fonts-upload-form input[type="text"],
[data-theme="dark"] .fonts-upload-form textarea {
    background: var(--surface-elevated, #2a2a3a);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .upload-preview {
    background: var(--surface-elevated, #2a2a3a);
    border-color: var(--border-color, #444);
}

[data-theme="dark"] .font-card {
    background: var(--surface-card, #1e1e2e);
    border-color: var(--border-color, #333);
}

[data-theme="dark"] .font-card-expanded {
    border-color: var(--border-color, #333);
}

[data-theme="dark"] .font-card-name {
    color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .font-card-meta-inline {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .font-card-desc {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .font-card-admin {
    border-color: var(--border-color, #333);
}

[data-theme="dark"] .font-expand-arrow,
[data-theme="dark"] .guide-arrow {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .font-sample-input {
    background: var(--surface-elevated, #2a2a3a);
    border-color: var(--border-color, #444);
    color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .fonts-guide {
    background: var(--surface-card, #1e1e2e);
    border-color: var(--border-color, #333);
}

[data-theme="dark"] .guide-section p,
[data-theme="dark"] .guide-section ul {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .guide-section p code {
    background: var(--surface-elevated, #2a2a3a);
    color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .fonts-subtitle {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .fonts-empty {
    color: var(--text-secondary, #aaa);
}

[data-theme="dark"] .upload-preview-info {
    color: var(--text-secondary, #aaa);
}

/* Reusable info chip with animated tooltip (works on hover + tap) */
.info-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    padding: 1px 7px 2px;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-size: 0.75em;
    line-height: 1.4;
    color: var(--text-secondary, #6b7280);
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.info-tip:hover,
.info-tip:focus-visible {
    background: rgba(0, 0, 0, 0.1);
    color: #1f2937;
    outline: none;
}
.info-tip:active { transform: scale(0.96); }

[data-theme="dark"] .info-tip {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary, #aaa);
}
[data-theme="dark"] .info-tip:hover,
[data-theme="dark"] .info-tip:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}
/* Invert tooltip bubble in dark mode for readable contrast (matches .action-tooltip) */
[data-theme="dark"] .info-tip::before {
    background: #e5e7eb;
    color: #111827;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .info-tip::after {
    border-top-color: #e5e7eb;
}

.info-tip::before,
.info-tip::after {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    pointer-events: none;
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 50;
}
.info-tip::before {
    content: attr(data-tooltip);
    width: max-content;
    max-width: min(280px, 80vw);
    padding: 0.55rem 0.75rem;
    background: #1f2937;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.4;
    text-align: left;
    white-space: normal;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}
.info-tip::after {
    content: '';
    bottom: calc(100% + 4px);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

/* Desktop: hover or keyboard focus reveals it */
@media (hover: hover) {
    .info-tip:hover::before,
    .info-tip:hover::after,
    .info-tip:focus-visible::before,
    .info-tip:focus-visible::after {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
/* Mobile / touch: tap toggles via .is-open class (set by JS) */
.info-tip.is-open::before,
.info-tip.is-open::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .info-tip,
    .info-tip::before,
    .info-tip::after {
        transition: opacity 0.05s ease;
    }
}

/* Carousel: subtle Resume button shown after user takes manual control */
.carousel-resume {
    margin: 0.85rem auto 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.85rem 0.4rem 0.7rem;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--playdate-border);
    border-radius: 999px;
    color: var(--playdate-gray-dark);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.carousel-resume:hover {
    background: rgba(255, 173, 0, 0.12);
    border-color: var(--playdate-yellow);
    color: var(--playdate-yellow-dark);
}
.carousel-resume:active { transform: scale(0.97); }
.carousel-resume:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--playdate-yellow-light);
}
.carousel-resume[hidden] { display: none; }

.carousel-resume-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--playdate-yellow);
    box-shadow: 0 0 0 3px rgba(255, 173, 0, 0.18);
}

[data-theme="dark"] .carousel-resume {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--playdate-border);
    color: rgba(255, 255, 255, 0.78);
}
[data-theme="dark"] .carousel-resume:hover {
    background: rgba(255, 173, 0, 0.14);
    border-color: var(--playdate-yellow);
    color: var(--playdate-yellow);
}

/* Center the pill below the thumbnails */
.game-carousel { display: flex; flex-direction: column; align-items: stretch; }
.carousel-resume { align-self: center; }
