    body, html {
        margin: 0;
        padding: 0;
        font-family: 'Verdana', sans-serif;
		background-color: #000;
        color: #e0f7ff;
        overflow: hidden;
    }

        canvas { display: block; }

        /* ── Loading indicator ───────────────────────────────────── */
        #loading {
            position: fixed;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: #000;
            color: #a78bfa;
            font-family: 'Verdana', sans-serif;
            font-size: 1.5em;
            z-index: 1000;
            gap: 20px;
        }
        #loading-spinner {
            width: 48px;
            height: 48px;
            border: 4px solid rgba(167,139,250,0.2);
            border-top-color: #a78bfa;
            border-radius: 50%;
            animation: spin 0.9s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* ── Start screen ────────────────────────────────────────── */
        #start-screen {
            position: fixed;
            inset: 0;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: radial-gradient(ellipse at 50% 40%, #1a003388 0%, #00000099 70%);
            z-index: 100;
            gap: 18px;
            text-align: center;
        }
        #start-screen h1 {
            font-family: "Soda Shake", "Comic Sans MS", cursive;
            font-size: clamp(3rem, 8vw, 6rem);
            color: #e0c3fc;
            text-shadow: 0 0 30px #c084fc, 0 0 60px #7c3aed;
            margin: 0;
            animation: titlePulse 3s ease-in-out infinite;
        }
        @keyframes titlePulse {
            0%, 100% { text-shadow: 0 0 30px #c084fc, 0 0 60px #7c3aed; }
            50%       { text-shadow: 0 0 50px #e879f9, 0 0 90px #a855f7; }
        }
        #start-screen p {
            font-family: 'Verdana', sans-serif;
            font-size: 1.1rem;
            color: #c4b5fd;
            margin: 0;
            max-width: 440px;
            line-height: 1.6;
        }
        #new-game-button {
            font-size: 1.5rem;
            padding: 18px 52px;
            border: none;
            border-radius: 50px;
            background: linear-gradient(135deg, #7c3aed, #06b6d4);
            color: #fff;
            cursor: pointer;
            font-family: "Cream Wish", "Comic Sans MS", cursive;
            box-shadow: 0 0 30px #7c3aed88, 0 0 60px #06b6d433;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            animation: buttonPulse 2.5s ease-in-out infinite;
        }
        @keyframes buttonPulse {
            0%, 100% { box-shadow: 0 0 30px #7c3aed88, 0 0 60px #06b6d433; }
            50%       { box-shadow: 0 0 50px #a855f7cc, 0 0 90px #06b6d466; }
        }
        #new-game-button:hover {
            transform: scale(1.06);
            box-shadow: 0 0 50px #c084fcaa, 0 0 90px #06b6d466;
        }
        #new-game-button:active {
            transform: scale(0.97);
        }
        #start-hint {
            font-size: 0.8rem;
            color: #6d28d9;
            font-family: 'Verdana', sans-serif;
        }

        /* ── In-game HUD ─────────────────────────────────────────── */
        #hud {
            position: absolute;
            top: 10px;
            left: 10px;
            display: none;
            flex-direction: column;
            gap: 6px;
            z-index: 10;
        }
        .hud-bar-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .hud-bar-label {
            font-size: 11px;
            color: #94a3b8;
            font-family: 'Verdana', sans-serif;
            width: 72px;
            text-align: right;
        }
        .hud-bar {
            width: 130px;
            height: 10px;
            background: rgba(255,255,255,0.08);
            border-radius: 6px;
            overflow: hidden;
        }
        #harmony-fill {
            height: 100%;
            background: linear-gradient(90deg, #00ff88, #00ffcc);
            transition: width 0.3s ease;
        }
        #confluence-fill {
            height: 100%;
            background: linear-gradient(90deg, #ffd700, #ffca66);
            transition: width 0.3s ease;
        }
        #ball-counter {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
            max-width: 200px;
        }
        .ball-pip {
            width: 12px;
            height: 12px;
            border-radius: 50%;
        }

        /* ── Control panel ───────────────────────────────────────── */
        #control-panel {
            position: absolute;
            bottom: 14px;
            right: 510px;
            display: none;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 8px;
            align-items: flex-end;
            z-index: 10;
        }

        /* ── Add-ball panel (inside controls) ────────────────────── */
        #add-ball-panel {
            display: flex;
            flex-direction: column;
            gap: 6px;
            background: rgba(0,0,0,0.6);
            border: 1px solid #334155;
            border-radius: 10px;
            padding: 8px 10px;
        }
        #add-ball-panel label {
            font-size: 11px;
            color: #94a3b8;
            font-family: 'Verdana', sans-serif;
        }
        #add-ball-row {
            display: flex;
            gap: 6px;
            align-items: center;
        }
        #add-ball-name {
            background: #0f172a;
            border: 1px solid #334155;
            border-radius: 6px;
            color: #e2e8f0;
            padding: 4px 8px;
            font-size: 13px;
            width: 90px;
        }
        #add-ball-color {
            width: 32px;
            height: 28px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            padding: 0;
        }
        #add-ball-button {
            font-size: 13px;
            padding: 4px 10px;
        }

        /* ── Stat panel (bottom-right of game area) ──────────────── */
        #stat-panel {
            position: absolute;
            bottom: 0;
            right: 500px;
            padding: 6px 10px;
            z-index: 10;
            display: none;
        }
        #fps-counter {
            font-size: 11px;
            color: #475569;
            font-family: 'Courier New', monospace;
        }
        #performance-stats {
            opacity: 0.3;
        }
        #performance-stats:hover { opacity: 1; }
        #performance-stats table {
            background-color: #000;
            text-transform: uppercase;
        }
        #performance-stats td {
            width: 120px;
            border: 1px solid #666;
            padding: 2px 8px;
            font-family: Courier New;
            font-size: 11px;
            color: #e2e8f0;
        }
        #performance-stats tr:nth-child(2n) { background-color: #111; }

        /* ── Settings panel (collapsible dev tool) ───────────────── */
        #settingsMenu {
            position: absolute;
            bottom: 60px;
            right: 510px;
            background: rgba(0,0,0,0.85);
            border: 1px solid #334155;
            border-radius: 10px;
            padding: 10px 14px;
            display: none;
            flex-direction: column;
            gap: 6px;
            z-index: 20;
            color: #94a3b8;
            font-family: 'Verdana', sans-serif;
            font-size: 12px;
        }
        .settings-row { display: flex; align-items: center; gap: 8px; }
        .settings-row label { width: 130px; }
        .settings-row input[type=range] { width: 90px; }
        #settings-toggle {
            font-size: 12px;
            padding: 4px 10px;
        }

        /* ── Game-over / Victory screens ─────────────────────────── */
        #game-over-screen, #victory-screen {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.88);
            display: none;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 50;
            color: #e0f7ff;
            font-family: "Cream Wish", "Comic Sans MS", cursive;
            text-shadow: 1px 1px 1px #000;
            gap: 12px;
        }
        #game-over-screen h2, #victory-screen h2 {
            font-size: 3em;
            margin-bottom: 10px;
            font-family: "Soda Shake", "Comic Sans MS", cursive;
        }
        #game-over-stats, #victory-stats { font-size: 1.1em; }
        #upgrade-options { display: flex; gap: 20px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }

        /* ── Hidden utility elements (required by game logic) ─────── */
        #hidden-ui { display: none; }

    #game-container {
        width: 100vw;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    #encounter-screen {
        flex: 1;
       /* background: linear-gradient(to bottom, #1a0033, #000011); */
        position: relative;
        overflow: hidden;
    }
	.fullwidth {
	  width: 100%;
	}
	
	#footer {
	  position: absolute;
	  bottom: 0;
	}

	#stat-panel {
	  position: absolute;
	  right: 0;
	  bottom: 0;
	  padding: 4px;
	  font-family: "Cream Wish", "Comic Sans MS";
	  text-align: right;
	}
	#performance-stats {
	  opacity: 0.3;
	}
	#performance-stats:hover {
	  opacity: 1;
	}
	#performance-stats table {
	  background-color: #000;
	  text-transform: uppercase;
	}
	#performance-stats td {
		width: 120px;
		border: 1px solid #666;
		padding: 2px 8px;
		font-family: Courier New;
	}
	#performance-stats tr:nth-child(2n) {
		  background-color: #111;
	}
	.selector {
		height: 100%;
	}
	#add-ball-color {
	  height: 100%;
	}
	.ui.section {
		display: flex;
		flex-wrap: wrap;
		border: 2px inset #64727d;
		text-shadow: 1px 1px 1px #000;
	}
	.ui.section input, .ui.section button {
		font-family: "Cream Wish", "Comic Sans MS";
		text-align: center;
		font-size: 20px;
		padding: 6px;
	}
	.subsection {
		flex: 1; /* This allows subsections to take up equal space */
		min-width: 150px; /* Set a minimum width to control when they wrap */
		padding: 4px;
		border: 1px inset #444f5e;
	}
	.ui.header {
		font-size: 23px;
		border-bottom: 1px solid #3E4757;
		font-family: "Soda Shake", "Comic Sans MS";
		text-align: center;
		font-size: 45px;
	}
	.section-title {
		border-bottom: 1px solid brown;
		margin-bottom: 4px;
		padding-bottom: 2px;
		font-size: 23px;
		letter-spacing: 1px;
	}
    #ui-overlay {
		
        position: absolute;
        bottom: 0;
        right: 0;
        width: 50%;
        padding: 10px;
        box-sizing: border-box;
        display: flex;
		
		display: none;
		
        justify-content: space-between;
        background: rgba(26, 0, 51, 0.8);
        border-top: 2px solid #7b00ff;
		max-height: 98px;
    }
    .ui-panel {
        background-color: rgba(123, 0, 255, 0.2);
        border-radius: 10px;
        padding: 10px;
        margin: 5px;
        box-shadow: 0 0 10px rgba(123, 0, 255, 0.5);
    }
    #harmony-bar, #confluence-bar {
        width: 200px;
        height: 20px;
        background-color: rgba(255, 255, 255, 0.1);
        border-radius: 10px;
        overflow: hidden;
        position: relative;
    }
    #harmony-fill, #confluence-fill {
        width: 100%;
        height: 100%;
        transition: width 0.3s ease-in-out;
        position: absolute;
        top: 0;
        left: 0;
    }
    #harmony-fill {
        background: linear-gradient(90deg, #00ff88, #00ffcc);
    }
    #confluence-fill {
        background: linear-gradient(90deg, #ffd700, #ffca66);
    }
    #potential-friend {
        position: absolute;
        right: 50px;
        bottom: 50px;
        width: 200px;
        height: 200px;
        background: radial-gradient(circle, #7b00ff, #4a0099);
        border-radius: 50%;
        overflow: hidden;
        box-shadow: 0 0 20px #7b00ff;
    }
	#control-panel {
		position: absolute;
		bottom: 0;
		padding: 10px;
		right: 500px;
	}
    .cpanel-button {
background: radial-gradient(circle, #00ffcc, #00ff88);
border-radius: 5% 20%;
cursor: pointer;
box-shadow: 0 0 20px #00ffcc;
text-align: center;
color: #000;
font-weight: bold;
transition: all 0.3s ease;
float: left;
padding: 10px 20px;
font-family: "Cream Wish";
text-shadow: 1px 2px 1px #fff;
font-size: 24px;
	}
	.play-pause-button {
	  background: radial-gradient(circle, #9282b5, #4a65f7);
	  box-shadow: 0 0 20px #75399d;
	}
	.autolaunch-button {
		 background: radial-gradient(circle, #ff9700, #ff6000);
		box-shadow: 0 0 20px #ffd300;
	}
	.end-encounter-button {
		background: radial-gradient(circle, #6e8bb7, #365680);
box-shadow: 0 0 20px #329ec8;
	}

	#new-game-button, #continue-button {
        background: radial-gradient(circle, #a959ff, #8c1eaa);
		box-shadow: 0 0 20px #ff7bf1;
    }
	.cpanel-button:hover {
	  box-shadow: 0 0 30px #ffffff;
	}
	.cpanel-button:active {
	  background: radial-gradient(circle, #ffffff, #ff7800);
		box-shadow: 0 0 20px #ffffff;
	}
    #new-game-button:hover, #continue-button:hover {

    }
	/* .autolaunch-button { */
		/* height: 100px; */
		/* width: 100px; */
		/* background-color: #1f3d64; */
		/* border: 1px solid #797979; */
		/* text-align: center; */
		/* line-height: 100px; */
		/* cursor: pointer; */
		/* float: left; */
	/* } */
	/* .autolaunch-button:hover { */
		/* background-color: #5a779d; */
		/* border: 1px solid #fff; */
	/* } */
	#autolaunch-start {
	}
	#autolaunch-stop {
	}
	#main-canvas {
	  border-left: 2px solid #515151;
	}
    #particles-canvas, #main-canvas, #background-canvas, #bg-particle-canvas, #pixi-canvas {
        position: absolute;
        top: 0;
        left: 0;
        width: calc(100% - 500px);
        height: 100%; 
    }
	#scoreboard-canvas {
		position: absolute;
		top: 0;
		right: 0;
		width: 500px;
		height: 100%;
	}
	#bg-particle-canvas {
		opacity: 0.15;
		transition: all 0.15s ease;
	}
	#bg-particle-canvas.illuminate-low {
		opacity: 0.2;
	}
	#bg-particle-canvas.illuminate-high {
		opacity: 0.3;
	}
    /* #shop-button, #play-pause-button, #new-game-button { */
        /* padding: 10px 20px; */
        /* background: linear-gradient(90deg, #7b00ff, #c800ff); */
        /* color: white; */
        /* border: none; */
        /* border-radius: 25px; */
        /* cursor: pointer; */
        /* font-family: 'Quicksand', sans-serif; */
        /* font-weight: bold; */
        /* text-transform: uppercase; */
        /* transition: all 0.3s ease; */
    /* } */
    /* #shop-button:hover, #play-pause-button:hover, #new-game-button:hover { */
        /* transform: scale(1.05); */
        /* box-shadow: 0 0 15px rgba(123, 0, 255, 0.8); */
    /* } */
    /* #shop-button { */
        /* right: 20px; */
        /* top: 120px; */
    /* } */
    /* #play-pause-button { */
        /* right: 20px; */
        /* top: 20px; */
    /* } */
    /* #new-game-button { */
        /* right: 20px; */
        /* top: 70px; */
    /* } */
    #bondball-counter {
        position: absolute;
        top: 20px;
        left: calc(50% - 250px);
        transform: translateX(-50%);
        display: flex;
        gap: 5px;
    }
    .bondball-pip {
        width: 15px;
        height: 15px;
        background-color: #00ffcc;
        border-radius: 50%;
        box-shadow: 0 0 5px #00ffcc;
    }
    #game-over-screen, #victory-screen {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.8);
        display: none;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        color: #e0f7ff;
		font-family: "Cream Wish", "Comic Sans MS";
		text-shadow: 1px 1px 1px #000;
    }
    #game-over-screen h2, #victory-screen h2 {
        font-size: 3em;
        margin-bottom: 20px;
		font-family: "Soda Shake", "Comic Sans MS";
    }
    #game-over-stats, #victory-stats {
        font-size: 1.2em;
        margin-bottom: 20px;
    }

    #upgrade-options {
        display: flex;
        gap: 20px;
        margin-top: 20px;
    }
	.upgrade-option h3 {
	  font-family: "Soda Shake", "Comic Sans MS";
	  font-size: 38px;
	}
	#upgrade-options-inner {
	  padding: 10px 0px;
	}
    .upgrade-option {
        padding: 20px;
        background-color: rgba(123, 0, 255, 0.2);
        border-radius: 15px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 1.2em;
        text-align: center;
        width: 200px;
    }
	.upgrade-option div {
		font-size: 23px;
	}

	.ug-good {
		text-shadow: 2px 2px 2px #00454d;
		color: #a8f3ff;
	}
	.ug-bad {
		text-shadow: 2px 2px 2px #800f0f;
		color: #ffb3b0;
	}
    .upgrade-option:hover {
        background-color: rgba(123, 0, 255, 0.4);
        transform: scale(1.05);
    }
    .upgrade-option.empathy {
        background-color: rgba(255, 0, 0, 0.2);
    }
    .upgrade-option.understanding {
        background-color: rgba(0, 255, 0, 0.2);
    }
    .upgrade-option.harmony {
        background-color: rgba(0, 255, 255, 0.2);
    }
    .upgrade-option.confluence {
        background-color: rgba(255, 0, 255, 0.2);
    }
	@keyframes bulge {
		0%, 100% { transform: scale(1); }
		50% { transform: scale(1.2); }
	}

	.bulge {
		animation: bulge 0.2s ease-in-out;
	}
	
	
	
.player-upgrade-option-container {
    background-color: #00000087;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.puo-name {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 5px;
}

.puo-upgrades {
    width: 100%;
}

.puo-upgrades-select {
    padding: 5px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 3px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"%3E%3Cpath d="M7 10l5 5 5-5z"/%3E%3Cpath d="M0 0h24v24H0z" fill="none"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 16px;
}

/* Hover effect for select box */
.puo-upgrades-select:hover {
    border-color: #999;
}

/* Focus effect for select box */
.puo-upgrades-select:focus {
    outline: none;
    box-shadow: 0 0 2px 1px rgba(0, 140, 255, 0.5);
}
