#version{
	position: absolute;
	top: 20px;
	left: 20px;
	font-size: 1vmin;
}
html{
	margin: 0;
	padding: 0;
	overflow: hidden;
}
body{
	margin: 0;
	padding: 0;
	height: 100vh;
}
input{
	border-radius: 0 !important;
}
.data{
	display: none;
}
#fore{
	transition: -webkit-transform .5s ease-in-out;
	transition: transform .5s ease-in-out;
	transition: transform .5s ease-in-out, -webkit-transform .5s ease-in-out;
	text-align: center;
}
.title{
	font-family: Monoton;
}
#title{
	padding-top: 20px;
	color: white;
	font-size: 10vmin;
	text-shadow: 0 0 1vmin black;
	text-align: center;
	-webkit-transform: translate3d(0, -100vh, 0);
	        transform: translate3d(0, -100vh, 0);
	transition: -webkit-transform .5s ease-out;
	transition: transform .5s ease-out;
	transition: transform .5s ease-out, -webkit-transform .5s ease-out;
/* animation: slidetop 0.5s ease-out forwards; */
}
/* @keyframes slidetop{
	0%{transform: translate3d(0, -100vh, 0)}
}
@keyframes leavetop{
	100%{transform: translate3d(0, -100vh, 0)}
}
@keyframes slideleft{
	0%{transform: translate3d(-100vw, 0, 0)}
	50%{transform: translate3d(-100vw, 0, 0)}
}
@keyframes slideright{
	0%{transform: translate3d(100vw, 0, 0)}
	50%{transform: translate3d(100vw, 0, 0)}
} */
.menuitem{
	color: white;
	font-size: 7vmin;
	text-align: center;
	text-shadow: 0 0 1vmin black;
	-webkit-transform: translate3d(-100vw, 0, 0);
	        transform: translate3d(-100vw, 0, 0);
	transition: -webkit-transform .5s ease-out;
	transition: transform .5s ease-out;
	transition: transform .5s ease-out, -webkit-transform .5s ease-out;
/* animation: slideleft 1s -0.5s ease-out forwards; */
}

/* Styling for the Main Menu Button after a win */
#main-menu-btn {
    /* Position the button at 70% down the screen, as requested */
    position: absolute;
    top: 70vh;
    
    /* Ensure it is horizontally centered */
    left: 50%;
    transform: translateX(-50%);

    /* Ensure it is visible above the countdown/Won! message */
    z-index: 100001;
}

#main-menu-btn:hover {
    /* This rule combines both transforms and uses !important to win */
    -webkit-transform: translateX(-50%) scale(0.9) !important;
            transform: translateX(-50%) scale(0.9) !important;
}

