/* ========================================
   CSS VARIABLES - Theme System Foundation
   ======================================== */

:root {
    /* Primary Colors */
    --primary-color: #1DB954;           /* Spotify green */
    --primary-light: #1ed760;           /* Spotify green bright */
    --primary-dark: #1aa34a;            /* Spotify green dark */

    /* Background Colors */
    --bg-primary: #0f0c29;              /* Dark gradient primary */
    --bg-secondary: #302b63;            /* Dark gradient secondary */
    --bg-gradient-end: #24243e;         /* Dark gradient end */
    --bg-card: rgba(255, 255, 255, 0.05);      /* Card background */
    --bg-overlay: rgba(0, 0, 0, 0.3);          /* Overlay background */

    /* Text Colors */
    --text-primary: #ffffff;            /* Main text white */
    --text-secondary: #b3b3b3;          /* Secondary text gray */

    /* Border & Shadow Colors */
    --border-color: rgba(255, 255, 255, 0.1);  /* Light border */
    --border-hover: rgba(255, 255, 255, 0.2);  /* Hover border */
    --shadow-color: rgba(0, 0, 0, 0.5);        /* Shadow dark */
    --shadow-color-light: rgba(0, 0, 0, 0.3);  /* Shadow light */

    /* Accent Colors */
    --accent-color: #ff006e;            /* Pink accent */
    --success-color: #44ff44;           /* Success green */
    --error-color: #ff4444;             /* Error red */

    /* Scrollbar Colors */
    --scrollbar-track: rgba(255, 255, 255, 0.05);     /* Track */
    --scrollbar-thumb: rgba(29, 185, 84, 0.4);        /* Thumb */
    --scrollbar-thumb-hover: rgba(29, 185, 84, 0.6);  /* Thumb hover */

    /* Font */
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'Courier New', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary), var(--bg-gradient-end));
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#app {
    width: 100%;
    height: 100vh;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.view.hidden {
    display: none;
}

/* Player View Layout */
#player-view {
    width: min(1400px, 100%);
    height: 100%;
    max-height: calc(100vh - 24px);
    margin: 0 auto;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.status-text {
    font-size: 0.9em;
    color: var(--text-secondary);
    flex: 1;
}

#widget-container {
    flex: 1;
    overflow: hidden;
}

/* Login View */
.login-container {
    text-align: center;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.login-container h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-container p {
    font-size: 1.1em;
    margin-bottom: 30px;
    opacity: 0.8;
}

.note {
    font-size: 0.9em;
    opacity: 0.6;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: #000;
    padding: 15px 30px;
    font-size: 1.1em;
    margin-bottom: 20px;
}

.btn-primary:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(29, 185, 84, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9em;
    background: var(--border-hover);
    color: var(--text-primary);
    margin-left: 8px;
}

.btn-small:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Player View */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 40px;
    max-width: 1400px;
    width: 100%;
    height: calc(100vh - 60px);
    align-items: center;
}

/* Spintable Section */
.spintable-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.spintable {
    position: relative;
    width: 280px;
    height: 280px;
    margin-bottom: 20px;
}

.album-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: spin 20s linear infinite;
}

/* Pause animation when track is paused */
.album-cover.paused {
    animation-play-state: paused;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Progress Ring - SVG circle for track progress */
.progress-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    pointer-events: none;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

#progress-circle {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-dasharray: 660;
    stroke-dashoffset: 660;
    transition: stroke-dashoffset 0.3s linear;
}

.track-info {
    text-align: center;
    width: 100%;
}

.track-info h2 {
    font-size: 1.5em;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-info p {
    font-size: 1em;
    opacity: 0.8;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.time-display {
    font-size: 0.9em;
    opacity: 0.6;
    margin-top: 12px;
    font-variant-numeric: tabular-nums;
}

/* Lyrics Section */
.lyrics-section {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border-radius: 15px;
    padding: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    height: 100%;
    overflow: hidden;
}

.lyrics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.lyrics-header h3 {
    font-size: 1.3em;
    margin: 0;
}

.lyrics-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lyrics-container.empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder {
    text-align: center;
    opacity: 0.5;
    font-size: 1.1em;
}

.lyric-line {
    padding: 10px 0;
    font-size: 1.05em;
    line-height: 1.55;
    opacity: 0.6;
    transition: all 0.3s ease;
    cursor: pointer;
}

.lyric-line:hover {
    opacity: 0.8;
    padding-left: 10px;
}

.lyric-line.current {
    opacity: 1;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.15em;
    transform: translateX(5px);
}

/* Scrollbar styling */
.lyrics-container::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* Status Bar */
.status-bar {
    display: none;
}

#status-message {
    font-family: var(--font-mono);
}

/* ========================================
   SETTINGS MODAL STYLES
   ======================================== */

.settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
    transition: opacity 0.3s ease;
}

.settings-modal.hidden {
    display: none;
    opacity: 0;
}

.settings-modal-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 90%;
    max-width: 800px;
    height: 80vh;
    max-height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.settings-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--text-primary);
}

