/* ===== CSS VARIABLES ===== */
:root {
    --red: #C41E3A;
    --dark-red: #8B0000;
    --green: #165B33;
    --dark-green: #0d3b22;
    --gold: #FFD700;
    --gold-dark: #B8860B;
    --white: #FFF8E7;
    --dark-wood: #1a0e06;
    --wood: #2c1810;
    --light-wood: #3d2314;
    --text-light: rgba(255, 248, 231, 0.9);
    --text-muted: rgba(255, 248, 231, 0.6);
    --shadow-gold: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Lato', 'Helvetica Neue', sans-serif;
    background: url('/images/bg-wood.png') center center / cover fixed,
                radial-gradient(ellipse at top, #2c1810 0%, #0d0804 60%, #000 100%);
    min-height: 100vh;
    color: var(--white);
    overflow-x: hidden;
    position: relative;
}

/* ===== FAIRY LIGHTS ===== */
.fairy-lights {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 1000;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    overflow: hidden;
}

.light-bulb {
    width: 10px;
    height: 14px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    flex-shrink: 0;
    animation: glow 2s ease-in-out infinite alternate;
}

.light-wire {
    width: 20px;
    height: 1px;
    background: rgba(255,255,255,0.3);
    align-self: flex-start;
    margin-top: 15px;
}

@keyframes glow {
    from { opacity: 0.6; box-shadow: 0 0 6px 2px currentColor; }
    to { opacity: 1; box-shadow: 0 0 14px 6px currentColor; }
}

/* ===== SNOW ===== */
.snow-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    color: white;
    font-size: 1rem;
    opacity: 0;
    animation: fall linear infinite;
    user-select: none;
}

@keyframes fall {
    0% { transform: translateY(-20px) rotate(0deg); opacity: 0.8; }
    100% { transform: translateY(100vh) rotate(360deg); opacity: 0; }
}

/* ===== HEADER ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 5, 2, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    padding: 0.75rem 0;
    margin-top: 55px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-emoji { font-size: 2rem; }

.logo-text {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.8rem;
    color: var(--gold);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    position: relative;
    z-index: 2;
    min-height: calc(100vh - 160px);
    padding-bottom: 3rem;
}

/* ===== FLASH MESSAGES ===== */
.flash {
    max-width: 1000px;
    margin: 1.5rem auto 0;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    animation: slideDown 0.3s ease;
}

.flash--success {
    background: rgba(22, 91, 51, 0.8);
    border: 2px solid #4CAF50;
    color: #90EE90;
}

.flash--error {
    background: rgba(139, 0, 0, 0.8);
    border: 2px solid var(--red);
    color: #FFB0B0;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.container--narrow {
    max-width: 650px;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 0 1.5rem 2rem;
    position: relative;
}

.hero-banner {
    width: 100%;
    max-height: 420px;
    object-fit: cover;
    object-position: center 40%;
    display: block;
    border-bottom: 3px solid rgba(255, 215, 0, 0.4);
    margin-bottom: 2rem;
}

.hero__content {
    padding-top: 1.5rem;
}

.hero__title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--gold);
    text-shadow:
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.3),
        2px 2px 0 var(--dark-red);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero__subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ===== CARDS ===== */
.card {
    background: rgba(20, 10, 5, 0.85);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.card--festive {
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), var(--shadow-gold);
}

.card--participants {
    border: 2px solid rgba(22, 91, 51, 0.6);
}