#name{
	background-color: rgba(0, 0, 0, 0.5);
	outline: none;
	border: 1vmin solid white;
	font-size: 10vmin;
	text-align: center;
	color: white;
	padding: 1vmin;
	width: 60vw;
}
#colorpicker{
	margin: 0;
	padding: 0;
	width: 80vw;
	height: 5vmin;
	background: linear-gradient(90deg,
		hsl(0, 100%, 50%),
		hsl(60, 100%, 50%),
		hsl(120, 100%, 50%),
		hsl(180, 100%, 50%),
		hsl(240, 100%, 50%),
		hsl(300, 100%, 50%),
		hsl(360, 100%, 50%)
	);
	border-radius: 3.5vmin;
	border: 1vmin solid white;
	display: inline-block;
	cursor: pointer;
}
#slider{
	margin: 0;
	padding: 0;
	width: 7vmin;
	height: 7vmin;
	border: 1vmin solid white;
	border-radius: 4.5vmin;
	-webkit-transform: translate(-4.5vmin, -2vmin);
	        transform: translate(-4.5vmin, -2vmin);
	cursor: pointer;
	box-shadow: 0 0 1vmin black;
	transition: -webkit-transform .2s;
	transition: transform .2s;
	transition: transform .2s, -webkit-transform .2s;
}
#slider:hover{
	-webkit-transform: translate(-4.5vmin, -2vmin) scale(1.2);
	        transform: translate(-4.5vmin, -2vmin) scale(1.2);
}
#settings{
	height: 20vmin;
	width: 20vmin;
	background-color: #6eb0ea;
	position: absolute;
	bottom: 2vmin;
	right: 2vmin;
	opacity: 1;
	border-radius: 10vmin;
	cursor: pointer;
	box-shadow: 0 2vmin 3vmin rgba(0, 0, 0, 0.5);
	transition: box-shadow .2s, background .2s, -webkit-transform .2s;
	transition: transform .2s, box-shadow .2s, background .2s;
	transition: transform .2s, box-shadow .2s, background .2s, -webkit-transform .2s;
	-webkit-transform: translate3d(50vw, 0, 0);
	        transform: translate3d(50vw, 0, 0);
	z-index: 100;
}
#settings::after{
	content: "";
	background-image: url("https://jchabin.github.io/cars/gear.png");
	background-size: cover;
	height: 10vmin;
	width: 10vmin;
	position: absolute;
	bottom: 5vmin;
	left: 5vmin;
	transition: -webkit-transform .2s;
	transition: transform .2s;
	transition: transform .2s, -webkit-transform .2s;
}
#settings:hover{
	-webkit-transform: scale(0.9) rotate(45deg) !important;
	        transform: scale(0.9) rotate(45deg) !important;
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
}
#toolbar{
	width: 22vmin;
	height: 85vmin;
	border-radius: 11vmin;
	background-color: rgba(0, 0, 0, 0.5);
	position: absolute;
	right: 1vmin;
	bottom: 1vmin;
	-webkit-transform: scaleY(0);
	        transform: scaleY(0);
	transition: -webkit-transform .5s;
	transition: transform .5s;
	transition: transform .5s, -webkit-transform .5s;
	-webkit-transform-origin: 50% 87.5%;
	        transform-origin: 50% 87.5%;
}
#toolbar.sel{
	-webkit-transform: scaleY(1);
	        transform: scaleY(1);
}
.tools{
	height: 20vmin;
	width: 20vmin;
	background-color: #db6262;
	border-radius: 10vmin;
	cursor: pointer;
	transition: box-shadow .2s, background .2s, -webkit-transform .2s;
	transition: transform .2s, box-shadow .2s, background .2s;
	transition: transform .2s, box-shadow .2s, background .2s, -webkit-transform .2s;
	margin: 1vmin;
	box-shadow: 0 1vmin 2vmin rgba(0, 0, 0, 0.5);
}
.tools:hover{
	-webkit-transform: scale(0.9) !important;
	        transform: scale(0.9) !important;
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
}
.tools::after{
	content: "";
	display: inline-block;
	background-image: url("https://jchabin.github.io/cars/newTrack.png");
	-webkit-filter: invert(1);
	        filter: invert(1);
	background-size: cover;
	margin-top: 5vmin;
	height: 10vmin;
	width: 10vmin;
	transition: -webkit-transform .2s;
	transition: transform .2s;
	transition: transform .2s, -webkit-transform .2s;
}
.tools:sel{
	background-color: #62db68;
}
#edit{
	background-color: #55db8f;
}
#cardboard::after{
	background-image: url("https://jchabin.github.io/cars/cardboard.png");
	-webkit-filter: brightness(5);
	        filter: brightness(5);
}
#cardboard.sel{
	background-color: #62db68;
}
#cardboard.disabled{
	background-color: #a3a3a3 !important;
	cursor: default !important;
}
#cardboard.disabled:hover{
	background-color: #a3a3a3 !important;
	-webkit-transform: none !important;
	        transform: none !important;
}
#cardboard{
	background-color: #db6262;
}
#help{
	background-color: #9a55db;
	font-family: Arial;
	color: white;
	font-size: 15vmin;
	text-align: center;
	line-height: 20vmin;
}
#help::after{
	display: none;
}
#start{
/* animation: slideleft 1s -0.25s forwards; */
	font-size: 10vmin;
	background-color: rgba(0, 0, 0, 0.5);
	display: inline-block;
	border: 1vmin solid white;
	padding: 2vmin;
	cursor: pointer;
	transition: box-shadow .2s, -webkit-transform .2s;
	transition: transform .2s, box-shadow .2s;
	transition: transform .2s, box-shadow .2s, -webkit-transform .2s;
	text-shadow: none;
	box-shadow: 0 2vmin 3vmin rgba(0, 0, 0, 0.5);
}
#start:hover{
	-webkit-transform: scale(0.9);
	        transform: scale(0.9);
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
}
.button{
	border: 1vmin solid white;
	padding: 2vmin;
	font-size: 10vmin !important;
	background-color: rgba(0, 0, 0, 0.5);
	position: absolute;
	width: 80vmin;
	left: calc(50vw - 43vmin);
	text-shadow: none;
	line-height: 10vmin;
	cursor: pointer;
	box-shadow: 0 2vmin 3vmin rgba(0, 0, 0, 0.5);
	transition: box-shadow .2s, -webkit-transform .2s;
	transition: transform .2s, box-shadow .2s;
	transition: transform .2s, box-shadow .2s, -webkit-transform .2s;
}
.button:hover{
	-webkit-transform: scale(0.9) !important;
	        transform: scale(0.9) !important;
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
}
#host{
	top: calc(30vh - 8vmin);
	-webkit-transform: translate3d(-100vw, 0, 0);
	        transform: translate3d(-100vw, 0, 0);
	transition: box-shadow .2s, -webkit-transform .5s ease-out;
	transition: transform .5s ease-out, box-shadow .2s;
	transition: transform .5s ease-out, box-shadow .2s, -webkit-transform .5s ease-out;
