/* --- RESET & BASE VARIABLES --- */
:root {
    /* Snow defaults (Overridden by JS Config) */
    --snow-bg: #0b5345;
    --snow-speed-1: 10s;
    --snow-speed-2: 15s;
    --snow-speed-3: 20s;
    --snow-size-1: 400px;
    --snow-size-2: 600px;
    --snow-size-3: 800px;

    /* Colors */
    --color-card-bg: #ffffff;
    --color-border: #eab308; /* yellow-500 */
    --color-text-main: #374151;
    --color-text-red: #dc2626;
    --color-btn-blue: #2563eb;
    --color-btn-blue-hover: #1d4ed8;
    --color-btn-gray: #374151;
    --spotify-green: #1DB954;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    /* SAFE FONT STACK: 
       Uses the native OS font. Works in Discord Activity without external requests.
    */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    background-color: var(--snow-bg);
    color: var(--color-text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
    transition: background-color 0.5s;
}

/* --- PARALLAX BLIZZARD SNOW EFFECT --- */
.snow-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 0; overflow: hidden;
}

.snow {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        radial-gradient(4px 4px at 20% 30%, white, transparent),
        radial-gradient(4px 4px at 40% 70%, white, transparent),
        radial-gradient(4px 4px at 60% 40%, white, transparent);
    background-repeat: repeat;
    animation: snowfall linear infinite;
}

.snow.layer1 { opacity: 0.6; background-size: var(--snow-size-1); animation-duration: var(--snow-speed-1); }
.snow.layer2 { opacity: 0.8; background-size: var(--snow-size-2); animation-duration: var(--snow-speed-2); }
.snow.layer3 { opacity: 1.0; background-size: var(--snow-size-3); animation-duration: var(--snow-speed-3); }

@keyframes snowfall {
    from { transform: translateY(-500px); }
    to { transform: translateY(0); }
}

/* --- GAME CONTAINER --- */
#game-container {
    width: 100%; max-width: 500px;
    background-color: var(--color-card-bg);
    padding: 1.5rem; border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border: 4px solid var(--color-border);
    position: relative; z-index: 10;
}

/* --- HEADER & TEXT --- */
.header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
h1 { font-size: 1.8rem; font-weight: 700; color: var(--color-text-red); }
.date-text { font-size: 0.875rem; font-weight: 700; color: #6b7280; }
.subtitle { text-align: center; font-size: 0.875rem; color: #374151; margin-bottom: 1rem; }
.font-bold { font-weight: 700; }

/* --- STATUS BAR --- */
#status-message {
    text-align: center; font-size: 1.25rem; font-weight: 600;
    margin-bottom: 1.5rem; padding: 0.75rem; border-radius: 0.5rem;
    transition: background-color 0.3s, color 0.3s;
}
.status-playing { background-color: #fef9c3; color: #854d0e; }
.status-won { background-color: #bbf7d0; color: #166534; }
.status-lost { background-color: #fecaca; color: #991b1b; }

/* --- GRID & BOXES --- */
.game-grid {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem; margin-bottom: 2rem;
}

.box {
    width: 100%; padding-top: 100%;
    background-color: transparent; border: none;
    cursor: pointer; position: relative; border-radius: 0.75rem;
    transition: transform 0.1s, filter 0.1s;
}

.box:not(.revealed):hover {
    transform: translateY(-4px) scale(1.05);
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.box.revealed { cursor: default; transform: none; filter: none; }
.game-content {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; justify-content: center; align-items: center;
    font-size: 3rem; line-height: 1;
}

.santa-found { animation: bounceIn 0.5s ease; }
@keyframes bounceIn {
    0% { opacity: 0; transform: scale(0.5); }
    60% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

/* --- SPOTIFY SECTION --- */
.spotify-wrapper {
    background-color: #064e3b; /* Dark Green */
    border: 2px solid var(--color-border);
    border-radius: 0.75rem; padding: 1rem; color: white;
    margin-bottom: 1.5rem; position: relative;
}

.spotify-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 8px;
}
.spotify-header h3 { font-size: 1rem; color: #fef3c7; margin: 0; }

.player-flex { display: flex; gap: 12px; align-items: center; margin-bottom: 15px; }
.album-art { width: 64px; height: 64px; border-radius: 6px; background: #333; object-fit: cover; }
.track-info { flex: 1; min-width: 0; }
.track-title { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.track-artist { font-size: 0.85rem; color: #d1d5db; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.controls-row { display: flex; gap: 8px; }
.sp-btn {
    border: none; border-radius: 6px; cursor: pointer;
    font-size: 0.85rem; font-weight: 600; padding: 10px;
    transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
}
.btn-skip { background-color: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }
.btn-skip:hover:not(:disabled) { background-color: rgba(255,255,255,0.25); }
.btn-skip:disabled { opacity: 0.6; cursor: not-allowed; background: #333; }

/* Search Dropdown */
.search-container { position: relative; margin-top: 12px; }
.search-input {
    width: 100%; padding: 10px; border-radius: 6px; border: none;
    background: rgba(255,255,255,0.9); font-family: inherit;
}
.search-input:disabled { background: #ddd; cursor: not-allowed; }

.search-results {
    position: absolute; bottom: 100%; left: 0; width: 100%;
    background: #1f2937; border-radius: 6px; overflow: hidden;
    box-shadow: 0 -5px 20px rgba(0,0,0,0.5); z-index: 50;
    max-height: 200px; overflow-y: auto; display: none; margin-bottom: 5px;
}
.search-results.active { display: block; }

.result-item {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-bottom: 1px solid #374151; cursor: pointer; transition: 0.2s;
}
.result-item:hover { background: #374151; }
.result-item img { width: 40px; height: 40px; border-radius: 4px; }
.result-info h4 { font-size: 0.9rem; color: white; margin: 0; }
.result-info p { font-size: 0.75rem; color: #9ca3af; margin: 0; }


/* --- FOOTER & MODALS --- */
.footer-area { margin-top: 1rem; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; }
.btn {
    padding: 0.75rem 1.5rem; font-weight: 700; font-size: 1.125rem;
    color: white; background-color: var(--color-btn-blue);
    border: none; border-radius: 9999px; cursor: pointer;
    transition: transform 0.15s;
}
.btn:hover { background-color: var(--color-btn-blue-hover); transform: scale(1.05); }
.hidden { display: none !important; }
.btn-gray { background-color: var(--color-btn-gray); }

.reset-btn {
    margin-top: 20px; font-size: 0.75rem; color: #dc2626; 
    background: none; border: 1px solid #dc2626; 
    padding: 6px 12px; border-radius: 4px; cursor: pointer; opacity: 0.7;
}

/* Modal */
#game-modal {
    position: fixed; inset: 0; z-index: 100;
    background-color: rgba(17, 24, 39, 0.9); display: none; 
    justify-content: center; align-items: center;
}
.modal-content {
    background-color: white; padding: 2rem; border-radius: 1rem;
    text-align: center; max-width: 34rem; width: 90%; border: 4px solid var(--color-text-red);
}

/* Toast */
#toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(100px);
    background-color: #1f2937; color: white; padding: 12px 24px; 
    border-radius: 50px; font-weight: 600; z-index: 200; 
    opacity: 0; transition: transform 0.3s, opacity 0.3s;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }