/* ============================================
   ChessStake - Global Styles
   Modern Web3 Gaming Design System
   Light/Dark Theme Support
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ============================================
   Light Theme (Default)
   ============================================ */
:root {
    /* Core Colors - Light Theme */
    --color-bg-primary: #f8fafc;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f1f5f9;
    --color-bg-elevated: #ffffff;
    --color-bg-hover: #e2e8f0;

    /* Accent Colors - Vibrant but readable */
    --color-accent-primary: #0891b2;      /* Cyan-600 */
    --color-accent-secondary: #7c3aed;    /* Violet-600 */
    --color-accent-tertiary: #16a34a;     /* Green-600 */
    --color-accent-warning: #d97706;      /* Amber-600 */
    --color-accent-danger: #dc2626;       /* Red-600 */

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0891b2 0%, #7c3aed 100%);
    --gradient-secondary: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    --gradient-success: linear-gradient(135deg, #16a34a 0%, #0891b2 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(8, 145, 178, 0.1) 0%, transparent 70%);

    /* Text Colors */
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-muted: #94a3b8;
    --color-text-accent: #0891b2;

    /* USDC Brand Color */
    --color-usdc: #2775ca;

    /* Board Colors - Light Style */
    --board-light: #f0d9b5;
    --board-dark: #b58863;
    --board-highlight: rgba(8, 145, 178, 0.4);
    --board-move-hint: rgba(8, 145, 178, 0.3);
    --board-check: rgba(220, 38, 38, 0.5);

    /* Border for light theme */
    --color-border: #e2e8f0;

    /* Shadows for light theme */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(8, 145, 178, 0.25);
    --shadow-glow-violet: 0 0 20px rgba(124, 58, 237, 0.25);

    /* Navbar background */
    --navbar-bg: rgba(248, 250, 252, 0.9);
    --navbar-border: rgba(0, 0, 0, 0.06);
}

/* ============================================
   Dark Theme
   ============================================ */
[data-theme="dark"] {
    /* Core Colors - Dark Theme */
    --color-bg-primary: #0a0a0f;
    --color-bg-secondary: #12121a;
    --color-bg-tertiary: #1a1a24;
    --color-bg-elevated: #22222e;
    --color-bg-hover: #2a2a38;

    /* Accent Colors - Electric & Vibrant */
    --color-accent-primary: #00f0ff;      /* Cyan */
    --color-accent-secondary: #8b5cf6;    /* Violet */
    --color-accent-tertiary: #22c55e;     /* Green */
    --color-accent-warning: #f59e0b;      /* Amber */
    --color-accent-danger: #ef4444;       /* Red */

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 100%);
    --gradient-secondary: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --gradient-success: linear-gradient(135deg, #22c55e 0%, #00f0ff 100%);
    --gradient-glow: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.15) 0%, transparent 70%);

    /* Text Colors */
    --color-text-primary: #ffffff;
    --color-text-secondary: #a1a1aa;
    --color-text-muted: #71717a;
    --color-text-accent: #00f0ff;

    /* Board Colors - Dark Style */
    --board-light: #2a2a38;
    --board-dark: #1a1a24;
    --board-highlight: rgba(0, 240, 255, 0.3);
    --board-move-hint: rgba(0, 240, 255, 0.2);
    --board-check: rgba(239, 68, 68, 0.5);

    /* Border for dark theme */
    --color-border: rgba(255, 255, 255, 0.08);

    /* Shadows for dark theme */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(0, 240, 255, 0.3);
    --shadow-glow-violet: 0 0 30px rgba(139, 92, 246, 0.3);

    /* Navbar background */
    --navbar-bg: rgba(10, 10, 15, 0.8);
    --navbar-border: rgba(255, 255, 255, 0.06);
}

