:root {
    --bg-black: #060607;
    --bg-black-soft: #0c0d0e;
    --panel-bg: rgba(24, 25, 26, 0.55);
    --panel-bg-solid: #16171a;
    --panel-border: rgba(255, 255, 255, 0.1);
    --bens-gold: #d4af37;
    --bens-gold-bright: #f0cc5f;
    --text-light: #f4f3ee;
    --text-muted: #9a9a97;
    --card-radius: 18px;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    --font-display: 'Oswald', 'Arial Narrow', sans-serif;
    --font-body: 'Barlow', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    background-color: var(--bg-black);
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--text-light);
    background-color: var(--bg-black);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Hero background for the voting/landing pages (background-image set inline, base path varies by environment) */
body.hero-page {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

/* Lightning flash overlay, hero pages only. Two layers with different
   timing so the flashes don't land in an obviously repeating pattern. */
.lightning-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: #eef3ff;
    mix-blend-mode: overlay;
    opacity: 0;
    pointer-events: none;
}

.lightning-overlay-1 {
    animation: lightning-flash-a 9s infinite;
}

.lightning-overlay-2 {
    animation: lightning-flash-b 13s infinite;
    animation-delay: 2.5s;
}

@keyframes lightning-flash-a {
    0%, 92%, 100% { opacity: 0; }
    93% { opacity: 0.55; }
    93.6% { opacity: 0.05; }
    94.2% { opacity: 0.4; }
    95% { opacity: 0; }
}

@keyframes lightning-flash-b {
    0%, 95%, 100% { opacity: 0; }
    96% { opacity: 0.4; }
    96.8% { opacity: 0; }
    97.3% { opacity: 0.25; }
    98% { opacity: 0; }
}

.lightning-overlay-3 {
    animation: lightning-flash-c 16s infinite;
    animation-delay: 5s;
}

@keyframes lightning-flash-c {
    0%, 93.5%, 100% { opacity: 0; }
    94% { opacity: 0.5; }
    94.5% { opacity: 0.08; }
    95% { opacity: 0.35; }
    95.7% { opacity: 0; }
}

/* Lightning bolt strikes, paired with the flash overlays above */
.lightning-bolt {
    position: fixed;
    top: -2%;
    width: clamp(46px, 9vw, 90px);
    z-index: 1;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 0 10px rgba(220, 230, 255, 0.85)) drop-shadow(0 0 26px rgba(160, 190, 255, 0.5));
}

.lightning-bolt svg {
    width: 100%;
    height: 100%;
    display: block;
}

.lightning-bolt-1 {
    left: 14%;
    height: 42vh;
    animation: bolt-flash-a 9s infinite;
}

.lightning-bolt-2 {
    left: 55%;
    height: 38vh;
    transform: scaleX(-1);
    animation: bolt-flash-b 13s infinite;
    animation-delay: 2.5s;
}

.lightning-bolt-3 {
    left: 82%;
    height: 46vh;
    animation: bolt-flash-c 16s infinite;
    animation-delay: 5s;
}

@keyframes bolt-flash-a {
    0%, 92%, 100% { opacity: 0; }
    92.4% { opacity: 1; }
    92.8% { opacity: 0.15; }
    93.2% { opacity: 0.9; }
    94% { opacity: 0; }
}

@keyframes bolt-flash-b {
    0%, 95.6%, 100% { opacity: 0; }
    96% { opacity: 1; }
    96.4% { opacity: 0.1; }
    96.9% { opacity: 0.75; }
    97.6% { opacity: 0; }
}

@keyframes bolt-flash-c {
    0%, 93.7%, 100% { opacity: 0; }
    94.1% { opacity: 1; }
    94.5% { opacity: 0.1; }
    94.9% { opacity: 0.8; }
    95.6% { opacity: 0; }
}

@media (max-width: 480px) {
    .lightning-bolt-3 {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightning-overlay,
    .lightning-bolt {
        display: none;
    }
}

body.coach-page {
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.07), transparent 55%),
        linear-gradient(180deg, var(--bg-black-soft), var(--bg-black));
}

