:root {
    /* Color System */
    --bg-primary: #0a0b14;
    --bg-secondary: #12141f;
    --bg-tertiary: #1a1d2e;
    --bg-card: #1e2139;
    --bg-elevated: #252a41;
    --bg-input: #1a1d2e;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --text-muted: #475569;
    
    /* Brand Colors */
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    
    /* Accent Colors */
    --accent-purple: #a855f7;
    --accent-teal: #14b8a6;
    --accent-orange: #f97316;
    
    /* Status Colors */
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --error-400: #f87171;
    --error-500: #ef4444;
    --error-600: #dc2626;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    
    /* Shadows */
    --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);
    --shadow-glow: 0 0 20px rgb(59 130 246 / 0.15);
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Typography */
    --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
    background: var(--bg-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

html, body {
    height: 100%;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    min-height: -webkit-fill-available;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    /* PWA safe area support for iOS */
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.container {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    display: flex;
    flex-direction: column;
    background: inherit;
}

/* Leaderboards page specific layout */
body.leaderboards-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
}

body.leaderboards-page .header {
    flex-shrink: 0;
}

body.leaderboards-page .leaderboards-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

body.leaderboards-page .footer {
    flex-shrink: 0;
}

/* Analytics page specific layout */
body.analytics-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: -webkit-fill-available;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    background-attachment: fixed;
}

body.analytics-page .header {
    flex-shrink: 0;
}

body.analytics-page .analytics-container {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

body.analytics-page .footer {
    flex-shrink: 0;
}

.content {
    flex: 1;
    width: 100%;
    padding: 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: inherit;
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

.content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(20, 184, 166, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

.footer {
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 0.875rem;
    box-sizing: border-box;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

.wrapper {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    text-align: center;
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(148, 163, 184, 0.1);
    align-self: center;
}

.version-info {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-elevated);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Typography - Simplified */
h1 {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    line-height: 1.2;
}

h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-400);
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}



/* Syntax highlighting styles */
.char.keyword {
    color: #569cd6;
}

.char.string {
    color: #ce9178;
}

.char.comment {
    color: #6a9955;
    font-style: italic;
}

.char.number {
    color: #b5cea8;
}

.char.function {
    color: #dcdcaa;
}

.char.operator {
    color: #d4d4d4;
}

.char.preprocessor {
    color: #c586c0;
}

.char.type {
    color: #4ec9b0;
}

.char.builtin {
    color: #4dc9b0;
}

.char.decorator {
    color: #c586c0;
}

.char.namespace {
    color: #4ec9b0;
}

.char.punctuation {
    color: #d4d4d4;
}

/* Highlight correctly typed characters in green, errors in red */
.char.correct-char {
    background: rgba(34, 197, 94, 0.15) !important;
    color: var(--success-400) !important;
    border-radius: 2px;
}

.char.incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    color: var(--error-400) !important;
    text-decoration: underline;
    text-decoration-color: var(--error-400);
    border-radius: 2px;
}

/* Modern Input Styles */
input[type="text"] {
    background: var(--bg-elevated);
    border: 2px solid rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 500;
    margin: 0.75rem 0;
    width: 100%;
    max-width: 400px;
    transition: all var(--transition-normal);
    outline: none;
    font-family: var(--font-body);
}

input[type="text"]:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

/* Language Selection Dropdown */
.language-selection {
    margin: 1rem 0;
}

.language-selection label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.language-dropdown {
    background: var(--bg-elevated);
    border: 2px solid rgba(148, 163, 184, 0.2);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 500;
    width: 100%;
    max-width: 280px;
    transition: all var(--transition-normal);
    outline: none;
    font-family: var(--font-body);
    cursor: pointer;
}

.language-dropdown:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: var(--bg-card);
}

