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

@font-face {
    font-family: 'Fixel Display';
    src: url('../assets/font/FixelDisplay-Regular.woff2') format('woff2'),
         url('../assets/font/FixelDisplay-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Fixel Display';
    src: url('../assets/font/FixelDisplay-Medium.woff2') format('woff2'),
         url('../assets/font/FixelDisplay-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Fixel Display';
    src: url('../assets/font/FixelDisplay-Bold.woff2') format('woff2'),
         url('../assets/font/FixelDisplay-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

:root {
    --bg: #121212;
    --text: #FFFFFF;
    --border: rgba(217, 217, 217, 0.4);
    --accent: #FFFFFF;
    --dot-radius: 49%;
    --header-top: 40px;
    --footer-bottom: 40px;
    --wave-label-offset: 54px;
    --circle-top: 64px;
    --circle-height: calc(100vh - 128px);
    --text-position: calc(var(--circle-height) / 2 + 44px);
}

/* ============================================
   BASE STYLES
   ============================================ */

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ============================================
   BACKGROUND LAYERS
   ============================================ */

.bg-photo {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0;
    transition: opacity 1.2s ease;
}

.bg-photo.visible {
    opacity: 1;
}

#bgOverlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(18, 18, 18, 0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* ============================================
   CONTAINER
   ============================================ */

.container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    z-index: 2;
}

/* ============================================
   ZONE: HEADER (Логотип сверху)
   ============================================ */

.header {
    position: absolute;
    top: var(--header-top);
    left: 50%;
    width: auto;
    height: auto;
    transform: translateX(-50%);
    text-align: center;
    z-index: 50;
    pointer-events: none;
}

.header img {
    width: 108px;
    height: 46px;
    display: block;
}

/* ============================================
   ZONE: MAIN CONTENT
   ============================================ */

.main-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: visible;
}

/* ============================================
   ZONE: CIRCLES & DOTS (Круги с точками)
   ============================================ */

.circular-selector {
    position: absolute;
    top: var(--circle-top);
    width: var(--circle-height);
    height: var(--circle-height);
    z-index: 5;
    overflow: visible;
}

.left-selector {
    left: 0;
    transform: translateX(-50%);
}

.right-selector {
    right: 0;
    transform: translateX(50%);
}

.circle-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.circle-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    color: var(--border);
}

.selector-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Позиционирование точек на окружности */
.dot[style*="--angle: 0deg"] {
    right: calc(50% - var(--dot-radius));
    top: 50%;
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 45deg"] {
    right: calc(50% - var(--dot-radius) * 0.7071);
    top: calc(50% - var(--dot-radius) * 0.7071);
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 90deg"] {
    right: 50%;
    top: calc(50% - var(--dot-radius));
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 135deg"] {
    right: calc(50% + var(--dot-radius) * 0.7071);
    top: calc(50% - var(--dot-radius) * 0.7071);
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 180deg"] {
    right: calc(50% + var(--dot-radius));
    top: 50%;
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 225deg"] {
    right: calc(50% + var(--dot-radius) * 0.7071);
    top: calc(50% + var(--dot-radius) * 0.7071);
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 270deg"] {
    right: 50%;
    top: calc(50% + var(--dot-radius));
    transform: translate(50%, -50%);
}

.dot[style*="--angle: 315deg"] {
    right: calc(50% - var(--dot-radius) * 0.7071);
    top: calc(50% + var(--dot-radius) * 0.7071);
    transform: translate(50%, -50%);
}

.dot:hover {
    width: 16px;
    height: 16px;
}

.dot.active {
    width: 14px;
    height: 14px;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

/* ============================================
   ZONE: WAVE LABELS (Названия "theme" и "ambient")
   ============================================ */

.selector-label {
    position: absolute;
    width: auto;
    height: auto;
    font-size: 36px;
    font-weight: 500;
    color: var(--text);
    z-index: 100;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: block;
    visibility: visible;
    opacity: 1;
}

.selector-label.fade-in {
    transition: opacity 0.6s ease;
}

.left-selector-label {
    left: var(--wave-label-offset);
}

.right-selector-label {
    right: var(--wave-label-offset);
}

/* ============================================
   ZONE: CENTER INFO (Названия выбранных станций)
   ============================================ */

.center-info {
    display: none;
}

.scroll-area {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    z-index: 1;
}

.scroll-area-left {
    left: 0;
}

.scroll-area-right {
    right: 0;
}

.center-info-left,
.center-info-right {
    position: absolute;
    top: 50%;
    width: auto;
    height: auto;
    z-index: 10;
    pointer-events: none;
}

.center-info-left {
    left: var(--text-position);
}

.center-info-right {
    right: var(--text-position);
    text-align: right;
}

.center-icon {
    width: 64px;
    height: 64px;
    display: none;
    opacity: 0.9;
    transform: translateY(-50%);
    pointer-events: none;
}

.info-title {
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 54px;
    white-space: pre-line;
    line-height: 110%;
    transform: translateY(-50%);
    pointer-events: none;
}

.info-title.ani-exit-up,
.center-icon.ani-exit-up {
    animation: exitUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.info-title.ani-enter-down,
.center-icon.ani-enter-down {
    animation: enterDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.info-title.ani-exit-down,
.center-icon.ani-exit-down {
    animation: exitDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.info-title.ani-enter-up,
.center-icon.ani-enter-up {
    animation: enterUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes exitUp {
    from {
        opacity: 1;
        transform: translateY(-50%);
    }
    to {
        opacity: 0;
        transform: translateY(calc(-50% - 30px));
    }
}

@keyframes enterDown {
    from {
        opacity: 0;
        transform: translateY(calc(-50% + 30px));
    }
    to {
        opacity: 1;
        transform: translateY(-50%);
    }
}

@keyframes exitDown {
    from {
        opacity: 1;
        transform: translateY(-50%);
    }
    to {
        opacity: 0;
        transform: translateY(calc(-50% + 30px));
    }
}

@keyframes enterUp {
    from {
        opacity: 0;
        transform: translateY(calc(-50% - 30px));
    }
    to {
        opacity: 1;
        transform: translateY(-50%);
    }
}

.selector-display {
    display: none;
}

.selector-icon {
    display: none;
}

.theme-name,
.ambient-name {
    display: none;
}

/* ============================================
   ZONE: CENTER PLACEHOLDER (Select Stations)
   ============================================ */

.center-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 54px;
    text-align: center;
    line-height: 110%;
    white-space: pre;
    color: var(--text);
    opacity: 0.6;
    pointer-events: none;
    z-index: 8;
    transition: opacity 0.8s ease 0.3s;
}

.center-placeholder.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* ============================================
   ZONE: CENTER PLUS (Плюсик при обе выбрано)
   ============================================ */

.center-plus {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 54px;
    text-align: center;
    color: var(--text);
    opacity: 0.6;
    pointer-events: none;
    z-index: 8;
    transition: opacity 0.8s ease 0.3s;
}

.center-plus.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

/* ============================================
   ZONE: FOOTER (Навигация внизу)
   ============================================ */

.footer {
    position: absolute;
    bottom: var(--footer-bottom);
    left: 50%;
    width: auto;
    height: auto;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 50;
    pointer-events: none;
}

.footer a {
    color: var(--text);
    text-decoration: none;
    font-weight: 400;
    font-size: 13px;
    opacity: 0.7;
    transition: opacity 0.3s;
    cursor: pointer;
    pointer-events: auto;
}

.footer a:hover {
    opacity: 0.5;
}

.divider {
    opacity: 0.7;
}

.beta-label {
    color: var(--text);
    font-weight: 400;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.7;
}

/* ============================================
   ZONE: LANGUAGE POPOVER
   ============================================ */

.lang-popover {
    position: fixed;
    background: rgba(255, 255, 255, 0.09);
    border-radius: 8px;
    padding: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.28);
}

.lang-popover.visible {
    opacity: 1;
    pointer-events: auto;
}

.lang-popover-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.lang-item {
    padding: 6px 14px;
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    opacity: 0.7;
    border-radius: 4px;
    transition: opacity 0.2s;
    text-align: center;
    white-space: nowrap;
}

.lang-item:hover {
    opacity: 1;
}

.lang-item.active {
    opacity: 1;
    font-weight: 500;
}

/* ============================================
   ZONE: POPOVERS (Списки станций и управление)
   ============================================ */

.popover {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.09);
    border: none;
    border-radius: 8px;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.28);
}

.popover.visible {
    opacity: 1;
    pointer-events: auto;
}

.popover-left {
    left: 16px;
    width: 252px;
}

.popover-right {
    right: 16px;
    width: 252px;
}

.popover-volume {
    left: calc(16px + 252px + 12px);
    width: 88px;
    padding: 20px 8px;
    justify-content: center;
    display: flex;
}

.popover-volume-right {
    right: calc(16px + 252px + 12px);
    width: 88px;
    padding: 20px 8px;
    justify-content: center;
    display: flex;
}

.popover-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.popover-item {
    padding: 8px 12px;
    font-size: 14px;
    color: var(--text);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

#themePopoverList .popover-item {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    transition: padding-left 0.2s ease;
}

#ambientPopoverList .popover-item {
    justify-content: flex-end;
    transition: padding-right 0.2s ease;
}

.popover-item:hover {
    background-color: transparent;
}

.popover-item.active {
    background-color: transparent;
    font-weight: 500;
    padding-left: 20px;
}

.popover-item.active::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--text);
    border-radius: 50%;
    flex-shrink: 0;
}