.vote-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.vote-card {
    background: var(--panel-bg);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--panel-border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(212, 175, 55, 0.06);
    padding: 36px 28px;
    max-width: 440px;
    width: 100%;
    text-align: center;
}

.club-logo {
    max-width: 128px;
    width: 100%;
    height: auto;
    margin-bottom: 16px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}

.club-logo-small {
    max-width: 84px;
    width: 100%;
    height: auto;
    margin-bottom: 10px;
    filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.6));
}

.group-name {
    margin: 0 0 4px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-light);
}

.vote-subtitle,
.coach-subtitle {
    margin: 0 0 10px;
    color: var(--bens-gold);
    font-size: 0.8rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
}

.vote-deadline {
    margin: 0 0 28px;
    color: var(--text-muted);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.vote-deadline i {
    color: var(--bens-gold);
    margin-right: 4px;
}

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

.form-group label {
    display: block;
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    margin-bottom: 7px;
    color: var(--text-muted);
}

.form-group label i {
    color: var(--bens-gold);
    width: 18px;
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 12px 14px;
    font-size: 1rem;
    color: var(--text-light);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    min-height: 48px;
    font-family: inherit;
}

.form-group select option {
    background: var(--panel-bg-solid);
    color: var(--text-light);
}

.form-group input[type="text"]::placeholder {
    color: var(--text-muted);
}

.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--bens-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.form-error {
    color: #ff8a80;
    font-size: 0.9rem;
    margin: -6px 0 14px;
    display: none;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #16130a;
    background: linear-gradient(135deg, var(--bens-gold-bright), var(--bens-gold));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    min-height: 48px;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.25);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.35);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: default;
    transform: none;
}

.thank-you {
    padding: 24px 0;
}

.thank-you i {
    font-size: 3rem;
    color: var(--bens-gold);
    margin-bottom: 12px;
}

.thank-you h2 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-light);
}

.thank-you p {
    color: var(--text-muted);
    margin: 0;
}

.notice-card {
    margin: auto;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.notice-card i {
    font-size: 2.5rem;
    margin-bottom: 12px;
    color: var(--bens-gold);
}

/* Coach results page */
.coach-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 36px 16px 16px;
    flex: 1;
    width: 100%;
}

.coach-header {
    text-align: center;
    margin-bottom: 28px;
}

.coach-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.coach-meta i {
    color: var(--bens-gold);
}

.category-card {
    background: var(--panel-bg);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--panel-border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow);
    padding: 22px;
    margin-bottom: 18px;
}

.category-card h2 {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
}

.category-card h2 i {
    color: var(--bens-gold);
    margin-right: 8px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.bar-label {
    flex: 0 0 120px;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-light);
}

.leader-icon {
    color: var(--bens-gold);
}

.bar-track {
    flex: 1;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a6d1f, var(--bens-gold-bright));
    border-radius: 999px;
    transition: width 0.4s ease;
}

.bar-count {
    flex: 0 0 28px;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--bens-gold);
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 20px 16px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.developed-by-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.developed-by-link {
    display: inline-block;
}

.craftyco-logo {
    height: 34px;
    width: auto;
    vertical-align: middle;
    opacity: 0.95;
}

/* Landing page */
.landing-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}

.landing-card {
    background: var(--panel-bg);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--panel-border);
    border-radius: var(--card-radius);
    box-shadow: var(--shadow), 0 0 0 1px rgba(212, 175, 55, 0.06);
    padding: 36px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
}

.landing-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0;
    text-align: left;
}

.landing-list li {
    margin-bottom: 10px;
}

.landing-list a {
    display: block;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-light);
    text-decoration: none;
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 0.95rem;
    min-height: 44px;
    transition: background 0.12s ease, border-color 0.12s ease;
}

.landing-list a:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.landing-list a i {
    color: var(--bens-gold);
    margin-right: 8px;
}

@media (max-width: 420px) {
    .bar-label {
        flex-basis: 90px;
        font-size: 0.82rem;
    }
}
