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

body {
    overflow: hidden;
    background: #04040a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #e0e0f0;
    user-select: none;
    -webkit-user-select: none;
}

#canvas-container {
    position: fixed;
    inset: 0;
}

canvas {
    display: block;
}

#title {
    position: fixed;
    top: 24px;
    left: 28px;
    pointer-events: none;
}

#title h1 {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(200, 210, 240, 0.5);
}

#title h1 span {
    color: rgba(120, 140, 255, 0.7);
}

#dashboard-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(100, 110, 180, 0.1);
    border-radius: 9px;
    color: rgba(180, 190, 240, 0.6);
    text-decoration: none;
    transition: all 0.2s ease;
}

#dashboard-link:hover {
    background: rgba(100, 110, 200, 0.12);
    color: rgba(200, 210, 255, 0.9);
    border-color: rgba(100, 110, 180, 0.25);
}

#dashboard-link:active {
    transform: scale(0.94);
}

#stats {
    position: fixed;
    top: 24px;
    right: 28px;
    display: flex;
    gap: 20px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.stat-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: rgba(200, 210, 240, 0.35);
}

.stat-value {
    font-size: 18px;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    color: rgba(200, 210, 240, 0.7);
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', ui-monospace, monospace;
}

#controls {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(12, 12, 24, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(100, 110, 180, 0.12);
    border-radius: 14px;
}

#controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(100, 110, 180, 0.1);
    border-radius: 9px;
    color: rgba(180, 190, 240, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
}

#controls button:hover {
    background: rgba(100, 110, 200, 0.12);
    color: rgba(200, 210, 255, 0.9);
    border-color: rgba(100, 110, 180, 0.25);
}

#controls button:active {
    transform: scale(0.94);
}

.divider {
    width: 1px;
    height: 24px;
    background: rgba(100, 110, 180, 0.15);
    margin: 0 6px;
}

.seed-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

#save-state {
    width: 28px;
    height: 26px;
    padding: 0;
}

.seed-group label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: rgba(200, 210, 240, 0.35);
}

#seed-input {
    width: 90px;
    height: 26px;
    padding: 0 8px;
    background: rgba(100, 110, 180, 0.08);
    border: 1px solid rgba(100, 110, 180, 0.15);
    border-radius: 6px;
    color: rgba(200, 210, 240, 0.7);
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', 'JetBrains Mono', ui-monospace, monospace;
    outline: none;
    transition: border-color 0.2s;
}

#seed-input:focus {
    border-color: rgba(120, 140, 255, 0.4);
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-group label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: rgba(200, 210, 240, 0.35);
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 3px;
    background: rgba(100, 110, 180, 0.2);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: rgba(130, 140, 220, 0.6);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: rgba(150, 160, 240, 0.8);
}

input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: rgba(130, 140, 220, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

#hint {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    letter-spacing: 0.06em;
    color: rgba(180, 190, 240, 0.25);
    pointer-events: none;
    white-space: nowrap;
}

/* --- Mobile --- */
@media (max-width: 600px) {
    #title {
        top: 16px;
        left: 16px;
    }

    #stats {
        top: 16px;
        right: 16px;
        gap: 14px;
    }

    #hint {
        display: none;
    }

    #controls {
        bottom: 16px;
        left: 12px;
        right: 12px;
        transform: none;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        padding: 10px 12px;
    }

    .divider {
        display: none;
    }

    #seed-input {
        width: 70px;
    }

    input[type="range"] {
        width: 60px;
    }
}
