:root {
    --bg: #000000;

    --cyan: #00f6ff;
    --cyan-dim: #0a9db3;

    --glass-bg: rgba(0, 18, 22, 0.4);
    --glass-bg-strong: rgba(0, 26, 32, 0.55);
    --glass-border: rgba(0, 246, 255, 0.22);
    --glass-border-strong: rgba(0, 246, 255, 0.5);

    --text-primary: #eafdff;
    --text-secondary: #7fd3db;
    --text-muted: #3c5c60;

    --emerald: #00ffa3;
    --emerald-dim: #00c780;
    --rose: #ff2f6e;
    --rose-dim: #d9114f;
    --amber: #ffd000;

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;

    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;
    --font-mono: "SF Mono", "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

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

body {
    background-color: var(--bg);
    background-image:
        linear-gradient(rgba(0, 246, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 246, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 50% 0%, rgba(0, 246, 255, 0.16), transparent 45%),
        radial-gradient(circle at 100% 100%, rgba(0, 255, 163, 0.07), transparent 40%);
    background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%;
    background-attachment: fixed;
    background-repeat: repeat, repeat, no-repeat, no-repeat;
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

.page {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 48px 20px;
}

.page-center {
    align-items: center;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);
    border: 1px solid var(--glass-border);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(0, 246, 255, 0.08), inset 0 1px 0 rgba(0, 246, 255, 0.06);
}

.glass-sm {
    background: var(--glass-bg-strong);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid var(--glass-border);
}

.panel {
    position: relative;
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg);
    padding: 32px;
    height: fit-content;
    overflow: hidden;
}

.panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    box-shadow: 0 0 16px 1px var(--cyan);
    opacity: 0.7;
}

.panel-wide {
    max-width: 720px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    gap: 12px;
}

.brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin: 0;
    color: var(--text-primary);
    text-shadow: 0 0 16px rgba(0, 246, 255, 0.4);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 4px 0 20px;
}

/* status badge */

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
}

.pulse {
    height: 8px;
    width: 8px;
    border-radius: 999px;
    background: var(--text-muted);
}

.pulse.online {
    background: var(--emerald);
    box-shadow: 0 0 12px 2px var(--emerald);
    animation: pulse-glow 1.6s ease-in-out infinite;
}

.pulse.offline {
    background: var(--rose-dim);
    box-shadow: 0 0 8px 1px var(--rose-dim);
}

.pulse.busy {
    background: var(--amber);
    box-shadow: 0 0 12px 2px var(--amber);
    animation: pulse-glow 1s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.status-text {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.status-text.online { color: var(--emerald); text-shadow: 0 0 8px rgba(0, 255, 163, 0.5); }
.status-text.busy { color: var(--amber); text-shadow: 0 0 8px rgba(255, 208, 0, 0.5); }

/* buttons + links */

.link-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 14px;
    margin-bottom: 20px;
    border-radius: var(--radius-md);
    color: var(--cyan);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.link-btn:hover {
    border-color: var(--glass-border-strong);
    box-shadow: 0 0 20px rgba(0, 246, 255, 0.18);
    transform: translateY(-1px);
}

.link-btn-sm {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.link-btn-sm:hover { color: var(--cyan); }

.logout-row {
    margin-top: 20px;
    text-align: center;
}

.controls {
    display: flex;
    flex-direction: row;
    gap: 12px;
    margin: 20px 0;
}

.controls .btn {
    flex: 1;
}

@media (max-width: 560px) {
    .controls {
        flex-direction: column;
    }
}

.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 15px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    color: var(--text-primary);
    transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
}

.btn:not(:disabled):hover {
    transform: translateY(-2px);
}

.btn-start {
    background: linear-gradient(135deg, rgba(0, 255, 163, 0.22), rgba(0, 255, 163, 0.06));
    border-color: rgba(0, 255, 163, 0.45);
    box-shadow: 0 0 14px rgba(0, 255, 163, 0.12);
}
.btn-start:not(:disabled):hover { box-shadow: 0 0 28px rgba(0, 255, 163, 0.4); }

.btn-stop {
    background: linear-gradient(135deg, rgba(255, 47, 110, 0.22), rgba(255, 47, 110, 0.06));
    border-color: rgba(255, 47, 110, 0.45);
    box-shadow: 0 0 14px rgba(255, 47, 110, 0.12);
}
.btn-stop:not(:disabled):hover { box-shadow: 0 0 28px rgba(255, 47, 110, 0.4); }

.btn-update {
    background: linear-gradient(135deg, rgba(0, 246, 255, 0.2), rgba(0, 246, 255, 0.05));
    border-color: rgba(0, 246, 255, 0.4);
    box-shadow: 0 0 14px rgba(0, 246, 255, 0.12);
}
.btn-update:not(:disabled):hover { box-shadow: 0 0 28px rgba(0, 246, 255, 0.35); }

.w-full { width: 100%; }

/* cards */

.card {
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.card-title {
    margin: 0 0 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--cyan-dim);
}

/* player list */

.player-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.player {
    display: flex;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--emerald);
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.35);
}

