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

body {
    font-family: 'Montserrat', sans-serif;
    background: #1e1e1e;
    color: #ffffff;
    overflow: hidden;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s;
}

.loading-content {
    text-align: center;
}

.loader {
    width: 60px;
    height: 60px;
    border: 3px solid #3e3e42;
    border-top: 3px solid #4fc3f7;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #4fc3f7;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 12px;
    font-weight: 400;
    color: #858585;
}

#scene-container {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
}

#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 48px;
    height: 48px;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 6px;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1001;
}

.hamburger {
    width: 24px;
    height: 2px;
    background: #4fc3f7;
    position: relative;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: #4fc3f7;
    left: 0;
}

.hamburger::before {
    top: -7px;
}

.hamburger::after {
    bottom: -7px;
}

/* Top Bar */
.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #252526;
    border-bottom: 1px solid #3e3e42;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-logo {
    font-size: 28px;
}

.app-title {
    font-size: 16px;
    font-weight: 700;
    color: #4fc3f7;
    letter-spacing: 1px;
}

.top-bar-center {
    flex: 1;
    max-width: 600px;
}

.search-container {
    width: 100%;
}

#global-search {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #ffffff;
    padding: 8px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#global-search:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.3);
}

.top-bar-right {
    display: flex;
    gap: 8px;
}

.icon-button {
    position: relative;
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.icon-button:hover {
    background: #37373d;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.3);
}

.icon-button .icon {
    font-size: 18px;
}

.icon-button .count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #ec407a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* Qt Panels */
.qt-panel {
    background: linear-gradient(to bottom, #252526, #232324);
    border: 1px solid #3e3e42;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.panel-header {
    background: #2d2d30;
    border-bottom: 1px solid #3e3e42;
    padding: 12px 16px;
    border-radius: 6px 6px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    font-size: 11px;
    font-weight: 700;
    color: #4fc3f7;
    letter-spacing: 2px;
}

.mobile-close-btn {
    display: none;
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 32px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    line-height: 1;
    padding: 0;
}

/* Left Panel */
.left-panel {
    position: absolute;
    top: 80px;
    left: 20px;
    width: 320px;
    max-height: calc(100vh - 240px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.region-search, .station-search {
    padding: 12px 16px;
    border-bottom: 1px solid #3e3e42;
}

.region-search input, .station-search input {
    width: 100%;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #ffffff;
    padding: 8px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    outline: none;
}

.region-search input:focus, .station-search input:focus {
    border-color: #4fc3f7;
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.3);
}

.region-list, .stations-container {
    overflow-y: auto;
    flex: 1;
}

.region-item {
    padding: 12px 16px;
    border-bottom: 1px solid #3e3e42;
    cursor: pointer;
    transition: background 0.2s;
}

.region-item:hover, .region-item:active {
    background: #2d2d30;
}

.region-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.region-emoji {
    font-size: 20px;
}

.region-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.region-meta {
    font-size: 11px;
    color: #858585;
}

.station-count {
    background: #2d2d30;
    padding: 2px 8px;
    border-radius: 3px;
}

.list-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #3e3e42;
    background: #2d2d30;
}

.back-btn {
    background: transparent;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #4fc3f7;
    padding: 6px 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.back-btn:hover, .back-btn:active {
    background: #37373d;
}

.station-item {
    padding: 12px 16px;
    border-bottom: 1px solid #3e3e42;
    transition: background 0.2s;
}

.station-item:hover, .station-item:active {
    background: #2d2d30;
}

.station-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.station-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.station-item-location {
    font-size: 11px;
    color: #858585;
}

.station-play-btn {
    background: #4fc3f7;
    border: none;
    border-radius: 50%;
    color: #1e1e1e;
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.station-play-btn:hover, .station-play-btn:active {
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.5);
}

.station-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.genre-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.station-genre {
    font-size: 10px;
    color: #858585;
    text-transform: uppercase;
}

/* Right Panel */
.right-panel {
    position: absolute;
    top: 80px;
    right: 20px;
    width: 320px;
    max-height: calc(100vh - 240px);
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.now-playing {
    padding: 20px;
    border-bottom: 1px solid #3e3e42;
}

.station-artwork {
    width: 100%;
    aspect-ratio: 1;
    background: #1e1e1e;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.artwork-placeholder {
    font-size: 64px;
    opacity: 0.3;
}

.station-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.station-location {
    font-size: 13px;
    font-weight: 500;
    color: #cccccc;
    margin-bottom: 12px;
}

.station-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.genre-tag, .stream-quality {
    display: inline-block;
    background: #4fc3f7;
    color: #1e1e1e;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stream-quality {
    background: #2d2d30;
    color: #858585;
}

.audio-controls {
    padding: 20px;
    border-bottom: 1px solid #3e3e42;
    position: relative;
}

.play-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #4fc3f7;
    border: none;
    color: #1e1e1e;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 auto 20px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.play-button:hover, .play-button:active {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.5);
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #3e3e42;
    border-top: 3px solid #4fc3f7;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.volume-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mute-btn {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 20px;
    cursor: pointer;
    min-width: 24px;
}

.volume-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    background: #3e3e42;
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: #4fc3f7;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.volume-value {
    font-size: 12px;
    font-weight: 600;
    color: #858585;
    min-width: 40px;
    text-align: right;
}

.stream-status {
    padding: 12px 20px;
    border-bottom: 1px solid #3e3e42;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #858585;
}

.status-dot.status-playing {
    background: #2ecc71;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.status-connecting {
    background: #f39c12;
}

.status-dot.status-error {
    background: #e74c3c;
}

.status-dot.status-paused {
    background: #858585;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: #cccccc;
}

.quick-actions {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-btn {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
}

.action-btn:hover, .action-btn:active {
    background: #37373d;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.3);
}

.action-btn .icon {
    font-size: 16px;
}

/* Radio Roulette Button */
.roulette-btn {
    position: fixed;
    bottom: 120px;
    right: 30px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ec407a, #ab47bc);
    border: 3px solid #3e3e42;
    box-shadow: 0 4px 20px rgba(236, 64, 122, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    z-index: 200;
    animation: roulettePulse 2s ease-in-out infinite;
}

.roulette-btn:hover, .roulette-btn:active {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(236, 64, 122, 0.6);
}

@keyframes roulettePulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(236, 64, 122, 0.4);
    }
    50% {
        box-shadow: 0 6px 30px rgba(236, 64, 122, 0.7);
    }
}

.roulette-icon {
    font-size: 32px;
    margin-bottom: 4px;
}

.roulette-text {
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-align: center;
    line-height: 1;
}

.roulette-glow {
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(236, 64, 122, 0.3), transparent);
    pointer-events: none;
}

/* Roulette Overlay */
.roulette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.roulette-content {
    text-align: center;
}

.roulette-spinner {
    font-size: 120px;
    animation: spin 1s linear infinite;
    margin-bottom: 30px;
}

.roulette-countdown {
    font-size: 80px;
    font-weight: 700;
    color: #4fc3f7;
    margin-bottom: 20px;
}

.roulette-message {
    font-size: 20px;
    font-weight: 600;
    color: #cccccc;
    letter-spacing: 1px;
}

/* Mobile Player Bar */
.mobile-player-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: #252526;
    border-top: 1px solid #3e3e42;
    padding: 8px 12px;
    z-index: 150;
    align-items: center;
    gap: 12px;
}

