@import url("https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Manrope:wght@300;400;500;600;700&display=swap");

:root {
    --bg: #090b12;
    --panel: #111622;
    --panel2: #151c29;
    --text: #f0f2f7;
    --muted: #929aaa;
    --faint: #5c6577;
    --line: rgba(205, 219, 255, .12);
    --purple: #a68cff;
    --blue: #7eb8ff;
    --mint: #a0f4d0;
    --font: 'Manrope', sans-serif;
    --mono: 'DM Mono', monospace
}

* {
    box-sizing: border-box
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.5 var(--font)
}

body {
    overflow-x: hidden
}

body:before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: radial-gradient(ellipse at 74% 8%, rgba(79, 66, 157, .14), transparent 38%), radial-gradient(ellipse at 5% 52%, rgba(25, 89, 120, .09), transparent 36%)
}

a {
    color: inherit;
    text-decoration: none
}

button, input {
    font: inherit;
    color: inherit
}

button {
    cursor: pointer
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .025;
    z-index: 10;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E")
}

.site-header {
    height: 82px;
    padding: 0 max(28px, calc((100vw - 1500px) / 2));
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    gap: 24px
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap
}

.brand-mark {
    width: 30px;
    height: 30px;
    border: 1px solid var(--mint);
    border-radius: 50%;
    display: grid;
    place-items: center
}

.brand-mark span {
    width: 9px;
    height: 9px;
    background: var(--mint);
    border-radius: 50%;
    box-shadow: 0 0 14px var(--mint)
}

.brand-name {
    font-size: 12px;
    letter-spacing: .14em
}

.brand-name b {
    font-weight: 700;
    color: var(--mint)
}

.main-nav {
    display: flex;
    align-items: center;
    gap: clamp(10px, 1.4vw, 22px)
}

.main-nav a {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap
}

.main-nav a:hover, .main-nav a.is-active {
    color: var(--mint)
}

.header-tools {
    display: flex;
    align-items: center;
    gap: 16px
}

.language-switch {
    display: flex;
    gap: 6px;
    align-items: center;
    font: 11px var(--mono);
    color: var(--faint)
}

.lang-button {
    border: 0;
    background: none;
    color: var(--muted);
    padding: 4px
}

.lang-button.is-active {
    color: var(--mint)
}

.header-play {
    padding: 9px 14px;
    border: 1px solid var(--line);
    border-radius: 22px;
    font-size: 12px
}

.tiny-play {
    color: var(--mint);
    margin-right: 6px
}

.relaxator-layout {
    width: 100%;
    max-width: 1700px;
    margin: 0 auto;
    padding: 22px 26px 28px;
    display: grid;
    grid-template-columns:minmax(0, 1fr) 350px;
    gap: 22px;
    align-items: start
}

.relaxator-workspace {
    min-width: 0
}

.relaxator-heading {
    margin: 0 0 17px
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font: 10px var(--mono);
    letter-spacing: .12em
}

.section-index {
    color: var(--mint)
}

h1 {
    font-size: clamp(22px, 2.3vw, 34px);
    line-height: 1.18;
    font-weight: 500;
    letter-spacing: -.035em;
    margin: 10px 0 5px;
    max-width: 920px
}

h1 em {
    font-style: normal;
    color: var(--mint)
}

.relaxator-heading {
    text-transform: uppercase;
    font-size: 12px;
    color: var(--muted);
    margin: 0
}

.relaxator-heading h1 {
    font-size: 18px;
    margin-bottom: 14px;
    font-weight: normal;
    letter-spacing: 1px;

}

.relaxator-heading span {
    font-weight: 700;
    color: var(--mint);
}

.compact-player {
    height: 60px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    background: rgba(17, 22, 34, .9);
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 14px;
    min-width: 0
}

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

.player-main-controls button, .mode-button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--panel2);
    font-size: 11px
}

.player-main-controls .play-button {
    width: 36px;
    height: 36px;
    background: var(--mint);
    color: #09120f;
    border: 0;
    font-weight: 700
}

.player-track {
    min-width: 100px;
    flex: 1;
    overflow: hidden
}

.player-track-line {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
    overflow: hidden
}

.player-track-line strong {
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis
}

.player-track-line > span {
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis
}

.player-track-meta {
    display: flex;
    gap: 12px;
    font-size: 9px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden
}

.player-track-meta span {
    overflow: hidden;
    text-overflow: ellipsis
}

.player-track-meta #now-tempo {
    color: var(--mint);
    flex-shrink: 0
}

.player-timeline {
    display: flex;
    align-items: center;
    gap: 6px;
    font: 9px var(--mono);
    color: var(--muted);
    width: 155px;
    flex-shrink: 0
}

.player-timeline input {
    width: 100%;
    min-width: 20px;
    accent-color: var(--mint)
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 14px
}

.player-volume input {
    width: 62px;
    accent-color: var(--mint)
}

.mode-button {
    font-size: 17px;
    flex-shrink: 0
}

.mode-button.is-active {
    border-color: var(--mint);
    color: var(--mint);
    background: rgba(160, 244, 208, .1)
}

