/* --- Winter Theme Global --- */
#Calendar {
    /* Icy Blue Gradient matching the fanart vibes */
    background: linear-gradient(180deg, #87CEEB 0%, #E0F7FA 50%, #B3E5FC 100%);
    min-height: 100vh;
    color: #023e8a;
    padding-bottom: 60px;
    font-family: 'Inter', sans-serif;
    position: relative;
    overflow-x: hidden;
}

/* --- Clean Header Section --- */
.calendar-header {
    text-align: center;
    padding: 30px 20px;
    position: relative;
    z-index: 5;
    /* Soft glass effect */
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(135, 206, 235, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.calendar-header h1 {
    font-family: 'Mountains of Christmas', cursive;
    font-size: clamp(3rem, 6vw, 4.5rem);
    margin: 0;
    color: #0077b6; /* Strong Blue */
    text-shadow: 2px 2px 0px #fff, 0 0 10px rgba(0, 119, 182, 0.2);
    line-height: 1.1;
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Info Tooltip */
.info-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.info-icon {
    font-size: 1.8rem;
    opacity: 0.8;
    transition: opacity 0.3s;
    display: inline-block;
    line-height: 1;
}

.info-tooltip:hover .info-icon {
    opacity: 1;
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 320px;
    background-color: rgba(2, 62, 138, 0.95);
    color: white;
    text-align: left;
    border-radius: 10px;
    padding: 15px;
    position: absolute;
    z-index: 1000;
    top: 50%;
    left: 120%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif !important;
    font-weight: 400;
    line-height: 1.6;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    text-shadow: none;
}

.tooltip-text::before {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -8px;
    border-width: 8px;
    border-style: solid;
    border-color: transparent rgba(2, 62, 138, 0.95) transparent transparent;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.calendar-subtitle {
    font-size: 1rem;
    color: #023e8a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 5px;
}

/* --- Countdown Box --- */
.reveal-info-container {
    margin: 15px 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    padding: 8px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.reveal-timer {
    font-size: 1.2rem;
    color: #0077b6;
    font-weight: 600;
}

.reveal-timer strong {
    color: #e63946;
    font-weight: 800;
}

.reveal-subtext {
    font-size: 0.8rem;
    color: #023e8a;
    opacity: 0.8;
    margin-top: 2px;
    font-style: italic;
}

/* --- Action Area with Buttons --- */
.calendar-action-area {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 20;
    gap: 8px;
}

/* Buttons Row - Both buttons side by side */
.action-buttons-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

/* --- Stamp Style Entry Button --- */

.btn-stamp-entry {
    background: #e63946; /* Festive Red */
    color: white;
    font-family: 'Mountains of Christmas', cursive;
    font-size: 1.15rem;
    font-weight: 700;
    padding: 10px 22px;
    border: 2.5px solid white;
    border-radius: 8px;
    box-shadow: 
        0 0 0 3px #c0392b,  /* Darker Red Outer Ring */
        0 4px 12px rgba(0,0,0,0.3);
    text-shadow: 1px 1px 0 rgba(0,0,0,0.2);
    letter-spacing: 1px;
    transform: rotate(-2deg);
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-stamp-entry:hover {
    transform: rotate(0deg) scale(1.03);
    background: #ff4d4d;
    box-shadow: 
        0 0 0 3px #c0392b,
        0 6px 16px rgba(0,0,0,0.35);
}

.btn-stamp-entry:active {
    transform: rotate(0deg) scale(0.98);
    box-shadow: 
        0 0 0 3px #c0392b,
        0 2px 6px rgba(0,0,0,0.3);
}

.btn-stamp-entry:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: rotate(-2deg);
}

/* --- Delta YouTube Button (Always Visible) --- */
.btn-delta-youtube {
    background: linear-gradient(135deg, #FF0000, #CC0000);
    color: white;
    text-decoration: none;
    padding: 8px 18px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Mountains of Christmas', cursive;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(255, 0, 0, 0.25);
    transition: all 0.3s;
    border: 2px solid white;
    transform: rotate(1deg);
}

.btn-delta-youtube:hover {
    transform: rotate(0deg) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.5);
    background: linear-gradient(135deg, #ff1a1a, #dd0000);
}

/* YouTube icon in button */
.btn-delta-youtube .youtube-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* LIVE indicator - only shown during stream time */
.btn-delta-youtube .live-indicator {
    font-size: 1rem;
    animation: blink 1.5s ease-in-out infinite;
}

/* When LIVE, add pulsing glow to entire button */
.btn-delta-youtube.is-live {
    animation: pulse-glow 2s ease-in-out infinite;
    box-shadow: 0 6px 25px rgba(255, 0, 0, 0.6);
}

.youtube-text {
    letter-spacing: 0.5px;
}

@keyframes pulse-glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.participant-text { 
    margin: 0;
    font-size: 0.85rem; 
    color: #023e8a; 
}
.participant-text strong { 
    color: #e63946; 
    font-size: 1rem; 
}

.entry-note { 
    font-size: 0.75rem; 
    color: #023e8a; 
    margin: 0;
    font-weight: 500; 
    opacity: 0.7; 
}

/* --- The Calendar Board --- */
.calendar-board-container {
    max-width: 600px;
    margin: 0 auto 50px;
    position: relative;
    padding: 10px;
    /* Frame effect */
    background: white;
    border-radius: 15px;
    box-shadow: 0 15px 40px rgba(0, 50, 100, 0.2);
}

.calendar-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* 4 cols to match portrait ratio roughly */
    grid-template-rows: repeat(6, 1fr);
    /* Aspect ratio of the provided image 718x1024 */
    aspect-ratio: 718 / 1024;
    position: relative;
    background-image: url('/static/images/winter_calender.png');
    background-size: 100% 100%; /* Stretch to fit */
    border-radius: 8px;
    overflow: hidden;
}

/* --- Doors --- */
.calendar-door {
    position: relative;
    width: 100%;
    height: 100%;
    cursor: pointer;
    perspective: 1000px;
    z-index: 10;
}

/* Door Front (The Image Slice) */
.door-front {
    position: absolute;
    inset: 0;
    /* Image set via JS to match bg position */
    background-image: url('/static/images/winter_calender.png'); 
    background-size: 400% 600%; /* 4 cols, 6 rows */
    
    /* The "Tiny Black Border" - actually a dashed cut line */
    border: 1px dashed rgba(0,0,0,0.3); 
    box-shadow: inset 0 0 2px rgba(255,255,255,0.3); 
    
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: left;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    z-index: 2;
}

.door-front:hover {
    border-color: rgba(255,255,255,0.9);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.5);
}

/* The Number */
.door-front span {
    font-family: 'Mountains of Christmas', cursive;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    font-weight: 700;
    pointer-events: none;
}

/* Day 24 Special Styling */
.calendar-door[data-day="24"] .door-front {
    border: 2px solid rgba(255, 215, 0, 0.8); /* Gold border */
}
.calendar-door[data-day="24"] .door-front span {
    color: #ffd700;
    font-size: 2.5rem;
    text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}

/* Opened State */
.calendar-door.open .door-front {
    transform: rotateY(-115deg);
    box-shadow: -5px 5px 15px rgba(0,0,0,0.3);
}

/* Door Back (The Prize Hole) */
.door-back {
    position: absolute;
    inset: 0.1rem;
    background: #fff;
    background: radial-gradient(circle, #fff 0%, #f0f8ff 100%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0.4rem;
    text-align: center;
    box-shadow: inset 0.2rem 0.2rem 0.8rem rgba(0,0,0,0.2);
    z-index: 1;
    overflow: hidden;
    gap: 0.5rem;
}

/* Header with image and title side by side */
.door-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 0.1rem solid rgba(0, 119, 182, 0.2);
}

.door-prize-img { 
    width: 2rem;
    height: 2rem;
    object-fit: contain; 
    filter: drop-shadow(0 0.2rem 0.2rem rgba(0,0,0,0.1));
    flex-shrink: 0;
}

.door-prize-title { 
    font-size: 0.7rem;
    font-weight: 700;
    color: #023e8a;
    line-height: 1.2;
    flex: 1;
    text-align: left;
}

/* Winners list */
.door-winners-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    overflow-y: auto;
}

.door-winner-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.3rem;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0.3rem;
    border: 0.1rem solid rgba(0, 119, 182, 0.2);
    position: relative;
}

.winner-username {
    font-size: 0.65rem;
    font-weight: 700;
    color: #0077b6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.2;
}

.winner-id {
    font-size: 0.5rem;
    color: #666;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    user-select: all;
    line-height: 1.2;
    transition: opacity 0.2s;
}

.winner-id:hover {
    color: #0077b6;
    text-decoration: underline;
}

.locked-msg { 
    font-size: 0.7rem;
    color: #ccc;
    font-weight: 700;
    text-transform: uppercase;
}

/* Admin Button */
.admin-door-btn { 
    position: absolute;
    top: 0.2rem;
    right: 0.2rem;
    font-size: 0.6rem;
    padding: 0.2rem 0.3rem;
    background: #333;
    color: white;
    border: none;
    cursor: pointer;
    z-index: 20;
    border-radius: 0.2rem;
    line-height: 1;
}

/* --- Sponsors Section --- */
.sponsors-section-final {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: center;
}

/* Column Styling */
.sponsor-col {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers title */
    flex: 1;
    min-width: 250px;
}

/* Column Header */
.sponsor-col h3 {
    font-family: 'Mountains of Christmas', cursive;
    color: #0077b6;
    font-size: 1.6rem;
    margin: 0 0 15px 0; /* Space below title */
    border-bottom: 2px solid rgba(255,255,255,0.5);
    padding-bottom: 5px;
    display: inline-flex; /* Flex for icon alignment */
    align-items: center;
    gap: 10px;
    width: fit-content;
}

/* Section icons next to headers */
.sponsor-col h3 .section-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* Container for items inside column */
.sponsor-content {
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers chips */
    gap: 15px;
    width: 100%;
}

/* Text List Style (For pure names) */
.sponsor-content.text-list {
    background: rgba(255, 255, 255, 0.6);
    padding: 15px 25px;
    border-radius: 12px;
    min-width: 200px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border: 1px solid rgba(255,255,255,0.8);
}

.sponsor-name-item {
    font-weight: 700;
    color: #023e8a;
    font-size: 1rem;
    padding: 6px 0;
    border-bottom: 1px solid rgba(0, 119, 182, 0.1);
}
.sponsor-name-item:last-child { border-bottom: none; }

/* Chip Style (For Links/Images) */
.sponsor-link-box {
    background: rgba(255,255,255,0.7);
    padding: 10px 20px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #023e8a;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.2s;
    min-width: 160px;
    border: 1px solid white;
}
.sponsor-link-box:hover { 
    transform: translateY(-2px); 
    background: white; 
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}
.sponsor-link-box img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }

/* Small chips for Discord row */
.sponsor-link-box.small {
    padding: 8px 15px;
    min-width: 120px;
    font-size: 0.9rem;
}

.discord-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    width: 100%;
}

