/* =========================================================
   ASTRAWAVE MINI STUDIO
   STYLE SHEET
   ========================================================= */

:root {
    --bg-main: #080611;
    --bg-panel: #100c1c;
    --bg-panel-2: #151024;
    --bg-card: #19132a;
    --bg-card-hover: #211936;

    --purple: #8f7cff;
    --purple-bright: #b59cff;
    --pink: #ff4fd8;
    --cyan: #4de8ff;
    --blue: #657cff;
    --green: #67ffb0;
    --orange: #ffb85c;
    --red: #ff6b8a;

    --text-main: #f7f2ff;
    --text-soft: #b9afca;
    --text-muted: #766c87;

    --border: rgba(143, 124, 255, 0.22);
    --border-bright: rgba(143, 124, 255, 0.5);

    --shadow-purple: 0 0 25px rgba(143, 124, 255, 0.18);
    --shadow-pink: 0 0 25px rgba(255, 79, 216, 0.15);

    --radius: 14px;
    --radius-small: 9px;
}


/* =========================================================
   RESET
   ========================================================= */

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

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 15% 10%,
            rgba(143, 124, 255, 0.12),
            transparent 30%
        ),
        radial-gradient(
            circle at 85% 20%,
            rgba(255, 79, 216, 0.08),
            transparent 28%
        ),
        radial-gradient(
            circle at 50% 100%,
            rgba(77, 232, 255, 0.05),
            transparent 35%
        ),
        var(--bg-main);

    color: var(--text-main);

    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    overflow-x: hidden;
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.hidden {
    display: none !important;
}


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

.background-grid {
    position: fixed;
    inset: 0;

    pointer-events: none;
    z-index: -3;

    background-image:
        linear-gradient(
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px
        );

    background-size: 40px 40px;

    mask-image:
        linear-gradient(
            to bottom,
            black,
            transparent 90%
        );
}

.background-glow {
    position: fixed;

    width: 420px;
    height: 420px;

    border-radius: 50%;

    pointer-events: none;
    z-index: -2;

    filter: blur(90px);

    opacity: 0.12;
}

.glow-one {
    top: -180px;
    left: -120px;

    background: var(--purple);
}

.glow-two {
    top: 20%;
    right: -180px;

    background: var(--pink);
}


/* =========================================================
   TOP BAR
   ========================================================= */

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;

    min-height: 72px;
    width: 100%;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    padding: 12px 28px;

    background: rgba(8, 6, 17, 0.88);

    border-bottom: 1px solid var(--border);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.25),
        0 1px 20px rgba(143, 124, 255, 0.05);
}


/* =========================================================
   BRAND
   ========================================================= */

.brand {
    display: flex;
    align-items: center;

    gap: 13px;

    min-width: 0;
}

.brand-icon {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            rgba(143, 124, 255, 0.3),
            rgba(255, 79, 216, 0.18)
        );

    border: 1px solid rgba(143, 124, 255, 0.45);

    box-shadow:
        0 0 20px rgba(143, 124, 255, 0.18),
        inset 0 0 20px rgba(255, 255, 255, 0.03);

    color: var(--purple-bright);

    font-size: 21px;
    font-weight: 800;
}

.brand-text {
    display: flex;
    flex-direction: column;

    line-height: 1.1;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;

    letter-spacing: 0.3px;
}

.brand-subtitle {
    margin-top: 4px;

    color: var(--text-muted);

    font-size: 11px;
    font-weight: 600;

    text-transform: uppercase;
    letter-spacing: 1.5px;
}


/* =========================================================
   TOP BAR ACTIONS
   ========================================================= */

.topbar-actions {
    display: flex;
    align-items: center;

    gap: 8px;

    flex-wrap: wrap;
}

.topbar-actions button {
    border: 1px solid var(--border);

    background: rgba(255, 255, 255, 0.035);

    padding: 9px 14px;

    border-radius: 9px;

    color: var(--text-soft);

    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        color 0.18s ease,
        box-shadow 0.18s ease;
}