.language-dropdown option {
    background: var(--bg-elevated);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Modern Button Styles - Simplified */
button {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-transform: none;
    letter-spacing: 0.015em;
}

/* Primary Button */
.btn-primary, button:not(.btn-secondary):not(.btn-outline) {
    background: var(--primary-500);
    color: white;
    margin: 0.25rem;
}

.btn-primary:hover, button:not(.btn-secondary):not(.btn-outline):hover {
    background: var(--primary-400);
}

/* Secondary Button */
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.3);
    margin: 0.25rem;
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary-500);
}

/* Outline Button */
.btn-outline {
    background: transparent;
    color: var(--primary-400);
    border: 1px solid var(--primary-500);
    margin: 0.25rem;
}

.btn-outline:hover {
    background: var(--primary-500);
    color: white;
}

button:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Input and Button Groups - Simplified */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin-top: 1.5rem;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
        width: 100%;
        max-width: 280px;
    }
    
    .button-group button {
        width: 100%;
        margin: 0.125rem 0;
    }
}

/* Game Interface Styles - Simplified */
.game-container {
    max-width: 1000px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.1);
    align-self: center;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.countdown-display {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-body);
}

.countdown-label, .countdown-suffix {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.countdown-number {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-400);
    font-family: var(--font-mono);
}

.stats-panel {
    display: flex;
    gap: 1rem;
}

.stat-card {
    background: var(--bg-elevated);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    text-align: center;
    border: 1px solid rgba(148, 163, 184, 0.1);
    min-width: 70px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-top: 0.25rem;
}

.code-section {
    margin: 1.5rem 0;
}

.code-title {
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 1rem;
    text-align: center;
}

.code-wrapper {
    position: relative;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.code-display {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: none;
    padding: 0;
    overflow-x: auto;
}

#user-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.game-actions {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
}

@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .stats-panel {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .countdown-display {
        justify-content: center;
    }
}

/* Character and Typing Styles - Simplified */
.char {
    transition: color var(--transition-fast);
    display: inline-block;
    position: relative;
}

.char.cursor::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background: var(--primary-400);
    border-radius: 1px;
    animation: blink 1.2s ease-in-out infinite;
}

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

.char.incorrect {
    color: var(--error-400);
    background: rgba(239, 68, 68, 0.1);
    text-decoration: underline;
    text-decoration-color: var(--error-400);
}

.char.waiting {
    background: rgba(251, 191, 36, 0.08);
}

/* Syntax Highlighting - Modern Colors */
.char.keyword {
    color: #e772ff;
    font-weight: 500;
}

.char.string {
    color: #a5d6ff;
}

.char.comment {
    color: #8b949e;
    font-style: italic;
}

.char.number {
    color: #79c0ff;
}

.char.function {
    color: #d2a8ff;
    font-weight: 500;
}

.char.operator {
    color: #ff72dc;
}

.char.preprocessor {
    color: #ffa657;
}

.char.type {
    color: #7ee787;
}

.char.builtin {
    color: #79c0ff;
}

.char.decorator {
    color: #d2a8ff;
}

.char.namespace {
    color: #7ee787;
}

.char.punctuation {
    color: var(--text-primary);
}

/* Multiplayer cursor styles - Non-interfering */
.char.other-cursor {
    position: relative;
    opacity: 0.7;
}

.char.other-cursor::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: var(--accent-teal);
    pointer-events: none;
}

/* Completion Modal - Matching App Style */
.completion-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 24px !important;
    border: 1px solid rgba(148, 163, 184, 0.1);
    text-align: center;
    z-index: 1000;
    max-width: 440px;
    width: 90%;
    backdrop-filter: blur(10px);
    overflow: hidden;
    box-sizing: border-box;
}

/* Modal close button */
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none !important;
    border: none !important;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 2rem !important;
    height: 2rem !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    transition: all 0.2s;
    line-height: 1;
    font-family: Arial, sans-serif;
}

.modal-close:hover {
    background: rgba(148, 163, 184, 0.1) !important;
    color: var(--text-primary);
}

/* Add backdrop overlay - Lighter */
.completion-message::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 11, 20, 0.6);
    z-index: -1;
    backdrop-filter: blur(4px);
}

