/* Base Variables */
:root {
    --primary: #39ff14; /* Neon Green */
    --primary-hover: #32e612;
    --primary-dim: rgba(57, 255, 20, 0.15);
    --bg-dark: #0a0a0c;
    --bg-surface: #141418;
    --bg-surface-light: #1c1c22;
    --border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --error: #ef4444;
}

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

html, body {
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    line-height: 1.2;
    color: #ffffff;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-hover);
}

.hidden { display: none !important; }
.text-center { text-align: center; }
.text-white { color: #ffffff; }
.text-neon { color: var(--primary); text-shadow: 0 0 10px rgba(57, 255, 20, 0.4); }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.w-full { width: 100%; }
.mx-auto { margin-left: auto; margin-right: auto; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.flex-align-center { display: flex; align-items: center; gap: 0.5rem; }
.flex-center { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.flex-1 { flex: 1; }
.rounded-lg { border-radius: 12px; }
.bg-surface { background: var(--bg-surface-light); }

/* Utility additions */
.text-error { color: var(--error); }
.flex-column { display: flex; flex-direction: column; }
.block { display: block; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }

/* Container & Cards */
.container {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 24px;
    padding-bottom: 60px;
    position: relative;
    z-index: 2;
}

.container > section, .container > div {
    margin-left: auto;
    margin-right: auto;
}

.embedded-container {
    /* Top padding already handled in .container */
}

.card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.glass-card {
    background: rgba(20, 20, 24, 0.6);
    backdrop-filter: blur(16px);
}

.bg-darker {
    background: #0d0d10;
}

.border-neon {
    border-color: rgba(57, 255, 20, 0.3);
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.05);
}

.section-header h2 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
}

/* Grid Layouts */
.grid-2-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
}

.btn-primary {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover:not(:disabled) {
    border-color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.btn-secondary {
    background: rgba(57, 255, 20, 0.05);
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn-secondary:hover:not(:disabled) {
    background: rgba(57, 255, 20, 0.15);
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
}

.btn-large {
    padding: 1.2rem 2rem;
    font-size: 1.1rem;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.hide-mobile {
    display: inline-block;
}

.desktop-row {
    display: flex;
    flex-direction: column;
}

@media (min-width: 769px) {
    .desktop-row {
        flex-direction: row !important;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 600px !important;
    }
    .desktop-row > button {
        flex: 1;
        min-width: 200px;
    }
    .desktop-row > p {
        width: 100%;
        text-align: center;
    }
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"], 
input[type="email"] {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    width: 100%;
}

input[type="text"]:focus, 
input[type="email"]:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.15);
}

/* Category Cards */
.category-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.cat-card input[type="radio"] {
    display: none;
}

.cat-card span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.cat-card input[type="radio"]:checked + span {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.15);
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.25rem 0;
}

.checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 0.15rem;
    accent-color: var(--primary);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
}

/* File Upload Custom UI */
.file-upload-wrapper {
    position: relative;
    overflow: hidden;
}

#photo-upload {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.file-upload-ui {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.file-upload-wrapper:hover .file-upload-ui {
    border-color: var(--primary);
    background: rgba(57, 255, 20, 0.05);
}

.file-upload-ui svg {
    color: var(--primary);
}

/* Error states */
.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    text-align: center;
    font-weight: 500;
}

/* Prizes & Rules Lists */
.prize-list, .rules-list {
    list-style: none;
}

.prize-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.compact-prizes li {
    padding: 0.75rem 0;
}

.prize-list li:last-child { border-bottom: none; padding-bottom: 0; }
.prize-list li:first-child { padding-top: 0; }

.prize-rank {
    font-weight: 800;
    font-size: 1.05rem;
    min-width: 110px;
    text-transform: uppercase;
}

.prize-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.rules-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.rules-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-size: 1.2rem;
    line-height: 1;
}

/* Success UI */
.success-icon {
    width: 64px; height: 64px;
    background: var(--primary-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon svg { width: 32px; height: 32px; }

/* Countdown */
.countdown-timer { 
    display: flex;
    flex-wrap: wrap; 
    gap: 0.75rem; 
    justify-content: center;
}
.cd-box {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(57, 255, 20, 0.3);
    border-radius: 8px;
    padding: 10px 15px;
    display: flex;
    flex-direction: column;
    min-width: 65px;
}
.cd-box span {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
}
.cd-box small {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-top: 4px;
    font-weight: 600;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    justify-content: center;
}

@media (min-width: 860px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-item {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.1);
}

.highlighted-card {
    border: 2px solid var(--primary) !important;
    box-shadow: 0 0 25px rgba(57, 255, 20, 0.4) !important;
    transform: translateY(-4px);
}

.rank-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: var(--primary);
    color: #000;
    font-weight: 800;
    font-size: 0.9rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

.gallery-img-wrapper {
    position: relative;
    background: #050505;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    height: 260px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-info {
    padding: 1.2rem;
    text-align: left;
}

.gallery-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.meta-left {
    min-width: 0;
    flex: 1;
}

.gallery-author {
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
}

.gallery-cat {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    color: var(--text-muted);
    white-space: nowrap;
}

.vote-btn {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.vote-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #000;
    border-color: var(--primary);
}

.vote-btn:disabled {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    cursor: default;
    border-color: rgba(255, 255, 255, 0.05);
}

.vote-btn.voted {
    border-color: var(--primary);
    color: var(--primary);
}

.share-btn-card {
    padding: 0.75rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.share-btn-card:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: var(--primary);
}

/* Shared Setup Card (Compact highlight) */
.shared-setup-card {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    max-width: 600px;
    width: 92vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(57, 255, 20, 0.3);
    box-shadow: 0 0 40px rgba(57, 255, 20, 0.15);
    border-radius: 16px;
    background: var(--bg-surface);
    overflow: hidden;
}

.modal-body {
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.modal-close {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.1);
    color: #fff;
    font-size: 24px;
    width: 36px; height: 36px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 50;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover { 
    background: var(--primary); 
    color: #000; 
}

.modal-image-container {
    width: 100%;
    background: #050505;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.modal-img {
    width: 100%;
    max-height: 58vh;
    object-fit: contain;
    display: block;
}

/* Spinner */
.spinner {
    animation: rotate 2s linear infinite;
    width: 24px; height: 24px;
}
.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}
.spinner-green { color: var(--primary); width: 40px; height: 40px; margin-bottom: 1rem; }

@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Footer / Powered By */
#wbx-powered-by-slot {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

/* -----------------------------
   MOBILE RESPONSIVENESS
----------------------------- */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
    
    .container {
        padding: 12px;
        padding-bottom: 40px;
    }

    .card { padding: 1.25rem; }

    .grid-2-col {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .category-cards {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .file-upload-ui {
        padding: 1.5rem 1rem;
    }

    .prize-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .prize-rank { min-width: auto; }

    /* Gallery tweaks for mobile */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .gallery-img-wrapper {
        height: 210px;
    }

    .gallery-info {
        padding: 0.85rem;
    }

    .gallery-author {
        font-size: 0.95rem;
    }
    
    .vote-btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .share-btn-card {
        padding: 0.6rem !important;
    }

    /* Shared card mobile */
    .shared-setup-card {
        max-width: 340px;
        margin-bottom: 0.5rem;
    }
    
    .cd-box { padding: 8px 12px; min-width: 55px; }
    .cd-box span { font-size: 1.5rem; }

    /* Modal tweaks for mobile */
    .modal-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem;
    }
}