.topbar-actions button:hover {
    transform: translateY(-1px);

    border-color: var(--border-bright);

    background: rgba(143, 124, 255, 0.1);

    color: var(--text-main);

    box-shadow: var(--shadow-purple);
}

.topbar-actions button:active {
    transform: translateY(0);
}


/* =========================================================
   MAIN APP
   ========================================================= */

.studio {
    width: min(1500px, calc(100% - 40px));

    margin: 0 auto;

    padding: 34px 0 50px;
}


/* =========================================================
   SHARED PANELS
   ========================================================= */

.panel {
    position: relative;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.025),
            rgba(255, 255, 255, 0.008)
        ),
        var(--bg-panel);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.025);

    overflow: hidden;
}

.panel::before {
    content: "";

    position: absolute;

    top: 0;
    left: 0;
    right: 0;

    height: 1px;

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(143, 124, 255, 0.5),
            transparent
        );

    opacity: 0.7;
}


/* =========================================================
   STUDIO HEADER
   ========================================================= */

.studio-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;

    gap: 20px;

    margin: 24px 0 25px;
}

.studio-title-area h1 {
    font-size: clamp(30px, 4vw, 48px);

    line-height: 1;

    letter-spacing: -1.5px;

    background:
        linear-gradient(
            90deg,
            var(--text-main),
            var(--purple-bright),
            var(--pink)
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.studio-title-area > p:last-child {
    margin-top: 10px;

    max-width: 650px;

    color: var(--text-soft);

    font-size: 14px;
    line-height: 1.6;
}

.eyebrow {
    display: block;

    margin-bottom: 7px;

    color: var(--purple-bright);

    font-size: 10px;
    font-weight: 900;

    letter-spacing: 1.8px;

    text-transform: uppercase;
}

.studio-status {
    display: flex;
    align-items: center;

    gap: 8px;

    padding: 8px 12px;

    border: 1px solid rgba(77, 232, 255, 0.2);

    border-radius: 999px;

    background: rgba(77, 232, 255, 0.05);

    color: var(--cyan);

    font-size: 11px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;

    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;

    flex-shrink: 0;

    border-radius: 50%;

    background: var(--cyan);

    box-shadow: 0 0 10px var(--cyan);

    animation: statusPulse 2s infinite ease-in-out;
}

@keyframes statusPulse {
    0%,
    100% {
        opacity: 0.55;
        transform: scale(0.85);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}


/* =========================================================
   TRANSPORT
   ========================================================= */

.transport-panel {
    display: flex;
    align-items: center;

    gap: 15px;

    padding: 14px 16px;
}

.transport-controls {
    display: flex;
    align-items: center;

    gap: 7px;
}

.transport-button {
    width: 40px;
    height: 40px;

    display: grid;
    place-items: center;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: rgba(255, 255, 255, 0.035);

    cursor: pointer;

    color: var(--text-soft);

    transition:
        transform 0.16s ease,
        color 0.16s ease,
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease;
}

.transport-button:hover {
    transform: translateY(-1px);

    color: var(--text-main);

    background: rgba(143, 124, 255, 0.12);

    border-color: var(--border-bright);

    box-shadow: var(--shadow-purple);
}

.transport-button:active {
    transform: translateY(0);
}

.play-button {
    background:
        linear-gradient(
            135deg,
            rgba(143, 124, 255, 0.2),
            rgba(255, 79, 216, 0.1)
        );
}

.play-button.active {
    color: white;

    border-color: rgba(77, 232, 255, 0.4);

    box-shadow:
        0 0 18px rgba(77, 232, 255, 0.12);
}

.loop-button.active {
    color: white;

    background:
        linear-gradient(
            135deg,
            rgba(143, 124, 255, 0.28),
            rgba(255, 79, 216, 0.15)
        );

    border-color: rgba(143, 124, 255, 0.55);

    box-shadow:
        0 0 18px rgba(143, 124, 255, 0.16);
}

.transport-divider {
    width: 1px;
    height: 30px;

    background: var(--border);
}

.transport-info {
    display: flex;
    align-items: center;

    gap: 18px;
}

.tempo-control {
    display: flex;
    align-items: center;

    gap: 8px;
}

.tempo-control label,
.master-label {
    color: var(--text-muted);

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.tempo-control input {
    width: 70px;

    padding: 8px 9px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: rgba(0, 0, 0, 0.2);

    color: var(--text-main);

    text-align: center;

    outline: none;
}

.tempo-control input:focus {
    border-color: var(--purple);

    box-shadow:
        0 0 12px rgba(143, 124, 255, 0.15);
}

.time-display {
    min-width: 88px;

    display: flex;
    align-items: center;

    gap: 8px;
}

.time-label {
    color: var(--text-muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 0.8px;
}

.time-display strong {
    color: var(--text-soft);

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 12px;
}

.master-control {
    display: flex;
    align-items: center;

    gap: 9px;

    margin-left: auto;
}

#masterVolume {
    width: 125px;
}

#masterVolumeValue {
    min-width: 35px;

    color: var(--text-soft);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 10px;

    text-align: right;
}


/* =========================================================
   RANGE INPUTS
   ========================================================= */

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;

    width: 110px;
    height: 4px;

    border-radius: 99px;

    background: rgba(255, 255, 255, 0.08);

    outline: none;

    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;

    width: 13px;
    height: 13px;

    border-radius: 50%;

    background: var(--purple-bright);

    border: 2px solid var(--bg-panel);

    box-shadow:
        0 0 10px rgba(143, 124, 255, 0.55);

    transition: transform 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;

    border-radius: 50%;

    background: var(--purple-bright);

    border: 2px solid var(--bg-panel);

    box-shadow:
        0 0 10px rgba(143, 124, 255, 0.55);
}


/* =========================================================
   SEQUENCER
   ========================================================= */

.sequencer-panel {
    padding: 18px;
}

.sequencer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 16px;
}

.section-title {
    display: flex;
    align-items: center;

    gap: 10px;

    font-size: 15px;
    font-weight: 800;
}

.section-title-icon {
    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: rgba(143, 124, 255, 0.12);

    color: var(--purple-bright);

    font-size: 13px;
}

.section-description {
    display: block;

    margin-top: 5px;

    color: var(--text-muted);

    font-size: 11px;
}

.sequencer-actions {
    display: flex;
    gap: 7px;
}

.small-button {
    padding: 8px 12px;

    border: 1px solid var(--border);

    border-radius: 8px;

    background: rgba(255, 255, 255, 0.035);

    color: var(--text-soft);

    font-size: 10px;
    font-weight: 800;

    cursor: pointer;

    transition: 0.16s ease;
}

.small-button:hover {
    color: var(--text-main);

    background: rgba(143, 124, 255, 0.1);

    border-color: var(--border-bright);

    box-shadow: var(--shadow-purple);
}


/* =========================================================
   SEQUENCER SCROLL AREA
   ========================================================= */

.sequencer {
    width: 100%;

    overflow-x: auto;

    padding-bottom: 6px;
}

.sequencer::-webkit-scrollbar {
    height: 7px;
}

.sequencer::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.025);

    border-radius: 99px;
}

