@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@700;900&family=Prompt:wght@400;500;600;700;800&display=swap');

:root {
    --rg-maroon-950: #2b0605;
    --rg-maroon-900: #45090a;
    --rg-red-800: #6e1113;
    --rg-red-700: #8f1618;
    --rg-red-600: #b3201f;
    --rg-red-accent: #d8262a;
    --rg-gold-100: #fdf3d9;
    --rg-gold-300: #f3d38a;
    --rg-gold-400: #e6bd5c;
    --rg-gold-500: #d4af37;
    --rg-gold-600: #b8860b;
    --rg-gold-700: #8a6508;
    --rg-cream: #fffaf0;
    --rg-ink: #3a1414;
    --rg-ink-soft: #6b3a3a;
}

body.vote-page {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: 'Prompt', 'Sarabun', Arial, sans-serif;
    color: var(--rg-ink);
    position: relative;
    background-color: var(--rg-maroon-950);
    background-image: url('../../imgback/vote-bg-red-gold.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
body.vote-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at 15% 15%, rgba(212,175,55,0.16), transparent 40%),
        radial-gradient(circle at 85% 85%, rgba(212,175,55,0.12), transparent 40%);
    pointer-events: none;
}

.vote-card {
    background: linear-gradient(180deg, var(--rg-cream) 0%, #fff3d9 100%);
    border: 2px solid var(--rg-gold-500);
    box-shadow:
        0 0 0 6px rgba(212,175,55,0.12),
        0 20px 50px rgba(43,6,5,0.45),
        inset 0 0 30px rgba(212,175,55,0.08);
    position: relative;
}
.vote-card::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(184,134,11,0.45);
    border-radius: 20px;
    pointer-events: none;
}