.completion-message h2 {
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-display);
    background: linear-gradient(135deg, var(--primary-400) 0%, var(--accent-purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Stats display - Matching app style */
.completion-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-display {
    background: var(--bg-elevated);
    padding: 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.stat-display .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.025em;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-display .stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

/* Leaderboard submission styles */
.leaderboard-submission {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.leaderboard-submission h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-display);
}

.name-input-section {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.name-input-section input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.name-input-section input:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.name-input-section input::placeholder {
    color: var(--text-muted);
}

.name-input-section button {
    padding: 0.75rem 1.5rem;
    background: var(--primary-500);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.name-input-section button:hover:not(:disabled) {
    background: var(--primary-600);
}

.name-input-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submission-status {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* Global leaderboard styles */
.snippet-leaderboard {
    margin-top: 2rem;
    padding: 1.5rem 0 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.snippet-leaderboard h3 {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-display);
}

#global-leaderboard-loading {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 2rem 0;
}

#global-leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#global-leaderboard-list li {
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all var(--transition-fast);
}

#global-leaderboard-list li.first-place {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid var(--success-400);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.score-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.first-place .player-name {
    color: var(--success-400);
}

/* Global leaderboards page styles */
.leaderboards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

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

.leaderboards-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.leaderboards-header p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.leaderboards-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-dropdown {
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

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

.leaderboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.1);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.leaderboard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.card-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.snippet-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
}

.snippet-meta {
    display: flex;
    gap: 0.5rem;
}

.language-tag, .difficulty-tag {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.language-tag {
    background: var(--primary-100);
    color: var(--primary-700);
}

.difficulty-tag {
    color: white;
}

.difficulty-easy {
    background: var(--success-500);
}

.difficulty-medium {
    background: var(--warning-500);
}

.difficulty-hard {
    background: var(--error-500);
}

.card-content {
    padding: 1.5rem;
}

.top-scores {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.top-scores li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.1);
    transition: all var(--transition-fast);
}

.top-scores li.first-place {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid var(--success-400);
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.score-rank {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 2rem;
    text-align: center;
}

.first-place .score-rank {
    color: var(--success-500);
}

.score-details .player-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.first-place .score-details .player-name {
    color: var(--success-400);
}

.score-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.view-more {
    margin-top: 1rem;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-500);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn-link:hover {
    color: var(--primary-600);
    text-decoration: underline;
}

.loading-state, .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

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

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Leaderboard modal styles */
.leaderboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    max-height: 60vh;
    overflow-y: auto;
}

.full-leaderboard {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.full-leaderboard li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.full-leaderboard li.first-place {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid var(--success-400);
}

/* Responsive design */
@media (max-width: 768px) {
    .leaderboards-filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-dropdown {
        width: 200px;
    }
    
    .leaderboards-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
}

/* Header styles for leaderboards page */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.app-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-500);
    margin: 0;
}

/* Home page styles */
.home-actions {
    margin: 2rem 0;
    text-align: center;
}

.home-actions .btn-outline {
    display: inline-block;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--primary-400);
    color: var(--primary-500);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.home-actions .btn-outline:hover {
    background: var(--primary-500);
    color: white;
}

/* Leaderboards page styles */
.leaderboards-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    box-sizing: border-box;
}

.leaderboards-header {
    text-align: center;
}

.leaderboards-header h2 {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}

.leaderboards-header p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    margin: 0;
}

.leaderboards-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.filter-dropdown {
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    min-width: 150px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-dropdown:focus {
    outline: none;
    border-color: var(--primary-400);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.loading-state {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    padding: 4rem 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.empty-state h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-family: var(--font-display);
}

.empty-state p {
    color: var(--text-secondary);
    margin: 0;
}

.empty-state a {
    color: var(--primary-500);
    text-decoration: none;
}

.empty-state a:hover {
    text-decoration: underline;
}

.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
    flex: 1;
    overflow: visible;
    padding-bottom: 2rem;
}

.leaderboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.1);
    overflow: hidden;
    transition: all var(--transition-fast);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.leaderboard-card:hover {
    border-color: var(--primary-400);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    background: rgba(148, 163, 184, 0.02);
}