.sequencer::-webkit-scrollbar-thumb {
    background: rgba(143, 124, 255, 0.25);

    border-radius: 99px;
}


/* =========================================================
   STEP NUMBERS
   ========================================================= */

.step-numbers {
    min-width: 1060px;

    display: grid;

    grid-template-columns:
        165px
        repeat(16, minmax(34px, 1fr))
        125px;

    gap: 7px;

    align-items: center;

    margin-bottom: 7px;
}

.step-number {
    color: var(--text-muted);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 9px;

    text-align: center;
}

.step-number:nth-child(4n + 1) {
    color: var(--purple-bright);
}

.step-number-label {
    color: var(--text-muted);

    font-size: 8px;
    font-weight: 900;

    letter-spacing: 1px;

    text-align: center;
}


/* =========================================================
   TRACKS
   ========================================================= */

.tracks {
    min-width: 1060px;
}

.track {
    display: grid;

    grid-template-columns:
        165px
        minmax(544px, 1fr)
        125px;

    gap: 7px;

    align-items: center;

    margin-bottom: 9px;
}

.track:last-child {
    margin-bottom: 0;
}

.track-info {
    min-height: 43px;

    display: flex;
    align-items: center;

    gap: 10px;

    padding: 7px 10px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: rgba(255, 255, 255, 0.025);

    cursor: pointer;

    transition:
        border-color 0.16s ease,
        background 0.16s ease,
        box-shadow 0.16s ease;
}

