@import url('https://fonts.googleapis.com/css2?family=VT323&family=Press+Start+2P&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

:root {
    --screen-bg: #1a1f2e;
    --screen-text: #e8e8e0;
    --highlight-blue: #2d5eff;
    --highlight-gradient: linear-gradient(180deg, #4a7fff 0%, #2d5eff 50%, #1a4ad4 100%);
}

body {
    font-family: 'VT323', monospace;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Background themes */
.bg-desk {
    background: linear-gradient(135deg, #2c1810 0%, #4a3728 50%, #3d2a1c 100%);
}

.bg-locker {
    background: linear-gradient(180deg, #4a5568 0%, #2d3748 100%);
}

.bg-car {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
}

.bg-bedroom {
    background: linear-gradient(180deg, #2d1b4e 0%, #1a0f2e 100%);
}

.bg-plain {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
}

/* Desk decorations */
.desk-decorations {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cd-case {
    position: absolute;
    bottom: 15%;
    left: 10%;
    width: 80px;
    height: 70px;
    background: linear-gradient(135deg, #e0e0e0 0%, #a0a0a0 100%);
    border-radius: 4px;
    transform: rotate(-15deg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.itunes-card {
    position: absolute;
    top: 20%;
    right: 15%;
    width: 60px;
    height: 90px;
    background: linear-gradient(135deg, #00d4aa 0%, #00a080 100%);
    border-radius: 8px;
    transform: rotate(10deg);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

/* iPod Device */
.ipod-device {
    position: relative;
    width: 200px;
    height: 340px;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 
        0 20px 60px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.2);
    z-index: 10;
}

/* iPod Colors */
.ipod-white {
    background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 50%, #e8e8e8 100%);
}

.ipod-black {
    background: linear-gradient(180deg, #3a3a3a 0%, #1a1a1a 50%, #0a0a0a 100%);
}

.ipod-pink {
    background: linear-gradient(180deg, #ffb6c1 0%, #ff69b4 50%, #ff1493 100%);
}

.ipod-blue {
    background: linear-gradient(180deg, #87ceeb 0%, #4169e1 50%, #0000cd 100%);
}

.ipod-green {
    background: linear-gradient(180deg, #90ee90 0%, #32cd32 50%, #228b22 100%);
}

.ipod-red {
    background: linear-gradient(180deg, #ff6b6b 0%, #ee0000 50%, #cc0000 100%);
}

/* Wear levels */
.wear-mint {}

.wear-light {
    filter: saturate(0.9) brightness(0.98);
}

.wear-light::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cline x1='10' y1='20' x2='30' y2='25' stroke='%23ccc' stroke-width='0.3'/%3E%3C/svg%3E");
    opacity: 0.2;
    pointer-events: none;
}

.wear-loved {
    filter: saturate(0.85) brightness(0.95) sepia(0.05);
}

.wear-vintage {
    filter: saturate(0.7) brightness(0.9) sepia(0.15);
}

/* Hold switch */
.hold-switch-container {
    position: absolute;
    top: 8px;
    right: 15px;
}

.hold-switch {
    width: 30px;
    height: 12px;
    background: #666;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.hold-slider {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 8px;
    background: #888;
    border-radius: 4px;
    transition: transform 0.2s;
}

.hold-switch.locked .hold-slider {
    transform: translateX(14px);
}

.hold-orange {
    position: absolute;
    left: 2px;
    top: 2px;
    width: 12px;
    height: 8px;
    background: #ff6600;
    border-radius: 4px;
}

/* Screen bezel */
.screen-bezel {
    width: 170px;
    height: 128px;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 8px;
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.8),
        0 1px 0 rgba(255,255,255,0.1);
}

/* iPod Screen */
.ipod-screen {
    width: 100%;
    height: 100%;
    background: var(--screen-bg);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    font-family: 'VT323', monospace;
    color: var(--screen-text);
    box-shadow: 0 0 20px rgba(100, 150, 255, 0.15);
}

.ipod-screen.dimmed {
    opacity: 0.3;
}

.ipod-screen.scanlines::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,0.1) 2px,
        rgba(0,0,0,0.1) 4px
    );
    pointer-events: none;
    z-index: 100;
}

.ipod-screen.pixel-grid::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(0,0,0,0.05) 1px, rgba(0,0,0,0.05) 2px),
        repeating-linear-gradient(0deg, transparent, transparent 1px, rgba(0,0,0,0.05) 1px, rgba(0,0,0,0.05) 2px);
    pointer-events: none;
    z-index: 101;
}

/* Screen content */
.screen-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 4px 6px;
    font-size: 11px;
}

/* Boot screen */
.boot-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #000;
}

.apple-logo {
    font-size: 40px;
    color: #888;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.apple-logo.small {
    font-size: 28px;
    margin-bottom: 20px;
}

.boot-progress-container {
    width: 80%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    overflow: hidden;
}

.boot-progress-bar {
    height: 100%;
    background: #888;
    border-radius: 3px;
    transition: width 0.1s;
}

.sad-ipod {
    text-align: center;
}

.sad-icon {
    font-size: 40px;
    color: #888;
    margin-bottom: 10px;
}

.sad-text {
    color: #888;
    font-size: 12px;
}

/* Menu screen */
.menu-screen {
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
    color: #000;
}

.menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 4px;
    background: linear-gradient(180deg, #b0b0b0 0%, #888 100%);
    border-radius: 2px;
    margin-bottom: 2px;
}

.menu-title {
    font-weight: bold;
    font-size: 12px;
}

.battery-display {
    display: flex;
    align-items: center;
}

.battery-bar {
    width: 20px;
    height: 8px;
    border: 1px solid #000;
    border-radius: 2px;
    position: relative;
}

.battery-bar::after {
    content: '';
    position: absolute;
    right: -3px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 4px;
    background: #000;
    border-radius: 0 1px 1px 0;
}

.battery-level {
    display: block;
    height: 100%;
    background: #32cd32;
    border-radius: 1px;
}

.menu-list {
    flex: 1;
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 2px;
}

.menu-item.selected {
    background: var(--highlight-gradient);
    color: white;
}

.menu-icon {
    width: 16px;
    text-align: center;
    margin-right: 6px;
}

.menu-name {
    flex: 1;
}

.menu-arrow {
    font-size: 8px;
}

/* Now Playing screen */
.now-playing {
    background: linear-gradient(180deg, #1a1f2e 0%, #0a0f1e 100%);
    color: #fff;
    align-items: center;
}

.now-playing-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 9px;
    color: #888;
    margin-bottom: 4px;
}

.album-art {
    width: 50px;
    height: 50px;
    background: #333;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
}

.song-info {
    text-align: center;
    width: 100%;
    overflow: hidden;
}

.song-title {
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
}

.song-title.marquee {
    width: 100%;
}

.song-title.marquee span {
    display: inline-block;
    transition: transform 0.15s linear;
}

.song-artist {
    font-size: 10px;
    color: #aaa;
}

.song-album {
    font-size: 9px;
    color: #666;
}

.progress-container {
    width: 100%;
    margin-top: 4px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: #666;
    border-radius: 2px;
}

.progress-diamond {
    position: absolute;
    top: -4px;
    transform: translateX(-50%);
    font-size: 8px;
    color: #fff;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 8px;
    color: #666;
    margin-top: 2px;
}

.play-indicator {
    font-size: 10px;
    margin-top: 2px;
}

/* About screen */
.about-screen {
    background: linear-gradient(180deg, #e8e8e8 0%, #d0d0d0 100%);
    color: #000;
}

.about-title {
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    padding: 4px;
    background: linear-gradient(180deg, #b0b0b0 0%, #888 100%);
    border-radius: 2px;
    margin-bottom: 4px;
}

.about-content {
    font-size: 10px;
    line-height: 1.4;
}

.about-detail {
    color: #444;
    margin-left: 8px;
}

/* Clock screen */
.clock-screen {
    background: #000;
    color: #fff;
    align-items: center;
    justify-content: center;
}

.clock-time {
    font-size: 28px;
    font-weight: bold;
}

.clock-date {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

.clock-city {
    font-size: 10px;
    color: #666;
    margin-top: 8px;
}

/* Calendar screen */
.calendar-screen {
    background: #000;
    color: #fff;
    font-size: 9px;
}

.calendar-header {
    text-align: center;
    font-size: 11px;
    margin-bottom: 4px;
}

.calendar-days {
    display: flex;
    justify-content: space-around;
    color: #888;
    margin-bottom: 2px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    text-align: center;
}

.calendar-grid .today {
    background: var(--highlight-blue);
    border-radius: 2px;
}

/* Brick game */
.brick-game {
    background: #000;
    position: relative;
}

.game-start, .game-over {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #fff;
    font-size: 16px;
}

.game-instruction {
    font-size: 10px;
    color: #888;
    margin-top: 10px;
}

.game-area {
    width: 100%;
    height: 100%;
    position: relative;
}

.game-hud {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px;
    font-size: 9px;
    color: #888;
}

.brick {
    position: absolute;
    width: 18%;
    height: 6%;
    border-radius: 2px;
}

.brick.active {
    background: linear-gradient(180deg, #ff6b6b 0%, #cc0000 100%);
    border: 1px solid #ff9999;
}

.brick.destroyed {
    opacity: 0;
}

.ball {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.paddle {
    position: absolute;
    bottom: 5%;
    width: 25%;
    height: 4%;
    background: #fff;
    border-radius: 3px;
    transform: translateX(-50%);
}

/* iPod label */
.ipod-label {
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 1px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.ipod-black .ipod-label {
    color: #888;
}

/* Click wheel */
.click-wheel-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.click-wheel {
    width: 140px;
    height: 140px;
    background: radial-gradient(circle, #f8f8f8 0%, #e0e0e0 100%);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    box-shadow:
        inset 0 0 20px rgba(0,0,0,0.1),
        0 4px 10px rgba(0,0,0,0.2);
}

.ipod-black .click-wheel {
    background: radial-gradient(circle, #2a2a2a 0%, #1a1a1a 100%);
}

.click-wheel.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Wheel buttons */
.wheel-button {
    position: absolute;
    background: transparent;
    border: none;
    font-size: 10px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    font-family: 'VT323', monospace;
}

.ipod-black .wheel-button {
    color: #888;
}

.wheel-button:hover:not(:disabled) {
    color: #000;
}

.ipod-black .wheel-button:hover:not(:disabled) {
    color: #fff;
}

.wheel-button:active:not(:disabled) {
    transform: scale(0.95);
}

.menu-btn {
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
}

.prev-btn {
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.next-btn {
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.play-btn {
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
}

/* Center button */
.center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background: linear-gradient(180deg, #e8e8e8 0%, #c0c0c0 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow:
        0 2px 4px rgba(0,0,0,0.2),
        inset 0 1px 0 rgba(255,255,255,0.5);
}

.ipod-black .center-button {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
}

.center-button:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Earbuds */
.earbuds {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
}

.earbud-wire {
    width: 2px;
    height: 100px;
    background: #fff;
    margin: 0 auto;
    border-radius: 1px;
}

.earbud {
    width: 12px;
    height: 16px;
    background: #fff;
    border-radius: 50% 50% 50% 50%;
    position: absolute;
    bottom: -20px;
}

.earbud.left {
    left: -30px;
}

.earbud.right {
    right: -30px;
}

/* Nostalgia overlay */
.nostalgia-overlay {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 8px;
    white-space: nowrap;
    animation: fadeInOut 3s ease;
    z-index: 200;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    10%, 90% { opacity: 1; }
}

/* Footer */
.app-footer {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    z-index: 1000;
}

.footer-divider {
    opacity: 0.5;
}

.remix-link {
    color: rgba(100,150,255,0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.remix-link:hover {
    color: rgba(100,150,255,1);
}

/* Mobile responsiveness */
@media (max-width: 480px) {
    .ipod-device {
        width: 180px;
        height: 310px;
    }
    
    .screen-bezel {
        width: 150px;
        height: 112px;
    }
    
    .click-wheel {
        width: 120px;
        height: 120px;
    }
    
    .center-button {
        width: 42px;
        height: 42px;
    }
    
    .desk-decorations {
        display: none;
    }
    
    .earbuds {
        display: none;
    }
}

@media (max-height: 600px) {
    .ipod-device {
        height: 280px;
    }
    
    .click-wheel {
        width: 100px;
        height: 100px;
    }
    
    .center-button {
        width: 36px;
        height: 36px;
    }
}