/* ===== CSS Variables ===== */
:root {
    /* Light theme (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1a1a2e;
    --text-secondary: #6c757d;
    --text-muted: #adb5bd;
    --border-color: #dee2e6;
    --accent-primary: #6366f1;
    --accent-secondary: #818cf8;
    --accent-light: #e0e7ff;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --start-word-bg: #dcfce7;
    --start-word-border: #86efac;
    --start-word-text: #166534;
    --end-word-bg: #fef3c7;
    --end-word-border: #fcd34d;
    --end-word-text: #92400e;
    --chain-word-bg: #e0e7ff;
    --chain-word-border: #a5b4fc;
    --chain-word-text: #3730a3;
    --modal-bg: rgba(0, 0, 0, 0.5);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Animations */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* Dark theme */
[data-theme="dark"] {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #25253a;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --accent-primary: #818cf8;
    --accent-secondary: #a5b4fc;
    --accent-light: #312e81;
    --start-word-bg: #064e3b;
    --start-word-border: #059669;
    --start-word-text: #6ee7b7;
    --end-word-bg: #78350f;
    --end-word-border: #d97706;
    --end-word-text: #fcd34d;
    --chain-word-bg: #312e81;
    --chain-word-border: #6366f1;
    --chain-word-text: #c7d2fe;
    --modal-bg: rgba(0, 0, 0, 0.75);
}

/* ===== Reset & Base Styles ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== Header ===== */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 100;
}

.header-left,
.header-actions {
    flex: 1;
}

.header-actions {
    justify-content: flex-end;
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-left,
.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.icon-btn:hover {
    background-color: var(--bg-tertiary);
}

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

/* ===== Game Container ===== */
.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    gap: 24px;
}

/* ===== Chain Display ===== */
.chain-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.word-node {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    border: 2px solid;
    min-width: 140px;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.word-node:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.start-word {
    background-color: var(--start-word-bg);
    border-color: var(--start-word-border);
    color: var(--start-word-text);
}

.end-word {
    background-color: var(--end-word-bg);
    border-color: var(--end-word-border);
    color: var(--end-word-text);
}

.chain-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.chain-link {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 300px;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chain-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
}

.chain-connector svg {
    width: 20px;
    height: 20px;
}

.chain-word {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background-color: var(--chain-word-bg);
    border: 2px solid var(--chain-word-border);
    border-radius: 10px;
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--chain-word-text);
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.chain-word.invalid {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--error);
    color: var(--error);
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* Connection strength indicators */
.chain-word.strength-perfect {
    background-color: rgba(16, 185, 129, 0.15);
    border-color: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.chain-word.strength-strong {
    background-color: rgba(16, 185, 129, 0.1);
    border-color: var(--success);
}

.chain-word.strength-valid {
    background-color: var(--chain-word-bg);
    border-color: var(--chain-word-border);
}

.chain-word.strength-weak {
    background-color: rgba(245, 158, 11, 0.1);
    border-color: var(--warning);
}

@keyframes shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Arrow connector between chain links */
.link-arrow {
    display: flex;
    justify-content: center;
    color: var(--text-muted);
    padding: 4px 0;
}

.link-arrow svg {
    width: 16px;
    height: 16px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ===== Input Section ===== */
.input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: auto;
    padding-bottom: 20px;
}

.attempts-display {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.attempts-display span {
    color: var(--accent-primary);
    font-weight: 700;
}

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

.word-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

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

.word-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 12px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading spinner animation */
.submit-btn.loading {
    cursor: wait;
}

.submit-btn .spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hint-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    min-height: 1.25em;
    transition: color var(--transition-fast);
}

.hint-text.error {
    color: var(--error);
}

.hint-text.success {
    color: var(--success);
}

.hint-text {
    white-space: pre-line;
}

/* ===== Game Result ===== */
.game-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 20px;
    animation: fadeIn 0.5s ease;
}

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

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.result-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-message {
    font-size: 1rem;
    color: var(--text-secondary);
}

.result-chain {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
    max-width: 100%;
}

.result-chain .result-word {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
}

.result-chain .result-word.start {
    background-color: var(--start-word-bg);
    color: var(--start-word-text);
}

.result-chain .result-word.end {
    background-color: var(--end-word-bg);
    color: var(--end-word-text);
}

.result-chain .result-word.chain {
    background-color: var(--chain-word-bg);
    color: var(--chain-word-text);
}

.result-chain .result-arrow {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.result-chain .result-strength {
    margin-left: 2px;
    font-size: 0.75rem;
}

.optimal-path {
    margin-top: 12px;
    padding: 12px 16px;
    background-color: var(--bg-tertiary);
    border-radius: 10px;
    border: 1px dashed var(--border-color);
}

.optimal-path-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
}

.optimal-path-chain {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    align-items: center;
}

.optimal-path-chain .result-word {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    opacity: 0.85;
}

.optimal-path-chain .result-word.start {
    background-color: var(--start-word-bg);
    color: var(--start-word-text);
}

.optimal-path-chain .result-word.end {
    background-color: var(--end-word-bg);
    color: var(--end-word-text);
}

.optimal-path-chain .result-word.chain {
    background-color: var(--chain-word-bg);
    color: var(--chain-word-text);
}

.optimal-path-chain .result-arrow {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.share-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    position: relative;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.copied-toast {
    position: absolute;
    bottom: -32px;
    padding: 6px 12px;
    background-color: var(--success);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    animation: toastIn 0.3s ease;
}

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

/* ===== Modals ===== */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background-color: var(--modal-bg);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: relative;
    background-color: var(--bg-primary);
    border-radius: 16px;
    padding: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
    z-index: 1;
}

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

.modal-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-right: 40px;
}