.vizual-section {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: #02040a
}

.vizual-caption {
    height: 40px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(17, 22, 34, .82);
    font: 11px var(--mono);
    letter-spacing: .07em;
    color: #d7e3ff
}

.vizual-caption button {
    width: 30px;
    height: 30px;
    border: 0;
    background: transparent;
    font-size: 22px;
    color: var(--mint)
}

#vizual-frame {
    position: relative;
    height: clamp(300px, 46vh, 560px);
    min-height: 450px;
    overflow: hidden
}

#vizual-stage, .vizual-instance {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden
}

.vizual-instance {
    opacity: 0;
    transition: opacity .32s ease
}

.vizual-instance.is-visible {
    opacity: 1
}

.vizual-instance.is-leaving {
    opacity: 0
}

.vizual-canvas {
    display: block;
    width: 100%;
    height: 100%
}

.vizual-picker-section {
    margin-top: 15px
}

.picker-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 9px
}

.mono-label {
    font: 10px var(--mono);
    letter-spacing: .1em;
    color: var(--muted)
}

.picker-hint {
    font-size: 11px;
    color: var(--faint)
}

.vizual_box {
    display: grid;
    grid-template-rows: repeat(3, minmax(80px, 100px));   /* 3 ряда */
    grid-auto-flow: column;
    grid-auto-columns: minmax(80px, 1fr);                  /* колонки тянутся, но не уже 80px */
    gap: 8px;
    padding: 2px 2px 8px;
    max-height: calc(3 * 100px + 2 * 8px + 10px);          /* ~326px — под 3 ряда */
    width: 100%;
    max-width: 100%;
    overflow-x: auto;                                      /* если кнопок очень много — скролл, а не выезд */
    scrollbar-width: thin;
    scrollbar-color: #39465c transparent;
}

/* дочерние тайлы не должны раздувать колонку */
.vizual_box > * {
    min-width: 0;
    width: 100%;
}

/*.vizual_box {*/
/*    display: grid;*/
/*    !*grid-template-rows:repeat(2, minmax(80px, 100px));*!*/
/*    grid-template-rows:repeat(2, minmax(80px, 100px));*/
/*    grid-auto-flow: column;*/
/*    max-height: 216px;*/
/*    grid-auto-columns: clamp(80px, 8vw, 90px);*/
/*    gap: 8px;*/
/*    padding: 2px 2px 8px;*/
/*    scrollbar-width: thin;*/
/*    scrollbar-color: #39465c transparent*/
/*}*/

.vizual-tile {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(145deg, #172333, #0d111b);
    color: #b7c2d5;
    padding: 9px;
    display: flex;
    align-items: end;
    text-align: left;
    font-size: 11px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    transition: border-color .2s, background .2s, transform .2s
}


.vizual-tile:hover {
    border-color: rgba(160, 244, 208, .5);
    transform: translateY(-1px)
}

.vizual-tile.is-active {
    border-color: var(--mint);
    color: var(--mint);
    background: linear-gradient(145deg, rgba(160, 244, 208, .16), #111622);
    box-shadow: inset 0 0 0 1px rgba(160, 244, 208, .15)
}

.relaxator-sidebar {
    height: calc(100vh - 126px);
    min-height: 430px;
    max-height: 1000px;
    position: sticky;
    top: 18px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(17, 22, 34, .86)
}

.sidebar-heading {
    height: 45px;
    flex-shrink: 0;
    padding: 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line)
}

#track-count {
    font: 10px var(--mono);
    color: var(--faint)
}

.relax-track-list {
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: #39465c transparent
}

.relax-track {
    width: 100%;
    display: grid;
    grid-template-columns:60px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 0;
    border-bottom: 1px solid rgba(205, 219, 255, .07);
    background: transparent;
    text-align: left;
    min-height: 82px
}

.relax-track:hover {
    background: rgba(255, 255, 255, .035)
}

.relax-track.is-playing {
    background: rgba(160, 244, 208, .075);
    box-shadow: inset 2px 0 var(--mint)
}

.relax-track img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
    background: var(--panel2)
}

.relax-track-info {
    min-width: 0;
    display: block
}

.relax-track-top {
    display: flex;
    flex-direction: column;
    min-width: 0
}

.relax-track-top strong {
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.relax-track-artist {
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.relax-track-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 5px;
    min-width: 0;
    font-size: 9px;
    color: var(--faint)
}

.relax-track-genres {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1
}

.tempo {
    color: var(--mint);
    white-space: nowrap
}

.track-duration {
    align-self: start;
    padding-top: 3px;
    font: 9px var(--mono);
    color: var(--faint)
}

.site-footer {
    width: calc(100% - 52px);
    max-width: 1648px;
    margin: 10px auto 0;
    padding: 18px 0 24px;
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px
}

.footer-brand .brand-mark {
    width: 24px;
    height: 24px
}

.footer-note, .footer-copy {
    font-size: 10px;
    color: var(--faint)
}

#vizual-frame:fullscreen {
    height: 100vh;
    width: 100vw;
    border: 0;
    border-radius: 0
}

