﻿:root {
    --bg-900: #05070f;
    --bg-850: #070b16;
    --bg-800: #0b1020;
    --bg-700: #111933;
    --bg-600: #162043;
    --card-bg: rgba(20, 32, 66, 0.92);
    --card-border: rgba(82, 100, 150, 0.25);
    --text-100: #f8fafc;
    --text-200: #e2e8f0;
    --text-300: #cbd5f5;
    --muted: #94a3b8;
    --accent: #7c5cff;
    --accent-strong: #5b21ff;
    --brand: #00e59b;
    --brand-strong: #00c785;
    --danger: #fb7185;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --shadow-soft: 0 20px 60px rgba(5, 12, 27, 0.45);
    --shadow-border: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: radial-gradient(circle at top, rgba(59, 130, 246, 0.2) 0%, rgba(14, 21, 40, 0.95) 45%, #05070f 100%);
    color: var(--text-200);
}

body {
    min-height: 100vh;
}

.app-body,
.auth-body {
    min-height: 100vh;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

button,
.button,
.button-ghost {
    font-family: inherit;
    border: none;
    cursor: pointer;
}

.brand-button {
    background: linear-gradient(135deg, var(--brand), #2dd4bf);
    color: var(--bg-900);
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 12px 30px rgba(0, 229, 155, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-button:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 16px 40px rgba(0, 229, 155, 0.35);
}

.button-ghost {
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.2);
    padding: 0.75rem 1.5rem;
    color: var(--text-200);
    background: rgba(15, 23, 42, 0.45);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.button-ghost:hover {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.65);
}

.page-container {
    width: min(1024px, 92vw);
    margin: 0 auto;
    padding: 40px 0 120px;
    flex: 1 0 auto;
}

/* Top Navigation */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px clamp(16px, 5vw, 32px);
}

.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(92, 59, 255, 0.18);
    border: 1px solid rgba(121, 87, 255, 0.2);
    color: var(--text-200);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Hero Section */
.hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 28px;
}

.banner-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-lg);
    padding: 28px;
    background: linear-gradient(135deg, rgba(92, 59, 255, 0.35), rgba(8, 47, 73, 0.9));
    border: 1px solid rgba(148, 163, 184, 0.12);
    box-shadow: var(--shadow-soft);
    min-height: 240px;
}

.banner-card h1 {
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    margin: 0 0 14px;
    color: #f8faff;
    letter-spacing: -0.02em;
}

.banner-card p {
    margin: 0 0 20px;
    color: rgba(248, 250, 255, 0.8);
    max-width: 420px;
    font-size: 1rem;
    line-height: 1.5;
}

.banner-card .subnote {
    font-size: 0.85rem;
    color: rgba(226, 232, 240, 0.7);
}

.banner-art {
    position: absolute;
    inset: auto -20% -30% auto;
    width: clamp(200px, 45%, 340px);
    opacity: 0.9;
    pointer-events: none;
}

.quick-stats {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.quick-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--card-border);
    padding: 18px;
    box-shadow: var(--shadow-border);
}

.quick-card span {
    display: block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-bottom: 6px;
}

.quick-card strong {
    font-size: 1.2rem;
    color: var(--text-100);
}

/* Games grid */
.section-title {
    margin: 48px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-title h2 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--text-100);
}

.section-title a {
    font-size: 0.9rem;
    color: var(--muted);
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.game-card {
    position: relative;
    background: linear-gradient(160deg, rgba(17, 30, 59, 0.85), rgba(14, 23, 42, 0.92));
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.1);
    padding: 18px;
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    transform: translateY(0);
    transition: transform 0.2s ease, border 0.2s ease;
}

.game-card:hover {
    transform: translateY(-6px);
    border-color: rgba(0, 229, 155, 0.35);
}

.game-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(11, 15, 30, 0.6);
}

.game-card h3 {
    margin: 0;
    color: var(--text-100);
    font-size: 1.15rem;
}

.game-card p {
    margin: 0;
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.72);
    flex: 1 0 auto;
}

.game-actions {
    display: flex;
    gap: 10px;
}

.queue-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.83rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

/* Queue list */
.queue-wrapper {
    margin-top: 36px;
    background: rgba(12, 21, 43, 0.75);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.08);
    padding: 24px;
}

.queue-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.queue-card {
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.queue-card strong {
    color: var(--text-100);
}

.queue-card small {
    display: block;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.queue-card a {
    background: rgba(0, 229, 155, 0.12);
    color: var(--brand);
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.2s ease;
}

.queue-card a:hover {
    background: rgba(0, 229, 155, 0.22);
}

.queue-empty {
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Auth screens */
.auth-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 16px 80px;
}

.auth-card {
    width: min(400px, 92vw);
    background: rgba(13, 20, 40, 0.88);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(148, 163, 184, 0.14);
    padding: 32px clamp(20px, 5vw, 36px);
    box-shadow: var(--shadow-soft);
}

.auth-card h1 {
    margin: 0 0 8px;
    color: var(--text-100);
    font-size: 1.8rem;
}

.auth-card p.lead {
    margin: 0 0 28px;
    color: var(--muted);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(8, 15, 32, 0.95);
    color: var(--text-200);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: rgba(0, 229, 155, 0.7);
    box-shadow: 0 0 0 3px rgba(0, 229, 155, 0.12);
}

.input-error {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--danger);
}

.form-submit {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--brand), #43e8c7);
    color: var(--bg-900);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 20px 40px rgba(0, 229, 155, 0.25);
}

.form-submit:hover {
    filter: brightness(1.05);
}

.auth-footer {
    margin-top: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.auth-footer a {
    color: var(--brand);
    font-weight: 600;
}

.notice-card {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.85rem;
    margin-bottom: 16px;
}

/* Bottom navigation */
.bottom-nav {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    width: min(420px, 88vw);
    background: rgba(11, 18, 35, 0.92);
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    padding: 12px 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    box-shadow: 0 18px 36px rgba(5, 10, 28, 0.45);
    backdrop-filter: blur(14px);
}

.bottom-nav a {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease, color 0.2s ease;
}

.bottom-nav a.active,
.bottom-nav a:hover {
    background: rgba(0, 229, 155, 0.12);
    color: var(--brand);
}

.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #4ade80;
    box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .top-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .button-ghost,
    .brand-button {
        flex: 1 1 auto;
    }

    .banner-card {
        min-height: 220px;
        padding: 24px;
    }

    .banner-card p {
        max-width: none;
    }

    .banner-art {
        display: none;
    }
}

@media (max-width: 520px) {
    .hero-grid {
        grid-template-columns: 1fr;
    }

    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .page-container {
        width: 92vw;
    }

    .queue-wrapper {
        padding: 18px;
    }
}
/* History */
.history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.history-card {
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(12, 20, 40, 0.82);
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-border);
}

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

.history-game {
    font-weight: 600;
    color: var(--text-100);
}

.history-result {
    font-weight: 600;
    color: var(--text-200);
}

.history-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.history-label {
    display: block;
    font-size: 0.78rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.history-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--text-200);
}

.history-details[open] summary {
    color: var(--brand);
}

.history-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.velha-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin: 16px 0;
}

.velha-board span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.12);
    font-weight: 600;
}

.history-log {
    background: rgba(8, 15, 32, 0.85);
    border-radius: var(--radius-sm);
    padding: 14px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.85rem;
}

.pagination {
    margin-top: 32px;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.pagination a {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-200);
}

.pagination a.active,
.pagination a:hover {
    background: rgba(0, 229, 155, 0.18);
    border-color: rgba(0, 229, 155, 0.4);
    color: var(--brand);
}
