:root {
    --bg: #0b1020;
    --panel: #121836;
    --muted: #8ea0ff;
    --text: #f3f6ff;
    --green: #5ee1a8;
    --pink: #ff7ab6;
    --yellow: #ffd166;
    --red: #ff6b6b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --radius: 18px;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial;
    background:
        radial-gradient(1200px 800px at 20% -10%, #1f2a6c 0%, rgba(31, 42, 108, 0) 60%),
        radial-gradient(1200px 800px at 120% 10%, #6f3aff 0%, rgba(111, 58, 255, 0) 60%),
        radial-gradient(1200px 800px at 20% 100%, #6f3aff 0%, rgba(111, 58, 255, 0) 60%),
        radial-gradient(1200px 800px at 100% 100%, #6f3aff 0%, rgba(111, 58, 255, 0) 60%),
        var(--bg);
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    /* stop tiling */
    background-attachment: fixed, fixed, fixed, fixed, fixed;
}

.wrap {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px
}

header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px
}

header .logo {
    font-size: 32px
}

header h1 {
    font-size: 26px;
    margin: 0;
    letter-spacing: .5px
}

.panels {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 18px;
    margin-top: 24px;
}

.card {
    background: linear-gradient(180deg, rgba(18, 24, 54, .98), rgba(18, 24, 54, .96));
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    background-clip: padding-box;
}

.card h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--muted)
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap
}

input[type=number],
input[type=text] {
    background: #0e1330;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 10px 12px;
    outline: 0;
    min-width: 90px;
}

input[type=checkbox] {
    transform: scale(1.1)
}

label {
    opacity: .9
}

button {
    background: #25307a;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .12);
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    transition: .15s transform ease, .15s opacity ease
}

button:hover {
    transform: translateY(-1px)
}

button.primary {
    background: #3a46a7
}

button.good {
    background: #1c6e4a
}

button.warn {
    background: #8a3349
}

button.ghost {
    background: transparent;
    border-color: rgba(255, 255, 255, .2)
}

.timer {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: 1px;
    margin: 10px 0
}

.muted {
    color: #b9c3ff
}

.grid {
    display: grid;
    gap: 12px
}

.friends {
    display: grid;
    gap: 12px
}

.friend {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
    background: rgba(255, 255, 255, .03);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;
    padding: 12px
}

.friend .name {
    font-weight: 600
}

.progress {
    height: 10px;
    background: #0e1330;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    overflow: hidden
}

.progress>span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--green), #4bd6ff);
    width: 0%
}

.kpis {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 6px
}

.kpi {
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 12px
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #1a1f41;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
    display: none
}

.footer {
    opacity: .7;
    font-size: 12px;
    margin-top: 18px
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px
}

.badge {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    font-size: 12px;
    background: rgba(255, 255, 255, .04)
}

.badge .dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ff6b6b
}

.badge.connected .dot {
    background: #5ee1a8
}

.badge.disconnected .dot {
    background: #ff6b6b
}

/* Layout helpers */
.row.wrap {
    flex-wrap: wrap;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 180px;
}

.align-end {
    align-self: flex-end;
}

/* Inputs styled like the rest of the app */
.input,
select.input {
    background: #0e1330;
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 12px;
    padding: 10px 12px;
    outline: 0;
}

/* Pill summary row */
.pills {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 14px;
}

.pill {
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
}

.note {
    font-size: 12px;
    color: #b9c3ff;
    opacity: .9;
}

/* Slight breathing room below this card */
#goalCard {
    margin-bottom: 14px;
}

#hbCtxMenu {
    position: fixed;
    z-index: 2000;
    display: none;
    min-width: 160px;
    background: #141a3a;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
    padding: 6px;
}

#hbCtxMenu button {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text);
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
}

#hbCtxMenu button:hover {
    background: rgba(255, 255, 255, .08);
}

#hbCtxMenu .danger {
    color: #ff8a8a;
}


@media (max-width:900px) {
    .panels {
        grid-template-columns: 1fr
    }

    .timer {
        font-size: 44px
    }
}