.vote-title {
    font-family: 'Cinzel', 'Prompt', serif;
    font-size: 2.4em;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 0 0 0.15em 0;
    text-align: center;
    background: linear-gradient(90deg, var(--rg-gold-700) 0%, var(--rg-gold-400) 35%, var(--rg-gold-600) 60%, var(--rg-gold-700) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(184,134,11,0.25);
}
.vote-title::after {
    content: '';
    display: block;
    width: 90px;
    height: 3px;
    margin: 0.5em auto 0 auto;
    background: linear-gradient(90deg, transparent, var(--rg-gold-500), transparent);
    border-radius: 2px;
}

.vote-lead {
    margin: 0.4em 0 1em 0;
    font-size: 1.1em;
    font-weight: 500;
    color: var(--rg-ink-soft);
    text-align: center;
}

.vote-alert {
    width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    padding: 1em 1.2em;
    margin-bottom: 1.2em;
    text-align: center;
    border: 1.5px solid transparent;
}
.vote-alert-title {
    font-weight: 700;
    margin-bottom: 0.4em;
}
.vote-alert-text {
    font-size: 0.92em;
    font-weight: 600;
}
.vote-alert-meta {
    margin-top: 0.5em;
    font-size: 0.78em;
    color: var(--rg-ink-soft);
}
.vote-alert-error {
    background: #fdecec;
    border-color: var(--rg-red-accent);
}
.vote-alert-error .vote-alert-title { color: var(--rg-red-700); }
.vote-alert-error .vote-alert-text { color: var(--rg-red-600); }
.vote-alert-banner {
    font-size: 1.15em;
    font-weight: 700;
    color: var(--rg-red-700);
}

.vote-alert-success {
    background: linear-gradient(135deg, #fff8e6 0%, #fdf0c8 100%);
    border-color: var(--rg-gold-500);
}
.vote-alert-success .vote-alert-title { color: var(--rg-gold-700); }
.vote-alert-item {
    color: var(--rg-red-700);
    font-weight: 700;
}
.vote-alert-thanks {
    margin-top: 0.7em;
    font-weight: 800;
    color: var(--rg-gold-700);
}

.vote-alert-info {
    background: #fff8e6;
    border-color: var(--rg-gold-400);
    color: var(--rg-ink-soft);
    font-weight: 600;
}

.vote-rules {
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(135deg, var(--rg-maroon-900) 0%, var(--rg-red-800) 100%);
    border: 1.5px solid var(--rg-gold-500);
    border-radius: 12px;
    padding: 0.9em 1.1em;
    margin-bottom: 1em;
}
.vote-rules-title {
    color: var(--rg-gold-400);
    font-size: 0.95em;
    font-weight: 700;
    margin-bottom: 0.3em;
}
.vote-rules-text {
    color: var(--rg-gold-100);
    font-size: 0.8em;
    line-height: 1.6;
}
.vote-rules-text strong { color: #fff; }

.vote-countdown {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-weight: 700;
    color: var(--rg-cream);
    background: linear-gradient(90deg, var(--rg-red-700), var(--rg-red-600));
    border: 1px solid var(--rg-gold-500);
    border-radius: 999px;
    padding: 0.6em 1em;
    margin-bottom: 1.2em;
    letter-spacing: 0.3px;
}

.vote-candidate,
.vote-option {
    position: relative;
    border-radius: 14px;
    padding: 8px;
    transition: transform 0.2s ease, background 0.2s ease;
}
.vote-option:hover {
    background: rgba(212,175,55,0.12);
}
.vote-option:active {
    transform: scale(0.98);
    background: rgba(212,175,55,0.22);
}

.vote-candidate-img {
    border: 4px solid var(--rg-gold-300);
    box-shadow: 0 6px 16px rgba(43,6,5,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.vote-option:hover .vote-candidate-img {
    transform: scale(1.05);
    border-color: var(--rg-gold-500);
    box-shadow: 0 8px 22px rgba(184,134,11,0.4);
}
.vote-candidate-img.is-selected {
    border-color: var(--rg-red-accent);
    box-shadow: 0 0 0 4px rgba(216,38,42,0.25), 0 8px 22px rgba(184,134,11,0.4);
}
.vote-candidate-img.is-voted {
    border-color: var(--rg-gold-600);
    box-shadow: 0 0 0 4px rgba(212,175,55,0.3);
}

/* ปุ่มซูมรูป (แว่นขยาย) วางมุมล่างขวาของรูปผู้สมัคร กดแล้วเปิดรูปขนาดใหญ่ใน lightbox */
.vote-zoom-btn {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 2px solid var(--rg-gold-300);
    background: linear-gradient(135deg, var(--rg-maroon-900), var(--rg-maroon-950));
    color: var(--rg-gold-300);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(43,6,5,0.45);
    transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
    pointer-events: auto;
    z-index: 4;
}
.vote-zoom-btn:hover,
.vote-zoom-btn:focus-visible {
    background: linear-gradient(135deg, var(--rg-gold-500), var(--rg-gold-700));
    color: var(--rg-maroon-950);
    transform: scale(1.1);
}
.vote-zoom-btn svg {
    width: 16px;
    height: 16px;
}

.candidate-description {
    color: var(--rg-ink-soft);
    font-size: 0.8em;
    line-height: 1.4;
    text-align: center;
    margin-top: 0.2em;
    max-width: 9.5em;
}

/* Lightbox: แสดงรูปผู้สมัครขนาดใหญ่พร้อมชื่อและคำอธิบาย */
.vote-zoom-modal-backdrop {
    background: rgba(20,4,4,0.78);
    backdrop-filter: blur(2px);
}
.vote-zoom-modal {
    background: var(--rg-cream);
    border: 3px solid var(--rg-gold-400);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.vote-zoom-modal-img {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    background: #00000010;
}
.vote-zoom-modal-name {
    color: var(--rg-red-700);
    font-weight: 800;
}
.vote-zoom-modal-desc {
    color: var(--rg-ink-soft);
    font-size: 0.92em;
    line-height: 1.6;
    white-space: pre-line;
}
.vote-zoom-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6em;
    line-height: 1;
    color: var(--rg-ink-soft);
    cursor: pointer;
}
.vote-zoom-modal-close:hover {
    color: var(--rg-red-700);
}

.vote-badge {
    background: linear-gradient(135deg, var(--rg-gold-500), var(--rg-gold-700));
    color: var(--rg-maroon-950);
    box-shadow: 0 2px 6px rgba(43,6,5,0.35);
}

.candidate-name {
    color: var(--rg-red-700);
    font-weight: 700;
}
.candidate-name.is-voted {
    color: var(--rg-gold-600);
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.vote-candidate-count {
    color: var(--rg-ink-soft);
    font-size: 0.85em;
}
.vote-candidate-tag {
    color: var(--rg-gold-700);
    font-size: 0.78em;
    font-weight: 700;
}

.vote-selected-count {
    font-weight: 700;
    font-size: 1.15em;
    color: var(--rg-red-700);
    margin-bottom: 0.8em;
}

.vote-submit-btn,
.vote-btn {
    border: none;
    border-radius: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.vote-submit-btn {
    padding: 0.9em 2em;
    font-size: 1.1em;
    color: var(--rg-maroon-950);
    background: linear-gradient(90deg, var(--rg-gold-400) 0%, var(--rg-gold-600) 50%, var(--rg-gold-400) 100%);
    box-shadow: 0 6px 18px rgba(184,134,11,0.4);
}
.vote-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(184,134,11,0.55);
}
.vote-submit-btn:disabled {
    background: #d8cfc2;
    color: #8a8175;
    box-shadow: none;
    cursor: not-allowed;
}

.vote-modal-backdrop {
    background: rgba(43,6,5,0.55);
    backdrop-filter: blur(2px);
}
.vote-modal {
    background: linear-gradient(180deg, var(--rg-cream) 0%, #fff3d9 100%);
    border: 2px solid var(--rg-gold-500);
    box-shadow: 0 20px 50px rgba(43,6,5,0.5);
}
.vote-modal-title {
    font-family: 'Cinzel', 'Prompt', serif;
    color: var(--rg-red-700);
    letter-spacing: 1px;
}
.vote-modal-text {
    color: var(--rg-ink-soft);
}
.vote-modal-highlight {
    color: var(--rg-gold-700);
    font-weight: 700;
}
.vote-modal-warning {
    color: var(--rg-red-accent);
    font-weight: 600;
}

.vote-btn-primary {
    padding: 0.6em 1.6em;
    color: var(--rg-maroon-950);
    background: linear-gradient(90deg, var(--rg-gold-400), var(--rg-gold-600));
    box-shadow: 0 4px 12px rgba(184,134,11,0.4);
}
.vote-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(184,134,11,0.55);
}
.vote-btn-secondary {
    padding: 0.6em 1.6em;
    color: var(--rg-ink);
    background: #ece2d0;
    border: 1px solid var(--rg-gold-400);
}
.vote-btn-secondary:hover {
    background: #e0d3b8;
}

@media (max-width: 640px) {
    body.vote-page {
        padding: 0 12px;
        box-sizing: border-box;
    }
    .vote-title { font-size: 1.7em; letter-spacing: 1px; }
    .vote-title::after { width: 70px; }
    .vote-lead { font-size: 1em; }
    .vote-card {
        padding: 1.6em 1.1em !important;
        margin-top: 1.2em !important;
        margin-bottom: 1.2em !important;
        border-radius: 22px !important;
    }
    .vote-card::before { inset: 7px; border-radius: 16px; }
    .vote-rules { padding: 0.8em 0.9em; }
    .vote-rules-text { font-size: 0.76em; line-height: 1.55; }
    .vote-countdown { font-size: 0.88em; padding: 0.55em 0.8em; }
    .vote-option { padding: 6px; }
    .vote-candidate-img,
    img.candidate-img {
        width: 84px !important;
        height: 84px !important;
        border-width: 3px;
    }
    .candidate-name { font-size: 0.92em; }
    .vote-candidate-count { font-size: 0.78em; }
    .candidate-description { font-size: 0.75em; max-width: 8em; }
    .vote-zoom-btn { width: 26px; height: 26px; }
    .vote-zoom-btn svg { width: 14px; height: 14px; }
    .vote-modal { padding: 1.6em 1.1em !important; }
    .vote-modal-title { font-size: 1.1em; }
}

@media (max-width: 380px) {
    .vote-title { font-size: 1.4em; }
    .vote-candidate-img,
    img.candidate-img {
        width: 72px !important;
        height: 72px !important;
    }
    .vote-submit-btn { padding: 0.8em 1.4em !important; font-size: 1em; }
}
