:root {
    --bg: #050708;
    --panel: #0a1012;
    --panel-2: #0d1518;
    --border: #16383d;
    --cyan: #00e5ff;
    --cyan-dim: #008fa0;
    --text: #d7faff;
    --muted: #55777c;
    --danger: #ff3864;
    --shadow: rgba(0, 229, 255, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(0, 229, 255, 0.07),
            transparent 40%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        "Courier New",
        Courier,
        monospace;

    letter-spacing: 0.04em;
}

body::before {
    content: "";

    position: fixed;
    inset: 0;

    pointer-events: none;

    background:
        linear-gradient(
            rgba(255, 255, 255, 0.015) 50%,
            transparent 50%
        );

    background-size: 100% 4px;

    opacity: 0.35;

    z-index: 10;
}


/* =========================
   LOGIN
   ========================= */

.login-page {
    min-height: 100vh;

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

    padding: 24px;
}

.login-shell {
    width: 100%;
    max-width: 440px;
}

.terminal-label {
    color: var(--cyan-dim);

    font-size: 11px;

    margin-bottom: 10px;

    letter-spacing: 0.18em;
}

.login-card {
    position: relative;

    background:
        linear-gradient(
            145deg,
            rgba(0, 229, 255, 0.035),
            transparent 45%
        ),
        var(--panel);

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

    padding: 36px;

    box-shadow:
        0 0 40px var(--shadow),
        inset 0 0 30px rgba(0, 229, 255, 0.025);
}

.login-card::before,
.login-card::after {
    content: "";

    position: absolute;

    width: 18px;
    height: 18px;

    border-color: var(--cyan);
}

.login-card::before {
    left: -1px;
    top: -1px;

    border-left: 2px solid;
    border-top: 2px solid;
}

.login-card::after {
    right: -1px;
    bottom: -1px;

    border-right: 2px solid;
    border-bottom: 2px solid;
}

.logo {
    color: var(--cyan);

    font-size: 30px;
    font-weight: bold;

    letter-spacing: 0.16em;

    text-shadow:
        0 0 8px rgba(0, 229, 255, 0.7),
        0 0 24px rgba(0, 229, 255, 0.25);
}

.subtitle {
    margin-top: 8px;
    margin-bottom: 30px;

    color: var(--muted);

    font-size: 11px;

    letter-spacing: 0.16em;
}

.login-card form {
    display: flex;
    flex-direction: column;
}

.login-card label {
    color: var(--cyan-dim);

    font-size: 11px;

    margin-bottom: 7px;
}

.login-card input {
    width: 100%;

    padding: 13px 12px;

    margin-bottom: 20px;

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

    background: #030607;

    color: var(--text);

    outline: none;

    font-family: inherit;
    font-size: 14px;

    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}

.login-card input:focus {
    border-color: var(--cyan);

    box-shadow:
        0 0 12px rgba(0, 229, 255, 0.12);
}

.login-card button,
.logout,
.control,
.play,
.ai-button {
    font-family: inherit;

    cursor: pointer;

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

    background: var(--panel-2);

    color: var(--cyan);

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

.login-card button {
    padding: 13px;

    margin-top: 4px;

    font-size: 13px;

    letter-spacing: 0.12em;
}

.login-card button:hover,
.logout:hover,
.control:hover,
.play:hover,
.ai-button:hover {
    border-color: var(--cyan);

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

    box-shadow:
        0 0 15px rgba(0, 229, 255, 0.12);
}

.connection-status {
    margin-top: 24px;

    color: var(--muted);

    font-size: 9px;

    text-align: center;

    letter-spacing: 0.1em;
}

.error {
    margin-bottom: 20px;

    padding: 10px;

    border: 1px solid rgba(255, 56, 100, 0.4);

    background: rgba(255, 56, 100, 0.06);

    color: var(--danger);

    font-size: 11px;
}


/* =========================
   PLAYER
   ========================= */

.topbar {
    height: 62px;

    display: flex;
    align-items: center;

    padding: 0 28px;

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

    background: rgba(5, 7, 8, 0.92);
}

.brand {
    color: var(--cyan);

    font-size: 18px;
    font-weight: bold;

    letter-spacing: 0.18em;

    text-shadow:
        0 0 8px rgba(0, 229, 255, 0.55);
}

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

    margin-left: auto;
    margin-right: 20px;

    color: var(--muted);

    font-size: 10px;

    letter-spacing: 0.1em;
}

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

    margin-right: 8px;

    border-radius: 50%;

    background: var(--cyan);

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

.logout {
    padding: 7px 10px;

    font-size: 10px;

    color: var(--muted);
}


/* =========================
   MAIN PLAYER
   ========================= */

.player {
    width: min(760px, calc(100% - 32px));

    margin: 0 auto;

    padding: 52px 0 70px;
}

.album {
    display: flex;
    justify-content: center;
}

.cover {
    width: min(420px, 78vw);
    aspect-ratio: 1;

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

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

    background:
        radial-gradient(
            circle,
            rgba(0, 229, 255, 0.12),
            transparent 55%
        ),
        #020405;

    color: var(--cyan);

    font-size: clamp(52px, 10vw, 96px);
    font-weight: bold;

    letter-spacing: 0.12em;

    box-shadow:
        0 0 50px rgba(0, 229, 255, 0.06),
        inset 0 0 60px rgba(0, 229, 255, 0.03);
}

.track-info {
    margin-top: 30px;

    text-align: center;
}

.artist {
    color: var(--cyan);

    font-size: 12px;

    letter-spacing: 0.16em;
}

.title {
    margin-top: 10px;

    font-size: clamp(22px, 4vw, 34px);

    font-weight: bold;

    letter-spacing: 0.04em;
}

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

    color: var(--muted);

    font-size: 11px;
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;

    gap: 12px;

    margin-top: 34px;
}

