/* Outfit by The Outfit Project Authors, SIL Open Font License (fonts/outfit-OFL.txt). */
@font-face {
	font-family: "Outfit";
	src: url("fonts/outfit-600.woff2") format("woff2");
	font-weight: 600;
	font-display: swap;
}

/* Lavender (default): a soft, cool light theme. */
:root {
	--bg: #e9e7f6;
	--panel: #f3f1fb;
	--surface: rgb(250 249 255 / 0.78);
	--raised: #fbfaff;
	--chip: #e6e3f5;
	--hover: #e0dcf2;
	--border: #d2cdea;
	--text: #1d1a33;
	--body-text: #4b4768;
	--muted: #6e6a8c;
	--accent: #6b57e8;
	--on-accent: #fff;
	--accent-soft: #d6cdfc;
	--on-accent-soft: #241a5e;
	--secure: #15803d;
	--error: #d33a4a;
	--shadow: rgb(70 55 150 / 0.18);
	--backdrop: rgb(45 38 90 / 0.3);
	color-scheme: light;
}

/* AMOLED dark. */
:root[data-theme="dark"] {
	--bg: #000;
	--panel: #000;
	--surface: rgb(14 14 18 / 0.9);
	--raised: #07070a;
	--chip: #111116;
	--hover: #141414;
	--border: #2a2f3a;
	--text: #e7e9ee;
	--body-text: #c9cbd3;
	--muted: #8b91a0;
	--accent: #7c5cff;
	--on-accent: #fff;
	--accent-soft: #c4b5fd;
	--on-accent-soft: #120c24;
	--secure: #4ade80;
	--error: #ff6b6b;
	--shadow: rgb(0 0 0 / 0.6);
	--backdrop: rgb(0 0 0 / 0.55);
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html,
body {
	height: 100%;
	margin: 0;
}

body {
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font-family:
		system-ui,
		-apple-system,
		"Segoe UI",
		sans-serif;
}

a {
	color: var(--accent);
}

[hidden] {
	display: none !important;
}

/* Wallpaper: fixed behind the desktop and the browser's new tab page. */
.wallpaper {
	position: fixed;
	inset: 0;
	z-index: -1;
	isolation: isolate;
	overflow: hidden;
}

/* Desktop: top bar, date and clock, app icons; brand and the wallpaper button along the
   bottom, above the floating dock. */
.desktop {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 0 20px calc(var(--dock-space) + 6px);
	overflow: hidden auto;
	color: #fff;
}

/* Browser: tabs, toolbar and pages, over the wallpaper. */
.browser {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.topbar {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 56px;
	padding-top: env(safe-area-inset-top);
	text-shadow: 0 1px 6px rgb(0 0 0 / 0.5);
}

.topbar-name {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.4em;
	text-transform: uppercase;
}

.topbar-spacer {
	flex: 1;
}

.topbar-button {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border: 1px solid rgb(255 255 255 / 0.18);
	border-radius: 12px;
	background: rgb(16 16 22 / 0.45);
	backdrop-filter: blur(12px);
	color: #fff;
	cursor: pointer;
}

.topbar-button svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.topbar-time {
	font-size: 14px;
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.desktop-main {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	margin: auto 0;
	padding: 16px 0;
}

.desktop-apps {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: clamp(10px, 3.4vw, 28px);
	animation: rise-in 0.6s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.desktop-app {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	font: inherit;
	cursor: pointer;
}

.desktop-app-icon {
	display: grid;
	place-items: center;
	width: clamp(54px, 14vw, 76px);
	height: clamp(54px, 14vw, 76px);
	border: 1px solid rgb(255 255 255 / 0.22);
	border-radius: 22px;
	background: rgb(255 255 255 / 0.14);
	backdrop-filter: blur(16px);
	box-shadow: 0 8px 24px rgb(0 0 0 / 0.25);
	transition:
		transform 0.15s,
		background 0.15s;
}

.desktop-app:hover .desktop-app-icon {
	background: rgb(255 255 255 / 0.24);
	transform: translateY(-2px);
}

.desktop-app:active .desktop-app-icon {
	transform: scale(0.95);
}

.desktop-app-icon svg {
	width: 44%;
	height: 44%;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.desktop-app-label {
	font-size: 13px;
	font-weight: 500;
	text-shadow: 0 1px 6px rgb(0 0 0 / 0.6);
}

/* The browser's new tab page: just search, transparent over the wallpaper. */
#home-screen {
	position: relative;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 24px 20px calc(var(--dock-space) + 8px);
	overflow: hidden auto;
}

.home-main {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	width: 100%;
	margin: auto 0;
}

.home-clock {
	color: #fff;
	text-align: center;
	text-shadow: 0 2px 18px rgb(0 0 0 / 0.35);
}

.home-date {
	margin: 0;
	font-size: clamp(15px, 3.6vw, 19px);
	font-weight: 500;
	letter-spacing: 0.02em;
}

.home-time {
	margin: 0 0 8px;
	font-size: clamp(64px, 19vw, 132px);
	font-weight: 300;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
	line-height: 1;
}

.home-footer {
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
	flex-wrap: wrap;
	gap: 12px 16px;
	width: 100%;
	color: #fff;
}

/* Frosted glass, for controls that sit on the wallpaper. */
.glass-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: none;
	padding: 11px 18px;
	border: 1px solid rgb(255 255 255 / 0.2);
	border-radius: 16px;
	background: rgb(16 16 22 / 0.55);
	backdrop-filter: blur(14px);
	color: #fff;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.glass-button:hover {
	background: rgb(16 16 22 / 0.7);
}

.glass-button svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
}

/* Animated constellation behind everything on the home screen. */
.stars {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -2;
	pointer-events: none;
}

/* Glow rising from the bottom edge of the home screen. */
.wallpaper::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 55%;
	z-index: -1;
	background:
		radial-gradient(70% 90% at 50% 100%, rgb(124 92 255 / 0.5), transparent 70%),
		radial-gradient(45% 70% at 20% 100%, rgb(214 51 132 / 0.3), transparent 70%),
		radial-gradient(45% 70% at 80% 100%, rgb(56 120 255 / 0.28), transparent 70%);
	pointer-events: none;
	animation: glow-in 1.2s ease-out both;
}

/* Wallpapers. Night (the default styles above) is the constellation with a glow. */
/* Photo wallpapers; the position keeps each car in view on wide screens. */
.wallpaper[data-wallpaper="gtr-sunset"] {
	background: #3a3150 url("wallpapers/gtr-sunset.jpg") center 48% / cover no-repeat;
}

.wallpaper[data-wallpaper="r34-night"] {
	background: #000 url("wallpapers/r34-night.jpg") center 80% / cover no-repeat;
}

.wallpaper[data-wallpaper="maybach-night"] {
	background: #111 url("wallpapers/maybach-night.jpg") center 62% / cover no-repeat;
}

.wallpaper[data-wallpaper="maybach-driveway"] {
	background: #3d4a7a url("wallpapers/maybach-driveway.jpg") center 58% / cover no-repeat;
}

.wallpaper[data-wallpaper="flower-field"] {
	background: #c98a8a url("wallpapers/flower-field.jpg") center 62% / cover no-repeat;
}

.wallpaper[data-wallpaper="hokage"] {
	background: #3aa0e8 url("wallpapers/hokage.jpg") center 35% / cover no-repeat;
}

.wallpaper[data-wallpaper="overcast"] {
	background: #8a94a8 url("wallpapers/overcast.jpg") center 30% / cover no-repeat;
}

.wallpaper[data-wallpaper="beach"] {
	background: #a9b8c8 url("wallpapers/beach.jpg") center 58% / cover no-repeat;
}

.wallpaper[data-wallpaper="blue-hour"] {
	background: #1b3a6b url("wallpapers/blue-hour.jpg") center 55% / cover no-repeat;
}

.wallpaper[data-wallpaper="cabin"] {
	background: #1d2a1d url("wallpapers/cabin.jpg") center 62% / cover no-repeat;
}

.wallpaper[data-wallpaper="snow"] {
	background: radial-gradient(120% 80% at 50% 0%, #1b2550 0%, #0a0f24 45%, #000 100%);
}

.wallpaper.photo::after {
	display: none;
}

.wallpaper[data-wallpaper="snow"]::after {
	background: radial-gradient(70% 90% at 50% 100%, rgb(150 180 255 / 0.28), transparent 70%);
}

/* Labels sit on the wallpaper, so they're white with a shadow whatever the theme. */
.apps-grid .shortcut-label,
#home-screen .status {
	color: #fff;
	font-weight: 500;
	text-shadow:
		0 1px 2px rgb(28 22 70 / 0.75),
		0 0 10px rgb(28 22 70 / 0.5);
}

/* Clock, search and shortcuts rise in one after another on load. */
.home-clock,
.search {
	animation: rise-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.search {
	animation-delay: 0.08s;
}

@keyframes rise-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

@keyframes glow-in {
	from {
		opacity: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.home-clock,
	.search,
	.desktop-apps,
	.wallpaper::after {
		animation: none;
	}
}

input,
select {
	font: inherit;
	color: var(--text);
	background: var(--panel);
	border: 1px solid var(--border);
	border-radius: 999px;
	outline: none;
}

input:focus,
select:focus {
	border-color: var(--accent);
}

/* Search bar: icon, input and a round arrow button in one pill. */
.search {
	display: flex;
	align-items: center;
	gap: 10px;
	width: min(640px, 100%);
	padding: 6px 6px 6px 20px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	box-shadow: 0 10px 40px var(--shadow);
	backdrop-filter: blur(8px);
}

.search:focus-within {
	border-color: var(--accent);
}

.search-icon {
	width: 20px;
	height: 20px;
	flex: none;
	fill: none;
	stroke: var(--muted);
	stroke-width: 2;
	stroke-linecap: round;
}

#search {
	flex: 1;
	min-width: 0;
	padding: 10px 0;
	border: 0;
	background: transparent;
	font-size: 17px;
}

.search-go {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--accent);
	color: #fff;
	cursor: pointer;
}

.search-go:hover {
	filter: brightness(1.12);
}

.search-go svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Shortcut tiles: rounded squares with a remove button and an Add tile at the end. */
.shortcuts {
	display: grid;
	grid-template-columns: repeat(auto-fit, 84px);
	justify-content: center;
	gap: 14px 10px;
	width: min(780px, 100%);
	margin-top: 10px;
}

.shortcut-item {
	position: relative;
}

.shortcut {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	cursor: pointer;
}

.shortcut-icon {
	display: grid;
	place-items: center;
	width: 64px;
	height: 64px;
	border: 1px solid rgb(255 255 255 / 0.22);
	border-radius: 20px;
	background: rgb(255 255 255 / 0.16);
	backdrop-filter: blur(14px);
	color: #fff;
	transition:
		border-color 0.15s,
		transform 0.15s;
}

.shortcut:hover .shortcut-icon {
	border-color: var(--accent);
	transform: translateY(-2px);
}

.shortcut:focus-visible {
	outline: none;
}

.shortcut:focus-visible .shortcut-icon {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.shortcut-icon svg {
	width: 28px;
	height: 28px;
}

.shortcut-letter {
	font-size: 26px;
	font-weight: 700;
	line-height: 1;
}

.shortcut-label {
	max-width: 100%;
	overflow: hidden;
	font-size: 13px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.shortcut-add .shortcut-icon {
	border-style: dashed;
	background: transparent;
}

.shortcut-add .shortcut-icon svg {
	fill: none;
	stroke: rgb(255 255 255 / 0.85);
	stroke-width: 2;
	stroke-linecap: round;
}

.shortcut-remove {
	position: absolute;
	top: -6px;
	right: 2px;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 50%;
	background: var(--raised);
	color: var(--muted);
	cursor: pointer;
	opacity: 0;
	transition: opacity 0.15s;
}

.shortcut-item:hover .shortcut-remove,
.shortcut-remove:focus-visible {
	opacity: 1;
}

/* No hover on touch screens, so keep the trash button visible. */
@media (hover: none) {
	.shortcut-remove {
		opacity: 1;
	}
}

.shortcut-remove:hover {
	color: var(--error);
	border-color: var(--error);
}

.shortcut-remove svg {
	width: 14px;
	height: 14px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.status {
	min-height: 1.4em;
	margin: 0;
	font-size: 14px;
	color: var(--muted);
}

.status.error {
	color: var(--error);
}

.settings {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 18px 20px 20px;
	font-size: 14px;
}

.settings label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.settings .status {
	min-height: 0;
}

.settings select,
.settings input {
	width: 240px;
	max-width: 55%;
	padding: 6px 12px;
	border-radius: 8px;
}

#toolbar {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 6px 8px;
	background: var(--panel);
	border-bottom: 1px solid var(--border);
}

.icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--text);
	cursor: pointer;
}

.icon:hover {
	background: var(--border);
}

.icon svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Address bar with a status icon: home on skeld:// pages, lock on https. */
.bar {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
	margin: 0 4px;
}

.bar-icon {
	position: absolute;
	left: 12px;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: var(--muted);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
}

.bar-icon.secure {
	stroke: var(--secure);
}

#bar {
	width: 100%;
	padding: 8px 14px 8px 36px;
	font-size: 14px;
}