/* -webkit-transform-style: preserve-3d; */
/* animation: slideleft 1s -0.5s ease-out forwards; */
}
#join{
	top: calc(70vh - 8vmin);
	-webkit-transform: translate3d(-100vw, 0, 0);
	        transform: translate3d(-100vw, 0, 0);
	transition: box-shadow .2s, -webkit-transform .5s ease-out;
	transition: transform .5s ease-out, box-shadow .2s;
	transition: transform .5s ease-out, box-shadow .2s, -webkit-transform .5s ease-out;
/* -webkit-transform-style: preserve-3d; */
/* animation: slideleft 1s ease-out forwards; */
}

#hostsettings {
	/* --- THIS IS THE FIX ---
	We calculate the top based on the bottom of the #host button.
	#host top:     calc(30vh - 8vmin)
	#host height:  16vmin (padding 2*2 + line-height 10 + border 1*2)
	#host bottom:  (30vh - 8vmin) + 16vmin = 30vh + 8vmin
	
	We add a 2vmin gap for spacing.
	New top = (30vh + 8vmin) + 2vmin = 30vh + 10vmin
	*/
	top: calc(30vh + 10vmin);
	
	/* Entry animation */
	-webkit-transform: translate3d(-100vw, 0, 0);
	    	transform: translate3d(-100vw, 0, 0);
	transition: box-shadow .2s, -webkit-transform .5s ease-out;
	transition: transform .5s ease-out, box-shadow .2s;
	transition: transform .5s ease-out, box-shadow .2s, -webkit-transform .5s ease-out;

	/* Visual style – same family as .button, slightly smaller */
	border: 1vmin solid white;
	padding: 1.5vmin;
	font-size: 7vmin !important;
	background-color: rgba(0, 0, 0, 0.5);
	position: absolute;
	width: 60vmin;
	left: calc(50vw - 31vmin); /* Centered (60vmin width + 2*1vmin border)/2 = 31vmin */
	text-shadow: none;
	line-height: 7vmin;
	cursor: pointer;
	box-shadow: 0 1.5vmin 2.5vmin rgba(0, 0, 0, 0.5);

	/* Ensures it sits cleanly between Host and Join on any screen */
	z-index: 10;
}

#hostsettings:hover {
	-webkit-transform: scale(0.9) !important;
	        transform: scale(0.9) !important;
}


/* --- NEW HOST SETTINGS MENU STYLES --- */