.player .dot {
    height: 7px;
    width: 7px;
    border-radius: 999px;
    background: var(--emerald);
    margin-right: 10px;
    box-shadow: 0 0 8px 1px var(--emerald);
}

.player.muted {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
    text-shadow: none;
}

/* console */

.console {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    box-shadow: inset 0 0 24px rgba(0, 246, 255, 0.06);
    font-family: var(--font-mono);
    font-size: 0.76rem;
    line-height: 1.5;
    padding: 12px 14px;
    height: 380px;
    overflow-y: auto;
    color: #00ffa3;
}

.console .line {
    white-space: pre-wrap;
    word-break: break-word;
    opacity: 0.92;
    text-shadow: 0 0 6px rgba(0, 255, 163, 0.25);
}

.console .line.system { color: var(--cyan); font-weight: 600; text-shadow: 0 0 8px rgba(0, 246, 255, 0.4); }
.console .line.error { color: var(--rose); font-weight: 600; text-shadow: 0 0 8px rgba(255, 47, 110, 0.4); }
.console .empty { color: var(--text-muted); font-style: italic; text-shadow: none; }

/* progress bar */

.progress-wrap {
    display: none;
    margin: 20px 0;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
}

.progress-wrap.active { display: block; }

.progress-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: capitalize;
}

#progress-percent {
    color: var(--emerald);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.5);
}

.progress-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--glass-border);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--emerald-dim), var(--cyan));
    box-shadow: 0 0 14px rgba(0, 246, 255, 0.6);
    transition: width 0.4s ease;
}

/* login */

.login-card {
    display: flex;
    flex-direction: column;
    text-align: center;
}

.input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 16px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 246, 255, 0.3);
}

.error-text {
    color: var(--rose);
    font-size: 0.85rem;
    margin: -8px 0 16px;
    text-shadow: 0 0 8px rgba(255, 47, 110, 0.4);
}

/* settings page */

.settings-form {
    display: flex;
    flex-direction: column;
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 0;
    border-bottom: 1px solid var(--glass-border);
}

@media (min-width: 640px) {
    .setting-row {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.setting-input {
    margin-bottom: 0;
    color: var(--emerald);
    width: 100%;
}

@media (min-width: 640px) {
    .setting-input { width: 260px; }
}

.tip-wrap {
    position: relative;
    display: inline-flex;
}

.tip-icon {
    height: 16px;
    width: 16px;
    border-radius: 999px;
    background: var(--glass-bg-strong);
    border: 1px solid var(--glass-border);
    color: var(--cyan-dim);
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
}

.tip-box {
    display: none;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    padding: 10px 12px;
    background: rgba(0, 8, 10, 0.95);
    border: 1px solid var(--glass-border-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.4;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 246, 255, 0.15);
    z-index: 20;
}

.tip-wrap:hover .tip-box { display: block; }

.apply-btn { margin-top: 24px; }
