@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === CRT / RETRO BASE === */
body {
    font-family: 'VT323', 'Tahoma', monospace;
    background: #008080;
    color: #000;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: default;
}

/* === SCANLINES OVERLAY === */
body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0,0,0,0.15) 0px,
        rgba(0,0,0,0.15) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 100000;
    animation: scanFlicker 0.1s infinite;
}

/* === CRT VIGNETTE === */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.4) 100%);
    pointer-events: none;
    z-index: 99999;
}

@keyframes scanFlicker {
    0% { opacity: 0.95; }
    50% { opacity: 1; }
    100% { opacity: 0.95; }
}

/* ============================================
   DESKTOP ICONS
   ============================================ */
.desktop-icons {
    position: fixed;
    top: 20px; left: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 5;
}

.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    width: 80px;
    text-align: center;
}

.desktop-icon:hover {
    background: rgba(0,0,128,0.3);
    outline: 1px dotted white;
}

.desktop-icon span {
    color: white;
    font-size: 11px;
    font-family: 'Tahoma', sans-serif;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.8);
}

/* ============================================
   TASKBAR (Windows XP)
   ============================================ */
.taskbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 36px;
    background: linear-gradient(180deg, #3168d5 0%, #1842a0 3%, #2b5bc7 5%, #2456c4 50%, #1f4cb8 50%, #1a44ad 97%, #163d9e 100%);
    border-top: 2px solid #5b9bd5;
    z-index: 99998;
    display: flex;
    align-items: center;
    padding: 0 4px;
    gap: 4px;
}