/* The ☰ dropdown. */
.menu-wrap {
	position: relative;
}

.menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 20;
	display: flex;
	flex-direction: column;
	min-width: 240px;
	padding: 8px;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: radial-gradient(120% 80% at 0% 0%, rgb(124 92 255 / 0.12), transparent 60%), var(--raised);
	box-shadow: 0 18px 50px var(--shadow);
	backdrop-filter: blur(12px);
	animation: menu-in 0.14s ease-out;
}

@keyframes menu-in {
	from {
		opacity: 0;
		transform: translateY(-4px) scale(0.98);
	}
}

.menu button {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 11px 12px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 15px;
	text-align: left;
	cursor: pointer;
}

.menu button:hover:not(:disabled),
.menu button:focus-visible {
	background: var(--hover);
	outline: none;
}

.menu button:disabled {
	color: var(--muted);
	opacity: 0.5;
	cursor: default;
}

.menu svg {
	width: 18px;
	height: 18px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.menu hr {
	width: calc(100% - 16px);
	margin: 6px auto;
	border: 0;
	border-top: 1px solid var(--border);
}

#tabbar {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 8px 8px 6px;
	background: var(--bg);
}

#tabs {
	display: flex;
	gap: 6px;
	min-width: 0;
	overflow-x: auto;
	scrollbar-width: none;
}

