/* Temporary Christmas theme. Loaded by header.php inside its date window (or with ?theme=christmas). */

:root {
    --xm-red: #ef4444;
    --xm-green: #22c55e;
    --xm-gold: #fbbf24;
    --xm-night: #0c1220;
}

/* Header: cold winter-night tint */
.main-header,
.main-header-sub {
    position: relative;
    overflow: hidden;
    background-image:
        linear-gradient(180deg, rgba(10, 25, 60, 0.55) 0%, rgba(30, 50, 90, 0.3) 60%, rgba(12, 18, 32, 0.85) 100%),
        url('../images/header-bg.webp');
}

/* Snow: two tiled layers, small flakes slow and large flakes faster */
.main-header::before,
.main-header-sub::before {
    content: "";
    position: absolute;
    inset: -20px -40px 0;
    pointer-events: none;
    z-index: 2;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 300' fill='%23fff'%3E%3Ccircle cx='20' cy='30' r='3'/%3E%3Ccircle cx='140' cy='80' r='2.5'/%3E%3Ccircle cx='250' cy='20' r='3.5'/%3E%3Ccircle cx='80' cy='160' r='3'/%3E%3Ccircle cx='200' cy='200' r='2.5'/%3E%3Ccircle cx='280' cy='130' r='3'/%3E%3Ccircle cx='40' cy='260' r='3.5'/%3E%3Ccircle cx='170' cy='280' r='2'/%3E%3C/svg%3E"),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200' fill='%23fff' fill-opacity='.6'%3E%3Ccircle cx='30' cy='20' r='1.5'/%3E%3Ccircle cx='110' cy='60' r='1.2'/%3E%3Ccircle cx='170' cy='110' r='1.5'/%3E%3Ccircle cx='60' cy='130' r='1.2'/%3E%3Ccircle cx='140' cy='180' r='1.5'/%3E%3Ccircle cx='10' cy='190' r='1'/%3E%3C/svg%3E");
    background-size: 300px 300px, 200px 200px;
    animation: xm-snow 14s linear infinite, xm-drift 6s ease-in-out infinite alternate;
}
@keyframes xm-snow {
    from { background-position: 0 0, 0 0; }
    to   { background-position: 0 600px, 0 400px; }
}
@keyframes xm-drift { from { translate: -20px 0; } to { translate: 20px 0; } }

.header-title .title-site {
    color: var(--xm-red);
    text-shadow: 0 0 18px rgba(239, 68, 68, 0.5), 2px 2px 3px rgba(0, 0, 0, 0.6);
}
.header-title .title-site::after { content: " 🎄"; font-size: .8em; }

/* Nav + buttons */
.main-links a:hover, .main-links a.active { color: #fca5a5; }
.main-header-container.sticky {
    background: rgba(10, 16, 32, 0.85);
    border-bottom-color: rgba(239, 68, 68, 0.35);
}
.gh-login {
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    box-shadow: 0 4px 18px rgba(239, 68, 68, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Content: winter-night page, string of twinkling lights along the top of the raised panel */
.main-section { background-color: var(--xm-night); }
.main-section a:hover { color: var(--xm-green); }
.main-section > .container,
.main-section > .player-profile-container,
.main-section > .game-detail-container {
    z-index: 3;
    border-color: rgba(255, 255, 255, 0.12);
}
.main-section > .container::before,
.main-section > .player-profile-container::before,
.main-section > .game-detail-container::before,
.main-section > .container::after,
.main-section > .player-profile-container::after,
.main-section > .game-detail-container::after {
    content: "";
    position: absolute;
    top: -6px; left: 18px; right: 18px;
    height: 26px;
    pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 26'%3E%3Cpath d='M0 4Q20 14 40 4T80 4T120 4T160 4' fill='none' stroke='%23334155' stroke-width='1.5'/%3E%3Cg%3E%3Crect x='18' y='7' width='4' height='4' fill='%23475569'/%3E%3Cellipse cx='20' cy='16' rx='4' ry='6' fill='%23ef4444'/%3E%3Crect x='58' y='7' width='4' height='4' fill='%23475569'/%3E%3Cellipse cx='60' cy='16' rx='4' ry='6' fill='%2322c55e'/%3E%3Crect x='98' y='7' width='4' height='4' fill='%23475569'/%3E%3Cellipse cx='100' cy='16' rx='4' ry='6' fill='%23fbbf24'/%3E%3Crect x='138' y='7' width='4' height='4' fill='%23475569'/%3E%3Cellipse cx='140' cy='16' rx='4' ry='6' fill='%233b82f6'/%3E%3C/g%3E%3C/svg%3E") repeat-x 0 0 / 160px 26px;
    filter: drop-shadow(0 0 4px rgba(255, 220, 150, 0.6));
}
/* second copy offset by two bulbs, so alternating bulbs twinkle out of step */
.main-section > .container::after,
.main-section > .player-profile-container::after,
.main-section > .game-detail-container::after {
    background-position: 80px 0;
    filter: drop-shadow(0 0 6px rgba(255, 220, 150, 0.8));
    animation: xm-twinkle 1.6s ease-in-out infinite alternate;
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 40px, transparent 40px 80px);
    mask: repeating-linear-gradient(90deg, #000 0 40px, transparent 40px 80px);
}
@keyframes xm-twinkle { from { opacity: 0; } to { opacity: 1; } }

.footer { border-top: 2px solid rgba(34, 197, 94, 0.5); }

@media (prefers-reduced-motion: reduce) {
    .main-header::before, .main-header-sub::before,
    .main-section > .container::after,
    .main-section > .player-profile-container::after,
    .main-section > .game-detail-container::after { animation: none; }
}
