body {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.87);
    background-color: #000000;
}

#app {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Name gate: covers everything until the player has a name, so it sits above
   every other overlay and is the only thing on screen that takes clicks. */
#name-gate {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #05080c;
    font-family: system-ui, sans-serif;
    z-index: 100;
}

.name-gate-dialog {
    display: flex;
    flex-direction: column;
    width: min(360px, calc(100vw - 48px));
    padding: 24px;
    background-color: rgba(11, 15, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}

.name-gate-title {
    margin: 0 0 18px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-align: center;
    color: #ffd25a;
}

.name-gate-label {
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

.name-gate-input {
    padding: 10px 12px;
    font-family: inherit;
    font-size: 16px;
    color: inherit;
    background-color: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
}

.name-gate-input:focus {
    outline: none;
    border-color: #ffd25a;
}

.name-gate-hint {
    margin: 6px 0 16px;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.45);
}

.name-gate-play {
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0b0f14;
    background-color: #ffd25a;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.name-gate-play:disabled {
    color: rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.1);
    cursor: not-allowed;
}

/* A HUD panel your own blob has wandered under. Faded rather than hidden: the
   leaderboard is still readable at a glance through it, and a panel that
   vanished outright would read as a bug. See ui/overlayFade.ts. */
.hud-panel-dimmed {
    opacity: 0.2;
}

#rank-table,
#radar,
#sucker-status {
    transition: opacity 180ms ease-out;
}

#rank-table {
    position: fixed;
    top: 12px;
    left: 12px;
    width: 220px;
    padding: 10px 12px;
    background-color: rgba(11, 15, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-family: system-ui, sans-serif;
    font-size: 13px;
    pointer-events: none;
    z-index: 10;
}

.rank-table-title {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

#rank-table ol {
    list-style: none;
    margin: 0;
    padding: 0;
}

#rank-table li {
    display: flex;
    align-items: center;
    padding: 2px 4px;
    border-radius: 4px;
}

.rank-table-rank {
    width: 1.5em;
    color: rgba(255, 255, 255, 0.5);
}

.rank-table-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.rank-table-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-table-mass {
    font-variant-numeric: tabular-nums;
    color: rgba(255, 255, 255, 0.75);
}

.rank-table-self {
    background-color: rgba(255, 210, 90, 0.22);
    font-weight: 600;
}

.rank-table-self .rank-table-mass,
.rank-table-self .rank-table-rank {
    color: #ffd25a;
}

#radar {
    position: fixed;
    bottom: 12px;
    left: 12px;
    padding: 8px;
    background-color: rgba(11, 15, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    pointer-events: none;
    z-index: 10;
}

.radar-title {
    font-family: system-ui, sans-serif;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 6px;
}

#radar canvas {
    display: block;
    border-radius: 3px;
}

#sucker-status {
    position: fixed;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 18px;
    padding: 8px 16px;
    background-color: rgba(11, 15, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-family: system-ui, sans-serif;
    font-size: 13px;
    pointer-events: none;
    z-index: 10;
}

.sucker-status-stat {
    display: flex;
    align-items: baseline;
    gap: 6px;
    white-space: nowrap;
}

/* Separates the session total from the three live swarm counts beside it. */
.sucker-status-divided {
    padding-left: 18px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.sucker-status-count {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 16px;
    min-width: 1.2em;
    text-align: right;
}

.sucker-status-label {
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 11px;
}

.sucker-status-mass {
    font-variant-numeric: tabular-nums;
    color: #ffd25a;
    font-size: 12px;
}

/* Connection status: hidden while a healthy game is in progress, and the
   loudest thing on screen when it isn't. Sits top-centre because the empty
   arena it explains has nothing else in it to look at. */
#connection-status {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background-color: rgba(11, 15, 20, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    font-family: system-ui, sans-serif;
    font-size: 13px;
    pointer-events: none;
    z-index: 20;
}

.connection-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background-color: #8a94a0;
}

.connection-status-label {
    font-weight: 600;
    white-space: nowrap;
}

.connection-status-detail {
    color: rgba(255, 255, 255, 0.55);
    white-space: nowrap;
}

#connection-status[data-phase="live"] .connection-status-dot {
    background-color: #4ade80;
}

#connection-status[data-phase="connecting"] .connection-status-dot {
    background-color: #facc15;
    animation: connection-pulse 1s ease-in-out infinite;
}

#connection-status[data-phase="stalled"] .connection-status-dot {
    background-color: #fb923c;
}

#connection-status[data-phase="offline"] .connection-status-dot,
#connection-status[data-phase="incompatible"] .connection-status-dot {
    background-color: #f87171;
}

#connection-status[data-phase="offline"],
#connection-status[data-phase="incompatible"] {
    border-color: rgba(248, 113, 113, 0.55);
}

@keyframes connection-pulse {
    50% { opacity: 0.3; }
}