/* Pill-shaped tabs; the active one is filled with the accent. */
.tab {
	display: flex;
	align-items: center;
	gap: 6px;
	width: 200px;
	min-width: 96px;
	flex: 0 1 auto;
	height: 34px;
	padding: 0 6px 0 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font-size: 13px;
	cursor: default;
	user-select: none;
	transition:
		background 0.15s,
		color 0.15s;
}

.tab:hover {
	background: var(--hover);
	color: var(--text);
}

.tab.active {
	border-color: transparent;
	background: var(--accent-soft);
	color: var(--on-accent-soft);
	font-weight: 600;
}

.tab:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.tab-title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tab-close {
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	flex: none;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}

.tab-close:hover {
	background: rgb(127 127 127 / 0.25);
}

#add-tab {
	width: 34px;
	height: 34px;
	border-radius: 50%;
}

#frames {
	flex: 1;
	display: flex;
	min-height: 0;
	margin-bottom: var(--dock-space);
}

#frames iframe {
	flex: 1;
	width: 100%;
	border: 0;
	background: #fff;
}

/* Home screen and frames share the space under the toolbar. */
#home-screen:not([hidden]) + #frames {
	display: none;
}

.settings input[type="checkbox"] {
	width: auto;
	accent-color: var(--accent);
}