.control {
    width: 48px;
    height: 42px;

    font-size: 15px;
}

.play {
    width: 64px;
    height: 50px;

    border-color: var(--cyan);

    font-size: 18px;

    box-shadow:
        0 0 18px rgba(0, 229, 255, 0.08);
}

.progress {
    display: grid;

    grid-template-columns: 42px 1fr 42px;

    align-items: center;

    gap: 12px;

    margin-top: 30px;

    color: var(--muted);

    font-size: 9px;
}

.progress span:last-child {
    text-align: right;
}

input[type="range"] {
    width: 100%;

    accent-color: var(--cyan);

    cursor: pointer;
}

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

    gap: 14px;

    margin-top: 18px;

    color: var(--muted);

    font-size: 9px;
}

.volume input {
    flex: 1;
}


/* =========================
   PLAYLISTS
   ========================= */

.playlists {
    margin-top: 52px;

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

    padding-top: 22px;
}

.section-title {
    color: var(--cyan-dim);

    font-size: 10px;

    letter-spacing: 0.18em;

    margin-bottom: 14px;
}

.playlist-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 8px;
}

.playlist-item {
    display: flex;

    align-items: stretch;

    padding: 0;

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

    background: var(--panel);

    transition:
        border-color 0.15s,
        background 0.15s;
}

.playlist-item:hover {
    border-color: var(--cyan);

    background:
        rgba(0, 229, 255, 0.06);
}

.playlist-info {
    flex: 1;

    min-width: 0;

    padding: 14px;

    border: 0;

    background: transparent;

    color: var(--text);

    cursor: pointer;

    font-family: inherit;

    text-align: left;
}

.playlist-info:hover {
    background:
        rgba(0, 229, 255, 0.03);
}

.playlist-name {
    color: var(--cyan);

    font-size: 11px;
}

.playlist-meta {
    margin-top: 7px;

    color: var(--muted);

    font-size: 9px;
}

.playlist-delete {
    width: 48px;

    flex-shrink: 0;

    border: 0;

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

    background: transparent;

    color: var(--muted);

    cursor: pointer;

    font-family: inherit;

    font-size: 10px;

    transition:
        color 0.15s,
        background 0.15s;
}

.playlist-delete:hover {
    color: var(--cyan);

    background:
        rgba(0, 229, 255, 0.08);
}

.ai-entry {

    margin-top: 20px;

    text-align: center;
}

.ai-button {
    width: 100%;

    padding: 13px;

    border-color: var(--cyan-dim);

    font-size: 11px;

    letter-spacing: 0.12em;
}


/* =========================
   MOBILE
   ========================= */