.settings-close {
    background: none;
    border: none;
    font-size: 2em;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-close:hover {
    color: var(--error-color);
}

.settings-tabs {
    display: flex;
    gap: 10px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.settings-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 16px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.settings-tab-btn:hover {
    color: var(--text-primary);
}

.settings-tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.settings-tabs-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.settings-tab-content {
    display: none;
}

.settings-tab-content.active {
    display: block;
}

.settings-tab-content h3 {
    margin: 20px 0 12px 0;
    font-size: 1.1em;
    color: var(--primary-color);
}

.settings-group {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-group label {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.95em;
}

.settings-group input[type="text"],
.settings-group select {
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95em;
}

.settings-group input[type="text"]::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.settings-group input[type="range"] {
    cursor: pointer;
}

.palette-preview {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.preview-color {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.preview-color:hover {
    transform: scale(1.1);
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.layout-btn {
    padding: 12px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85em;
}

.layout-btn:hover {
    border-color: var(--primary-color);
}

.layout-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.widget-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 6px;
    margin-bottom: 8px;
}

.remove-widget-btn {
    background: rgba(255,68,68,0.7);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
}

.widget-container {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr) !important;
    grid-auto-rows: minmax(120px, 1fr) !important;
    flex: 1 !important;
    overflow: hidden !important;
    gap: 16px !important;
    padding: 16px !important;
    box-sizing: border-box !important;
}

.widget {
    display: flex !important;
    flex-direction: column;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0;
    box-shadow: none;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    touch-action: none;
}

.widget:hover {
    border-color: transparent;
    box-shadow: none;
}

.widget.dragging {
    opacity: 0.9;
    box-shadow: 0 12px 32px var(--shadow-color);
}

.widget-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--border-color);
    cursor: move;
    user-select: none;
    flex-shrink: 0;
}

.widget-title {
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-primary);
}

.widget-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.widget-close:hover {
    color: var(--error-color);
}

.widget-content {
    flex: 1;
    padding: 16px;
    overflow: hidden;
    font-size: 0.9em;
    min-width: 0;
}

.widget-lyrics {
    background: var(--bg-card);
    border-color: var(--border-color);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.widget-lyrics:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 24px var(--shadow-color);
}

.widget-resize-handle {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 50%, var(--primary-color) 50%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.widget:hover .widget-resize-handle {
    opacity: 0.6;
}

.widget.resizing .widget-resize-handle {
    opacity: 1;
}

.widget-drag-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 14px;
    cursor: move;
    z-index: 5;
}

.widget-drag-handle-left {
    left: 0;
}

.widget-drag-handle-right {
    right: 0;
    bottom: 20px;
}

.widget-drag-handle-top {
    top: 0;
    left: 0;
    right: 0;
    height: 14px;
    width: auto;
}

.widget-drag-handle-bottom {
    bottom: 0;
    left: 0;
    right: 20px;
    height: 14px;
    width: auto;
}

.widget-spintable .widget-content {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Widget-specific styles */
.spintable-widget-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spintable-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    margin: 0 auto;
    max-width: 200px;
}

.widget-album-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    animation: spin 20s linear infinite;
    box-shadow: 0 8px 24px var(--shadow-color);
}

.widget-progress-ring {
    display: none;
}


body.theme-retro-wood-vinyl {
    background:
        radial-gradient(circle at 20% 15%, rgba(255, 236, 206, 0.09), transparent 35%),
        radial-gradient(circle at 85% 80%, rgba(130, 78, 40, 0.2), transparent 30%),
        repeating-linear-gradient(12deg, rgba(255, 255, 255, 0.02) 0 2px, rgba(0, 0, 0, 0.04) 2px 5px),
        linear-gradient(135deg, var(--bg-primary), var(--bg-secondary), var(--bg-gradient-end));
}

body.theme-retro-wood-vinyl #player-view {
    border: 1px solid rgba(255, 219, 169, 0.18);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 228, 181, 0.06);
    background: linear-gradient(160deg, rgba(64, 39, 24, 0.85), rgba(34, 22, 14, 0.92));
}

body.theme-retro-wood-vinyl .player-header {
    background: linear-gradient(180deg, rgba(94, 58, 34, 0.8), rgba(66, 40, 23, 0.82));
    border-bottom: 1px solid rgba(245, 210, 163, 0.2);
}

body.theme-retro-wood-vinyl .btn-small {
    background: rgba(160, 110, 62, 0.45);
    border: 1px solid rgba(245, 210, 163, 0.18);
}

body.theme-retro-wood-vinyl .btn-small:hover {
    background: rgba(197, 144, 87, 0.55);
}