.text-button {
	flex: none;
	padding: 6px 12px;
	border: 1px solid var(--border);
	border-radius: 8px;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 14px;
	cursor: pointer;
}

.text-button:hover {
	background: var(--border);
}

.panel {
	width: min(760px, calc(100vw - 32px));
	max-height: min(80vh, 900px);
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 12px;
	background: var(--panel);
	color: var(--text);
}

#settings-panel {
	width: min(520px, calc(100vw - 32px));
}

.panel[open] {
	display: flex;
	flex-direction: column;
}

.panel::backdrop {
	background: var(--backdrop);
}

.panel-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 12px 12px 12px 20px;
	border-bottom: 1px solid var(--border);
}

.panel-head h2 {
	margin: 0 auto 0 0;
	font-size: 18px;
}

#history-search {
	width: min(260px, 40vw);
	padding: 6px 14px;
	font-size: 14px;
}

#history-list {
	overflow-y: auto;
	padding: 4px 8px 12px;
}

#history-list h3 {
	margin: 14px 12px 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--muted);
}

#history-list ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.history-item {
	display: flex;
	align-items: center;
	gap: 8px;
	border-radius: 8px;
}

.history-item:hover {
	background: var(--hover);
}

.history-open {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
	padding: 8px 12px;
	border: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.history-title,
.history-url {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.history-title {
	font-size: 14px;
}

.history-url {
	font-size: 12px;
	color: var(--muted);
}

.history-time {
	flex: none;
	font-size: 12px;
	color: var(--muted);
}

.history-remove {
	width: 28px;
	height: 28px;
	font-size: 16px;
	color: var(--muted);
}

.history-empty {
	margin: 32px 12px;
	text-align: center;
	color: var(--muted);
}

.panel-actions {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.text-button.primary {
	border-color: transparent;
	background: var(--accent);
	color: #fff;
}

.text-button.primary:hover {
	background: var(--accent);
	filter: brightness(1.12);
}

/* Games picker: a grid of cards with each site's banner and logo. */
.games {
	width: min(720px, calc(100vw - 24px));
}

.games-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
	padding: 16px;
	overflow-y: auto;
}

.game-site {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 18px;
	background: var(--surface);
	color: var(--text);
	font: inherit;
	text-align: left;
	cursor: pointer;
	transition:
		border-color 0.15s,
		transform 0.15s,
		box-shadow 0.15s;
}

.game-site:hover,
.game-site:focus-visible {
	border-color: var(--accent);
	box-shadow: 0 12px 30px var(--shadow);
	transform: translateY(-2px);
	outline: none;
}

.game-banner {
	display: block;
	width: 100%;
	aspect-ratio: 1.9;
	object-fit: cover;
	background: var(--chip);
}

.game-info {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px 12px;
}

.game-icon {
	width: 36px;
	height: 36px;
	flex: none;
	border-radius: 10px;
	object-fit: cover;
}

.game-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.game-name {
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.game-about {
	overflow: hidden;
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Phones: four smaller tiles per row so the home screen fits above the dock. */
@media (max-width: 520px) {
	.shortcuts {
		grid-template-columns: repeat(4, 1fr);
		gap: 12px 6px;
	}

	.shortcut-icon {
		width: 56px;
		height: 56px;
		border-radius: 17px;
	}

	.shortcut-icon svg {
		width: 24px;
		height: 24px;
	}

	.shortcut-label {
		font-size: 12px;
	}

	.shortcut-remove {
		top: -6px;
		right: 0;
		width: 22px;
		height: 22px;
	}
}

@media (max-width: 420px) {
	.games-list {
		gap: 10px;
		padding: 12px;
	}

	.game-info {
		padding: 8px 10px 10px;
	}

	.game-icon {
		width: 28px;
		height: 28px;
		border-radius: 8px;
	}

	.game-name {
		font-size: 14px;
	}

	.game-about {
		display: none;
	}
}

/* Credits. */
.credits {
	width: min(420px, calc(100vw - 32px));
}

.credits-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 26px 24px 28px;
	text-align: center;
}

.credits-logo {
	margin: 0 0 10px;
	font-family: "Outfit", system-ui, sans-serif;
	font-size: 44px;
	font-weight: 600;
	letter-spacing: -0.035em;
	color: var(--accent);
}

.credits-made {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.credits-names {
	margin: 0 0 14px;
	font-size: 26px;
	font-weight: 700;
}

.credits-and {
	color: var(--accent);
}

.credits-built {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.5;
}

/* Welcome tour. */
.tour {
	width: min(560px, calc(100vw - 32px));
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 28px;
	background: var(--raised);
	color: var(--text);
	box-shadow: 0 30px 80px var(--shadow);
}

.tour::backdrop {
	background: var(--backdrop);
	backdrop-filter: blur(14px);
}

.tour-card {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	animation: rise-in 0.3s ease-out;
}

.tour svg {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tour-steps {
	display: flex;
	align-items: center;
	gap: 10px;
}

.tour-pills {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 5px;
	list-style: none;
	border-radius: 999px;
	background: var(--chip);
}

.tour-pill {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	flex: none;
	border: 1.5px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font-size: 14px;
	font-weight: 600;
}

.tour-pill.done {
	border-color: transparent;
	background: var(--accent-soft);
	color: var(--on-accent-soft);
}

.tour-pill.done svg {
	width: 16px;
	height: 16px;
	stroke-width: 3;
}

.tour-pill.current {
	display: flex;
	gap: 8px;
	width: auto;
	min-width: 0;
	flex: 0 1 auto;
	padding: 0 14px 0 4px;
	border-color: transparent;
	background: var(--accent-soft);
	color: var(--on-accent-soft);
}

.tour-num {
	display: grid;
	place-items: center;
	width: 22px;
	height: 22px;
	flex: none;
	border-radius: 50%;
}

.tour-pill.current .tour-num {
	background: rgb(18 12 36 / 0.12);
}

.tour-pill-label {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.tour-skip {
	flex: none;
	padding: 6px 4px;
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 15px;
	cursor: pointer;
}

.tour-skip:hover {
	color: var(--text);
}

.tour-badge {
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	margin-top: 8px;
	border-radius: 50%;
	background: rgb(124 92 255 / 0.16);
	color: var(--accent);
}

.tour-badge svg {
	width: 24px;
	height: 24px;
}

.tour-title {
	margin: 0;
	font-size: 24px;
	letter-spacing: -0.01em;
}

.tour-body {
	margin: 0;
	color: var(--body-text);
	font-size: 16px;
	line-height: 1.6;
}

.tour-actions {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	margin-top: 8px;
}

.tour-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 20px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--chip);
	color: var(--text);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	cursor: pointer;
}

.tour-button svg {
	width: 18px;
	height: 18px;
}

.tour-button.primary {
	margin-left: auto;
	border-color: transparent;
	background: var(--accent-soft);
	color: var(--on-accent-soft);
}

.tour-button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.tour-button:hover {
	filter: brightness(1.1);
}

.tour-skip:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 8px;
}

/* Bottom bar: a floating sheet of dark glass. --dock-space is the room it takes up. */
:root {
	--dock-space: calc(84px + env(safe-area-inset-bottom));
}

.dock {
	position: fixed;
	left: 50%;
	bottom: calc(12px + env(safe-area-inset-bottom));
	z-index: 25;
	display: flex;
	justify-content: space-between;
	gap: 4px;
	width: min(560px, calc(100vw - 24px));
	height: 62px;
	padding: 8px;
	border: 1px solid rgb(255 255 255 / 0.14);
	border-radius: 22px;
	background: rgb(18 18 26 / 0.72);
	backdrop-filter: blur(18px) saturate(1.4);
	box-shadow: 0 14px 40px rgb(0 0 0 / 0.35);
	transform: translateX(-50%);
}

.dock button {
	position: relative;
	display: grid;
	place-items: center;
	flex: 1;
	padding: 0;
	border: 0;
	border-radius: 14px;
	background: transparent;
	color: rgb(255 255 255 / 0.72);
	cursor: pointer;
	transition:
		background 0.15s,
		color 0.15s;
}

@media (hover: hover) {
	.dock button:hover {
		background: rgb(255 255 255 / 0.1);
		color: #fff;
	}
}

.dock button.active {
	background: rgb(255 255 255 / 0.18);
	color: #fff;
}

.dock button:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.dock svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

@media (max-width: 540px) {
	.history-time {
		display: none;
	}

	/* Room for the address bar on phones. */
	#forward {
		display: none;
	}

	#toolbar {
		gap: 2px;
	}

	#history-search {
		order: 1;
		width: 100%;
	}
}

