html, body.wwg-game-body {
	margin: 0;
	padding: 0;
	height: 100%;
	width: 100%;
	overflow: hidden;
	background: #0b1220;
}

body.wwg-game-body {
	position: fixed;
	inset: 0;
	overscroll-behavior: none;
	touch-action: none;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	color: #fff;
}

.wwg-map {
	position: absolute;
	inset: 0;
	height: 100%;
	width: 100%;
}

.wwg-status {
	position: absolute;
	top: env(safe-area-inset-top, 0);
	left: 50%;
	transform: translateX(-50%);
	margin-top: 12px;
	padding: 6px 12px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 14px;
	line-height: 1.3;
	border-radius: 999px;
	pointer-events: none;
	z-index: 1000;
}

.wwg-status[hidden] {
	display: none;
}

/* GPS accuracy readout — top left */
.wwg-accuracy {
	position: absolute;
	top: env(safe-area-inset-top, 0);
	left: env(safe-area-inset-left, 0);
	margin: 12px;
	padding: 4px 10px;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 12px;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
	border-radius: 999px;
	pointer-events: none;
	z-index: 1000;
}

.wwg-accuracy::before {
	content: '';
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #9aa0a6;
	vertical-align: middle;
}

.wwg-accuracy.wwg-accuracy--good::before { background: #4caf50; }
.wwg-accuracy.wwg-accuracy--med::before  { background: #ffb74d; }
.wwg-accuracy.wwg-accuracy--bad::before  { background: #ef5350; }

/* Notice that appears below the accuracy pill when actions are gated off. */
.wwg-action-block {
	position: absolute;
	top: calc(env(safe-area-inset-top, 0px) + 42px);
	left: calc(env(safe-area-inset-left, 0px) + 12px);
	max-width: min(320px, calc(100% - 24px));
	padding: 8px 12px;
	background: rgba(0, 0, 0, 0.78);
	border-left: 3px solid #ffb74d;
	color: #ffe0a0;
	font-size: 12px;
	line-height: 1.4;
	border-radius: 8px;
	z-index: 1000;
	pointer-events: none;
}

.wwg-action-block[hidden] {
	display: none;
}

.wwg-action-block__title {
	display: block;
	font-weight: 600;
	color: #ffffff;
	margin-bottom: 2px;
}

.wwg-action-block__sub {
	display: block;
}

/* Mute / unmute button — bottom left */
.wwg-mute {
	position: absolute;
	bottom: env(safe-area-inset-bottom, 0);
	left: env(safe-area-inset-left, 0);
	margin: 12px;
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 999px;
	cursor: pointer;
	z-index: 1000;
	-webkit-tap-highlight-color: transparent;
}

.wwg-mute:hover,
.wwg-mute:focus {
	background: rgba(0, 0, 0, 0.78);
	outline: none;
}

.wwg-mute__icon {
	position: absolute;
	z-index: 10;
}

.wwg-mute__icon--off {
	display: none;
}

.wwg-mute.wwg-mute--muted .wwg-mute__icon--on {
	display: none;
}

.wwg-mute.wwg-mute--muted .wwg-mute__icon--off {
	display: inline-block;
}

/* HUD overlay shown while playing */
.wwg-hud {
	position: absolute;
	top: env(safe-area-inset-top, 0);
	right: 0;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 12px;
	padding: 6px 10px;
	background: rgba(0, 0, 0, 0.55);
	border-radius: 999px;
	z-index: 1000;
	font-size: 13px;
}

.wwg-hud__name {
	font-weight: 600;
}

.wwg-hud__score {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 8px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	font-variant-numeric: tabular-nums;
	font-weight: 600;
}

.wwg-hud__coin {
	color: #ffcf3a;
	font-size: 14px;
	line-height: 1;
}

.wwg-hud__logout {
	margin: 0;
}

.wwg-hud__btn {
	background: transparent;
	color: #cfe;
	border: none;
	padding: 0;
	font: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.wwg-hud__btn:hover {
	color: #fff;
}

/* Login card */
.wwg-login {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: radial-gradient(ellipse at top, #1b3057 0%, #0b1220 70%);
}

.wwg-login__card {
	width: 100%;
	max-width: 360px;
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.1);
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(6px);
}

.wwg-login__title {
	margin: 0 0 8px;
	font-size: 22px;
	font-weight: 700;
	letter-spacing: 0.2px;
}

.wwg-login__sub {
	margin: 0 0 18px;
	color: #b9c5d6;
	font-size: 14px;
	line-height: 1.4;
}

.wwg-login__error {
	margin: 0 0 12px;
	padding: 8px 10px;
	background: rgba(220, 70, 70, 0.18);
	border: 1px solid rgba(220, 70, 70, 0.4);
	border-radius: 8px;
	color: #ffd9d9;
	font-size: 13px;
}

.wwg-login__label {
	display: block;
	margin: 10px 0 6px;
	font-size: 12px;
	color: #c2cee0;
}

.wwg-login__input {
	width: 100%;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid rgba(255, 255, 255, 0.15);
	background: rgba(0, 0, 0, 0.25);
	border-radius: 10px;
	color: #fff;
	font-size: 16px;
	outline: none;
}

.wwg-login__input:focus {
	border-color: #2a7fff;
	box-shadow: 0 0 0 3px rgba(42, 127, 255, 0.25);
}

.wwg-login__btn {
	margin-top: 18px;
	width: 100%;
	padding: 12px 14px;
	background: #2a7fff;
	color: #fff;
	border: none;
	border-radius: 10px;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
}

.wwg-login__btn:hover {
	background: #1f6cdc;
}

/* Dark mode — auto-enabled when it's night at the player's location. */
body.wwg-dark .leaflet-container {
	/* Background shown when tiles haven't loaded yet (e.g. while zooming
	   out). Matches the filtered Dark Matter tile color so there's no
	   white-to-dark flash. */
	background: #262626;
}

body.wwg-dark .leaflet-tile-pane {
	/* Brighten the CARTO Dark Matter tiles so streets are easier to read.
	   Affects only raster tiles — vector markers (player, coins) live in
	   other panes and stay at their original colors. */
	filter: brightness(1.6) contrast(1.05);
}

body.wwg-dark .leaflet-control-attribution {
	background: rgba(0, 0, 0, 0.6);
	color: #d0d8e0;
}

body.wwg-dark .leaflet-control-attribution a {
	color: #aacfff;
}

body.wwg-dark .wwg-status,
body.wwg-dark .wwg-hud,
body.wwg-dark .wwg-accuracy,
body.wwg-dark .wwg-mute {
	background: rgba(0, 0, 0, 0.75);
}