#vizual-frame:fullscreen #vizual-stage {
    inset: 0
}

#vizual-frame:fullscreen .vizual-canvas {
    width: 100%;
    height: 100%
}

@media (max-width: 1100px) {
    .site-header {
        padding-inline: 20px
    }

    .main-nav {
        gap: 10px
    }

    .main-nav a {
        font-size: 11px
    }

    .relaxator-layout {
        padding-inline: 16px;
        grid-template-columns:minmax(0, 1fr) 320px;
        gap: 14px
    }

    .player-timeline {
        width: 110px
    }

    .player-volume input {
        width: 45px
    }
}

@media (max-width: 850px) {
    .site-header {
        height: auto;
        min-height: 72px;
        flex-wrap: wrap;
        padding: 14px 18px;
        gap: 12px
    }

    .main-nav {
        order: 3;
        width: 100%;
        overflow-x: auto;
        padding: 4px 0 2px
    }

    .header-tools {
        margin-left: auto
    }

    .relaxator-layout {
        display: flex;
        flex-direction: column;
        padding: 18px 14px;
        width: 100%
    }

    .relaxator-workspace, .relaxator-sidebar {
        width: 100%
    }

    .relaxator-sidebar {
        position: static;
        height: 420px;
        min-height: 300px;
        max-height: 55vh;
        order: 2
    }

    .compact-player {
        gap: 6px;
        padding: 6px
    }

    .player-track-line > span {
        display: none
    }

    .player-timeline {
        width: 100px
    }

    .player-volume {
        display: none
    }

    #vizual-frame {
        height: clamp(300px, 55vh, 560px)
    }

    .site-footer {
        width: calc(100% - 28px);
        flex-wrap: wrap
    }

    .footer-note {
        display: none
    }
}

@media (max-width: 520px) {
    .brand-name {
        font-size: 10px
    }

    .header-play {
        padding: 7px 9px
    }

    .language-switch {
        display: none
    }

    h1 {
        font-size: 24px
    }

    .relaxator-layout {
        padding-top: 14px
    }

    .compact-player {
        height: auto;
        min-height: 60px;
        flex-wrap: wrap
    }

    .player-track {
        flex-basis: calc(100% - 150px)
    }

    .player-timeline {
        flex: 1;
        width: auto;
        order: 3
    }

    .player-volume {
        display: none
    }

    .mode-button {
        width: 27px;
        height: 27px
    }

    #vizual-frame {
        height: 360px
    }

    .vizual_box {
        grid-template-rows:repeat(2, 80px);
        grid-auto-columns: 80px;
        max-height: 176px
    }

    .picker-hint {
        font-size: 10px
    }

    .relax-track {
        grid-template-columns:60px minmax(0, 1fr) auto
    }
}

/* Компактный плеер: информация в одну строку, шкала ниже */
.compact-player {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.player-main-controls {
    flex: 0 0 auto;
}

.player-track {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    overflow: hidden;
}

.player-track-line {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    line-height: 1.2;
}

.player-track-line > * {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-track-line strong {
    flex: 0 0 auto;
    max-width: 24%;
    font-size: 12px;
}

.player-track-line #now-subtitle {
    max-width: 27%;
    font-size: 10px;
    color: var(--muted);
}

.player-track-line #now-genres {
    font-size: 10px;
    color: var(--muted);
}

.player-track-line #now-tempo {
    flex: 0 0 auto;
    font-size: 10px;
    color: var(--mint);
}

.player-timeline {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    font: 9px var(--mono);
    color: var(--muted);
}

.player-timeline input {
    display: block;
    flex: 1 1 auto;
    width: 0;
    min-width: 20px;
    margin: 0;
    accent-color: var(--mint);
}

.player-volume {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

.player-volume input {
    width: 62px;
    accent-color: var(--mint);
}

.mode-button {
    flex: 0 0 auto;
}

/* На узких экранах сохраняем читаемость и не сжимаем плеер до нуля */
@media (max-width: 1100px) {
    .compact-player {
        gap: 7px;
    }

    .player-main-controls {
        gap: 4px;
    }

    .player-main-controls button {
        width: 27px;
        height: 27px;
    }

    .player-main-controls .play-button {
        width: 32px;
        height: 32px;
    }

    .player-volume input {
        width: 42px;
    }

    .player-track-line {
        gap: 6px;
    }

    .player-track-line strong {
        max-width: 30%;
    }

    .player-track-line #now-subtitle {
        max-width: 25%;
    }
}

@media (max-width: 850px) {
    .compact-player {
        flex-wrap: wrap;
        height: auto;
        min-height: 60px;
    }

    .player-track {
        flex: 1 1 180px;
    }

    .player-track-line #now-subtitle {
        display: none;
    }

    .player-timeline {
        width: 100%;
    }

    .player-volume {
        display: none;
    }
}

@media (max-width: 520px) {
    .player-track-line {
        gap: 5px;
    }

    .player-track-line strong {
        max-width: 45%;
    }

    .player-track-line #now-genres {
        display: none;
    }

    .player-timeline {
        gap: 5px;
    }
}