body.theme-retro-wood-vinyl .spintable-image-container {
    border-radius: 50%;
    background: radial-gradient(circle at 45% 42%, #1c1c1c 0 6%, #0d0d0d 7% 100%);
    box-shadow:
        inset 0 0 0 2px rgba(205, 163, 104, 0.35),
        inset 0 0 26px rgba(0, 0, 0, 0.55),
        0 10px 22px rgba(0, 0, 0, 0.45);
}

body.theme-retro-wood-vinyl .widget-album-cover {
    width: 38%;
    height: 38%;
    animation: spin-label 20s linear infinite;
    box-shadow: 0 0 0 4px rgba(205, 163, 104, 0.45), 0 8px 18px var(--shadow-color);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

body.theme-retro-wood-vinyl .spintable-image-container::before {
    content: '';
    position: absolute;
    inset: 5%;
    border-radius: 50%;
    background: repeating-radial-gradient(circle, rgba(240, 240, 240, 0.045) 0 1px, rgba(0, 0, 0, 0) 1px 4px);
    pointer-events: none;
    z-index: 1;
}

body.theme-retro-wood-vinyl .spintable-image-container::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d9c299;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 2px rgba(72, 49, 28, 0.8);
    z-index: 3;
}

@keyframes spin-label {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.progress-ring,
#progress-circle {
    display: none !important;
}

.lyrics-widget-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.lyrics-widget-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.lyrics-line {
    padding: 6px 0;
    opacity: 0.6;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95em;
}

.lyrics-line:hover {
    opacity: 0.8;
    padding-left: 8px;
}

.lyrics-line.current {
    opacity: 1;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.05em;
}

.lyrics-placeholder {
    text-align: center;
    opacity: 0.5;
    padding: 20px;
}

.queue-widget-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 300px;
}

.queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.queue-item:hover {
    background: rgba(29, 185, 84, 0.1);
    border-left: 3px solid var(--primary-color);
}

.queue-number {
    min-width: 24px;
    color: var(--primary-color);
    font-weight: 600;
    flex-shrink: 0;
}

.queue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.queue-track-name {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-track-artist {
    color: var(--text-secondary);
    font-size: 0.8em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-placeholder {
    text-align: center;
    opacity: 0.5;
    padding: 20px;
}

.progress-widget-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 3px;
    width: 0%;
    transition: width 0.2s linear;
}

.progress-times {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-secondary);
    font-family: monospace;
}

.playback-widget-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
}

.playback-status,
.playback-device {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1em;
}

.status-icon,
.device-icon {
    font-size: 1.5em;
}

.status-text,
.device-name {
    color: var(--text-primary);
}

.track-info-widget-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: space-between;
    height: 100%;
    min-height: 180px;
}

.track-title {
    margin: 0;
    font-size: 1.3em;
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    margin: 0;
    font-size: 1.05em;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-album {
    margin: 0;
    font-size: 0.98em;
    color: var(--text-secondary);
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-stats {
    font-size: 0.95em;
    color: var(--text-secondary);
}

.clock-widget-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
}

.clock-time {
    font-size: 2.5em;
    font-weight: 600;
    font-family: monospace;
    color: var(--primary-color);
}

.clock-timezone {
    font-size: 0.8em;
    color: var(--text-secondary);
}

.stats-widget-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    height: 100%;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.75em;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.2em;
    color: var(--primary-color);
    font-weight: 600;
}


/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
        padding: 20px;
        gap: 30px;
        min-height: calc(100vh - 60px);
    }

    .spintable {
        width: 240px;
        height: 240px;
    }

    .progress-ring {
        width: 190px;
        height: 190px;
    }

    .lyrics-section {
        max-height: 400px;
        min-height: 300px;
    }
}

/* Responsive Design - Tablet (768px and below) */
@media (max-width: 768px) {
    #player-view {
        padding: 10px;
    }

    .player-header {
        flex-wrap: wrap;
        padding: 10px;
        gap: 8px;
    }

    .header-controls {
        width: 100%;
        gap: 5px;
    }

    .btn-small {
        flex: 1;
        font-size: 0.8em;
    }

    .widget-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .widget {
        min-height: 120px;
    }

    .spintable {
        width: 200px;
        height: 200px;
    }

    .queue-item {
        padding: 8px;
        font-size: 0.8em;
    }

    .queue-track-artist {
        font-size: 0.7em;
    }
}

/* Responsive Design - Mobile (640px and below) */
@media (max-width: 640px) {
    .login-container {
        padding: 30px 20px;
        max-width: 100%;
    }

    #player-view {
        width: 100%;
        height: 100%;
        max-height: calc(100vh - 16px);
        border-radius: 10px;
    }

    .player-header {
        flex-direction: column;
        align-items: stretch;
        padding: 8px;
    }

    .header-controls {
        width: 100%;
    }

    .btn-small {
        flex: 1;
        font-size: 0.75em;
        padding: 8px 4px;
        margin-left: 0;
        width: 100%;
    }

    .widget-container {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .widget {
        min-height: 120px;
    }

    .spintable {
        width: 150px;
        height: 150px;
    }

    .progress-ring {
        width: 100px;
        height: 100px;
    }

    .queue-item {
        padding: 6px;
        gap: 6px;
    }

    .queue-number {
        font-size: 0.8em;
    }

    .queue-track-name {
        font-size: 0.85em;
    }

    .queue-track-artist {
        font-size: 0.7em;
    }

    .widget-content {
        padding: 8px;
    }

    h1, h2, h3 {
        font-size: 1.1em;
    }
}