.track:hover .track-info {
    border-color: var(--border-bright);

    background: rgba(143, 124, 255, 0.07);
}

.track.selected .track-info {
    border-color: rgba(77, 232, 255, 0.4);

    background:
        linear-gradient(
            135deg,
            rgba(77, 232, 255, 0.07),
            rgba(143, 124, 255, 0.08)
        );

    box-shadow:
        0 0 15px rgba(77, 232, 255, 0.06);
}

.track.muted .track-info {
    opacity: 0.45;
}

.track-icon {
    width: 29px;
    height: 29px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 8px;

    background: rgba(143, 124, 255, 0.1);

    color: var(--purple-bright);

    font-size: 14px;
}

.track-icon.drums {
    background: rgba(143, 124, 255, 0.12);
}

.track-icon.bass {
    background: rgba(255, 79, 216, 0.1);
}

.track-icon.piano {
    background: rgba(77, 232, 255, 0.1);
}

.track-icon.synth {
    background: rgba(101, 124, 255, 0.12);
}

.track-icon.guitar {
    background: rgba(255, 184, 92, 0.1);
}

.track-name-text {
    min-width: 0;
}

.track-name-text strong {
    display: block;

    font-size: 12px;
    font-weight: 800;
}

.track-name-text span {
    display: block;

    margin-top: 2px;

    color: var(--text-muted);

    font-size: 9px;
}


/* =========================================================
   STEP GRID
   ========================================================= */

.step-grid {
    display: grid;

    grid-template-columns:
        repeat(16, minmax(34px, 1fr));

    gap: 7px;

    min-width: 0;
}

.step {
    position: relative;

    min-height: 43px;

    border: 1px solid rgba(143, 124, 255, 0.12);

    border-radius: 7px;

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.025),
            rgba(255, 255, 255, 0.01)
        );

    cursor: pointer;

    transition:
        transform 0.12s ease,
        background 0.12s ease,
        border-color 0.12s ease,
        box-shadow 0.12s ease;
}

.step:hover {
    transform: translateY(-1px);

    border-color: rgba(143, 124, 255, 0.4);

    background: rgba(143, 124, 255, 0.08);
}

.step:nth-child(4n + 1) {
    border-left-color: rgba(143, 124, 255, 0.3);
}

.step.active {
    background:
        linear-gradient(
            145deg,
            rgba(143, 124, 255, 0.8),
            rgba(255, 79, 216, 0.65)
        );

    border-color: rgba(255, 255, 255, 0.4);

    box-shadow:
        0 0 13px rgba(143, 124, 255, 0.28),
        inset 0 0 10px rgba(255, 255, 255, 0.08);
}

.step.playing {
    box-shadow:
        0 0 0 2px var(--cyan),
        0 0 18px rgba(77, 232, 255, 0.4);
}

.track:nth-child(2) .step.active {
    background:
        linear-gradient(
            145deg,
            rgba(255, 79, 216, 0.68),
            rgba(143, 124, 255, 0.7)
        );
}

.track:nth-child(3) .step.active {
    background:
        linear-gradient(
            145deg,
            rgba(77, 232, 255, 0.65),
            rgba(143, 124, 255, 0.65)
        );
}

.track:nth-child(4) .step.active {
    background:
        linear-gradient(
            145deg,
            rgba(255, 79, 216, 0.7),
            rgba(143, 124, 255, 0.75)
        );
}

.track:nth-child(5) .step.active {
    background:
        linear-gradient(
            145deg,
            rgba(255, 184, 92, 0.65),
            rgba(255, 79, 216, 0.65)
        );
}