/* Apps: the shortcut grid on a sheet of dark glass, whatever the theme. */
.panel.apps {
	width: min(640px, calc(100vw - 24px));
	border-color: rgb(255 255 255 / 0.16);
	border-radius: 24px;
	background: rgb(18 18 26 / 0.78);
	backdrop-filter: blur(22px);
	color: #fff;
}

.panel.apps .panel-head {
	border-bottom-color: rgb(255 255 255 / 0.12);
}

.panel.apps .icon {
	color: #fff;
}

.apps-grid {
	margin: 0;
	padding: 20px 14px 22px;
	overflow-y: auto;
}

/* Browser chrome: tabs and toolbar on dark glass over the wallpaper, like the dock. */
#tabbar,
#toolbar,
#home-screen .search {
	--panel: transparent;
	--surface: rgb(18 18 26 / 0.62);
	--raised: #16161e;
	--chip: rgb(255 255 255 / 0.1);
	--hover: rgb(255 255 255 / 0.12);
	--border: rgb(255 255 255 / 0.14);
	--text: #f4f3fa;
	--body-text: #d9d7e6;
	--muted: #a9a6be;
	--accent-soft: rgb(255 255 255 / 0.2);
	--on-accent-soft: #fff;
	--secure: #4ade80;
	color-scheme: dark;
	color: var(--text);
}