@media (max-width: 600px) {

    .topbar {
        height: 56px;

        padding: 0 16px;
    }

    .brand {
        font-size: 15px;
    }

    .system-status {
        margin-right: 10px;

        font-size: 8px;
    }

    .logout {
        padding: 6px 7px;

        font-size: 8px;
    }

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

        padding-top: 32px;
    }

    .cover {
        width: min(340px, 82vw);
    }

    .title {
        font-size: 22px;
    }

    .playlist-list {
        grid-template-columns: 1fr;
    }

    .progress {
        grid-template-columns:
            36px 1fr 36px;

        gap: 8px;
    }
}


.cover {
    overflow: hidden;
}

.cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* =========================
   SCREEN SWITCHING
   ========================= */

.screen {
    display: none;
}

.screen.active {
    display: block;
}


/* =========================
   AI PLAYLIST
   ========================= */

.ai-player {
    width: min(760px, calc(100% - 32px));

    margin: 0 auto;

    padding: 70px 0;
}

.ai-window {
    border: 1px solid var(--cyan-dim);

    background:
        linear-gradient(
            145deg,
            rgba(0, 229, 255, 0.04),
            transparent 45%
        ),
        var(--panel);

    box-shadow:
        0 0 45px rgba(0, 229, 255, 0.08),
        inset 0 0 35px rgba(0, 229, 255, 0.025);
}

.ai-window-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 9px 12px;

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

    background:
        linear-gradient(
            90deg,
            rgba(0, 229, 255, 0.12),
            rgba(0, 229, 255, 0.025)
        );

    color: var(--cyan);

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

    letter-spacing: 0.1em;
}

.ai-window-code {
    color: var(--muted);

    font-size: 9px;
}

.ai-window-body {
    padding: 32px;
}

.ai-prompt-label {
    margin-bottom: 14px;

    color: var(--muted);

    font-size: 10px;

    letter-spacing: 0.14em;
}

.ai-prompt-line {
    display: flex;
    align-items: center;

    gap: 10px;

    padding: 0 12px;

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

    background: #030607;
}

.ai-prompt-line > span {
    color: var(--cyan);

    font-size: 15px;
}

.ai-prompt-line input {
    width: 100%;

    padding: 15px 0;

    border: 0;

    outline: none;

    background: transparent;

    color: var(--text);

    font-family: inherit;

    font-size: 14px;

    letter-spacing: 0.04em;
}

.ai-prompt-line:focus-within {
    border-color: var(--cyan);

    box-shadow:
        0 0 15px rgba(0, 229, 255, 0.1);
}

.ai-prompt-line input::placeholder {
    color: var(--muted);

    opacity: 0.7;
}


/* STATUS */

.ai-status {
    display: flex;

    gap: 8px;

    margin-top: 34px;

    padding-top: 18px;

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

    font-size: 9px;

    letter-spacing: 0.1em;
}

.ai-status-label {
    color: var(--cyan-dim);
}

#ai-status {
    color: var(--text);
}

#ai-status.generating {
    color: var(--cyan);

    animation: ai-pulse 1s infinite;
}

#ai-status.success {
    color: var(--cyan);
}

#ai-status.error {
    color: var(--danger);
}

@keyframes ai-pulse {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.45;
    }
}


/* ACTIONS */

.ai-actions {
    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 12px;

    margin-top: 28px;
}

.ai-generate,
.ai-back {
    padding: 12px 18px;

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

    background: var(--panel-2);

    color: var(--cyan);

    cursor: pointer;

    font-family: inherit;

    font-size: 10px;

    letter-spacing: 0.12em;

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

.ai-generate {
    border-color: var(--cyan);

    box-shadow:
        0 0 12px rgba(0, 229, 255, 0.06);
}

.ai-generate:hover,
.ai-back:hover {
    border-color: var(--cyan);

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

    box-shadow:
        0 0 15px rgba(0, 229, 255, 0.12);
}

.ai-generate:disabled {
    opacity: 0.45;

    cursor: wait;
}

.ai-back {
    color: var(--muted);
}


/* MOBILE AI */

@media (max-width: 600px) {

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

        padding-top: 32px;
    }

    .ai-window-body {
        padding: 22px 18px;
    }

    .ai-window-title {
        font-size: 9px;
    }

    .ai-actions {
        flex-direction: column;

        align-items: stretch;
    }

    .ai-generate,
    .ai-back {
        width: 100%;
    }
}