/* =========================================================
   TRACK CONTROLS
   ========================================================= */

.track-controls {
    min-height: 43px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    gap: 7px;

    padding: 5px 8px;

    border: 1px solid var(--border);

    border-radius: 9px;

    background: rgba(255, 255, 255, 0.025);
}

.track-control {
    min-width: 27px;
    height: 27px;

    border: 1px solid var(--border);

    border-radius: 6px;

    background: rgba(255, 255, 255, 0.025);

    color: var(--text-muted);

    font-size: 9px;
    font-weight: 800;

    cursor: pointer;

    transition: 0.16s ease;
}

.track-control:hover {
    color: var(--text-main);

    border-color: var(--border-bright);

    background: rgba(143, 124, 255, 0.1);
}

.track-control.active {
    color: white;

    background: rgba(255, 79, 216, 0.18);

    border-color: rgba(255, 79, 216, 0.45);

    box-shadow:
        0 0 10px rgba(255, 79, 216, 0.12);
}

.solo-button.active {
    background: rgba(77, 232, 255, 0.16);

    border-color: rgba(77, 232, 255, 0.42);

    color: var(--cyan);
}

.track-volume {
    width: 65px !important;
}


/* =========================================================
   BOTTOM GRID
   ========================================================= */

.bottom-grid {
    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        minmax(300px, 380px);

    gap: 18px;

    margin-top: 18px;
}


/* =========================================================
   PANEL HEADING
   ========================================================= */

.panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 15px;

    padding: 18px 18px 0;
}

.panel-heading h3 {
    font-size: 18px;
    font-weight: 850;

    letter-spacing: -0.3px;
}


/* =========================================================
   INSTRUMENT PANEL
   ========================================================= */

.instrument-panel {
    min-width: 0;
}

.instrument-content {
    display: grid;

    grid-template-columns:
        170px
        minmax(190px, 1fr)
        minmax(260px, 1.5fr);

    gap: 14px;

    padding: 18px;
}

.instrument-info {
    min-height: 180px;

    padding: 15px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background:
        radial-gradient(
            circle at 100% 0%,
            rgba(255, 79, 216, 0.09),
            transparent 55%
        ),
        rgba(255, 255, 255, 0.018);
}

.instrument-label {
    color: var(--text-muted);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1.4px;

    text-transform: uppercase;
}

.instrument-name {
    margin-top: 8px;

    font-size: 23px;
    font-weight: 900;

    letter-spacing: -0.5px;

    background:
        linear-gradient(
            90deg,
            var(--text-main),
            var(--purple-bright)
        );

    -webkit-background-clip: text;
    background-clip: text;

    color: transparent;
}

.instrument-description {
    margin-top: 14px;

    color: var(--text-soft);

    font-size: 10px;

    line-height: 1.55;
}

.instrument-badge {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    width: fit-content;

    padding: 6px 9px;

    border: 1px solid rgba(77, 232, 255, 0.22);

    border-radius: 999px;

    background: rgba(77, 232, 255, 0.05);

    color: var(--cyan);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.instrument-badge::before {
    content: "";

    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--cyan);

    box-shadow: 0 0 8px var(--cyan);
}


/* =========================================================
   KNOBS
   ========================================================= */

.knob-area {
    min-height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    gap: 18px;

    padding: 12px;

    border: 1px solid var(--border);

    border-radius: 11px;

    background: rgba(255, 255, 255, 0.015);
}

.knob-container {
    display: flex;
    flex-direction: column;

    align-items: center;

    gap: 7px;
}

.knob {
    position: relative;

    width: 58px;
    height: 58px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background:
        conic-gradient(
            from 225deg,
            var(--purple) 0deg,
            var(--purple) 190deg,
            rgba(255, 255, 255, 0.08) 190deg,
            rgba(255, 255, 255, 0.08) 270deg,
            transparent 270deg
        );

    box-shadow:
        0 0 20px rgba(143, 124, 255, 0.12),
        inset 0 0 12px rgba(0, 0, 0, 0.55);

    cursor: pointer;

    transition:
        transform 0.15s ease,
        filter 0.15s ease;
}

