:root {
    /* Light Mode Colors */
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #10b981;
    --secondary-hover: #059669;
    --accent-color: #f59e0b;
    --accent-hover: #d97706;
    --danger-color: #ef4444;
    --danger-hover: #dc2626;
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #e2e8f0;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.95);
    /* Text Colors */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;
    /* Border Colors */
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    --border-dark: #94a3b8;
    /* Shadow */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    /* Assistive Mode Colors */
    --assistive-primary: #f59e0b;
    --assistive-secondary: #fbbf24;
    /* Game Card Colors - DO NOT CHANGE */
    --color-yellow: #dd9427;
    --color-green: #0da215;
    --color-whitefaded: #e3e2e1;
    --color-blue1: #698992;
    --color-blue2: #5e9cb9;
    --color-blue3: #1f73bc;
}

[data-theme="dark"] {
    /* Dark Mode Colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    --bg-nav: rgba(15, 23, 42, 0.95);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -4px rgb(0 0 0 / 0.3);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navigation Styles */
.navbar {
    background-color: var(--bg-nav);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .navbar-brand:hover {
        color: var(--primary-hover);
    }

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

    .nav-link:hover {
        background-color: var(--bg-tertiary);
        color: var(--primary-color);
    }

    .nav-link.active {
        background-color: var(--primary-color);
        color: var(--text-inverse);
    }

/* Theme Toggle */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 50px;
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    transition: all 0.3s ease;
}

    .theme-toggle:hover {
        background-color: var(--bg-tertiary);
        transform: scale(1.05);
    }

    .theme-toggle svg {
        width: 1.25rem;
        height: 1.25rem;
        fill: var(--text-primary);
        transition: all 0.3s ease;
    }

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
}

.navbar-nav.mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-nav);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    flex-direction: column;
    padding: 1rem 2rem;
    gap: 1rem;
}

    .navbar-nav.mobile.show {
        display: flex;
    }

/* Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    font-family: inherit;
    line-height: 1;
}

    .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-inverse);
    border-color: var(--primary-color);
}

    .btn-primary:hover:not(:disabled) {
        background-color: var(--primary-hover);
        border-color: var(--primary-hover);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--text-inverse);
    border-color: var(--secondary-color);
}

    .btn-secondary:hover:not(:disabled) {
        background-color: var(--secondary-hover);
        border-color: var(--secondary-hover);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-outline {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-outline:hover:not(:disabled) {
        background-color: var(--primary-color);
        color: var(--text-inverse);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-danger {
    background-color: var(--danger-color);
    color: var(--text-inverse);
    border-color: var(--danger-color);
}

    .btn-danger:hover:not(:disabled) {
        background-color: var(--danger-hover);
        border-color: var(--danger-hover);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Card Styles */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

    .card:hover {
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-light);
    background-color: var(--bg-secondary);
}

/* Main Content Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Homepage Styles */
.homepage-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 2rem;
    text-align: center;
}

.homepage-hero {
    margin-bottom: 4rem;
}

    .homepage-hero h1 {
        font-size: 3.5rem;
        font-weight: bold;
        color: var(--text-primary);
        margin-bottom: 1rem;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .homepage-hero .subtitle {
        font-size: 1.25rem;
        color: var(--text-secondary);
        margin-bottom: 0;
    }

.game-modes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.game-mode-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
}

    .game-mode-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-xl);
    }

    .game-mode-card h2 {
        margin-top: 0;
        margin-bottom: 1rem;
        color: var(--text-primary);
        font-size: 1.5rem;
    }

    .game-mode-card p {
        margin-bottom: 1.5rem;
        color: var(--text-secondary);
    }

.join-room-section {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px dashed var(--border-medium);
}

    .join-room-section h3 {
        margin-top: 0;
        margin-bottom: 1.5rem;
        color: var(--text-primary);
    }

.join-room-form {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: stretch;
    flex-wrap: wrap;
}

