:root {
    --bg-color: #0f172a;
    --accent-color: #22c55e;
    --text-color: #e2e8f0;
    --text-color-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);

    --font-display: 'Bebas Neue', cursive;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.container {
    width: 100%;
    height: 100%;
    max-width: 1400px;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.page-header, .page-footer {
    padding: 1rem 2rem;
    flex-shrink: 0;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-color-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.page-header {
    border-bottom: 1px solid var(--border-color);
}
.page-footer {
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.content-grid {
    flex-grow: 1;
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
    padding: 2rem;
    overflow: hidden;
}

.qr-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    border-right: 1px solid var(--border-color);
    padding-right: 2rem;
}

.qr-code-wrapper {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    background-color: #fff;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.2);
}

.qr-code-wrapper img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 4px;
}

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

.instructions p {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

#countdown {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
}

.countdown-label {
    font-size: 1rem;
}

.countdown-time {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.poll-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.poll-question {
    font-family: var(--font-display);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 3rem;
    letter-spacing: 1px;
    color: var(--text-color);
}

.poll-choices {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.poll-choice {
    display: grid;
    grid-template-columns: 100px 1fr 120px;
    align-items: center;
    gap: 1rem;
    font-size: 1.25rem;
}

.choice-title {
    font-weight: 600;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.bar-container {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.05);
    height: 32px;
    border-radius: 8px;
    overflow: hidden;
}

.bar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #16a34a, var(--accent-color));
    border-radius: 8px;
    transition: width 0.5s ease-out;
}

.poll-choice.leading .bar {
    animation: pulse 2s infinite;
}

.choice-stats {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
    color: var(--text-color);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .qr-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-right: 0;
        padding-bottom: 1.5rem;
    }
    .poll-question {
        font-size: 3rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    .poll-choice {
        font-size: 1rem;
        grid-template-columns: 80px 1fr 100px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    .container {
        max-height: none;
    }
    .poll-question {
        font-size: 2.5rem;
    }
    .qr-code-wrapper {
        max-width: 200px;
    }
    .instructions p {
        font-size: 1rem;
    }
    .countdown-time {
        font-size: 1.25rem;
    }
    .page-header, .page-footer {
        padding: 0.75rem 1rem;
        font-size: 0.7rem;
    }
}
