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

:root {
    --bg-deep: #0d0d1a;
    --bg-surface: #16213e;
    --bg-card: #1a1f3a;
    --text-main: #e8eaf6;
    --text-muted: #8892b0;
    --gold: #ffd700;
    --gold-glow: rgba(255, 215, 0, 0.3);
    --border-dim: rgba(255, 255, 255, 0.08);
    --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    background: var(--bg-deep);
    background-image:
        radial-gradient(
            ellipse at 20% 10%,
            rgba(79, 195, 247, 0.07) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 80% 90%,
            rgba(129, 199, 132, 0.06) 0%,
            transparent 50%
        ),
        radial-gradient(
            ellipse at 50% 50%,
            rgba(255, 107, 107, 0.04) 0%,
            transparent 70%
        );
    background-attachment: fixed;
}

body {
    font-family: "Geist", system-ui, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── Connection Status Dot ────────────────────────────────────── */
.status-dot {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 100;
    transition:
        background var(--transition),
        box-shadow var(--transition);
}

.status-dot.connected {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.7);
}

.status-dot.disconnected {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.5);
}

/* ─── Header ───────────────────────────────────────────────────── */
header {
    text-align: center;
    padding: 48px 24px 32px;
    position: relative;
}

header::after {
    content: "";
    display: block;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 24px auto 0;
}

.game-subtitle {
    font-size: 0.85rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.game-title {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 900;
    color: var(--gold);
    text-shadow:
        0 0 30px var(--gold-glow),
        0 0 60px rgba(255, 215, 0, 0.15);
    letter-spacing: 0.02em;
    line-height: 1.1;
}

.game-title .amp {
    color: #fff;
    font-weight: 600;
    margin: 0 6px;
}

.tagline {
    margin-top: 12px;
    font-size: 1.05rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

/* ─── Main / Grid ──────────────────────────────────────────────── */
main {
    flex: 1;
    padding: 24px 24px 48px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.vote-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    align-items: start;
}

/* ─── Card ─────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid var(--border-dim);
    border-top: 3px solid var(--accent);
    padding: 28px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition:
        transform var(--transition),
        box-shadow var(--transition);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at 50% 0%,
        color-mix(in srgb, var(--accent) 12%, transparent) 0%,
        transparent 65%
    );
    pointer-events: none;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--accent),
        0 0 30px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* ─── Pokémon Image ─────────────────────────────────────────────── */
.card-visual {
    display: flex;
    justify-content: center;
    padding: 8px 0 4px;
}

.pokemon-img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(
        0 8px 24px color-mix(in srgb, var(--accent) 50%, transparent)
    );
    transition:
        transform var(--transition),
        filter var(--transition);
}

.card:hover .pokemon-img {
    transform: translateY(-4px) scale(1.04);
    filter: drop-shadow(
        0 14px 32px color-mix(in srgb, var(--accent) 70%, transparent)
    );
}

/* ─── Card Info ────────────────────────────────────────────────── */
.card-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pokemon-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.pokemon-category {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-top: -6px;
}

.type-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid currentColor;
}

.badge-fire {
    color: #ff7043;
    background: rgba(255, 112, 67, 0.12);
}
.badge-coral {
    color: #ff8a65;
    background: rgba(255, 138, 101, 0.12);
}
.badge-water {
    color: #29b6f6;
    background: rgba(41, 182, 246, 0.12);
}
.badge-flying {
    color: #90caf9;
    background: rgba(144, 202, 249, 0.12);
}
.badge-grass {
    color: #66bb6a;
    background: rgba(102, 187, 106, 0.12);
}
.badge-ghost {
    color: #ab47bc;
    background: rgba(171, 71, 188, 0.12);
}

.pokemon-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ─── Vote Section ─────────────────────────────────────────────── */
.vote-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vote-count {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    text-shadow: 0 0 20px color-mix(in srgb, var(--accent) 50%, transparent);
    transition: transform 0.2s ease;
}

.vote-count.bump {
    transform: scale(1.15);
}

.vote-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-top: -4px;
}

.vote-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 999px;
    overflow: hidden;
}

.vote-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-dark), var(--accent));
    border-radius: 999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);
}

/* ─── Button Hint ──────────────────────────────────────────────── */
.button-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 4px;
}

kbd {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-family: "Geist Mono", monospace;
    font-size: 0.78rem;
    color: var(--text-main);
}

/* ─── Totals Row ───────────────────────────────────────────────── */
.totals-row {
    text-align: center;
    margin-top: 36px;
}

.total-votes {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

#total-count {
    color: var(--gold);
    font-weight: 700;
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 860px) {
    .vote-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
        margin: 0 auto;
    }
}