.card__header {
    background: linear-gradient(135deg, var(--dark-red) 0%, #5a0010 50%, var(--dark-green) 100%);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
}

.card__icon { font-size: 2rem; }

.card__header h1, .card__header h2 {
    font-family: 'Mountains of Christmas', cursive;
    color: var(--gold);
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.card__header h1 { font-size: 2rem; }

.card__subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.card__body {
    padding: 2rem;
}

/* ===== FORMS ===== */
.form__group {
    margin-bottom: 1.5rem;
}

.form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 600px) {
    .form__row { grid-template-columns: 1fr; }
}

.form__label {
    display: block;
    color: var(--gold);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.label-hint {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.form__input, .form__textarea, .form__select {
    width: 100%;
    padding: 0.85rem 1rem;
    background: rgba(255, 248, 231, 0.07);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    color: var(--white);
    font-size: 1rem;
    font-family: 'Lato', sans-serif;
    transition: border-color 0.2s, background 0.2s;
}

.form__input:focus, .form__textarea:focus, .form__select:focus {
    outline: none;
    border-color: var(--gold);
    background: rgba(255, 248, 231, 0.12);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form__select option { background: var(--dark-wood); color: var(--white); }

.form__textarea { resize: vertical; min-height: 120px; }

.form__hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.6rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Lato', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.25s;
    text-decoration: none;
}

.btn--primary {
    background: linear-gradient(135deg, var(--red), var(--dark-red));
    color: var(--white);
    border: 2px solid rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.4);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(196, 30, 58, 0.6);
    border-color: var(--gold);
}

.btn--secondary {
    background: linear-gradient(135deg, var(--green), var(--dark-green));
    color: var(--white);
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.btn--secondary:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}

.btn--danger {
    background: linear-gradient(135deg, #8B0000, #5a0000);
    color: var(--white);
    border: 2px solid rgba(255, 100, 100, 0.4);
}

.btn--danger:hover {
    transform: translateY(-2px);
    border-color: #ff6666;
}

.btn--large {
    padding: 1rem 2.5rem;
    font-size: 1.15rem;
}

/* ===== HOW IT WORKS ===== */
.section-title {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2.2rem;
    color: var(--gold);
    text-align: center;
    margin: 2.5rem 0 2rem;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.step {
    background: rgba(20, 10, 5, 0.7);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
    position: relative;
}

.step:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 215, 0, 0.5);
}

.step__number {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: var(--gold);
    color: var(--dark-wood);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
}

.step__icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.step h3 { color: var(--gold); font-size: 1.1rem; margin-bottom: 0.5rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; line-height: 1.5; }

/* ===== GAMES PREVIEW ===== */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.game-card {
    background: linear-gradient(135deg, rgba(22, 91, 51, 0.5) 0%, rgba(10, 30, 15, 0.8) 100%);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all 0.3s;
    cursor: default;
}

.game-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: var(--gold);
    box-shadow: var(--shadow-gold);
}

.game-card__icon { font-size: 3.5rem; margin-bottom: 1rem; }
.game-card h3 { color: var(--gold); font-family: 'Mountains of Christmas', cursive; font-size: 1.3rem; margin-bottom: 0.5rem; }
.game-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== ADMIN PAGE ===== */
.admin-status { margin-bottom: 1.5rem; }

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
}

.status-badge--open { background: rgba(22, 91, 51, 0.5); border: 1px solid #4CAF50; color: #90EE90; }
.status-badge--closed { background: rgba(255, 165, 0, 0.2); border: 1px solid #FFA500; color: #FFD700; }
.status-badge--done { background: rgba(22, 91, 51, 0.5); border: 1px solid #4CAF50; color: #90EE90; }

.admin-link-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.admin-link-box h3 { color: var(--gold); margin-bottom: 1rem; font-size: 1.1rem; }

.link-copy-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-copy-group .form__input { flex: 1; }

.bookmarks-warning {
    background: rgba(255, 165, 0, 0.1);
    border: 1px solid rgba(255, 165, 0, 0.4);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: rgba(255, 220, 100, 0.9);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.close-group-section {
    background: rgba(139, 0, 0, 0.15);
    border: 1px solid rgba(196, 30, 58, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
}

.close-group-section h3 { color: var(--red); margin-bottom: 0.75rem; }
.close-group-section p { color: var(--text-muted); margin-bottom: 1rem; font-size: 0.95rem; }
.warning-text { color: #FFB0B0; }

/* ===== PARTICIPANTS TABLE ===== */
.participants-table {
    width: 100%;
    border-collapse: collapse;
}

.participants-table th {
    color: var(--gold);
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.participants-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    color: var(--text-light);
    font-size: 0.95rem;
}

.participants-table tr:hover td { background: rgba(255, 215, 0, 0.05); }

.family-tag {
    display: inline-block;
    background: rgba(22, 91, 51, 0.5);
    border: 1px solid rgba(22, 91, 51, 0.8);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #90EE90;
}

.drawn-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.drawn-badge--done { background: rgba(22,91,51,0.4); color: #90EE90; }
.drawn-badge--pending { background: rgba(255,165,0,0.2); color: #FFD700; }

.families-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.family-chip {
    background: linear-gradient(135deg, var(--dark-green), #0a2010);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 0.4rem 1rem;
    color: var(--white);
    font-size: 0.95rem;
}

/* ===== REGISTRATION PAGE ===== */
.participants-preview {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.participants-preview h3 { color: var(--gold); margin-bottom: 1rem; }

.participants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.participant-badge {
    background: rgba(22, 91, 51, 0.4);
    border: 1px solid rgba(22, 91, 51, 0.6);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--text-light);
}

.participant-badge small { color: var(--text-muted); font-size: 0.8rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 1.1rem;
}

/* ===== TEXT CENTER ===== */
.text-center { text-align: center; }
.big-emoji { font-size: 5rem; margin: 1rem 0; display: block; text-align: center; }

/* ===== FOOTER ===== */
.site-footer {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    font-size: 0.95rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero__title { font-size: 3rem; }
    .card__body { padding: 1.25rem; }
    .card__header { padding: 1.25rem; }
    .container { padding: 1rem; }
    .btn--large { padding: 0.85rem 1.75rem; font-size: 1rem; }
    .link-copy-group { flex-direction: column; }
}