.start-btn {
    background: linear-gradient(180deg, #3b8f44 0%, #2d7e37 50%, #1e6b28 100%);
    border: none;
    border-radius: 0 8px 8px 0;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-weight: bold;
    font-size: 13px;
    padding: 4px 16px 4px 8px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.start-btn:hover {
    background: linear-gradient(180deg, #4ba054 0%, #3d8e47 50%, #2e7b38 100%);
}

.start-btn::before {
    content: '🪟';
    font-size: 16px;
}

.taskbar-items {
    display: flex;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.taskbar-item {
    background: linear-gradient(180deg, #3d71d9 0%, #2f63c6 50%, #2456b8 100%);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 3px;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    padding: 2px 12px;
    height: 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-item.active {
    background: linear-gradient(180deg, #1c4eb8 0%, #1a44ad 50%, #163d9e 100%);
    box-shadow: inset 0 0 4px rgba(0,0,0,0.3);
}

.taskbar-clock {
    background: linear-gradient(180deg, #1690d1 0%, #0c7ec0 50%, #0570b0 100%);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 2px;
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    padding: 2px 10px;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ============================================
   GENERIC WINDOW (XP STYLE)
   ============================================ */
.win-window {
    position: absolute;
    z-index: 10;
    min-width: 200px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.4);
}

.win-window.focused {
    z-index: 100;
}

.win-titlebar {
    background: linear-gradient(180deg, #0a246a 0%, #3a6ea5 8%, #0a246a 100%);
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 4px;
    border-radius: 8px 8px 0 0;
    gap: 4px;
    cursor: grab;
    user-select: none;
}

.win-titlebar.inactive {
    background: linear-gradient(180deg, #7f9db9 0%, #9db5cb 8%, #7f9db9 100%);
}

.win-titlebar-text {
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    font-weight: bold;
    flex: 1;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.win-titlebar-btns {
    display: flex;
    gap: 2px;
}

.win-btn {
    width: 21px;
    height: 21px;
    background: linear-gradient(180deg, #fff 0%, #ddd 50%, #bbb 100%);
    border: 1px solid #0a246a;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    font-family: 'Marlett', sans-serif;
}

.win-btn:hover {
    background: linear-gradient(180deg, #fff 0%, #eee 50%, #ddd 100%);
}

.win-btn.close {
    background: linear-gradient(180deg, #e87461 0%, #d1503c 50%, #c0382a 100%);
    color: white;
}

.win-body {
    background: #ece9d8;
    border: 2px solid #0a246a;
    border-top: none;
}

/* ============================================
   MENU BAR
   ============================================ */
.win-menubar {
    background: #ece9d8;
    border-bottom: 1px solid #aca899;
    padding: 2px 4px;
    display: flex;
    gap: 2px;
    position: relative;
}

.win-menu-item {
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    color: #000;
    position: relative;
}

.win-menu-item:hover {
    background: #316ac5;
    color: white;
}

/* Dropdown menu */
.win-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #aca899;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.2);
    min-width: 180px;
    z-index: 5000;
    padding: 2px 0;
}

.win-dropdown.open {
    display: block;
}

.win-dropdown-item {
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    padding: 4px 24px 4px 28px;
    cursor: pointer;
    color: #000;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.win-dropdown-item:hover {
    background: #316ac5;
    color: white;
}

.win-dropdown-separator {
    height: 1px;
    background: #aca899;
    margin: 2px 0;
}

.win-dropdown-item.disabled {
    color: #808080;
    cursor: default;
}

.win-dropdown-item.disabled:hover {
    background: transparent;
    color: #808080;
}

/* ============================================
   ALBUM CONTENT
   ============================================ */
.album-content {
    padding: 16px;
}

.cover-section {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cover-art {
    width: 300px;
    height: 300px;
    border: 3px solid #808080;
    box-shadow:
        inset -1px -1px 0 #fff,
        inset 1px 1px 0 #404040,
        2px 2px 0 #808080;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.cover-art img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.cover-art:hover img {
    transform: scale(1.05) rotate(1deg);
}

/* Vinyl spin animation on play */
.cover-art.spinning img {
    animation: vinylSpin 4s linear infinite;
}

@keyframes vinylSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.album-info {
    flex: 1;
    min-width: 250px;
}

.album-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 28px;
    color: #000;
    margin-bottom: 8px;
    text-shadow: 2px 2px 0 #808080;
    animation: glitchTitle 3s infinite;
}

@keyframes glitchTitle {
    0%, 90%, 100% { transform: none; text-shadow: 2px 2px 0 #808080; }
    91% { transform: translate(-2px, 1px); text-shadow: 2px 2px 0 #ff0000, -2px -2px 0 #0000ff; }
    92% { transform: translate(2px, -1px); text-shadow: -2px 2px 0 #00ff00; }
    93% { transform: none; text-shadow: 2px 2px 0 #808080; }
    96% { transform: translate(1px, 2px) skew(-1deg); text-shadow: 3px 0 0 #ff0000, -3px 0 0 #0000ff; }
    97% { transform: none; text-shadow: 2px 2px 0 #808080; }
}

.album-subtitle {
    font-family: 'Tahoma', sans-serif;
    font-size: 16px;
    color: #333;
    margin-bottom: 16px;
    font-weight: bold;
}

.album-credits {
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    color: #555;
    line-height: 1.8;
    background: white;
    border: 2px inset #bbb;
    padding: 12px;
    margin-bottom: 12px;
}

.album-credits strong {
    color: #0a246a;
}

.album-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.album-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    font-weight: bold;
    text-decoration: none;
    color: #000;
    background: linear-gradient(180deg, #fff 0%, #ece9d8 89%, #d6d0c4 100%);
    border: 2px outset #d6d0c4;
    cursor: pointer;
    transition: all 0.1s;
}

.album-link:active { border-style: inset; padding: 7px 15px 5px 17px; }
.album-link:hover { background: linear-gradient(180deg, #fff 0%, #f5f3ef 89%, #ece9d8 100%); }
.album-link.soundcloud { background: linear-gradient(180deg, #ff8800 0%, #ff5500 100%); color: white; border-color: #cc4400; }
.album-link.genius { background: linear-gradient(180deg, #ffff64 0%, #f0e040 100%); color: #000; border-color: #c0b030; }

/* ============================================
   MARQUEE
   ============================================ */
.retro-marquee {
    background: #000080;
    color: #ffff00;
    font-family: 'VT323', monospace;
    font-size: 18px;
    padding: 6px 0;
    overflow: hidden;
    white-space: nowrap;
    border: 2px inset #808080;
    margin-bottom: 16px;
}

.retro-marquee span {
    display: inline-block;
    animation: marqueeScroll 20s linear infinite;
}

@keyframes marqueeScroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
}

/* ============================================
   PLAYER SECTION
   ============================================ */
.player-section {
    background: #c0c0c0;
    border: 2px outset #dfdfdf;
}

.player-header {
    background: linear-gradient(90deg, #000080, #1084d0);
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.player-header::before { content: '🎵'; }

/* ============================================
   NOW PLAYING
   ============================================ */
.now-playing {
    background: #000;
    color: #00ff00;
    font-family: 'VT323', monospace;
    font-size: 20px;
    padding: 12px 16px;
    margin: 4px;
    border: 2px inset #808080;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 50px;
    text-shadow: 0 0 8px #00ff00;
}

.now-playing-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 30px;
}

.viz-bar {
    width: 4px;
    background: #00ff00;
    animation: vizBounce 0.5s ease-in-out infinite alternate;
    box-shadow: 0 0 4px #00ff00;
}

.viz-bar:nth-child(1) { height: 10px; animation-delay: 0s; }
.viz-bar:nth-child(2) { height: 20px; animation-delay: 0.1s; }
.viz-bar:nth-child(3) { height: 15px; animation-delay: 0.2s; }
.viz-bar:nth-child(4) { height: 25px; animation-delay: 0.15s; }
.viz-bar:nth-child(5) { height: 12px; animation-delay: 0.3s; }
.viz-bar:nth-child(6) { height: 18px; animation-delay: 0.05s; }
.viz-bar:nth-child(7) { height: 22px; animation-delay: 0.25s; }
.viz-bar:nth-child(8) { height: 8px; animation-delay: 0.35s; }

@keyframes vizBounce {
    0% { height: 4px; }
    100% { height: 30px; }
}

.viz-bar.paused {
    animation-play-state: paused !important;
    height: 4px !important;
}

.now-playing-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

/* ============================================
   CANVAS VISUALIZER
   ============================================ */
.canvas-viz-container {
    margin: 4px;
    border: 2px inset #808080;
    background: #000;
    position: relative;
    height: 120px;
}

#vizCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

.viz-mode-label {
    position: absolute;
    top: 4px;
    right: 8px;
    color: rgba(0,255,0,0.5);
    font-family: 'VT323', monospace;
    font-size: 12px;
    pointer-events: none;
}

/* ============================================
   CONTROLS
   ============================================ */
.player-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px;
    background: #c0c0c0;
    flex-wrap: wrap;
}

.ctrl-btn {
    width: 32px;
    height: 28px;
    background: linear-gradient(180deg, #fff 0%, #c0c0c0 89%, #a0a0a0 100%);
    border: 2px outset #dfdfdf;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.ctrl-btn:active { border-style: inset; }
.ctrl-btn:hover { background: linear-gradient(180deg, #fff 0%, #d4d0c8 89%, #bbb 100%); }
.ctrl-btn.playing {
    border-style: inset;
    background: linear-gradient(180deg, #a0a0a0 0%, #c0c0c0 89%, #d0d0d0 100%);
}

.ctrl-btn.active-mode {
    border-style: inset;
    background: linear-gradient(180deg, #9a9 0%, #bdb 89%);
}

.progress-container {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-bar {
    flex: 1;
    height: 16px;
    background: white;
    border: 2px inset #808080;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #000080, #0078d7, #00a8ff);
    width: 0%;
    transition: width 0.1s linear;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: -2px;
    width: 4px;
    height: calc(100% + 4px);
    background: #0a246a;
}

.progress-time {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #000;
    min-width: 80px;
    text-align: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 4px;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: #808080;
    outline: none;
    border: 1px inset #808080;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 20px;
    background: linear-gradient(180deg, #fff 0%, #c0c0c0 100%);
    border: 1px outset #dfdfdf;
    cursor: pointer;
}

/* ============================================
   TRACKLIST
   ============================================ */
.tracklist {
    margin: 4px;
    border: 2px inset #808080;
    background: white;
    max-height: 400px;
    overflow-y: auto;
}

.tracklist::-webkit-scrollbar { width: 16px; }
.tracklist::-webkit-scrollbar-track { background: #ece9d8; border-left: 1px solid #aca899; }
.tracklist::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #ece9d8 0%, #d6d0c4 100%); border: 1px outset #dfdfdf; }

.tracklist-header {
    display: grid;
    grid-template-columns: 40px 1fr 80px;
    background: linear-gradient(180deg, #fff 0%, #ece9d8 100%);
    border-bottom: 1px solid #aca899;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    font-weight: bold;
    padding: 4px 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.tracklist-header span {
    padding: 2px 8px;
    border-right: 1px solid #aca899;
}

.track-item {
    display: grid;
    grid-template-columns: 40px 1fr 80px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.track-item:hover { background: #ece9d8; }

.track-item.active {
    background: #316ac5;
    color: white;
}

.track-item.active .track-duration,
.track-item.active .track-num { color: white; }

.track-item span {
    padding: 6px 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.track-num { text-align: center; color: #808080; }
.track-item.active .track-num { color: #ccc; }
.track-duration { text-align: right; color: #808080; }

/* ============================================
   STATUS BAR
   ============================================ */
.win-statusbar {
    background: #ece9d8;
    border-top: 1px solid #aca899;
    padding: 2px 8px;
    font-family: 'Tahoma', sans-serif;
    font-size: 11px;
    display: flex;
    gap: 12px;
}

.status-item {
    border-right: 1px solid #808080;
    padding-right: 12px;
    color: #555;
}

.status-item:last-child { border-right: none; }

/* ============================================
   LYRICS WINDOW
   ============================================ */
.lyrics-content {
    padding: 0;
    min-height: 200px;
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
}

.lyrics-content::-webkit-scrollbar { width: 16px; }
.lyrics-content::-webkit-scrollbar-track { background: #ece9d8; border-left: 1px solid #aca899; }
.lyrics-content::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #ece9d8 0%, #d6d0c4 100%); border: 1px outset #dfdfdf; }

.lyrics-text {
    padding: 16px;
    font-family: 'Tahoma', sans-serif;
    font-size: 13px;
    line-height: 1.8;
    white-space: pre-wrap;
    color: #000;
}

.lyrics-text .lyrics-section {
    color: #0a246a;
    font-weight: bold;
    font-size: 12px;
    margin-top: 16px;
    margin-bottom: 4px;
    display: block;
    padding: 2px 4px;
    background: #e8e8e8;
    border-left: 3px solid #316ac5;
}

.lyrics-text .lyrics-section:first-child {
    margin-top: 0;
}

.lyrics-placeholder {
    padding: 40px 16px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    color: #808080;
    text-align: center;
}

.lyrics-placeholder span {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

/* ============================================
   EQUALIZER WINDOW
   ============================================ */
.eq-body {
    background: #1a1a2e;
    padding: 12px;
    min-height: 200px;
}

.eq-presets {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.eq-preset-btn {
    font-family: 'Tahoma', sans-serif;
    font-size: 10px;
    padding: 2px 8px;
    background: linear-gradient(180deg, #444 0%, #333 100%);
    border: 1px outset #555;
    color: #0f0;
    cursor: pointer;
}

.eq-preset-btn:hover { background: linear-gradient(180deg, #555 0%, #444 100%); }
.eq-preset-btn.active { border-style: inset; background: #222; color: #0ff; }

.eq-sliders {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
    height: 150px;
    padding: 0 8px;
}

.eq-band {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.eq-band label {
    color: #0f0;
    font-family: 'VT323', monospace;
    font-size: 11px;
    text-shadow: 0 0 4px #0f0;
}

.eq-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 6px;
    height: 100px;
    background: linear-gradient(180deg, #0f0, #080);
    outline: none;
    writing-mode: vertical-lr;
    direction: rtl;
    border: 1px solid #0f0;
    border-radius: 0;
}

.eq-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 8px;
    background: linear-gradient(180deg, #0ff 0%, #088 100%);
    border: 1px solid #0ff;
    cursor: pointer;
    box-shadow: 0 0 6px #0ff;
}

.eq-value {
    color: #0ff;
    font-family: 'VT323', monospace;
    font-size: 10px;
}

/* ============================================
   POPUP WINDOWS
   ============================================ */
.popup-window {
    position: fixed;
    z-index: 9000;
    animation: popupBounce 0.3s ease-out;
}

@keyframes popupBounce {
    0% { transform: scale(0); }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.popup-body-content {
    padding: 16px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    text-align: center;
}

.popup-body-content p { margin-bottom: 12px; }

.popup-ok-btn {
    padding: 4px 24px;
    background: linear-gradient(180deg, #fff 0%, #ece9d8 89%, #d6d0c4 100%);
    border: 2px outset #d6d0c4;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    cursor: pointer;
}

.popup-ok-btn:active { border-style: inset; }

/* ============================================
   CLIPPY
   ============================================ */
.clippy-container {
    position: fixed;
    bottom: 50px;
    right: 20px;
    z-index: 99500;
    animation: clippyBounce 2s ease-in-out infinite;
}

@keyframes clippyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.clippy-bubble {
    background: #ffffcc;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 12px 16px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    max-width: 220px;
    margin-bottom: 8px;
    position: relative;
    box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.clippy-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border: 5px solid transparent;
    border-top-color: #000;
}

.clippy-emoji { font-size: 48px; text-align: right; }

/* ============================================
   BSOD (Blue Screen of Death)
   ============================================ */
.bsod-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #0000aa;
    z-index: 999999;
    color: white;
    font-family: 'VT323', 'Lucida Console', monospace;
    padding: 40px;
    cursor: none;
    animation: bsodFlash 0.1s;
}

.bsod-overlay.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

@keyframes bsodFlash {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 1; }
}

.bsod-header {
    background: #aaa;
    color: #0000aa;
    padding: 4px 16px;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.bsod-text {
    font-size: 18px;
    line-height: 1.8;
    text-align: center;
    max-width: 700px;
}

.bsod-text .bsod-error-code {
    font-size: 14px;
    color: #aaa;
    margin-top: 20px;
}

.bsod-progress {
    margin-top: 30px;
    font-size: 18px;
}

.bsod-progress .bsod-pct {
    color: #fff;
    animation: bsodCount 8s linear forwards;
}

@keyframes bsodCount {
    0% { content: '0'; }
    100% { content: '100'; }
}

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #000080;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    animation: loadingFade 1.5s ease-in-out forwards;
    animation-delay: 3s;
}

@keyframes loadingFade {
    0% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; pointer-events: none; }
}

.loading-logo {
    font-family: 'Press Start 2P', monospace;
    font-size: 24px;
    color: white;
    margin-bottom: 16px;
    text-shadow: 2px 2px 0 #000080, 4px 4px 0 rgba(0,0,0,0.3);
}

.loading-text {
    color: #c0c0c0;
    font-family: 'VT323', monospace;
    font-size: 24px;
    animation: loadBlink 0.8s infinite;
}

.loading-bar-container {
    width: 300px;
    height: 20px;
    background: #000;
    border: 2px inset #808080;
    margin-top: 20px;
}

.loading-bar-fill {
    height: 100%;
    background: repeating-linear-gradient(
        90deg,
        #00aa00 0px, #00aa00 12px,
        transparent 12px, transparent 14px
    );
    animation: loadBar 3s ease-in-out forwards;
    width: 0%;
}

@keyframes loadBar {
    0% { width: 0%; }
    30% { width: 30%; }
    60% { width: 65%; }
    80% { width: 85%; }
    100% { width: 100%; }
}

@keyframes loadBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* ============================================
   GLITCH & EFFECTS
   ============================================ */
.glitch-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 99990;
    opacity: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255,0,0,0.03) 0px,
        transparent 2px,
        rgba(0,0,255,0.03) 4px,
        transparent 6px
    );
}

.glitch-overlay.active { animation: glitchFlash 0.15s linear; }

@keyframes glitchFlash {
    0% { opacity: 1; transform: translateX(-10px); }
    25% { opacity: 0.8; transform: translateX(10px) skewX(2deg); }
    50% { opacity: 1; transform: translateX(-5px) skewX(-1deg); }
    75% { opacity: 0.6; transform: translateX(5px); }
    100% { opacity: 0; transform: none; }
}

.flying-icon {
    position: fixed;
    font-size: 24px;
    z-index: 2;
    pointer-events: none;
    animation: flyAcross 8s linear infinite;
    opacity: 0.6;
}

@keyframes flyAcross {
    0% { transform: translateX(-50px) translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { transform: translateX(calc(100vw + 50px)) translateY(-100px) rotate(360deg); opacity: 0; }
}

/* Visitor counter */
.visitor-counter {
    font-family: 'VT323', monospace;
    font-size: 14px;
    color: #808080;
    text-align: center;
    padding: 8px;
    border-top: 1px solid #aca899;
    background: #ece9d8;
}

.visitor-counter img {
    vertical-align: middle;
    image-rendering: pixelated;
}

/* Back link */
.back-link { display: inline-block; margin: 12px auto; text-align: center; width: 100%; }
.back-link a { font-family: 'Tahoma', sans-serif; font-size: 12px; color: #0000ff; text-decoration: underline; }
.back-link a:hover { color: #ff0000; }

/* ============================================
   START MENU
   ============================================ */
.start-menu {
    display: none;
    position: fixed;
    bottom: 36px;
    left: 0;
    width: 340px;
    background: #fff;
    border: 2px outset #d6d0c4;
    box-shadow: 4px 4px 10px rgba(0,0,0,0.3);
    z-index: 99999;
}

.start-menu.open { display: block; }

.start-menu-header {
    background: linear-gradient(180deg, #1f4cb8 0%, #3168d5 100%);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.start-menu-header span {
    color: white;
    font-family: 'Tahoma', sans-serif;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.start-menu-items {
    padding: 4px 0;
}

.start-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    cursor: pointer;
    color: #000;
}

.start-menu-item:hover {
    background: #316ac5;
    color: white;
}

.start-menu-sep {
    height: 1px;
    background: #aca899;
    margin: 4px 8px;
}

.start-menu-item .sm-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .cover-section {
        flex-direction: column;
        align-items: center;
    }

    .cover-art { width: 250px; height: 250px; }

    .album-info { min-width: unset; text-align: center; }
    .album-title { font-size: 18px; }
    .album-links { justify-content: center; }

    .popup-window,
    .desktop-icons,
    .clippy-container { display: none !important; }

    .player-controls { justify-content: center; }

    .eq-sliders { gap: 4px; }
    .eq-slider { height: 60px; }

    .win-window {
        position: relative !important;
        width: 98% !important;
        margin: 10px auto !important;
        left: auto !important;
        top: auto !important;
    }

    .canvas-viz-container { height: 80px; }

    .start-menu { width: 280px; }
}

@media (max-width: 480px) {
    .cover-art { width: 200px; height: 200px; }
    .album-title { font-size: 14px; }
    .tracklist-header { grid-template-columns: 30px 1fr 60px; }
    .track-item { grid-template-columns: 30px 1fr 60px; }
}