#tabbar {
	background: rgb(12 12 18 / 0.72);
	backdrop-filter: blur(20px);
}

#toolbar {
	position: relative;
	z-index: 30;
	background: rgb(12 12 18 / 0.72);
	backdrop-filter: blur(20px);
}

#home-screen .search {
	backdrop-filter: blur(18px);
	box-shadow: 0 10px 40px rgb(0 0 0 / 0.3);
}

/* Wallpaper picker: a card per wallpaper; the photos double as previews. */
.wallpaper-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 14px;
	padding: 18px;
	overflow-y: auto;
}

.wallpaper-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0;
	border: 0;
	background: none;
	color: #fff;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.wallpaper-preview {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	border: 2px solid rgb(255 255 255 / 0.14);
	border-radius: 16px;
	background: #222 center / cover no-repeat;
	transition:
		border-color 0.15s,
		transform 0.15s;
}

.wallpaper-card:hover .wallpaper-preview {
	transform: translateY(-2px);
}

.wallpaper-card[aria-checked="true"] .wallpaper-preview,
.wallpaper-card:focus-visible .wallpaper-preview {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px rgb(124 92 255 / 0.35);
}

.wallpaper-card:focus-visible {
	outline: none;
}

.wallpaper-name {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 4px;
	font-size: 14px;
	font-weight: 500;
}