/* Tutorial Modal */
.tutorial-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tutorial-intro {
    color: var(--text-secondary);
    line-height: 1.6;
}

.tutorial-example {
    padding: 16px;
    background-color: var(--bg-secondary);
    border-radius: 12px;
}

.example-chain {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.example-word {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.example-word.start {
    background-color: var(--start-word-bg);
    color: var(--start-word-text);
}

.example-word.end {
    background-color: var(--end-word-bg);
    color: var(--end-word-text);
}

.example-word.chain {
    background-color: var(--chain-word-bg);
    color: var(--chain-word-text);
}

.example-arrow {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.tutorial-rules {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.rule-icon {
    font-size: 1.25rem;
}

.rule p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.tutorial-scoring h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Word Rules Section */
.tutorial-word-rules {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.tutorial-word-rules h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.tutorial-word-rules > p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.word-rules-list {
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.word-rules-list li {
    margin-bottom: 0.25rem;
}

.word-rules-list strong {
    color: var(--text-primary);
}

.word-rules-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    font-style: italic;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.score-item {
    padding: 10px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.875rem;
    text-align: center;
}

.tutorial-start {
    margin-top: 8px;
}

.btn-primary {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

/* Statistics Modal */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.distribution-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.distribution-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.distribution-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.distribution-label {
    width: 24px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: right;
    color: var(--text-secondary);
}

.distribution-bar-container {
    flex: 1;
    height: 24px;
    background-color: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.distribution-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    min-width: 24px;
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.distribution-bar span {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.next-puzzle {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.next-puzzle span:first-child {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.countdown {
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

/* Settings Modal */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.setting-name {
    font-weight: 600;
    color: var(--text-primary);
}

.setting-desc {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
}

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

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--bg-tertiary);
    border-radius: 28px;
    transition: background-color var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

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

.toggle input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px var(--accent-light);
}

.settings-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.settings-footer .version {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-footer .credits {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ===== Utilities ===== */
.hidden {
    display: none !important;
}

/* ===== Mobile Responsive ===== */
@media (max-width: 480px) {
    .header {
        padding: 12px 0;
    }

    .title {
        font-size: 1.5rem;
    }

    .icon-btn {
        width: 36px;
        height: 36px;
    }

    .icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .word-node {
        padding: 12px 20px;
        font-size: 1rem;
        min-width: 120px;
    }

    .chain-word {
        padding: 10px 16px;
        font-size: 0.9375rem;
    }

    .word-input {
        padding: 12px 14px;
        font-size: 1rem;
    }

    .submit-btn {
        width: 48px;
        height: 48px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .stat-value {
        font-size: 1.75rem;
    }

    .modal-content {
        padding: 20px;
        border-radius: 12px;
    }

    .modal-content h2 {
        font-size: 1.25rem;
    }

    .example-word {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .score-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== Focus Visible ===== */
:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

/* ===== Scrollbar Styling ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

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

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) var(--bg-secondary);
}

/* ===== Title Container with Mode Indicator ===== */
.title-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mode-indicator {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-primary);
    background-color: var(--accent-light);
    padding: 2px 8px;
    border-radius: 10px;
}

/* ===== Mode Selection Modal ===== */
.mode-select-modal {
    max-width: 440px;
}

.mode-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.mode-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mode-card:hover {
    border-color: var(--accent-primary);
    background-color: var(--accent-light);
    transform: translateY(-2px);
}

.mode-card.custom {
    border-style: dotted;
    cursor: default;
}

.mode-card.custom:hover {
    transform: none;
}

/* Custom mode inputs */
.custom-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    width: 100%;
}

.custom-word-input {
    flex: 1;
    min-width: 100px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-align: center;
    text-transform: uppercase;
    transition: border-color var(--transition-fast);
}

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

.custom-word-input::placeholder {
    text-transform: none;
    color: var(--text-muted);
}

.custom-word-input.start {
    background-color: var(--start-word-bg);
    border-color: var(--start-word-border);
    color: var(--start-word-text);
}

.custom-word-input.start:focus {
    border-color: var(--start-word-border);
    box-shadow: 0 0 0 3px rgba(134, 239, 172, 0.2);
}

.custom-word-input.end {
    background-color: var(--end-word-bg);
    border-color: var(--end-word-border);
    color: var(--end-word-text);
}

.custom-word-input.end:focus {
    border-color: var(--end-word-border);
    box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.2);
}

.custom-word-input.start::placeholder {
    color: var(--start-word-text);
    opacity: 0.7;
}

.custom-word-input.end::placeholder {
    color: var(--end-word-text);
    opacity: 0.7;
}

.custom-arrow {
    color: var(--text-secondary);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.custom-error {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 8px;
    min-height: 1.2em;
}

.custom-start-btn {
    margin-top: 12px;
    width: 100%;
}

.mode-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.mode-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.mode-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

.practice-stats-section {
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.practice-stats-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
}

.practice-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

/* ===== Practice Mode Actions ===== */
.practice-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.practice-actions .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-secondary {
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    border: 2px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* ===== Mobile Keyboard Handling ===== */
@supports (height: 100dvh) {
    body, #app {
        min-height: 100dvh;
    }
}

/* Ensure input section stays visible on mobile */
.input-section {
    position: relative;
    z-index: 10;
}

/* Mobile keyboard open state */
body.keyboard-open .game-container {
    max-height: calc(var(--viewport-height, 100vh) - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.keyboard-open .chain-display {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    min-height: auto;
}

body.keyboard-open .word-node {
    padding: 8px 12px;
    font-size: 0.8rem;
    min-width: auto;
    flex-shrink: 0;
}

body.keyboard-open .chain-links {
    flex-direction: row;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    min-width: 0;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

/* Hide vertical arrows, show horizontal arrows */
body.keyboard-open .link-arrow {
    display: none;
}

body.keyboard-open .chain-link {
    flex-direction: row;
    flex-shrink: 0;
    gap: 6px;
    max-width: none;
    width: auto;
}

body.keyboard-open .chain-word {
    padding: 6px 10px;
    font-size: 0.75rem;
    white-space: nowrap;
}

body.keyboard-open .chain-connector {
    transform: rotate(-90deg);
}

body.keyboard-open .input-section {
    flex-shrink: 0;
    margin-top: auto;
    padding-bottom: 8px;
}

/* Mobile responsive for mode selection */
@media (max-width: 480px) {
    .practice-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .mode-card {
        padding: 16px;
    }

    .mode-icon {
        font-size: 1.75rem;
    }

    .mode-card h3 {
        font-size: 1rem;
    }

    .custom-word-input {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .custom-arrow {
        font-size: 1rem;
    }
}

/* ===== User Button & Avatar ===== */
#userBtn {
    position: relative;
}

#userBtn svg {
    transition: opacity var(--transition-fast);
}

#userBtn .user-avatar {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-primary);
}

#userBtn .user-avatar:not(.hidden) + svg {
    opacity: 0;
}

/* ===== User Profile Modal ===== */
.user-modal {
    max-width: 380px;
}

.user-modal-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.google-signin-btn:hover {
    border-color: var(--accent-primary);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.google-signin-btn:active {
    transform: translateY(0);
}

.user-modal-note {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

/* Signed In State */
.user-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
}

.user-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-primary);
}

.user-profile-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nickname-section {
    margin-bottom: 20px;
    text-align: left;
}

.nickname-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.nickname-input-group {
    display: flex;
    gap: 8px;
}

.nickname-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.9375rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

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

.nickname-input::placeholder {
    color: var(--text-secondary);
}

.nickname-save-btn {
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.nickname-save-btn:hover {
    opacity: 0.9;
}

.nickname-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

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

.user-actions .btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== Leaderboard Modal ===== */
.leaderboard-modal {
    max-width: 480px;
}

.leaderboard-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.leaderboard-tab {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.leaderboard-tab:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.leaderboard-tab.active {
    background: var(--accent-light);
    color: var(--accent-primary);
}

.leaderboard-content {
    min-height: 200px;
}

.leaderboard-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table th {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.leaderboard-table td {
    font-size: 0.9375rem;
}

.leaderboard-table .rank-col {
    width: 40px;
    text-align: center;
}

.leaderboard-table .name-col {
    min-width: 120px;
}

.leaderboard-table .stat-col {
    width: 70px;
    text-align: center;
}

.leaderboard-row {
    transition: background-color var(--transition-fast);
}

.leaderboard-row:hover {
    background-color: var(--bg-secondary);
}

.leaderboard-row.current-user {
    background-color: var(--accent-light);
}

.leaderboard-row.current-user:hover {
    background-color: var(--accent-light);
}

.leaderboard-rank {
    font-weight: 700;
    color: var(--text-secondary);
}

.leaderboard-rank.gold {
    color: #fbbf24;
}

.leaderboard-rank.silver {
    color: #9ca3af;
}

.leaderboard-rank.bronze {
    color: #d97706;
}

.leaderboard-player {
    display: flex;
    align-items: center;
    gap: 10px;
}

.leaderboard-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
}

.leaderboard-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.leaderboard-stat {
    font-weight: 600;
    color: var(--text-primary);
}

.leaderboard-refresh {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.leaderboard-refresh:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: var(--accent-light);
}

/* Mobile responsive for user modal */
@media (max-width: 480px) {
    .user-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .user-profile {
        padding: 12px;
    }

    .user-profile-avatar {
        width: 48px;
        height: 48px;
    }

    .user-profile-name {
        font-size: 1rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 6px;
    }

    .leaderboard-table .stat-col {
        width: 60px;
    }

    .leaderboard-name {
        max-width: 80px;
    }

    .leaderboard-avatar {
        width: 24px;
        height: 24px;
    }
}

/* ===== Infinite Mode Card ===== */
.mode-card.infinite {
    position: relative;
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.1));
}

.mode-card.infinite:hover {
    border-color: var(--warning);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.15));
}

.mode-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: linear-gradient(135deg, var(--warning), #f97316);
    color: white;
    border-radius: 12px;
}

.mode-badge.premium {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.mode-badge.free-trial {
    background: linear-gradient(135deg, #10b981, #059669);
}

.mode-badge.free {
    background: linear-gradient(135deg, #10b981, #059669);
}

/* ===== Ad Prompt Modal ===== */
.ad-prompt-modal {
    max-width: 360px;
    text-align: center;
}

.ad-prompt-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.ad-prompt-modal h2 {
    padding-right: 0;
    text-align: center;
}

.ad-prompt-desc {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ad-prompt-benefits {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.benefit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.ad-watch-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.ad-prompt-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ===== Ad Overlay (Mock Ad) ===== */
.ad-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    animation: fadeIn 0.2s ease;
}

.ad-modal {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 32px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ad-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.ad-icon {
    font-size: 2.5rem;
}

.ad-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ad-content p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.ad-timer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ad-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.ad-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px;
    transition: width 1s linear;
}

.ad-countdown {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-variant-numeric: tabular-nums;
}

.ad-placeholder-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    padding: 40px 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
    width: 100%;
}

.ad-skip-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    border-radius: 10px;
    cursor: pointer;
    transition: opacity var(--transition-fast);
}

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

.ad-skip-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.ad-cancel-btn {
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.ad-cancel-btn:hover {
    color: var(--text-primary);
}

.ad-premium-link {
    margin-top: 8px;
    font-size: 0.85rem;
    padding: 8px 16px;
}

/* ===== Hint Button ===== */
.hint-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.hint-btn:hover {
    border-color: var(--warning);
    color: var(--warning);
    background: rgba(245, 158, 11, 0.1);
}

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

.hint-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--success);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hint-badge.empty {
    background: var(--text-muted);
}

.hint-badge.ad {
    background: var(--warning);
}

/* Hint Suggestion Bubble */
.hint-suggestion {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.15));
    border: 1px solid var(--warning);
    border-radius: 20px;
    animation: hintPulse 2s ease-in-out infinite;
}

@keyframes hintPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

.hint-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.hint-word {
    font-size: 1rem;
    font-weight: 700;
    color: var(--warning);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ===== Premium Modal ===== */
.premium-modal {
    max-width: 400px;
    text-align: center;
}

.premium-header {
    margin-bottom: 24px;
}

.premium-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 8px;
}

.premium-modal h2 {
    padding-right: 0;
    text-align: center;
    margin-bottom: 4px;
}

.premium-tagline {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

.premium-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    text-align: left;
}

.premium-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.premium-feature .feature-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.premium-feature .feature-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.premium-feature .feature-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.premium-feature .feature-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Pricing Options */
.premium-pricing {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.pricing-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.pricing-option:hover {
    border-color: var(--accent-secondary);
}

.pricing-option.selected {
    border-color: var(--accent-primary);
    background: var(--accent-light);
}

.pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 2px 10px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--success);
    color: white;
    border-radius: 8px;
    white-space: nowrap;
}

.pricing-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.pricing-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pricing-period {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.premium-subscribe-btn {
    margin-bottom: 12px;
}

.premium-note {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Mobile responsive for hint */
@media (max-width: 480px) {
    .hint-btn {
        width: 48px;
        height: 48px;
    }

    .hint-suggestion {
        padding: 8px 12px;
    }

    .hint-word {
        font-size: 0.9rem;
    }
}

/* Cookie Consent Banner */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 16px;
    z-index: 9999;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    animation: slideUp 0.3s ease;
}

/* Hide cookie banner when mobile keyboard is open */
body.keyboard-open .cookie-banner {
    display: none;
}

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

.cookie-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 200px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.cookie-text a {
    color: var(--primary);
    text-decoration: underline;
}

.cookie-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.cookie-btn-accept {
    background: var(--primary);
    color: white;
}

.cookie-btn-accept:hover {
    background: var(--primary-dark);
}

.cookie-btn-reject {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.cookie-btn-reject:hover {
    background: var(--border);
}

@media (max-width: 600px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }

    .cookie-btn {
        flex: 1;
        max-width: 160px;
    }
}

/* Settings footer links */
.settings-links {
    margin-top: 12px;
}

.settings-links a {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
}

.settings-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}