/* Common variables (both themes) */
:root {
    /* Typography */
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 30px rgba(0, 240, 255, 0.3);
    --shadow-glow-violet: 0 0 30px rgba(139, 92, 246, 0.3);

    /* Borders */
    --border-subtle: 1px solid rgba(255, 255, 255, 0.06);
    --border-accent: 1px solid rgba(0, 240, 255, 0.3);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 150;
    --z-modal: 200;
    --z-tooltip: 300;
    --z-toast: 400;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Selection */
::selection {
    background: rgba(0, 240, 255, 0.3);
    color: var(--color-text-primary);
}

/* Hide scrollbars but allow scrolling */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

*::-webkit-scrollbar {
    display: none;  /* Chrome, Safari, Opera */
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.container-lg {
    max-width: 1440px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.1;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--spacing-md);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-accent-primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--color-text-primary);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.5);
}

/* Gradient Text */
.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--color-bg-primary);
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.5);
}

.btn-secondary {
    background: var(--color-bg-elevated);
    color: var(--color-text-primary);
    border: var(--border-accent);
}

.btn-secondary:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

.btn-outline {
    background: transparent;
    color: var(--color-text-primary);
    border: 2px solid var(--color-text-muted);
}

.btn-outline:hover {
    border-color: var(--color-accent-primary);
    color: var(--color-accent-primary);
    box-shadow: var(--shadow-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    color: var(--color-text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-lg {
    padding: 1.125rem 2.25rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

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

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-sticky);
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--navbar-border);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Auto-hide navbar on mobile */
@media (max-width: 768px) {
    .navbar.navbar-hidden {
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
    }

    /* Pull-down indicator when navbar is hidden */
    .navbar-pull-zone {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 20px;
        z-index: calc(var(--z-sticky) - 1);
        display: none;
    }

    .navbar.navbar-hidden + .navbar-pull-zone,
    .navbar-pull-zone.active {
        display: block;
    }

    /* Visual indicator */
    .navbar-pull-indicator {
        position: fixed;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--color-accent-primary);
        border-radius: 0 0 4px 4px;
        opacity: 0;
        transition: opacity 0.3s ease;
        z-index: calc(var(--z-sticky) - 1);
    }

    .navbar.navbar-hidden ~ .navbar-pull-indicator {
        opacity: 0.5;
    }

    /* Adjust body padding when navbar hidden */
    body.navbar-is-hidden {
        padding-top: 0 !important;
    }

    /* Safe area for notched phones */
    .navbar {
        padding-top: env(safe-area-inset-top, 0);
    }
}

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

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

.logo-icon {
    font-size: 2.2rem;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
    margin-bottom: 3px;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: var(--spacing-xl);
}

.nav-link {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-text-primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Cards */
.card {
    background: var(--color-bg-secondary);
    border: var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    transition: all var(--transition-normal);
}

.card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: var(--gradient-primary);
    opacity: 0;
    z-index: -1;
    transition: opacity var(--transition-normal);
}

.card-glow:hover::before {
    opacity: 0.1;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    background: rgba(0, 240, 255, 0.1);
    color: var(--color-accent-primary);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.badge-success {
    background: rgba(34, 197, 94, 0.1);
    color: var(--color-accent-tertiary);
    border-color: rgba(34, 197, 94, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-accent-warning);
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-violet {
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-accent-secondary);
    border-color: rgba(139, 92, 246, 0.2);
}

/* Form Elements */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--color-text-primary);
    background: var(--color-bg-tertiary);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

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

/* Section */
.section {
    padding: var(--spacing-4xl) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-3xl);
}

.section-badge {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: rgba(139, 92, 246, 0.1);
    color: var(--color-accent-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-full);
    border: 1px solid rgba(139, 92, 246, 0.2);
    margin-bottom: var(--spacing-lg);
}

.section-title {
    margin-bottom: var(--spacing-md);
}

.section-description {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Footer */
.footer {
    background: var(--color-bg-secondary);
    border-top: var(--border-subtle);
    padding: var(--spacing-3xl) 0 var(--spacing-xl);
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: var(--spacing-3xl);
    margin-bottom: var(--spacing-3xl);
}

.footer-brand p {
    max-width: 280px;
    font-size: 0.875rem;
}

.footer-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--spacing-lg);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: var(--spacing-sm);
}

.footer-links a {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
}