.host-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(5px);
	display: flex;
	justify-content: center;
	align-items: center;
	z-index: 100000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.host-settings-menu {
	background: rgba(0, 0, 0, 0.85);
	border: 1vmin solid white;
	box-shadow: 0 2vmin 3vmin rgba(0, 0, 0, 0.5);
	padding: 2vmin;
	width: 90vw;
	max-width: 1000px;
	color: white;
	text-align: center;
	transform: scale(0.9);
	transition: transform 0.3s ease;
	/* Added max-height and overflow for safety on small screens */
	max-height: 95vh;
	display: flex;
	flex-direction: column;
}

.host-modal-overlay.visible {
	opacity: 1;
	visibility: visible;
}

.host-modal-overlay.visible .host-settings-menu {
	transform: scale(1);
}

/* Title is smaller now */
.host-settings-menu h3 {
	font-size: 5vmin;
	margin-top: 0;
	margin-bottom: 2vmin;
	text-shadow: 0 0 1vmin black;
	color: white;
	flex-shrink: 0; /* Prevent title from shrinking */
}

.host-settings-content {
	display: flex;
	flex-direction: column;
	gap: 2vmin;
	overflow-y: auto; /* Allow content to scroll if needed */
	padding-right: 1vmin; /* Add padding for scrollbar */
}

/* Map Selection Buttons */
#map-selection-area {
	display: flex;
	justify-content: center;
	gap: 1.5vmin;
	flex-wrap: wrap;
	margin-bottom: 1vmin;
	flex-shrink: 0;
}

.map-preset-button {
	font-family: 'Monoton', cursive;
	font-size: 2.5vmin; /* Smaller font for map name */
	background-color: rgba(0, 0, 0, 0.5);
	border: 0.5vmin solid white;
	color: white;
	padding: 1vmin;
	cursor: pointer;
	text-shadow: none;
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
	transition: transform .2s, box-shadow .2s, border-color .2s;
	
	/* New styles for image layout */
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 25vmin; /* Give buttons a consistent width */
}

.map-preset-button img {
	width: 100%;
	height: 12vmin; /* Fixed height for image */
	object-fit: cover;
	border: 0.2vmin solid white;
	margin-bottom: 1vmin;
}

.map-preset-button:hover {
	-webkit-transform: scale(0.95);
	        transform: scale(0.95);
	box-shadow: 0 0.2vmin 0.5vmin rgba(0, 0, 0, 0.5);
}

.map-preset-button.active {
	border-color: #4dff4d;
	text-shadow: 0 0 1vmin #4dff4d;
	transform: scale(0.95);
}

/* Settings Grid Layout - RESTORED to clean 2-column */
#settings-grid {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 1.5vmin;
	align-items: center;
	text-align: right;
}

.host-settings-menu label {
	font-family: 'Press Start 2P', cursive;
	font-size: 2.2vmin;
	text-shadow: 0 0 0.5vmin black;
}

/* Shared style for inputs */
.host-settings-menu input[type="number"],
.host-settings-menu textarea {
	background-color: rgba(0, 0, 0, 0.5);
	border: 0.5vmin solid white;
	color: white;
	font-family: 'Press Start 2P', cursive;
	font-size: 2.2vmin;
	padding: 1vmin;
	box-sizing: border-box;
	text-align: left;
	outline: none;
}
.host-settings-menu input[type="number"]:focus,
.host-settings-menu textarea:focus {
	border-color: #4dff4d;
}


.host-settings-menu input[type="number"] {
	width: 20vmin; /* Increased width a bit */
}

/* Container for the bounce slider + value */
.bounce-slider-container {
	display: flex;
	align-items: center;
	gap: 1.5vmin;
}

.bounce-slider-container span {
	font-family: 'Press Start 2P', cursive;
	font-size: 2.2vmin;
	width: 6vmin; /* More space for "0.x" */
	text-align: left;
}