.wallpaper-card[aria-checked="true"] .wallpaper-name::after {
	content: "✓";
	margin-left: auto;
	color: var(--accent-soft);
}

.wallpaper-tag {
	padding: 2px 8px;
	border-radius: 999px;
	background: rgb(255 255 255 / 0.14);
	font-size: 11px;
}

.wallpaper-preview[data-wallpaper="gtr-sunset"] {
	background-image: url("wallpapers/gtr-sunset.jpg");
	background-position: center 48%;
}

.wallpaper-preview[data-wallpaper="r34-night"] {
	background-image: url("wallpapers/r34-night.jpg");
	background-position: center 80%;
}

.wallpaper-preview[data-wallpaper="maybach-night"] {
	background-image: url("wallpapers/maybach-night.jpg");
	background-position: center 62%;
}

.wallpaper-preview[data-wallpaper="maybach-driveway"] {
	background-image: url("wallpapers/maybach-driveway.jpg");
	background-position: center 58%;
}

.wallpaper-preview[data-wallpaper="flower-field"] {
	background-image: url("wallpapers/flower-field.jpg");
	background-position: center 62%;
}

.wallpaper-preview[data-wallpaper="hokage"] {
	background-image: url("wallpapers/hokage.jpg");
	background-position: center 35%;
}

.wallpaper-preview[data-wallpaper="overcast"] {
	background-image: url("wallpapers/overcast.jpg");
	background-position: center 30%;
}

.wallpaper-preview[data-wallpaper="beach"] {
	background-image: url("wallpapers/beach.jpg");
	background-position: center 58%;
}

.wallpaper-preview[data-wallpaper="blue-hour"] {
	background-image: url("wallpapers/blue-hour.jpg");
	background-position: center 55%;
}

.wallpaper-preview[data-wallpaper="cabin"] {
	background-image: url("wallpapers/cabin.jpg");
	background-position: center 62%;
}

