/* ─── Variables ──────────────────────────────────── */
:root {
    --burgundy: #BD2B32;
    --burgundy-dark: #8a1f24;
    --mesa: #215E21;
    --nos: #3380D9;
    --ellos: #D94D40;
    --bg: #111111;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --bg-input: #1e1e1e;
    --text: #f0f0f0;
    --text-muted: #888888;
    --border: #2a2a2a;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.3);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ─── Layout ─────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.text-accent { color: var(--burgundy); }

/* ─── Buttons ────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-sm {
    padding: 6px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

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

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

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

.btn-outline:hover {
    border-color: var(--text-muted);
    background: var(--bg-card);
}

.btn .material-icons-round {
    font-size: 1.1em;
}

/* ─── Nav ────────────────────────────────────────── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(17,17,17,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.nav-logo {
    font-weight: 700;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 1.4rem;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a:not(.btn) {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:not(.btn):hover {
    color: var(--text);
}

/* ─── Hero ───────────────────────────────────────── */
.hero {
    padding: 120px 0 80px;
    min-height: 90vh;
    display: flex;
    align-items: center;
}

.hero-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 480px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Phone mockup */
.phone-mockup {
    width: 280px;
    margin: 0 auto;
    background: #1a1a1a;
    border-radius: 32px;
    padding: 12px;
    border: 2px solid #333;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.phone-screen {
    background: var(--mesa);
    border-radius: 22px;
    padding: 20px 16px;
    min-height: 380px;
}

.mockup-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 20px;
    opacity: 0.9;
}

.mockup-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.mockup-team {
    text-align: center;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
}

.mockup-team.nos {
    background: rgba(51,128,217,0.25);
    border: 1px solid rgba(51,128,217,0.4);
}

.mockup-team.ellos {
    background: rgba(217,77,64,0.25);
    border: 1px solid rgba(217,77,64,0.4);
}

.team-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 4px;
}

.team-score {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
}

.mockup-vs {
    font-size: 0.8rem;
    font-weight: 600;
    opacity: 0.5;
}

.mockup-rounds {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mockup-round {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.08);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
}

.mockup-round span:first-child {
    opacity: 0.5;
    font-weight: 600;
}

/* ─── Features ───────────────────────────────────── */
.features {
    padding: 80px 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 48px;
    font-size: 1.05rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.2s;
}

.feature-card:hover {
    background: var(--bg-card-hover);
    border-color: #333;
    transform: translateY(-2px);
}

.feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(189,43,50,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon .material-icons-round {
    font-size: 1.3rem;
    color: var(--burgundy);
}

.feature-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── How it works ───────────────────────────────── */
.how-it-works {
    padding: 80px 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    margin-top: 48px;
}

.step {
    text-align: center;
    max-width: 260px;
}

.step-number {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--burgundy);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 16px;
}

.step h3 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.step p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.step-arrow {
    padding-top: 12px;
    color: var(--text-muted);
}

.step-arrow .material-icons-round {
    font-size: 1.5rem;
}

/* ─── Stats ──────────────────────────────────────── */
.stats-section {
    padding: 80px 0;
}

.stats-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Login form */
.stats-form {
    display: flex;
    gap: 12px;
}

.input-group {
    flex: 1;
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--burgundy);
}

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

.stats-error {
    color: var(--ellos);
    font-size: 0.9rem;
    margin-top: 12px;
    text-align: center;
}

/* Stats display */
.stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.stats-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    font-size: 2.5rem;
    color: var(--burgundy);
}

.stats-user h3 {
    font-size: 1.1rem;
    margin-bottom: 2px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card.win .stat-value { color: #4CAF50; }
.stat-card.lose .stat-value { color: var(--ellos); }
.stat-card.accent .stat-value { color: var(--nos); }

/* Win rate bar */
.winrate-bar-container {
    margin-bottom: 32px;
}

.winrate-bar {
    height: 8px;
    background: var(--bg-card);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.winrate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--nos), #4CAF50);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Game history */
.stats-history h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.stats-history h3 .material-icons-round {
    font-size: 1.2rem;
}

.partidas-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.partida-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.partida-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.partida-players {
    font-size: 0.85rem;
}

.partida-score {
    text-align: right;
}

.partida-score .score-line {
    font-size: 0.9rem;
    font-weight: 600;
}

.partida-score .score-line.nos { color: var(--nos); }
.partida-score .score-line.ellos { color: var(--ellos); }

.partida-result {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
}

.partida-result.win {
    background: rgba(76,175,80,0.15);
    color: #4CAF50;
}

.partida-result.lose {
    background: rgba(217,77,64,0.15);
    color: var(--ellos);
}

/* ─── Download ───────────────────────────────────── */
.download-section {
    padding: 80px 0;
    background: linear-gradient(135deg, var(--burgundy-dark) 0%, var(--burgundy) 100%);
    text-align: center;
}

.download-inner h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.download-inner p {
    opacity: 0.85;
    margin-bottom: 32px;
    font-size: 1.05rem;
}

.download-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.store-button {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.store-button:hover {
    background: rgba(0,0,0,0.5);
    border-color: rgba(255,255,255,0.35);
}

.store-button .material-icons-round {
    font-size: 2rem;
}

.store-button small {
    display: block;
    font-size: 0.7rem;
    opacity: 0.75;
    text-align: left;
}

.store-button strong {
    display: block;
    font-size: 1rem;
    text-align: left;
}

/* ─── Footer ─────────────────────────────────────── */
.footer {
    padding: 24px 0;
    border-top: 1px solid var(--border);
}

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

.footer-logo {
    font-weight: 600;
    font-size: 0.95rem;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
    .hero-inner {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .features-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }

    .step-arrow {
        transform: rotate(90deg);
    }

    .stats-form {
        flex-direction: column;
    }

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

    .nav-links a:not(.btn) {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .btn-lg {
        padding: 12px 20px;
        font-size: 0.9rem;
    }

    .partida-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .partida-score {
        text-align: left;
    }
}

/* ─── Loading spinner ────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

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

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