/* Right popover active state (mirrored) */
#ambientPopoverList .popover-item.active {
    font-weight: 500;
    padding-right: 20px;
}

#ambientPopoverList .popover-item.active::before {
    display: none;
}

#ambientPopoverList .popover-item.active::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--text);
    border-radius: 50%;
    flex-shrink: 0;
}

.volume-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.volume-slider {
    width: 4px;
    height: 120px;
    outline: none;
    cursor: pointer;
    accent-color: var(--text);
    -webkit-appearance: slider-vertical;
    appearance: slider-vertical;
    writing-mode: bt-lr;
}

.volume-icon {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

/* ============================================
   ZONE: MODAL (About & Credits)
   ============================================ */

@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
    to {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
}

@keyframes modalContentIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalContentOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(18, 18, 18, 0.05);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.4s ease, backdrop-filter 0.4s ease;
    pointer-events: none;
}

.modal-backdrop.visible {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: modalFadeIn 0.4s ease;
}

.modal-backdrop.visible .modal-content {
    animation: modalContentIn 0.5s ease 0.1s both;
}

.modal-backdrop.closing {
    animation: modalFadeOut 0.6s ease forwards;
}

.modal-backdrop.closing .modal-content {
    animation: modalContentOut 0.3s ease forwards;
}

.modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 48px;
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1),
                inset 0 0 40px rgba(255, 255, 255, 0.05);
    /* Holographic effect with prismatic light */
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(200, 255, 255, 0.08) 25%, rgba(255, 200, 255, 0.08) 75%, rgba(255, 255, 200, 0.08) 100%),
                rgba(255, 255, 255, 0.08);
}