.wallpaper-preview[data-wallpaper="snow"] {
	background:
		radial-gradient(circle at 20% 30%, #fff 0 1.5px, transparent 2px),
		radial-gradient(circle at 65% 20%, #fff 0 2px, transparent 2.5px),
		radial-gradient(circle at 80% 60%, #fff 0 1.5px, transparent 2px),
		radial-gradient(circle at 35% 70%, #fff 0 2px, transparent 2.5px),
		radial-gradient(circle at 50% 45%, #fff 0 1px, transparent 1.5px),
		radial-gradient(70% 90% at 50% 100%, rgb(150 180 255 / 0.3), transparent 70%),
		radial-gradient(120% 80% at 50% 0%, #1b2550 0%, #0a0f24 45%, #000 100%);
}

.wallpaper-preview[data-wallpaper="night"] {
	background:
		radial-gradient(circle at 15% 25%, #fff 0 1px, transparent 1.5px),
		radial-gradient(circle at 40% 15%, #fff 0 1.2px, transparent 1.7px),
		radial-gradient(circle at 70% 35%, #fff 0 1px, transparent 1.5px),
		radial-gradient(circle at 85% 18%, #fff 0 1.2px, transparent 1.7px),
		radial-gradient(circle at 55% 55%, #fff 0 1px, transparent 1.5px),
		radial-gradient(70% 90% at 50% 100%, rgb(124 92 255 / 0.5), transparent 70%),
		radial-gradient(45% 70% at 20% 100%, rgb(214 51 132 / 0.3), transparent 70%),
		#05050c;
}

@media (max-width: 420px) {
	.wallpaper-list {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
		padding: 14px;
	}
}

/* OS mode, after the reference: a full-width glass top bar, apps in the top left on wide
   screens, and a dock with dividers. */
.topbar {
	margin: 0 -20px;
	padding-inline: 20px;
	border-bottom: 1px solid rgb(255 255 255 / 0.08);
	background: rgb(12 12 18 / 0.45);
	backdrop-filter: blur(18px);
	text-shadow: none;
}

.topbar-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 10px;
	border: 0;
	border-radius: 10px;
	background: none;
	color: rgb(255 255 255 / 0.85);
	font: inherit;
	font-size: 13px;
	cursor: pointer;
}

.topbar-link:hover {
	background: rgb(255 255 255 / 0.1);
	color: #fff;
}

.topbar-link svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
}

.topbar .topbar-button {
	border: 0;
	background: none;
}

.dock-sep {
	flex: none;
	width: 1px;
	height: 26px;
	margin: 0 2px;
	background: rgb(255 255 255 / 0.16);
}

@media (min-width: 900px) {
	.desktop {
		position: relative;
	}

	.desktop-main {
		margin: 28px 0 auto;
	}

	.home-time {
		font-size: 84px;
	}

	.desktop-apps {
		position: absolute;
		top: 84px;
		left: 24px;
		display: grid;
		grid-template-columns: repeat(2, 92px);
		gap: 22px 4px;
	}

	.desktop-app-icon {
		width: 52px;
		height: 52px;
		border-radius: 14px;
	}

	.desktop-app-label {
		font-size: 12px;
	}
}

/* Browser mode: no desktop and no dock, the browser fills the screen. */
body[data-mode="browser"] {
	--dock-space: 0px;
}

body[data-mode="browser"] .dock,
body[data-mode="browser"] .desktop {
	display: none !important;
}

/* First visit: OS mode or browser mode. */
.mode-panel {
	width: min(620px, calc(100vw - 24px));
}

.mode-body {
	padding: 26px 22px 22px;
	text-align: center;
}

.mode-title {
	margin: 0;
	font-family: "Outfit", system-ui, sans-serif;
	font-size: 24px;
	font-weight: 600;
}

.mode-sub {
	margin: 6px 0 20px;
	color: rgb(255 255 255 / 0.65);
	font-size: 14px;
}

.mode-options {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

.mode-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 22px 16px;
	border: 1px solid rgb(255 255 255 / 0.14);
	border-radius: 20px;
	background: rgb(255 255 255 / 0.06);
	color: #fff;
	font: inherit;
	cursor: pointer;
	transition:
		background 0.15s,
		border-color 0.15s,
		transform 0.15s;
}

.mode-option:hover,
.mode-option:focus-visible {
	border-color: var(--accent);
	background: rgb(255 255 255 / 0.12);
	outline: none;
	transform: translateY(-2px);
}

.mode-icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 16px;
	background: rgb(255 255 255 / 0.12);
}

.mode-icon svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.mode-name {
	font-size: 17px;
	font-weight: 600;
}

.mode-about {
	color: rgb(255 255 255 / 0.65);
	font-size: 13px;
	line-height: 1.4;
}

@media (max-width: 480px) {
	.mode-options {
		grid-template-columns: 1fr;
	}

	.topbar-link {
		font-size: 0;
	}

	.topbar-link svg {
		width: 18px;
		height: 18px;
	}
}