#roomCodeInput {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-medium);
    border-radius: 0.5rem;
    background-color: var(--bg-card);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 200px;
    text-align: center;
    transition: all 0.3s ease;
}

    #roomCodeInput:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.error-message {
    color: var(--danger-color);
    margin-top: 1rem;
    font-weight: 500;
}

/* Game Header */
.game-header {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.game-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.game-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

    .game-info p {
        margin: 0;
        color: var(--text-secondary);
        font-weight: 500;
    }

.game-options {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Game Layout */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    align-items: start;
}

.game-board-section {
    order: 1;
}

.game-sidebar {
    order: 2;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Game Board */
.board-container {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 100%;
}

.game-card {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    aspect-ratio: 4/3;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    padding: 0.5rem;
}

    .game-card:hover {
        border-color: var(--primary-color);
        box-shadow: var(--shadow-md);
        transform: translateY(-2px);
    }

    .game-card.selected {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
        background-color: rgba(37, 99, 235, 0.05);
    }

    .game-card.assistant-selected {
        border-color: var(--assistive-primary);
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
        background-color: rgba(245, 158, 11, 0.05);
        animation: assistantPulse 2s ease-in-out;
    }

    .game-card svg {
        width: clamp(24px, 4vw, 48px);
        height: clamp(48px, 8vw, 96px);
        flex-shrink: 0;
    }

/* Chat System */
.chat-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    height: 400px;
    box-shadow: var(--shadow-sm);
}

.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
    border-radius: 1rem 1rem 0 0;
}

    .chat-header h3 {
        margin: 0;
        color: var(--text-primary);
        font-size: 1.125rem;
    }

.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-secondary);
}

