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

html, body {
    overflow-x: hidden;
    background: #000;
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
}

/* Full-bleed header with dynamic viewport height for mobile */
#header {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    z-index: 0;
    pointer-events: none; /* Let clicks pass through to content if needed */
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

#canvas-container.visible {
    opacity: 1;
}

#canvas-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Error message styling */
#error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
    border-radius: 8px;
    max-width: 90vw;
    z-index: 1000;
    display: none;
}

#error-message h2 {
    color: #ff6b6b;
    margin-bottom: 1rem;
}

#error-message p {
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Stats positioning */
#stats-container {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
}

/* Attractor label */
#attractor-ui {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.55rem;
    z-index: 10;
    pointer-events: auto;
    user-select: none;
    flex-wrap: nowrap;
    max-width: calc(100vw - 2rem);
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

#attractor-ui.visible {
    opacity: 1;
}

#attractor-label {
    font-family: 'Fira Code', monospace;
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.15em;
    word-spacing: -0.25em;
    color: #EEEEEE;
    pointer-events: auto;
    cursor: pointer;
    transition: none;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 0 1 auto;
}

#attractor-info-button {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 999px; /* keeps a comfortable hit target */
    border: none;
    background: transparent;
    color: #999999;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: none;
    transition: none;
}

#attractor-info-button svg {
    width: 18px;
    height: 18px;
    fill: #999999;
}

#attractor-tooltip {
    position: absolute;
    left: 50%;
    bottom: calc(2rem + 2.6rem);
    transform: translateX(-50%) translateY(8px);
    width: min(460px, calc(100vw - 2rem));
    padding: 1.1rem 1.25rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 4px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    pointer-events: none;
    z-index: 20;
    transition: opacity 0.16s ease, transform 0.16s ease;
}

#attractor-tooltip.is-open {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

#attractor-tooltip-title {
    font-family: 'Fira Code', monospace;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.6rem;
    transition: none;
    text-transform: uppercase;
    word-spacing: -0.15em;
    font-size: 0.9em;
}

#attractor-tooltip-body {
    font-family: 'Fira Code', monospace;
    font-weight: 300;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.74);
    transition: none;
}