.footer-links a:hover {
    color: var(--color-accent-primary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--spacing-xl);
    border-top: var(--border-subtle);
}

.footer-legal {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-legal a {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

.footer-copyright {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
}

/* Force dark footer in both themes */
.footer {
    background: #0a0a0f !important;
    border-top: none !important;
    position: relative;
    overflow: visible;
    margin-top: 0;
}

/* Wave separator above footer */
.footer-wave {
    position: absolute;
    top: -60px;
    left: 0;
    width: 100%;
    height: 60px;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.footer-wave svg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 100%;
    animation: waveMove 8s linear infinite;
}

.footer-wave svg path {
    fill: #0a0a0f;
}

@keyframes waveMove {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}
.footer .logo-text,
.footer .footer-title {
    color: #ffffff !important;
}

.footer .footer-brand p,
.footer .footer-links a,
.footer .footer-legal a,
.footer .footer-copyright {
    color: rgba(255, 255, 255, 0.6) !important;
}

.footer .footer-links a:hover,
.footer .footer-legal a:hover {
    color: #00d4aa !important;
}

.footer .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.footer .footer-social a {
    color: rgba(255, 255, 255, 0.5) !important;
}

.footer .footer-social a:hover {
    color: #00d4aa !important;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--color-bg-elevated);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    max-width: 420px;
    pointer-events: auto;
    animation: toast-in 0.3s ease;
    border-left: 3px solid var(--color-accent-primary);
}

.toast-error { border-left-color: var(--color-accent-danger); }
.toast-success { border-left-color: var(--color-accent-tertiary); }
.toast-warning { border-left-color: var(--color-accent-warning); }

.toast-out {
    animation: toast-out 0.3s ease forwards;
}

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

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

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast-error .toast-icon { color: var(--color-accent-danger); }
.toast-success .toast-icon { color: var(--color-accent-tertiary); }
.toast-warning .toast-icon { color: var(--color-accent-warning); }

.toast-content { flex: 1; }

.toast-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    margin-bottom: 0.15rem;
}

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

.toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--color-text-primary);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-text-secondary);
    font-size: 1.25rem;
}

.theme-toggle:hover {
    background: var(--color-bg-hover);
    color: var(--color-accent-primary);
    border-color: var(--color-accent-primary);
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

/* Light theme: show moon icon */
:root .theme-toggle .icon-moon {
    display: block;
}

/* Dark theme: show sun icon */
[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

/* Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.text-accent { color: var(--color-accent-primary); }
.text-muted { color: var(--color-text-muted); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

/* Responsive */
@media (max-width: 1024px) {
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-2xl);
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .nav-links {
        display: none;
    }

    /* La cabecera cabe en 360 px: menos aire, botones más cortos y nada que
       se salga por la derecha (el «Abrir App» quedaba cortado). */
    .nav-container {
        padding: 0.625rem 0.875rem;
        gap: 0.5rem;
    }

    .nav-auth {
        gap: 0.5rem;
        min-width: 0;
        flex-shrink: 1;
    }

    .nav-auth .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8125rem;
        white-space: nowrap;
    }

    .logo-text {
        font-size: 1.125rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }

    .toast-container {
        left: 10px;
        right: 10px;
        top: 70px;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ============================================
   Chess Title Badges
   ============================================ */
.chess-title-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    border-radius: 3px;
    white-space: nowrap;
    text-transform: uppercase;
    position: relative;
    top: -2px;
}

.chess-title-inline {
    font-weight: 700;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
    margin-right: 4px;
}

.chess-title-large {
    font-size: 1rem;
    padding: 4px 12px;
}

/* Title Progress Bar */
.title-progress {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: var(--spacing-md);
}

.title-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.title-progress-current {
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-progress-next {
    color: var(--color-text-muted);
}

.title-progress-bar {
    height: 6px;
    background: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.title-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.title-progress-info {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: right;
}

@media (max-width: 480px) {
    /* En la portada, el botón de wallet de la cabecera sobra: el héroe ya lo tiene. */
    .navbar #connectWallet {
        display: none;
    }
    .nav-auth .theme-toggle {
        display: none;
    }
}