.knob:hover {
    transform: scale(1.04);

    filter:
        drop-shadow(
            0 0 8px rgba(143, 124, 255, 0.25)
        );
}

.knob::before {
    content: "";

    width: 44px;
    height: 44px;

    border-radius: 50%;

    background:
        radial-gradient(
            circle at 35% 30%,
            #30264a,
            #100c1c 70%
        );

    border: 1px solid rgba(255, 255, 255, 0.08);

    box-shadow:
        inset 0 2px 5px rgba(255, 255, 255, 0.05);
}

.knob-indicator {
    position: absolute;

    top: 8px;
    left: 50%;

    width: 2px;
    height: 12px;

    transform-origin: 50% 21px;

    transform:
        translateX(-50%)
        rotate(35deg);

    border-radius: 99px;

    background: white;

    box-shadow:
        0 0 7px rgba(255, 255, 255, 0.7);

    pointer-events: none;
}

.knob-label {
    color: var(--text-muted);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 0.9px;

    text-transform: uppercase;

    text-align: center;
}

.knob-value {
    color: var(--text-soft);

    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;

    font-size: 8px;
}


/* =========================================================
   WAVE DISPLAY
   ========================================================= */

.wave-display {
    position: relative;

    min-height: 180px;

    display: flex;
    flex-direction: column;

    padding: 11px;

    border: 1px solid var(--border);

    border-radius: 11px;

    overflow: hidden;

    background:
        radial-gradient(
            circle at center,
            rgba(143, 124, 255, 0.08),
            transparent 70%
        );
}

.visualizer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-bottom: 7px;

    color: var(--text-muted);

    font-size: 8px;
    font-weight: 800;

    letter-spacing: 1px;

    text-transform: uppercase;
}

.visualizer-status {
    color: var(--cyan);

    font-size: 8px;
}

#visualizer {
    width: 100%;
    flex: 1;

    min-height: 130px;

    display: block;

    border-radius: 8px;

    background:
        linear-gradient(
            180deg,
            rgba(143, 124, 255, 0.04),
            rgba(0, 0, 0, 0.16)
        );
}

.wave-overlay {
    position: absolute;

    right: 18px;
    bottom: 16px;

    pointer-events: none;

    color: rgba(255, 255, 255, 0.3);

    font-size: 8px;

    letter-spacing: 1.2px;
}


/* =========================================================
   EXPORT PANEL
   ========================================================= */

.export-panel {
    min-width: 0;
}

.export-icon {
    width: 32px;
    height: 32px;

    display: grid;
    place-items: center;

    border-radius: 8px;

    background: rgba(255, 79, 216, 0.1);

    border: 1px solid rgba(255, 79, 216, 0.22);

    color: var(--pink);

    font-size: 15px;
}

.export-content {
    display: flex;
    flex-direction: column;

    gap: 18px;

    padding: 18px;
}

.export-info {
    display: flex;
    align-items: center;

    gap: 12px;
}

.export-icon-large {
    width: 42px;
    height: 42px;

    display: grid;
    place-items: center;

    flex-shrink: 0;

    border-radius: 10px;

    background:
        linear-gradient(
            135deg,
            rgba(143, 124, 255, 0.15),
            rgba(255, 79, 216, 0.1)
        );

    border: 1px solid var(--border);

    font-size: 18px;
}

.export-title {
    font-size: 13px;
    font-weight: 800;
}

.export-description {
    margin-top: 4px;

    color: var(--text-muted);

    font-size: 10px;

    line-height: 1.5;
}

.export-button {
    width: 100%;

    padding: 12px 17px;

    border: 1px solid rgba(143, 124, 255, 0.5);

    border-radius: 9px;

    background:
        linear-gradient(
            135deg,
            rgba(143, 124, 255, 0.2),
            rgba(255, 79, 216, 0.13)
        );

    color: var(--text-main);

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        box-shadow 0.18s ease;
}

.export-button:hover {
    transform: translateY(-1px);

    border-color: rgba(255, 255, 255, 0.45);

    box-shadow:
        0 0 25px rgba(143, 124, 255, 0.18);
}

