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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #fff;
}

#renderDiv {
    width: 100%;
    height: 100%;
    position: relative;
}

/* --- Corner controls container --- */
#corner-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    z-index: 210;
}

/* --- Multiplayer toggle --- */
#multiplayer-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

#multiplayer-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 200, 0, 0.3);
}

.mp-label {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.mp-off {
    font-size: 9px;
    color: rgba(255, 100, 100, 0.7);
    font-weight: 700;
}

.mp-on {
    font-size: 9px;
    color: rgba(100, 255, 100, 0.9);
    font-weight: 700;
}

/* --- Legend toggle button (always visible) --- */
#legend-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

#legend-toggle:hover {
    background: rgba(0, 0, 0, 0.7);
    border-color: rgba(0, 255, 255, 0.3);
}

.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.2);
    color: rgba(0, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.toggle-title {
    font-size: 11px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 400;
    font-style: italic;
}

/* --- Controls hint overlay --- */
#controls-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    z-index: 200;
    max-width: 420px;
    width: 90%;
    transition: opacity 0.5s;
}

#controls-hint.hidden {
    opacity: 0;
    pointer-events: none;
}

.hint-title {
    text-align: center;
    font-size: 11px;
    letter-spacing: 4px;
    color: rgba(0, 255, 255, 0.7);
    margin-bottom: 10px;
    font-weight: 600;
}

.hint-grid {
    display: grid;
    grid-template-columns: 28px 1fr;
    gap: 4px 8px;
    font-size: 12px;
    line-height: 1.6;
}

.hint-icon {
    text-align: center;
    font-size: 14px;
}

.hint-desc {
    color: rgba(255, 255, 255, 0.75);
    font-size: 11px;
}

.hint-fade {
    text-align: center;
    font-size: 9px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 8px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Attract mode overlay --- */
#attract-mode {
    position: fixed;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 300;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s;
}

#attract-mode.visible {
    opacity: 1;
}

#attract-text {
    font-size: clamp(28px, 7vw, 60px);
    color: #fff;
    text-shadow: 0 0 15px rgba(0, 255, 255, 0.5), 0 0 30px rgba(255, 0, 255, 0.3);
    letter-spacing: 6px;
    font-weight: 300;
    animation: pulse 2.5s ease-in-out infinite;
}

#attract-sub {
    font-size: clamp(11px, 2.5vw, 18px);
    color: rgba(255, 255, 255, 0.5);
    margin-top: 16px;
    letter-spacing: 3px;
    font-weight: 300;
}

@keyframes pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.01); }
}
