/* --- 1. GLOBAL BASE STYLING & ENCODED STAR CURSOR MATRIX --- */
html, body {
    /* Percent-encoded SVG data string to prevent string truncation inside web viewports */
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Ctext y='18' font-size='18'%3E⭐%3C/text%3E%3C/svg%3E"), auto;
    scroll-behavior: smooth;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body {
    margin: 0; padding: 20px;
    font-family: 'Courier New', monospace;
    color: #2b2d42;
}

#bgCanvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1; background-color: #ffffff;
}

/* --- 2. DYNAMIC LIGHT/DARK THEME CONFIGURATIONS --- */
body.dark-mode { color: #f1f2f6; }
body.dark-mode #container { background-color: rgba(20, 21, 30, 0.96); border-color: #ff4757; box-shadow: 6px 6px 0px #1e90ff; }
body.dark-mode #main-content { background-color: rgba(30, 31, 42, 0.9); border-color: #ff4757; }
body.dark-mode #sidebar { background-color: rgba(25, 26, 35, 0.9); border-color: #ff4757; }
body.dark-mode h2, body.dark-mode h3 { color: #ff4757; }
body.dark-mode h2 { border-bottom-color: #1e90ff; }
body.dark-mode .stat-card { background: #1a1b26; border-color: #ff4757; }
body.dark-mode .letter-box { background: #1a1b26; }
body.dark-mode blockquote { background-color: rgba(40, 42, 54, 0.8); color: #ffa502; }
body.dark-mode .fancy-stat-bar { background: #1a1c2a; border-color: #ff4757; }

/* --- 3. CRISP TEXT DECK NAVIGATION LISTS --- */
.tactical-nav ul { 
    list-style-type: '★ '; 
    padding-left: 15px; margin: 15px 0 20px 0;
}
.tactical-nav li { margin-bottom: 14px; }
.tactical-nav a { color: #1e90ff; text-decoration: none; font-weight: bold; font-size: 14px; padding: 2px 6px; transition: all 0.1s; }
.tactical-nav a:hover { background-color: #ff4757; color: white; }
body.dark-mode .tactical-nav a { color: #ff4757; }
body.dark-mode .tactical-nav a:hover { background-color: #1e90ff; color: white; }

/* --- 4. POLAROID FRAME PRESENTATION SHEET --- */
.birthday-photo-container {
    margin: 22px 0;
    display: block;
}
.birthday-photo {
    max-width: 220px;
    height: auto;
    border: 3px solid #2b2d42;
    box-shadow: 4px 4px 0px #ffa502;
    border-radius: 4px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s;
}
.birthday-photo:hover {
    transform: scale(1.04) rotate(-1.5deg);
}
body.dark-mode .birthday-photo {
    border-color: #ff4757;
    box-shadow: 4px 4px 0px #1e90ff;
}

/* --- 5. ARCADE CELL ENERGY SPEC BARS (High Contrast Overlays) --- */
.fancy-stat-bar {
    width: 100%;
    height: 34px; 
    background: #e1e2e6;
    border: 2px solid #2b2d42;
    box-shadow: inset 2px 2px 4px rgba(0,0,0,0.2);
    position: relative;
    margin: 18px 0;
    overflow: hidden;
}
.fancy-fill {
    height: 100%; box-sizing: border-box;
    background-image: repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.15) 4px, transparent 4px, transparent 8px);
    box-shadow: inset -2px 0px 6px rgba(0,0,0,0.2);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}
.pink-glow-bar { background-color: #ff4757; box-shadow: 0 0 8px rgba(255, 71, 87, 0.6); }
.blue-glow-bar { background-color: #1e90ff; box-shadow: 0 0 8px rgba(30, 144, 255, 0.6); }
.gold-glow-bar { background-color: #ffa502; box-shadow: 0 0 8px rgba(255, 165, 2, 0.6); }
.green-glow-bar { background-color: #2ed573; box-shadow: 0 0 8px rgba(46, 213, 115, 0.6); }
.purple-glow-bar { background-color: #e056fd; box-shadow: 0 0 8px rgba(224, 86, 253, 0.6); }

.fancy-stat-bar span {
    position: absolute;
    top: 0; left: 12px;
    font-size: 14px; 
    font-weight: 900; 
    color: #000000; 
    line-height: 30px; 
    z-index: 5;
    pointer-events: none;
    letter-spacing: 0.3px;
}
body.dark-mode .fancy-stat-bar span {
    color: #ffffff; 
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.95);
}

/* --- 6. SPLIT-BLOCK DIGITAL COUNTDOWN TELEMETRY --- */
.fancy-countdown {
    background: #1e2030; border: 2px dashed #ffa502; padding: 14px 10px; border-radius: 8px;
    box-shadow: inset 0 0 12px rgba(255, 165, 2, 0.25); text-align: center; margin-top: 10px; position: relative; 
}
.timer-grid { display: flex; justify-content: center; gap: 6px; margin-bottom: 8px; }
.time-block { background: #2a2b3d; border: 1px solid #ffa502; padding: 6px 4px; border-radius: 4px; min-width: 48px; box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4); }
.time-num { font-size: 1.4rem; font-weight: 900; color: #ffa502; text-shadow: 0 0 8px rgba(255, 165, 2, 0.7); }
.time-label { font-size: 8px; color: #a4b0be; font-weight: bold; letter-spacing: 0.5px; margin-top: 2px; }
.countdown-sub-label { font-size: 9px; color: #ffffff; font-weight: bold; letter-spacing: 0.5px; }

/* --- 7. HARDWARE OVERLAYS & STRUCTURAL LAYOUT SHIELDS --- */
#theme-toggle-btn {
    background: #2b2d42; color: #ffffff; border: 2px solid #1e90ff; font-family: 'Courier New', monospace; font-size: 11px; font-weight: bold;
    padding: 6px 12px; cursor: pointer; box-shadow: 3px 3px 0px #ff4757; margin-top: 10px; transition: all 0.1s;
}
#theme-toggle-btn:active { transform: translate(3px, 3px); box-shadow: 0px 0px 0px #ff4757; }

#achievement-toast {
    position: fixed; top: -120px; left: 50%; transform: translateX(-50%); background: #2b2d42; border: 3px solid #ffa502; padding: 14px 24px;
    display: flex; align-items: center; gap: 15px; z-index: 100000; box-shadow: 0px 8px 16px rgba(0,0,0,0.25); border-radius: 8px;
    transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); width: 380px; pointer-events: none;
}
#achievement-toast.show-toast { top: 25px; }
.toast-icon { font-size: 28px; animation: rotateDisc 2s infinite linear; }
.toast-title { font-weight: 900; font-size: 13px; color: #ffa502; letter-spacing: 1px; }
.toast-desc { font-size: 12px; color: #ffffff; margin-top: 2px; }

#splash-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #ffffff; z-index: 9999;
    display: flex; align-items: center; justify-content: center; text-align: center; transition: opacity 0.5s ease;
}
.splash-content { background: #ffffff; border: 4px solid #1e90ff; padding: 40px; box-shadow: 8px 8px 0px #ff4757; max-width: 500px; }
.splash-title { color: #ff4757; font-size: 2rem; margin: 0 0 10px 0; font-weight: 900; }
.splash-subtitle { color: #ffa502; font-size: 1rem; font-weight: bold; margin: 0 0 30px 0; letter-spacing: 1px; line-height: 1.4; }
.enter-btn { background: #2ed573; color: white; border: 2px solid #333; font-family: 'Courier New', monospace; font-weight: bold; font-size: 1.2rem; padding: 12px 28px; cursor: pointer; box-shadow: 4px 4px 0px #333; transition: all 0.1s; }
.enter-btn:active { transform: translate(4px, 4px); box-shadow: 0px 0px 0px #333; }

#container { max-width: 900px; margin: 40px auto; background-color: rgba(255, 255, 255, 0.95); border: 4px double #1e90ff; padding: 20px; box-shadow: 6px 6px 0px #ff4757; transition: all 0.3s; }
header { background-color: #ffa502; padding: 15px; border: 2px solid #1e90ff; margin-bottom: 20px; text-align: center; position: relative; overflow: hidden; }

/* --- 👾 RESTORED GLITTER SHINE HEADER ENGINE 👾 --- */
.glitch-permanent { 
    animation: textGlitchEffect 0.3s infinite linear; 
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 1px;
}

#flex-wrapper { display: flex; gap: 20px; align-items: flex-start; }
#sidebar { width: 260px; flex-shrink: 0; background-color: rgba(249, 248, 255, 0.9); border: 2px solid #1e90ff; padding: 15px; box-sizing: border-box; transition: all 0.3s; }
#main-content { flex: 1; background-color: rgba(255, 255, 255, 0.9); border: 2px solid #1e90ff; padding: 20px; box-sizing: border-box; transition: all 0.3s; }

.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.retro-badge { font-family: 'Courier New', monospace; font-size: 9px; font-weight: bold; color: #ffffff; padding: 4px 6px; border: 2px solid #2b2d42; box-shadow: 2px 2px 0px #2b2d42; }
.neon-blue-badge { background-color: #1e90ff; }
.neon-pink-badge { background-color: #ff4757; }

blockquote { border-left: 4px solid #ffa502; background-color: rgba(241, 242, 246, 0.8); margin: 15px 0; padding: 10px; font-style: italic; }
hr { border: 0; border-top: 2px dashed #ffa502; margin: 15px 0; }
footer { text-align: center; margin-top: 20px; font-size: 14px; color: #7f8c8d; }

/* --- 11. INSIDE JOKE SOUNDBOARD --- */
.soundboard { background: rgba(30, 144, 255, 0.05); border: 2px dashed #1e90ff; padding: 15px; margin: 20px 0; text-align: center; }
.button-grid { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.soundboard button { background: #ff4757; color: white; border: 2px solid #333; padding: 8px 15px; font-family: 'Courier New', monospace; font-weight: bold; cursor: pointer; box-shadow: 3px 3px 0px #333; }
.soundboard button:active { box-shadow: 0px 0px 0px #333; transform: translate(3px, 3px); }

/* --- 12. RACING STRIPE VINYL PLAYER --- */
.record-player-widget { background: #ffffff; border: 2px solid #2b2d42; padding: 12px; box-shadow: 4px 4px 0px #ffa502; border-radius: 8px; margin-top: 10px; }
.player-body {
    background-color: #ffccd2; background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255, 179, 188, 0.5) 10px, rgba(255, 179, 188, 0.5) 20px);
    border-radius: 16px; padding: 18px; display: flex; flex-direction: column; align-items: center; position: relative; border: 2px solid #2b2d42;
    box-shadow: inset -3px -3px 0px rgba(0,0,0,0.08), inset 3px 3px 0px rgba(255,255,255,0.4);
}
.vinyl-container { position: relative; width: 110px; height: 120px; }
.vinyl { width: 110px; height: 110px; background: radial-gradient(circle, #333 4%, #1a1a1a 8%, #222 12%, #111 16%, #292929 20%, #111 24%, #222 28%, #111 35%, #000 100%); border-radius: 50%; position: relative; box-shadow: 0 6px 12px rgba(0,0,0,0.35); }
.vinyl::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: conic-gradient(from 0deg, transparent 35%, rgba(255,255,255,0.12) 45%, transparent 55%, transparent 215%, rgba(255,255,255,0.12) 225%, transparent 235%); border-radius: 50%; }
.spinning { animation: rotateDisc 2.5s linear infinite; }
.vinyl-label { width: 36px; height: 36px; background: #ff4757; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; border: 1px dashed rgba(255,255,255,0.3); }
.vinyl-center { width: 8px; height: 8px; background: #ffffff; border-radius: 50%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 3; }
.tonearm { width: 45px; height: 8px; background: #95a5a6; position: absolute; top: 15px; right: -5px; transform-origin: top right; transform: rotate(15deg); transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border-radius: 4px; border: 1px solid #2b2d42; z-index: 5; }
.tonearm::before { content: ''; position: absolute; left: 0; top: 1px; width: 12px; height: 14px; background: #ffa502; border-radius: 2px; border: 1px solid #2b2d42; }
.active-arm { transform: rotate(34deg); }
.player-controls { display: flex; align-items: center; gap: 15px; margin-top: 5px; }
.ctrl-btn { background: transparent; border: none; color: #ff4757; font-size: 1.2rem; cursor: pointer; }
.play-trigger-btn { width: 44px; height: 44px; border-radius: 50%; background: #ffffff; border: 2px solid #ff4757; color: #ff4757; font-weight: bold; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: 0 3px 0px #2b2d42; }
.play-trigger-btn:active { transform: translateY(3px); box-shadow: 0 0px 0px #2b2d42; }
.playing-pulse { animation: buttonPulse 1.8s infinite ease-in-out; }

.track-display { margin-top: 12px; background: #2b2d42; padding: 10px 14px; border-radius: 8px; border: 2px solid #1e90ff; text-align: center; box-shadow: inset 0 0 8px rgba(30, 144, 255, 0.3); }
.track-status { font-size: 11px; letter-spacing: 1px; color: #2ed573; font-weight: bold; margin-bottom: 4px; }
.track-title { font-weight: 900; font-size: 14px; color: #ffffff; margin-bottom: 2px; }
.track-artist { font-size: 12px; color: #a4b0be; }

/* --- 13. TYPEWRITER DATA HOUSINGS --- */
.letter-box { background: white; border: 2px solid #2ed573; padding: 15px; margin-top: 20px; position: relative; overflow: visible; animation: letterBoxNeonGlow 2.5s infinite ease-in-out; }
#typewriter-output { font-size: 15px; line-height: 1.6; color: #2b2d42; border-left: 3px solid #2ed573; padding-left: 12px; position: relative; }
#typewriter-output::after { content: '█'; color: #2ed573; animation: flashPrompt 0.8s steps(2, start) infinite; margin-left: 4px; font-size: 13px; }
.letter-star { position: absolute; pointer-events: none; z-index: 999; font-size: 16px; user-select: none; animation: projectStarBurst 1.4s forwards cubic-bezier(0.1, 0.8, 0.25, 1); }

/* --- 14. GENERAL SYSTEM TIMELINES --- */
@keyframes rotateDisc { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes buttonPulse {
    0% { box-shadow: 0 3px 0px #2b2d42, 0 0 0 0px rgba(255, 71, 87, 0.4); }
    50% { box-shadow: 0 3px 0px #2b2d42, 0 0 0 8px rgba(255, 71, 87, 0); }
    100% { box-shadow: 0 3px 0px #2b2d42, 0 0 0 0px rgba(255, 71, 87, 0); }
}

/* Updated chromatic text-shadow generator creating full loop sparkles */
@keyframes textGlitchEffect {
    0% { color: #fff; text-shadow: 3px -2px 0px #ff4757, -3px 2px 0px #1e90ff, 0 0 10px rgba(255,255,255,0.4); transform: translate(0, 0); }
    20% { color: #2ed573; text-shadow: -2px 3px 0px #e056fd, 2px -2px 0px #ff4757, 0 0 14px #2ed573; transform: translate(-1px, 1px); }
    40% { color: #ffa502; text-shadow: -3px 1px 0px #ff4757, 3px -3px 0px #1e90ff, 0 0 14px #ffa502; transform: skewX(1deg) translate(1px, -1px); }
    60% { color: #1e90ff; text-shadow: 3px -3px 0px #ffa502, -2px 2px 0px #2ed573, 0 0 14px #1e90ff; transform: translate(-1px, -1px); }
    80% { color: #e056fd; text-shadow: -2px -2px 0px #2ed573, 3px 1px 0px #ff4757, 0 0 14px #e056fd; transform: translate(1px, 1px); }
    100% { color: #fff; text-shadow: 3px -2px 0px #ff4757, -3px 2px 0px #1e90ff, 0 0 10px rgba(255,255,255,0.4); transform: translate(0, 0); }
}
@keyframes flashPrompt { 50% { opacity: 0; } }
@keyframes projectStarBurst {
    0% { transform: translate(-50%, -50%) scale(0.3) rotate(0deg); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1.3) rotate(var(--r)); opacity: 0; }
}