/* --- NEW SLIDER STYLES --- */
input[type="range"] {
	-webkit-appearance: none;
	appearance: none;
	flex: 1;
	height: 2.5vmin;
	background: rgba(0, 0, 0, 0.5);
	border: 0.5vmin solid white;
	cursor: pointer;
	padding: 0;
}
/* Slider Handle: Webkit */
input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 3.5vmin; /* Circle size */
	height: 3.5vmin;
	background: white;
	border: 0.5vmin solid #555;
	border-radius: 50%;
	box-shadow: 0 0 1vmin black;
	transition: transform .2s;
}
input[type="range"]::-webkit-slider-thumb:hover {
	transform: scale(1.2);
}
/* Slider Handle: Firefox */
input[type="range"]::-moz-range-thumb {
	width: 3.5vmin;
	height: 3.5vmin;
	background: white;
	border: 0.5vmin solid #555;
	border-radius: 50%;
	box-shadow: 0 0 1vmin black;
	transition: transform .2s;
	cursor: pointer;
}
input[type="range"]::-moz-range-thumb:hover {
	transform: scale(1.2);
}


/* Custom Map Text Area */
#custom-map-input {
	display: none; /* Hidden by default */
	width: 100%;
	height: 12vmin;
	resize: none;
	font-size: 1.5vmin; /* Smaller to fit more text */
	font-family: monospace;
	line-height: 1.4;
	/* Make it span both columns */
	grid-column: 1 / -1;
	text-align: left;
}

/* Bottom Buttons */
.host-menu-buttons {
	display: flex;
	justify-content: space-between;
	gap: 2vmin;
	margin-top: 1.5vmin;
	flex-shrink: 0; /* Prevent buttons from shrinking */
}

.host-menu-button {
	flex: 1;
	font-size: 5vmin;
	background-color: rgba(0, 0, 0, 0.5);
	border: 1vmin solid white;
	padding: 2vmin;
	cursor: pointer;
	transition: box-shadow .2s, -webkit-transform .2s, border-color .2s;
	transition: transform .2s, box-shadow .2s, border-color .2s;
	transition: transform .2s, box-shadow .2s, border-color .2s, -webkit-transform .2s;
	text-shadow: none;
	box-shadow: 0 1vmin 2vmin rgba(0, 0, 0, 0.5);
	color: white;
}

.host-menu-button:hover {
	-webkit-transform: scale(0.9);
	        transform: scale(0.9);
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
}

.host-menu-button.continue {
	border-color: #4dff4d;
	text-shadow: 0 0 1vmin #4dff4d;
}

.host-menu-button.cancel {
	border-color: #ff4d4d;
	text-shadow: 0 0 1vmin #ff4d4d;
}

/* Fix XP Container Z-Index to be above Bob's black fade (which is 2147483640) */
#xp-container {
    z-index: 2147483647 !important; /* Max integer value */
}

/* XP Warning Message in Host Menu */
.xp-warning-container {
    background-color: rgba(138, 3, 3, 0.6); /* Dark Red background */
    border: 0.5vmin solid #ff4d4d;
    padding: 1vmin;
    margin-top: 2vmin;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    gap: 1vmin;
    animation: pulse-red 2s infinite;
}

.xp-warning-text {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5vmin;
    color: #ffcccc;
    text-shadow: none;
    margin: 0;
}

.xp-warning-link {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5vmin;
    color: white;
    text-decoration: underline;
    cursor: pointer;
}

.xp-warning-link:hover {
    color: #4dff4d;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 1vmin rgba(255, 0, 0, 0.2); }
    50% { box-shadow: 0 0 2vmin rgba(255, 0, 0, 0.5); }
    100% { box-shadow: 0 0 1vmin rgba(255, 0, 0, 0.2); }
}

/* --- END OF NEW STYLES --- */