.modal-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}

.modal-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-title {
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #FFFFFF;
    text-transform: lowercase;
    letter-spacing: 0.05em;
}

.modal-text {
    font-family: 'Fixel Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 160%;
    color: rgba(255, 255, 255, 0.95);
    opacity: 1;
}

.modal-text p {
    margin-bottom: 12px;
}

.modal-text p:last-child {
    margin-bottom: 0;
}

.modal-text a {
    color: #FFFFFF;
    text-decoration: underline;
    cursor: pointer;
    transition: opacity 0.3s;
    font-weight: 500;
}

.modal-text a:hover {
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        padding: 32px;
    }

    .modal-columns {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .modal-title {
        font-size: 20px;
    }

    .modal-text {
        font-size: 13px;
    }
}

/* ============================================
   UTILITIES
   ============================================ */

audio {
    display: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .circle-container {
        width: var(--circle-height);
        height: var(--circle-height);
    }
    
    .info-title {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    :root {
        --header-top: 20px;
        --footer-bottom: 20px;
        --circle-height: 150px;
        --circle-top: calc((100vh - 150px) / 2);
    }
    
    .circular-selector {
        position: relative;
        transform: none !important;
        width: 200px;
        height: 200px;
        top: auto;
    }
    
    .left-selector,
    .right-selector {
        position: relative;
        transform: none !important;
        margin: 20px auto;
    }
    
    .selector-label {
        position: relative;
        transform: none !important;
        top: auto;
        left: auto !important;
        right: auto !important;
        display: block;
        margin-bottom: 10px;
    }
    
    .center-info {
        position: relative;
        transform: none !important;
        top: auto;
        left: auto;
        gap: 40px;
        margin: 40px auto;
    }
    
    .info-title {
        font-size: 24px;
    }
}