.snippet-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
}

.snippet-meta {
    display: flex;
    gap: 0.5rem;
}

.language-tag, .difficulty-tag {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.language-tag {
    background: var(--bg-elevated);
    color: var(--text-secondary);
}

.difficulty-tag {
    color: white;
}

.difficulty-easy {
    background: var(--success-500);
}

.difficulty-medium {
    background: var(--warning-500);
}

.difficulty-hard {
    background: var(--error-500);
}

.card-content {
    padding: 1.5rem;
    overflow: hidden;
}

.top-scores {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.top-scores::-webkit-scrollbar {
    width: 4px;
}

.top-scores::-webkit-scrollbar-track {
    background: transparent;
}

.top-scores::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-sm);
}

.top-scores::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.top-scores li {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
    min-height: 3rem;
}

.top-scores li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.top-scores li.first-place {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(34, 197, 94, 0.1);
}

.score-rank {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 2rem;
    font-size: 0.875rem;
}

.first-place .score-rank {
    color: var(--success-400);
}

.score-details {
    flex: 1;
    margin-left: 0.75rem;
}

.player-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.first-place .player-name {
    color: var(--success-400);
}

.score-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.view-more {
    margin-top: 1rem;
    text-align: center;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-500);
    font-size: 0.875rem;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.btn-link:hover {
    color: var(--primary-600);
    text-decoration: underline;
}

.empty-message {
    grid-column: 1 / -1;
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.125rem;
    padding: 3rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.1);
}

/* Leaderboard modal styles */
.leaderboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    font-family: var(--font-display);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
    min-height: 200px;
}

.full-leaderboard {
    list-style: none;
    padding: 0;
    margin: 0;
}

.full-leaderboard li {
    display: flex;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.full-leaderboard li:last-child {
    border-bottom: none;
}

.full-leaderboard li.first-place {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--success-400);
}

/* Header styles for leaderboards page */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .app-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    font-family: var(--font-display);
}

.header-actions .btn-outline {
    display: inline-block;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--primary-400);
    color: var(--primary-500);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.header-actions .btn-outline:hover {
    background: var(--primary-500);
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    body.leaderboards-page {
        overflow-y: auto;
    }
    
    .leaderboards-container {
        padding: 1rem;
        gap: 1.5rem;
    }
    
    .leaderboards-header h2 {
        font-size: 2rem;
    }
    
    .leaderboards-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-bottom: 1rem;
    }
    
    .leaderboards-filters {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        flex-shrink: 0;
    }
    
    .filter-dropdown {
        width: 100%;
        max-width: 300px;
    }
    
    .header-content {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .header .app-title {
        font-size: 1.5rem;
    }
    
    .leaderboard-modal {
        padding: 1rem;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: calc(90vh - 120px);
    }
    
    .leaderboard-card {
        margin-bottom: 0;
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .snippet-title {
        font-size: 1rem;
    }
    
    .top-scores {
        max-height: 250px;
    }
    
    body.leaderboards-page .leaderboards-container::-webkit-scrollbar {
        width: 8px;
    }
}

@media (max-width: 480px) {
    .leaderboards-container {
        padding: 0.75rem;
    }
    
    .leaderboards-header h2 {
        font-size: 1.75rem;
    }
    
    .leaderboards-header p {
        font-size: 1rem;
    }
    
    .header-content {
        padding: 0 0.75rem;
    }
    
    .filter-dropdown {
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }
    
    .top-scores {
        max-height: 200px;
    }
    
    .modal-body {
        max-height: calc(85vh - 100px);
        padding: 1rem;
    }
    
    body.leaderboards-page .leaderboards-container::-webkit-scrollbar {
        width: 6px;
    }
}

.leaderboard {
    margin-top: 2rem;
    padding: 1.5rem 0 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.leaderboard h3 {
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    font-size: 1.125rem;
    font-weight: 600;
    font-family: var(--font-display);
}

#leaderboard-list {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#leaderboard-list li {
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    border: 1px solid rgba(148, 163, 184, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    min-height: 2.5rem;
    text-align: center;
}

#leaderboard-list li:first-child {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border: 1px solid var(--success-400);
    color: var(--success-400);
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.1);
}