.info{
	position: absolute;
	top: 0;
	left: 0;
	color: white;
	font-size: 5vmin;
	text-align: center;
	background-color: rgba(0, 0, 0, 0.5);
	width: 100%;
	border-bottom: 1vmin solid white;
	z-index: 100000;
}
.info.title{
	padding-top: 20px;
}
#code{
	text-align: center;
	font-size: 20vmin;
	text-shadow: 0 0 2vmin white;
}
#incode{
	text-align: center;
	font-size: 20vmin;
	text-shadow: 0 0 2vmin white;
	outline: none;
	border: none;
	width: 80vw;
	color: white;
	background: none;
	background-color: rgba(0, 0, 0, 0.5);
	text-transform: uppercase;
}
#startgame{
	position: absolute;
	bottom: 5vmin;
	right: 5vmin;
	color: white;
	border: 1vmin solid white;
	background-color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	font-size: 10vmin;
	padding: 2vmin;
	transition: box-shadow .2s, -webkit-transform .2s;
	transition: box-shadow .2s, transform .2s;
	transition: box-shadow .2s, transform .2s, -webkit-transform .2s;
	box-shadow: 0 2vmin 3vmin rgba(0, 0, 0, 0.5);
	z-index: 100000;
}
#startgame:hover{
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
	-webkit-transform: scale(0.9);
	        transform: scale(0.9);
	
}

#startsettings{
	position: absolute;
	bottom: 5vmin;
	left: 5vmin;
	color: white;
	border: 1vmin solid white;
	background-color: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	font-size: 10vmin;
	padding: 2vmin;
	transition: box-shadow .2s, -webkit-transform .2s;
	transition: box-shadow .2s, transform .2s;
	transition: box-shadow .2s, transform .2s, -webkit-transform .2s;
	box-shadow: 0 2vmin 3vmin rgba(0, 0, 0, 0.5);
	z-index: 100000;
}
#startsettings:hover{
	box-shadow: 0 0.5vmin 1vmin rgba(0, 0, 0, 0.5);
	-webkit-transform: scale(0.9);
	        transform: scale(0.9);
}

.label{
	font-family: "Press Start 2P";
	color: white;
	text-shadow: 0 0 1vmin black;
	display: inline-block;
	padding: 2vmin;
	position: absolute;
	font-size: 3vmin;
	-webkit-transform: translateX(-50%) translateY(-100%);
	        transform: translateX(-50%) translateY(-100%);
	text-align: center;
	line-height: 4vmin;
	z-index: 0;
}
#countdown{
	font-size: 50vmin;
	height: 70vmin;
	width: 100vw;
	position: absolute;
	top: calc(50vh - 35vmin);
	color: white;
	text-shadow: 0 0 2vmin white;
	z-index: 100000;
	display: table-cell;
	vertical-align: middle;
	text-align: center; 
	line-height: 23vmin;
}
#lap{
	font-size: 10vmin;
	position: absolute;
	color: white;
	text-shadow: 0 0 2vmin white;
	z-index: 100000;
	top: 3vmin;
	left: 3vmin;
}

/* --- TIMER UI --- */
#race-timer {
    position: absolute;
    top: 14vmin; /* Below the lap counter */
    left: 20px;
    font-size: 5vmin;
    color: #ffeb3b; /* Yellow tint */
    text-shadow: 0 0 0.5vmin black;
    z-index: 100;
    font-family: 'Monoton', cursive;
    display: none; /* Hidden until race starts */
}

/* --- WIN SCREEN FIXES --- */
/* Override specific ID styles when the win screen is active if needed, 
   but generally we just adjust the specific elements dynamically in JS. 
   However, we set the confetti canvas here. */

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Let clicks pass through */
    z-index: 200000; /* On top of almost everything */
}

/* New Class for PB Text */
.pb-text {
    font-family: 'Monoton', cursive;
    color: #ffd700; /* Gold */
    text-shadow: 0 0 2vmin #ffaa00;
    font-size: 6vmin;
    margin-top: 1vmin;
    animation: pulse-gold 1s infinite alternate;
}

