:root {
    --white: #ffffff;
    --stone-100: #f5f5f4;
    --stone-400: #a8a29e;
    --stone-600: #57534e;
    --stone-900: #1c1917;
    --indigo: #4f46e5;
    --rose: #f43f5e;
    --font-serif: 'Fraunces', serif;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: #ffffff;
    color: var(--stone-900);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
    min-height: 100vh;
}

#container {
    width: 100%;
    max-width: 800px;
    margin: auto 0;
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.page-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.page-header p {
    font-size: 1rem;
    color: var(--stone-600);
    max-width: 550px;
    margin: 0 auto;
    line-height: 1.6;
}

#live-status {
    position: absolute;
    top: -10px;
    right: 0;
    background-color: var(--white);
    color: var(--stone-600);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid #e7e5e4;
}

.live-dot {
    width: 6px;
    height: 6px;
    background-color: var(--rose);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

#poll-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.poll-choice {
    background-color: var(--white);
    border-radius: 12px;
    border: 1px solid #e7e5e4;
    padding: 0.75rem;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.poll-choice:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}

.poll-choice:focus-visible {
    outline: 2px solid var(--indigo);
    outline-offset: 2px;
}

#poll-grid.results-mode .poll-choice {
    cursor: default;
}

#poll-grid.results-mode .poll-choice:hover {
    transform: none;
    box-shadow: none;
}

.poll-choice.is-leader.results-mode {
    box-shadow: 0 0 0 3px var(--indigo);
}

.poll-choice .image-wrapper {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.poll-choice img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background-color: var(--stone-100);
}

.poll-choice .caption {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-600);
    margin-top: 0.75rem;
    padding: 0 0.25rem;
    text-transform: lowercase;
}

.percentage-bar-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background-color: rgba(0,0,0,0.05);
}

.percentage-bar {
    width: 0;
    height: 100%;
    background-color: var(--indigo);
    transition: width 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.is-leader .percentage-bar {
    background-color: var(--rose);
}

.voted-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.poll-choice.is-voted .voted-overlay {
    opacity: 1;
}

#form-container {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid #e7e5e4;
}

#entry-form label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--stone-600);
    margin-bottom: 0.75rem;
    display: block;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    margin: 0 auto;
}

#entry-form input[type="email"] {
    flex-grow: 1;
    border: 1px solid #d6d3d1;
    background-color: var(--white);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#entry-form input[type="email"]:focus {
    outline: none;
    border-color: var(--indigo);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

#entry-form button {
    background-color: var(--stone-900);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#entry-form button:hover {
    background-color: var(--stone-600);
}

#entry-form button:disabled {
    background-color: var(--stone-400);
    cursor: not-allowed;
}

#thank-you-message {
    color: var(--indigo);
    font-weight: 500;
}

#page-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #e7e5e4;
    font-size: 0.875rem;
    color: var(--stone-400);
}

#page-footer .brand {
    font-weight: 600;
    color: var(--stone-600);
}

#page-footer .embed-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

#page-footer .embed-hint svg {
    transform: rotate(180deg);
    fill: var(--stone-400);
}

#wbx-powered-by-slot {
    margin-top: 1.5rem;
}

#status-container h2 {
    font-family: var(--font-serif);
    text-align: center;
}
#status-container p {
    text-align: center;
    color: var(--stone-600);
    margin-top: 0.5rem;
}

.hidden {
    display: none !important;
}

@media (min-width: 640px) {
    #poll-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-row {
        flex-direction: row;
    }
}
