/* ═══════════════════════════════════════════════════════
   main.css  —  global reset, variables, and shared layout
   ═══════════════════════════════════════════════════════ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --w: 380px;
    --prog:         #f5c542;
    --useful:       #4ade80;
    --trap:         #f87171;
    --normal:       #a5b4fc;
    --loc:          #94a3b8;
    --slot-default: #fbbf24;
    --outline:
        -1px -1px 0 rgba(0,0,0,0.95),
         1px -1px 0 rgba(0,0,0,0.95),
        -1px  1px 0 rgba(0,0,0,0.95),
         1px  1px 0 rgba(0,0,0,0.95),
         0 0 6px rgba(0,0,0,0.8);
}

/* overlay-only body rules — scoped to .ap-overlay so they don't
   bleed into the config page (index.html) which loads main.css too */
body.ap-overlay {
    background: transparent;
    width: var(--w);
    overflow: hidden;
    padding: 8px;
    user-select: none;
}

/* ── header ─────────────────────────────────────────── */
#header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 5px 10px;
    border-radius: 4px;
}

#header .title {
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    flex: 1;
    text-shadow: var(--outline);
}

#header .game-label {
    font-size: 10px;
    letter-spacing: 0.06em;
    text-shadow: var(--outline);
}

/* ── connection dot ──────────────────────────────────── */
.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #374151;
    flex-shrink: 0;
}
.dot.connecting { background: #f59e0b; animation: blink 0.9s ease-in-out infinite; }
.dot.connected  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.7); }
.dot.error      { background: #ef4444; }

@keyframes blink { 0%,100% { opacity:1; } 50% { opacity:0.2; } }

/* ── status message ──────────────────────────────────── */
#status-msg {
    font-size: 11px;
    color: #94a3b8;
    padding: 5px 10px;
    background: rgba(0,0,0,0.55);
    border-radius: 3px;
    display: none;
    text-shadow: var(--outline);
}
#status-msg.show { display: block; }

/* ── feed ────────────────────────────────────────────── */
#feed {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* ── legend ──────────────────────────────────────────── */
#legend {
    display: none;
    margin-top: 6px;
    padding: 5px 10px;
    background: rgba(0,0,0,0.5);
    border-radius: 3px;
    gap: 10px;
}
#legend.show { display: flex; }

.leg {
    font-size: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: var(--outline);
}
.leg-dot { width: 7px; height: 7px; border-radius: 50%; }