@keyframes pulse-gold {
    from { transform: scale(1); text-shadow: 0 0 1vmin #ffaa00; }
    to { transform: scale(1.1); text-shadow: 0 0 3vmin #ffaa00; }
}

/* --- LOBBY LEADERBOARD STYLES --- */
#lobby-lb-container {
    position: absolute;
    top: 55%; /* Vertically centered, slightly pushed down */
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60vmin;
    max-height: 25vmin; /* Restrict height so it doesn't overlap buttons */
    background-color: rgba(0, 0, 0, 0.6);
    border: 0.5vmin solid white;
    overflow-y: auto; /* Scrollable if more than 5 entries */
    display: none; /* Hidden by default */
    z-index: 50;
    text-align: center;
    box-shadow: 0 1vmin 2vmin rgba(0, 0, 0, 0.5);
}

.lobby-lb-title {
    font-family: 'Monoton', cursive;
    color: #ffd700; /* Gold */
    font-size: 3vmin;
    padding: 1vmin;
    border-bottom: 0.2vmin solid white;
    background-color: rgba(0, 0, 0, 0.8);
    position: sticky;
    top: 0;
}

#lobby-lb-table {
    width: 100%;
    border-collapse: collapse;
}

#lobby-lb-table td {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5vmin;
    color: white;
    padding: 1vmin;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Rank Colors */
#lobby-lb-table tr:nth-child(1) td { color: #ffd700; text-shadow: 0 0 0.5vmin #ffd700; }
#lobby-lb-table tr:nth-child(2) td { color: #c0c0c0; }
#lobby-lb-table tr:nth-child(3) td { color: #cd7f32; }

/* Scrollbar beautification */
#lobby-lb-container::-webkit-scrollbar { width: 0.5vmin; }
#lobby-lb-container::-webkit-scrollbar-track { background: rgba(0,0,0,0.5); }
#lobby-lb-container::-webkit-scrollbar-thumb { background: white; }


#divider{
	height: 100vh;
	width: 4px;
	position: absolute;
	top: 0;
	left: calc(50vw - 2px);
	background-color: white;
}
#mywebsitelink{
	display: none;
	
	position: absolute;
	bottom: 0;
	left: 0;
	-webkit-transform: translate3d(-100vw, 0, 0);
	        transform: translate3d(-100vw, 0, 0);
	transition: -webkit-transform .5s ease-in-out;
	transition: transform .5s ease-in-out;
	transition: transform .5s ease-in-out, -webkit-transform .5s ease-in-out;
	line-height: 0;
}

/* --- SIGNUP PROMO POPUP --- */

.promo-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000000; /* Extremely high z-index to sit over game UI */
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Click-through when hidden */
}

.promo-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.promo-box {
    background-color: hsl(0, 50%, 20%); /* Darker version of your game red */
    border: 0.5vmin solid white;
    box-shadow: 0 0 5vmin rgba(255, 0, 0, 0.3);
    padding: 4vmin;
    width: 90%;
    max-width: 500px;
    text-align: center;
    color: white;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.promo-overlay.visible .promo-box {
    transform: scale(1);
}

.promo-title {
    font-family: 'Monoton', cursive;
    font-size: 5vmin;
    margin: 0 0 2vmin 0;
    color: #ffd700; /* Gold */
    text-shadow: 0 0 1vmin #ff4d4d;
    line-height: 1.2;
}

.promo-body {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.5vmin;
    margin-bottom: 3vmin;
    line-height: 1.8;
    color: #eee;
}

.promo-list {
    text-align: left;
    margin: 2vmin auto;
    width: fit-content;
    padding-left: 2vmin;
    list-style: none;
}

.promo-list li {
    margin-bottom: 1vmin;
}

.promo-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.5vmin;
}

.promo-btn {
    font-family: 'Press Start 2P', cursive;
    padding: 1.5vmin;
    border: 0.3vmin solid white;
    cursor: pointer;
    font-size: 1.5vmin;
    transition: transform 0.1s, box-shadow 0.1s;
    text-shadow: 1px 1px 0 #000;
}

.promo-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 0.5vmin 1vmin rgba(0,0,0,0.5);
}

.login-action {
    background-color: #4dff4d; /* Green */
    color: black;
    text-shadow: none;
    font-size: 2vmin;
    padding: 2vmin;
}

.dismiss-action {
    background: transparent;
    color: #aaa;
    border-color: #555;
    font-size: 1.2vmin;
}

.dismiss-action:hover {
    color: white;
    border-color: white;
}