.chat-entry {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.set-header {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.message-entry {
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border-radius: 0.5rem;
    border-left: 4px solid var(--secondary-color);
    box-shadow: var(--shadow-sm);
}

.message-author {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 0.5rem;
}

.message-text {
    color: var(--text-primary);
}

.set-cards {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chat-card {
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid var(--border-medium);
    background: var(--bg-card);
    border-radius: 0.25rem;
    width: 40px;
    height: 24px;
    padding: 2px;
}

    .chat-card svg {
        width: 16px;
        height: 32px;
    }

.chat-input-container {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 1rem 1rem;
}

.chat-input-form {
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

    .chat-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .chat-input::placeholder {
        color: var(--text-muted);
    }

.cards-remaining {
    margin-top: 1rem;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Leaderboard */
.leaderboard-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

    .leaderboard-section h3 {
        margin: 0 0 1rem 0;
        color: var(--text-primary);
        text-align: center;
        font-size: 1.125rem;
    }

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: 0.5rem;
    border-left: 4px solid var(--border-medium);
    transition: all 0.3s ease;
}

    .leaderboard-item.current-player {
        border-left-color: var(--secondary-color);
        background: rgba(16, 185, 129, 0.1);
    }

    .leaderboard-item:hover {
        transform: translateX(4px);
        box-shadow: var(--shadow-sm);
    }

.player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.player-score {
    background: var(--accent-color);
    color: var(--text-inverse);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.game-status {
    text-align: center;
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.winner-announcement {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    padding: 1rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
    text-align: center;
    animation: celebration 2s ease-in-out;
}

/* Waiting Room Styles */
.waiting-room-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.room-header {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

    .room-header h1 {
        margin: 0 0 1rem 0;
        color: var(--text-primary);
        font-size: 2rem;
    }

.room-code-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

    .room-code-display strong {
        color: var(--primary-color);
        font-size: 1.5rem;
        letter-spacing: 3px;
        font-family: 'Monaco', 'Menlo', monospace;
    }

.invite-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

    .invite-section h3 {
        margin: 0 0 1rem 0;
        color: var(--text-primary);
    }

.invite-link-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#inviteLink {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-medium);
    border-radius: 0.5rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

.invite-tip {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

.players-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

    .players-section h3 {
        margin: 0 0 1rem 0;
        color: var(--text-primary);
    }

.players-list {
    background: var(--bg-secondary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
    max-height: 200px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.3s ease;
}

    .player-item:last-child {
        border-bottom: none;
    }

    .player-item:hover {
        background-color: var(--bg-tertiary);
    }

.player-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

    .player-badge.you {
        background: var(--secondary-color);
        color: var(--text-inverse);
    }

    .player-badge.host {
        background: var(--accent-color);
        color: var(--text-inverse);
    }

.waiting-actions {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.btn-start {
    background: var(--secondary-color);
    color: var(--text-inverse);
    font-size: 1.125rem;
    padding: 1rem 2rem;
    margin-bottom: 1rem;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

    .btn-start:hover:not(:disabled) {
        background: var(--secondary-hover);
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
    }

    .btn-start:disabled {
        background: var(--text-muted);
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

.start-game-tip, .waiting-message {
    color: var(--text-secondary);
    margin: 1rem 0;
    font-style: italic;
    font-size: 0.875rem;
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    border: 1px solid var(--border-light);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: all 0.3s ease;
}

    .status-indicator.connected {
        background: var(--secondary-color);
    }

    .status-indicator.connecting {
        background: var(--accent-color);
        animation: pulse 1s infinite;
    }

    .status-indicator.disconnected {
        background: var(--danger-color);
    }

/* Assistive Mode Styles */
.btn.assistive-mode {
    background-color: var(--assistive-primary);
    color: var(--text-inverse);
    border-color: var(--assistive-primary);
}

    .btn.assistive-mode:hover:not(:disabled) {
        background-color: var(--assistive-secondary);
        border-color: var(--assistive-secondary);
    }

    .btn.assistive-mode.active {
        background-color: var(--assistive-secondary);
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
    }

.assistive-notification {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--assistive-primary), var(--assistive-secondary));
    color: var(--text-inverse);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    animation: slideDownNotification 0.5s ease;
    min-width: 300px;
    text-align: center;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Popup Overlay Styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.popup {
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    max-width: 90vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: slideDown 0.3s ease;
}

.hint-popup {
    padding: 2rem;
    text-align: center;
    max-width: 500px;
}

    .hint-popup h3 {
        margin: 0 0 1.5rem 0;
        color: var(--text-primary);
        font-size: 1.5rem;
    }

.hint-cards-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
    flex-wrap: wrap;
}

.hint-card {
    border: 3px solid var(--primary-color);
    border-radius: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    transition: transform 0.2s ease;
    min-width: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

    .hint-card:hover {
        transform: scale(1.05);
    }

    .hint-card svg {
        width: 25px;
        height: 50px;
        flex-shrink: 0;
    }

.hint-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.all-sets-popup {
    padding: 2rem;
    text-align: center;
    max-width: 800px;
}

    .all-sets-popup h3 {
        margin: 0 0 1.5rem 0;
        color: var(--text-primary);
        font-size: 1.5rem;
    }

.set-item {
    margin: 1.5rem 0;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: 0.75rem;
    background: var(--bg-secondary);
    transition: all 0.3s ease;
}

    .set-item:hover {
        border-color: var(--primary-color);
        box-shadow: var(--shadow-md);
    }

    .set-item h4 {
        margin: 0 0 1rem 0;
        color: var(--text-primary);
        font-size: 1.125rem;
    }

.set-cards-display {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.set-card {
    border: 2px solid var(--secondary-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-card);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    min-width: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
}

    .set-card svg {
        width: 22px;
        height: 44px;
        flex-shrink: 0;
    }

.theme-popup {
    padding: 2rem;
    text-align: center;
    max-width: 550px;
}

    .theme-popup h3 {
        margin: 0 0 1.5rem 0;
        color: var(--text-primary);
        font-size: 1.5rem;
    }

.theme-content {
    text-align: left;
}

.theme-section h4 {
    color: var(--text-primary);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.125rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 0.5rem;
}

.theme-section:first-child h4 {
    margin-top: 0;
}

.theme-option {
    margin-bottom: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

    .theme-option:hover {
        background-color: var(--bg-tertiary);
        transform: translateY(-1px);
        box-shadow: var(--shadow-md);
    }

    .theme-option.selected {
        border-color: var(--primary-color);
        background-color: rgba(37, 99, 235, 0.1);
        box-shadow: 0 0 0 1px var(--primary-color);
    }

.theme-option-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.theme-option-title {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 140px;
}

.color-theme-preview {
    display: flex;
    gap: 0.5rem;
}

.color-box {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-dark);
    border-radius: 0.25rem;
    box-shadow: var(--shadow-sm);
}

.shape-theme-preview {
    display: flex;
    gap: 0.5rem;
}

.shape-preview-svg {
    width: 28px;
    height: 56px;
    border: 1px solid var(--border-light);
    border-radius: 0.25rem;
    background: var(--bg-card);
    padding: 2px;
}

.theme-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

.no-sets-popup {
    padding: 2rem;
    text-align: center;
    max-width: 400px;
}

    .no-sets-popup h3 {
        color: var(--accent-color);
        margin: 0 0 1rem 0;
        font-size: 1.25rem;
    }

    .no-sets-popup p {
        color: var(--text-secondary);
        margin: 0 0 1.5rem 0;
        font-size: 1rem;
        line-height: 1.5;
    }

.end-game-popup {
    padding: 2rem;
    text-align: center;
    max-width: 500px;
}

    .end-game-popup h3 {
        margin: 0 0 1.5rem 0;
        color: var(--text-primary);
        font-size: 1.75rem;
    }

.game-end-message {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.game-stats {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
}

    .stat-item:last-child {
        border-bottom: none;
    }

.stat-label {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-value {
    color: var(--text-secondary);
    font-weight: 600;
}

.final-leaderboard {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-light);
}

    .final-leaderboard h4 {
        margin: 0 0 1rem 0;
        color: var(--text-primary);
    }

.leaderboard-final {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item-final {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-card);
    border-radius: 0.5rem;
    border-left: 4px solid var(--border-medium);
}

    .leaderboard-item-final.winner {
        border-left-color: var(--accent-color);
        background: rgba(245, 158, 11, 0.1);
        font-weight: 600;
    }

    .leaderboard-item-final .position {
        font-weight: 600;
        color: var(--text-primary);
        min-width: 30px;
    }

    .leaderboard-item-final .player-name {
        flex: 1;
        text-align: left;
        margin-left: 0.75rem;
        color: var(--text-primary);
    }

    .leaderboard-item-final .player-score {
        background: var(--accent-color);
        color: var(--text-inverse);
        padding: 0.25rem 0.75rem;
        border-radius: 1rem;
        font-weight: 600;
        font-size: 0.875rem;
    }

.end-game-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.change-name-popup {
    padding: 2rem;
    text-align: center;
    max-width: 400px;
}

    .change-name-popup h3 {
        margin: 0 0 1.5rem 0;
        color: var(--text-primary);
        font-size: 1.5rem;
    }

.change-name-content {
    margin-bottom: 1.5rem;
    text-align: left;
}

    .change-name-content p {
        margin-bottom: 1rem;
        color: var(--text-secondary);
    }

.name-input {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-medium);
    border-radius: 0.5rem;
    background: var(--bg-card);
    color: var(--text-primary);
    box-sizing: border-box;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

    .name-input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

.name-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.change-name-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Notification Styles */
.error-notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: var(--danger-color);
    color: var(--text-inverse);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    box-shadow: var(--shadow-xl);
}

/* Animation Keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDownNotification {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes assistantPulse {
    0%, 100% {
        box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.5);
    }
}

@keyframes celebration {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 20px;
        height: 20px;
        margin: -10px 0 0 -10px;
        border: 2px solid var(--primary-color);
        border-top: 2px solid transparent;
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Focus Styles for Accessibility */
.btn:focus,
.game-card:focus,
input:focus,
button:focus,
.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Responsive Design */

/* Large Desktop (1200px+) */
@media (min-width: 1200px) {
    .board {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
    }

    .game-card {
        min-height: 140px;
    }

        .game-card svg {
            width: clamp(32px, 5vw, 56px);
            height: clamp(64px, 10vw, 112px);
        }

    .main-container {
        padding: 3rem;
    }
}

/* Medium Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .board {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }

    .game-card {
        min-height: 130px;
    }

        .game-card svg {
            width: clamp(28px, 4.5vw, 52px);
            height: clamp(56px, 9vw, 104px);
        }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .game-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .game-sidebar {
        order: 1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .game-board-section {
        order: 2;
    }

    .board {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .game-card {
        min-height: 100px;
    }

    .navbar-container {
        padding: 1rem 1.5rem;
    }

    .main-container {
        padding: 1.5rem;
    }

    .homepage-hero h1 {
        font-size: 2.5rem;
    }

    .chat-section {
        height: 350px;
    }
}

/* Mobile (up to 767px) */
@media (max-width: 767px) {
    .mobile-menu-toggle {
        display: block;
    }

    .navbar-nav {
        display: none;
    }

        .navbar-nav.mobile {
            display: none;
        }

            .navbar-nav.mobile.show {
                display: flex;
            }

    .navbar-container {
        padding: 1rem;
    }

    .main-container {
        padding: 1rem;
    }

    .game-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .game-sidebar {
        order: 2;
        gap: 1rem;
    }

    .game-board-section {
        order: 1;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .game-title {
        font-size: 1.5rem;
    }

    .game-options {
        justify-content: center;
        gap: 0.5rem;
    }

        .game-options .btn {
            font-size: 0.875rem;
            padding: 0.5rem 1rem;
        }

    .board {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }

    .board-container {
        padding: 1rem;
    }

    .game-card {
        min-height: 80px;
        padding: 0.25rem;
    }

        .game-card svg {
            width: clamp(20px, 6vw, 32px);
            height: clamp(40px, 12vw, 64px);
        }

    .chat-section {
        height: 300px;
    }

    .chat-header {
        padding: 0.75rem 1rem;
    }

    .chat-log {
        padding: 0.75rem;
    }

    .chat-input-container {
        padding: 0.75rem 1rem;
    }

    .leaderboard-section {
        padding: 1rem;
    }

    .leaderboard-list {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.5rem;
    }

    .homepage-container {
        padding: 2rem 1rem;
    }

    .homepage-hero h1 {
        font-size: 2rem;
    }

    .game-modes {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .join-room-form {
        flex-direction: column;
        align-items: stretch;
    }

    #roomCodeInput {
        width: 100%;
        max-width: none;
    }

    .waiting-room-container {
        padding: 0 1rem;
    }

    .room-header,
    .invite-section,
    .players-section,
    .waiting-actions {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .room-code-display {
        flex-direction: column;
        gap: 0.5rem;
    }

    .invite-link-container {
        flex-direction: column;
    }

    .connection-status {
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        justify-content: center;
    }

    /* Popup adjustments for mobile */
    .popup {
        margin: 1rem;
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
    }

    .hint-popup,
    .all-sets-popup,
    .theme-popup,
    .no-sets-popup,
    .end-game-popup,
    .change-name-popup {
        padding: 1.5rem 1rem;
    }

    .hint-cards-container,
    .set-cards-display {
        gap: 0.5rem;
    }

    .hint-card,
    .set-card {
        padding: 0.5rem;
        gap: 0.125rem;
        min-width: 60px;
    }

        .hint-card svg,
        .set-card svg {
            width: 20px;
            height: 40px;
        }

    .theme-option-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .theme-option-title {
        min-width: auto;
        width: 100%;
    }

    .hint-buttons,
    .theme-buttons,
    .end-game-buttons,
    .change-name-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

        .hint-buttons .btn,
        .theme-buttons .btn,
        .end-game-buttons .btn,
        .change-name-buttons .btn {
            width: 100%;
        }

    .assistive-notification {
        top: 1rem;
        left: 1rem;
        right: 1rem;
        transform: none;
        min-width: auto;
        font-size: 0.875rem;
        padding: 0.75rem 1rem;
    }
}

/* Small Mobile (up to 480px) */
@media (max-width: 480px) {
    .game-card svg {
        width: clamp(18px, 5vw, 28px);
        height: clamp(36px, 10vw, 56px);
    }

    .hint-card svg,
    .set-card svg {
        width: 18px;
        height: 36px;
    }

    .hint-card,
    .set-card {
        padding: 0.25rem;
        gap: 0.125rem;
        min-width: 50px;
    }

    .shape-preview-svg {
        width: 20px;
        height: 40px;
    }

    .color-box {
        width: 20px;
        height: 20px;
    }

    .homepage-hero h1 {
        font-size: 1.75rem;
    }

    .game-title {
        font-size: 1.25rem;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .theme-toggle,
    .mobile-menu-toggle,
    .connection-status,
    .overlay,
    .assistive-notification,
    .error-notification {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .main-container {
        padding: 0;
        max-width: none;
    }
}




/* PWA Specific Styles - Add these to the end of game.css */

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-inverse);
    padding: 1rem;
    box-shadow: var(--shadow-xl);
    z-index: 1000;
    animation: slideUp 0.3s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.pwa-banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    justify-content: space-between;
}

.pwa-banner-icon {
    font-size: 2rem;
    flex-shrink: 0;
    animation: bounce 2s infinite;
}

.pwa-banner-text {
    flex: 1;
    min-width: 0;
}

    .pwa-banner-text strong {
        display: block;
        font-size: 1.1rem;
        margin-bottom: 0.25rem;
        font-weight: 600;
    }

    .pwa-banner-text p {
        margin: 0;
        font-size: 0.9rem;
        opacity: 0.9;
        line-height: 1.3;
    }

.pwa-banner-content .btn {
    margin-left: 0.5rem;
    border-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

    .pwa-banner-content .btn:hover {
        background-color: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.5);
    }

/* PWA Mode Specific Styles */
.pwa-mode {
    /* Styles for when app is running as PWA */
    padding-top: 0 !important;
}

    .pwa-mode .navbar {
        /* Ensure navbar is at the very top in PWA mode */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        width: 100%;
    }

    .pwa-mode main {
        /* Add top margin to account for fixed navbar */
        margin-top: 70px; /* Adjust based on your navbar height */
    }

    /* PWA Notification Positioning - Ensure notifications appear below navbar */
    .pwa-mode .assistive-notification,
    .pwa-mode .error-notification {
        top: calc(70px + env(safe-area-inset-top) + 1rem) !important;
        z-index: 1002 !important;
    }

    /* For notifications created by GameUI.showNotification */
    .pwa-mode [style*="position: fixed"][style*="top: 2rem"] {
        top: calc(70px + env(safe-area-inset-top) + 1rem) !important;
        z-index: 1002 !important;
    }

    /* General notification positioning fix for PWA */
    .pwa-mode div[style*="position: fixed"][style*="top:"] {
        top: calc(70px + env(safe-area-inset-top) + 1rem) !important;
        z-index: 1002 !important;
    }

/* iOS PWA Safe Area Support */
@supports (padding: max(0px)) {
    .pwa-mode .navbar {
        padding-top: env(safe-area-inset-top);
        background-color: var(--bg-nav);
        backdrop-filter: blur(10px);
    }

    .pwa-mode main {
        margin-top: calc(70px + env(safe-area-inset-top));
    }

    .pwa-mode .main-container {
        padding-bottom: max(env(safe-area-inset-bottom), 2rem);
    }

    .pwa-install-banner {
        padding-bottom: max(env(safe-area-inset-bottom), 1rem);
        bottom: env(safe-area-inset-bottom);
    }
}

/* PWA Status Bar Overlay Fix */
.pwa-mode body {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.pwa-mode html {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* PWA Splash Screen Simulation */
.pwa-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeOut 1s ease 2s forwards;
}

.pwa-loading-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 1.5s infinite;
}

.pwa-loading-text {
    color: var(--text-inverse);
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

/* PWA Animation Keyframes */
@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* PWA Standalone Detection */
@media (display-mode: standalone) {
    .pwa-mode {
        /* Additional standalone-specific styles */
    }

    /* Hide browser-specific UI elements when in standalone mode */
    .browser-only {
        display: none !important;
    }

    /* Force proper positioning in standalone mode */
    body {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .navbar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1001 !important;
        width: 100% !important;
        padding-top: env(safe-area-inset-top) !important;
    }

    main {
        margin-top: calc(70px + env(safe-area-inset-top)) !important;
    }

    /* Standalone mode notification positioning */
    .assistive-notification,
    .error-notification {
        top: calc(70px + env(safe-area-inset-top) + 1rem) !important;
        z-index: 1002 !important;
    }

    /* General standalone notification fix */
    div[style*="position: fixed"][style*="top:"] {
        top: calc(70px + env(safe-area-inset-top) + 1rem) !important;
        z-index: 1002 !important;
    }
}

/* Mobile PWA Optimizations */
@media (max-width: 768px) {
    /* PWA mode mobile fixes */
    .pwa-mode .navbar {
        position: fixed !important;
        top: 0 !important;
        padding-top: env(safe-area-inset-top) !important;
        background-color: var(--bg-nav) !important;
        backdrop-filter: blur(10px) !important;
        border-bottom: 1px solid var(--border-light) !important;
    }

    .pwa-mode main {
        margin-top: calc(80px + env(safe-area-inset-top)) !important;
        padding-top: 0 !important;
    }

    .pwa-mode .main-container {
        padding-top: 0 !important;
    }

    /* Mobile notification positioning */
    .pwa-mode .assistive-notification,
    .pwa-mode .error-notification {
        top: calc(80px + env(safe-area-inset-top) + 1rem) !important;
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
        z-index: 1002 !important;
    }

    /* Mobile general notification fix */
    .pwa-mode div[style*="position: fixed"][style*="top:"] {
        top: calc(80px + env(safe-area-inset-top) + 1rem) !important;
        left: 1rem !important;
        right: 1rem !important;
        transform: none !important;
        z-index: 1002 !important;
        max-width: calc(100vw - 2rem) !important;
    }

    .pwa-banner-content {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .pwa-banner-text {
        order: 1;
        margin-bottom: 0.5rem;
    }

    .pwa-banner-icon {
        order: 0;
        font-size: 1.75rem;
    }

    .pwa-banner-content .btn {
        margin: 0 0.25rem;
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
        min-width: 80px;
    }

    .pwa-banner-text strong {
        font-size: 1rem;
    }

    .pwa-banner-text p {
        font-size: 0.85rem;
    }
}

/* Small Mobile Adjustments */
@media (max-width: 480px) {
    .pwa-install-banner {
        padding: 0.75rem 0.5rem;
    }

    .pwa-banner-content {
        gap: 0.5rem;
    }

        .pwa-banner-content .btn {
            font-size: 0.8rem;
            padding: 0.4rem 0.8rem;
            min-width: 70px;
        }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .pwa-banner-icon {
        /* Ensure crisp icons on high DPI displays */
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark Mode PWA Adjustments */
[data-theme="dark"] .pwa-install-banner {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .pwa-banner-content .btn {
    border-color: rgba(255, 255, 255, 0.2);
}

    [data-theme="dark"] .pwa-banner-content .btn:hover {
        background-color: rgba(255, 255, 255, 0.15);
        border-color: rgba(255, 255, 255, 0.4);
    }

/* PWA Network Status Indicator */
.pwa-network-status {
    position: fixed;
    top: calc(70px + env(safe-area-inset-top) + 1rem);
    right: 1rem;
    background: var(--danger-color);
    color: var(--text-inverse);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    z-index: 1002;
    animation: slideIn 0.3s ease;
    display: none;
}

.pwa-mode .pwa-network-status {
    top: calc(70px + env(safe-area-inset-top) + 1rem) !important;
}

.pwa-network-status.online {
    background: var(--secondary-color);
}

.pwa-network-status.offline {
    background: var(--danger-color);
    display: block;
}

/* Print Styles for PWA */
@media print {
    .pwa-install-banner,
    .pwa-network-status {
        display: none !important;
    }
}}