.mobile-player-info {
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.mobile-station-name {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.mobile-station-location {
    font-size: 10px;
    color: #858585;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.mobile-play-btn, .mobile-expand-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #4fc3f7;
    border: none;
    color: #1e1e1e;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.mobile-expand-btn {
    background: #2d2d30;
    color: #cccccc;
}

/* Bottom Control Bar */
.bottom-bar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(to bottom, #252526, #232324);
    border: 1px solid #3e3e42;
    border-radius: 6px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.global-stats {
    display: flex;
    gap: 20px;
    padding-right: 20px;
    border-right: 1px solid #3e3e42;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-size: 16px;
    font-weight: 700;
    color: #4fc3f7;
}

.stat-text {
    font-size: 10px;
    color: #858585;
}

.globe-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    background: #2d2d30;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #cccccc;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s, box-shadow 0.2s;
}

.control-btn:hover, .control-btn:active {
    background: #37373d;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.3);
}

/* Footer */
.footer {
    position: fixed;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 500;
    color: #858585;
    z-index: 50;
}

.footer a {
    color: #4fc3f7;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Scrollbars */
.region-list::-webkit-scrollbar,
.stations-container::-webkit-scrollbar,
.right-panel::-webkit-scrollbar {
    width: 8px;
}

.region-list::-webkit-scrollbar-track,
.stations-container::-webkit-scrollbar-track,
.right-panel::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.region-list::-webkit-scrollbar-thumb,
.stations-container::-webkit-scrollbar-thumb,
.right-panel::-webkit-scrollbar-thumb {
    background: #3e3e42;
    border-radius: 4px;
}

.region-list::-webkit-scrollbar-thumb:hover,
.stations-container::-webkit-scrollbar-thumb:hover,
.right-panel::-webkit-scrollbar-thumb:hover {
    background: #4fc3f7;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .top-bar {
        height: auto;
        padding: 8px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .top-bar-left {
        gap: 8px;
    }

    .app-logo {
        font-size: 24px;
    }

    .app-title {
        font-size: 11px;
    }

    .top-bar-center {
        order: 3;
        width: 100%;
        margin-top: 4px;
        max-width: none;
    }

    #global-search {
        font-size: 12px;
        padding: 6px 10px;
    }

    .top-bar-right {
        gap: 6px;
    }

    .icon-button {
        width: 36px;
        height: 36px;
    }

    .icon-button .icon {
        font-size: 16px;
    }

    .left-panel {
        left: -340px;
        top: 0;
        height: 100vh;
        max-height: 100vh;
        z-index: 1000;
    }

    .left-panel.mobile-open {
        transform: translateX(340px);
    }

    .right-panel {
        display: none;
    }

    .right-panel.mobile-expanded {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        z-index: 500;
        overflow-y: auto;
    }

    .right-panel.mobile-expanded .now-playing {
        flex-shrink: 0;
    }

    .right-panel.mobile-expanded .audio-controls {
        flex-shrink: 0;
    }

    .right-panel.mobile-expanded .stream-status {
        flex-shrink: 0;
    }

    .right-panel.mobile-expanded .quick-actions {
        flex-shrink: 0;
    }

    .mobile-close-btn {
        display: block;
    }

    .mobile-player-bar {
        display: flex;
    }

    .roulette-btn {
        width: 64px;
        height: 64px;
        bottom: 80px;
        right: 12px;
    }

    .roulette-icon {
        font-size: 26px;
    }

    .roulette-text {
        font-size: 6px;
    }

    .bottom-bar {
        bottom: 76px;
        padding: 8px 12px;
        gap: 12px;
    }

    .global-stats {
        gap: 12px;
        padding-right: 12px;
    }

    .stat-number {
        font-size: 13px;
    }

    .stat-text {
        font-size: 9px;
    }

    .control-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .footer {
        display: none;
    }
}

@media (max-width: 480px) {
    .app-title {
        font-size: 10px;
    }

    .roulette-btn {
        width: 56px;
        height: 56px;
    }

    .roulette-icon {
        font-size: 22px;
    }

    .roulette-text {
        font-size: 5px;
    }
}