/* --- Snow Animation --- */
.snowflakes { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: hidden; }
.snowflake { color: #fff; font-size: 1.5em; opacity: 0.9; position: fixed; top: -10%; z-index: 9999; text-shadow: 0 0 5px rgba(255,255,255,0.8); animation: snowflakes-fall 10s linear infinite, snowflakes-shake 3s ease-in-out infinite; }
@keyframes snowflakes-fall { 0% { top: -10%; } 100% { top: 100%; } }
@keyframes snowflakes-shake { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(80px); } }
.snowflake:nth-of-type(0){left:1%;animation-delay:0s,0s}.snowflake:nth-of-type(1){left:10%;animation-delay:1s,1s}.snowflake:nth-of-type(2){left:20%;animation-delay:6s,.5s}.snowflake:nth-of-type(3){left:30%;animation-delay:4s,2s}.snowflake:nth-of-type(4){left:40%;animation-delay:2s,2s}.snowflake:nth-of-type(5){left:50%;animation-delay:8s,3s}.snowflake:nth-of-type(6){left:60%;animation-delay:6s,2s}.snowflake:nth-of-type(7){left:70%;animation-delay:2.5s,1s}.snowflake:nth-of-type(8){left:80%;animation-delay:1s,0s}.snowflake:nth-of-type(9){left:90%;animation-delay:3s,1.5s}.snowflake:nth-of-type(10){left:25%;animation-delay:4s,2.5s}.snowflake:nth-of-type(11){left:65%;animation-delay:2.5s,1.2s}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .sponsors-section-final { grid-template-columns: 1fr; gap: 30px; }
    .calendar-header h1 { font-size: 2.5rem; flex-direction: column; gap: 5px; }
    .calendar-action-area { gap: 6px; }
    
    /* Mobile tooltip - show below instead of to the side */
    .tooltip-text {
        width: 280px;
        top: 120%;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .tooltip-text::before {
        top: -16px;
        right: 50%;
        margin-right: -8px;
        border-color: transparent transparent rgba(2, 62, 138, 0.95) transparent;
    }
    .btn-stamp-entry { padding: 8px 18px; font-size: 1rem; letter-spacing: 0.8px; }
    .btn-delta-youtube { padding: 7px 14px; font-size: 0.9rem; }
    .btn-delta-youtube .youtube-icon { width: 20px; height: 20px; }
    .action-buttons-row { gap: 8px; }
    .participant-text { font-size: 0.8rem; }
    .entry-note { font-size: 0.7rem; }
    .sponsor-col { width: 100%; min-width: 0; }
    .sponsor-col h3 .section-icon { width: 28px; height: 28px; }
    .discord-row { flex-direction: row; justify-content: center; } /* Side by side on mobile for space */
}

/* --- Christmas Nav Button Animation --- */
.tab button.tablinks.calendar-nav-btn {
    background: linear-gradient(270deg, #c0392b, #27ae60, #c0392b, #27ae60);
    background-size: 300% 300%;
    animation: christmas-gradient 6s ease infinite;
    border: 1px solid rgba(255,255,255,0.2);
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tab button.tablinks.calendar-nav-btn i {
    color: #ffd700; /* Gold Icon */ 
}

@keyframes christmas-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}