.player-position {
    font-weight: 600;
    color: var(--text-secondary);
    margin-right: 1rem;
    font-size: 0.75rem;
}

.player-stats {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: var(--font-mono);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: var(--radius-sm);
    border: 1px solid var(--bg-tertiary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Leaderboards page scrollbar styling */
body.leaderboards-page .leaderboards-container::-webkit-scrollbar {
    width: 12px;
}

body.leaderboards-page .leaderboards-container::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

body.leaderboards-page .leaderboards-container::-webkit-scrollbar-thumb {
    background: var(--primary-400);
    border-radius: var(--radius-sm);
    border: 2px solid var(--bg-primary);
}

body.leaderboards-page .leaderboards-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-500);
}

/* Lobby Styles - Simplified */
.lobby-container {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
    width: 100%;
    align-items: start;
}

.lobby-main {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
}

.lobby-code-container {
    margin: 1.5rem 0;
    text-align: center;
}

.lobby-code-container label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.code-display-wrapper {
    position: relative;
    display: inline-block;
}

#lobby-code-span {
    background: var(--bg-elevated);
    color: var(--primary-400);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 1.125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border: 1px solid rgba(59, 130, 246, 0.3);
    display: inline-block;
    min-width: 160px;
    text-align: center;
}

.copyable {
    cursor: pointer;
    transition: all var(--transition-normal);
    user-select: none;
    position: relative;
}

.copyable:hover {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
}

.copy-notification {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success-500);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
    white-space: nowrap;
}

.copy-notification.show {
    opacity: 1;
}

.lobby-sidebar {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.1);
    height: fit-content;
}

.users-panel h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

#active-users-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#active-users-list li {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background var(--transition-fast);
    border: 1px solid rgba(148, 163, 184, 0.05);
}

#active-users-list li.current-user {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.2);
    color: var(--primary-400);
}

.user-emoji {
    font-size: 1rem;
    min-width: 1.25rem;
    text-align: center;
}

.user-name {
    flex: 1;
}

.you-badge {
    font-size: 0.75rem;
    color: var(--primary-400);
    font-style: italic;
    font-weight: 500;
}

@media (max-width: 1024px) {
    .lobby-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .lobby-sidebar {
        order: -1;
    }
}

/* Cursor and multiplayer styles */

.leaderboard {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--text-secondary);
}

.leaderboard h3 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

#leaderboard-list {
    list-style-position: inside;
    padding: 0;
    margin: 0;
    text-align: left;
}

#leaderboard-list li {
    padding: 5px 0;
    color: var(--text-primary);
}

#leaderboard-list li:first-child {
    color: var(--success-color);
    font-weight: bold;
}

/* PWA and iPad specific styles */
@media (display-mode: standalone) {
    /* Ensure full coverage in PWA mode */
    html, body {
        height: 100vh;
        height: -webkit-fill-available;
        background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
        background-attachment: fixed;
    }
    
    /* Remove any potential margins/padding that could show system background */
    body {
        margin: 0;
        padding: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    /* Ensure all containers inherit the background */
    .container, .content, .analytics-container, .leaderboards-container {
        background: inherit;
    }
}

/* iPad specific adjustments */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait),
       screen and (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) {
    /* iPad portrait and landscape */
    html {
        background: var(--bg-primary);
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    body {
        background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
        background-attachment: fixed;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
    
    /* Ensure content areas don't show gaps */
    .content {
        min-height: calc(100vh - 4rem);
        min-height: calc(-webkit-fill-available - 4rem);
    }
}

/* Fix for iOS Safari address bar disappearing */
@supports (-webkit-appearance: none) {
    html {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        background: var(--bg-primary);
    }
    
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
        background-attachment: fixed;
    }
}