.export-button:active {
    transform: translateY(0);
}

.export-button:disabled {
    opacity: 0.55;

    cursor: wait;

    transform: none;
}

.export-note {
    color: var(--text-muted);

    font-size: 9px;

    line-height: 1.4;

    text-align: center;
}


/* =========================================================
   FOOTER
   ========================================================= */

.footer {
    width: min(1500px, calc(100% - 40px));

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin: 0 auto;

    padding: 0 0 35px;

    color: var(--text-muted);

    font-size: 10px;

    letter-spacing: 0.5px;
}

.footer span:last-child {
    color: var(--purple-bright);
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background:
        linear-gradient(
            180deg,
            rgba(143, 124, 255, 0.45),
            rgba(255, 79, 216, 0.35)
        );

    border-radius: 99px;

    border: 2px solid var(--bg-main);
}

::-webkit-scrollbar-thumb:hover {
    background:
        linear-gradient(
            180deg,
            rgba(143, 124, 255, 0.7),
            rgba(255, 79, 216, 0.55)
        );
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1250px) {

    .instrument-content {
        grid-template-columns:
            1fr
            1fr;
    }

    .instrument-info {
        min-height: 150px;
    }

    .wave-display {
        grid-column: 1 / -1;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 900px) {

    .transport-panel {
        flex-wrap: wrap;
    }

    .master-control {
        width: 100%;
        margin-left: 0;
    }

    #masterVolume {
        flex: 1;
        width: auto;
    }

    .studio-header {
        align-items: flex-start;

        flex-direction: column;
    }
}


@media (max-width: 760px) {

    .topbar {
        padding: 10px 15px;

        align-items: flex-start;
    }

    .brand-subtitle {
        display: none;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .brand-title {
        font-size: 14px;
    }

    .topbar-actions {
        gap: 5px;
    }

    .topbar-actions button {
        padding: 8px 10px;

        font-size: 10px;
    }

    .studio {
        width: min(100% - 24px, 1500px);

        padding-top: 25px;
    }

    .studio-title-area h1 {
        font-size: 32px;
    }

    .transport-panel {
        align-items: flex-start;

        padding: 12px;
    }

    .transport-info {
        width: 100%;
    }

    .sequencer-panel {
        padding: 13px;
    }

    .sequencer-header {
        align-items: flex-start;

        flex-direction: column;
    }

    .sequencer-actions {
        width: 100%;
    }

    .small-button {
        flex: 1;
    }

    .instrument-content {
        grid-template-columns: 1fr;
    }

    .wave-display {
        grid-column: auto;
    }

    .knob-area {
        min-height: 160px;
    }

    .footer {
        width: calc(100% - 24px);

        flex-direction: column;

        text-align: center;
    }
}


@media (max-width: 500px) {

    .topbar {
        min-height: 62px;
    }

    .topbar-actions button {
        font-size: 0;
    }

    .topbar-actions button:first-child::before {
        content: "+";
        font-size: 15px;
    }

    .topbar-actions button:nth-child(2)::before {
        content: "↓";
        font-size: 15px;
    }

    .topbar-actions button:nth-child(3)::before {
        content: "↑";
        font-size: 15px;
    }

    .studio-title-area h1 {
        font-size: 28px;
    }

    .studio-title-area > p:last-child {
        font-size: 12px;
    }

    .transport-controls {
        width: 100%;
    }

    .transport-button {
        flex: 1;
    }

    .transport-info {
        justify-content: space-between;
    }

    .tempo-control input {
        width: 62px;
    }

    .master-control {
        flex-wrap: wrap;
    }

    .knob-area {
        gap: 10px;
    }

    .knob {
        width: 52px;
        height: 52px;
    }

    .knob::before {
        width: 39px;
        height: 39px;
    }

    .knob-indicator {
        top: 7px;
    }

    .knob-label {
        font-size: 7px;
    }

    .export-content {
        padding-top: 15px;
    }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;

        transition-duration: 0.01ms !important;
    }
}