* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #09090b;
    color: #f4f4f5;
}

body {
    padding: 16px;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
    color: white;
}

.app {
    width: 100%;
    max-width: 850px;
    margin: auto;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    font-size: 28px;
}

header p {
    margin: 4px 0 0;
    color: #a1a1aa;
}

#connection {
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.online {
    background: #064e3b;
    color: #6ee7b7;
}

.offline {
    background: #3f1d1d;
    color: #fca5a5;
}

.connecting {
    background: #422006;
    color: #fdba74;
}

.card {
    background: #111113;
    border: 1px solid #27272a;
    border-radius: 18px;
    padding: 18px;
    margin-bottom: 16px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.25);
}

.card h2 {
    margin-top: 0;
    font-size: 18px;
}

.login-card {
    max-width: 450px;
    margin: 60px auto;
    text-align: center;
}

.login-card p {
    color: #a1a1aa;
}

input {
    width: 100%;
    padding: 14px;
    margin: 12px 0;
    border: 1px solid #3f3f46;
    border-radius: 12px;
    background: #18181b;
    color: white;
    outline: none;
    text-align: center;
    font-size: 20px;
}

input:focus {
    border-color: #71717a;
}

button {
    background: #27272a;
    border-radius: 12px;
    padding: 14px;
    min-height: 50px;
    font-weight: 700;
    transition:
        transform 0.1s,
        background 0.15s;
}

button:active {
    transform: scale(0.96);
}

button:hover {
    background: #3f3f46;
}

.primary {
    width: 100%;
    background: #2563eb;
}

.primary:hover {
    background: #1d4ed8;
}

.button-grid {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 10px;
}

.button-grid button.large {
    grid-column: span 1;
}

.media-controls {
    display: grid;
    grid-template-columns:
        1fr 1.5fr 1fr;
    gap: 10px;
}

.media-controls button {
    font-size: 22px;
}

.media-controls .play {
    font-size: 15px;
}

.stats {
    display: grid;
    grid-template-columns:
        repeat(3, 1fr);
    gap: 10px;
}

.stat {
    background: #18181b;
    border-radius: 14px;
    padding: 15px;
    text-align: center;
}

.stat span {
    display: block;
    color: #a1a1aa;
    font-size: 12px;
    margin-bottom: 6px;
}

.stat strong {
    font-size: 24px;
}

.touchpad {
    height: 260px;
    border: 2px dashed #3f3f46;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #71717a;
    touch-action: none;
    user-select: none;
    margin-bottom: 12px;
}

.touchpad:active {
    border-color: #71717a;
    background: #18181b;
}

.mouse-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.warning {
    width: 100%;
    margin-bottom: 10px;
    background: #713f12;
}

.danger {
    width: 100%;
    margin-bottom: 10px;
    background: #7f1d1d;
}

.danger:hover {
    background: #991b1b;
}

.danger-card {
    border-color: #451a1a;
}

.error {
    color: #f87171 !important;
    min-height: 20px;
}

.hidden {
    display: none !important;
}

@media (max-width: 600px) {

    body {
        padding: 10px;
    }

    header h1 {
        font-size: 23px;
    }

    .card {
        padding: 14px;
        border-radius: 15px;
    }

    .button-grid {
        grid-template-columns:
            repeat(2, 1fr);
    }

    .stats {
        gap: 6px;
    }

    .stat {
        padding: 12px 5px;
    }

    .stat strong {
        font-size: 20px;
    }

    .touchpad {
        height: 230px;
    }
}