*, *::before, *::after {
	box-sizing: border-box;
}

:root {
	--sky: #99e0ff;
	--water: #00a9ee;
	--water-dark: #0078b7;
	--grass: #8fe38f;
	--ink: #17202a;
	--muted: #6e7a84;
	--paper: rgba(255, 255, 255, 0.9);
	--line: rgba(23, 32, 42, 0.12);
	--danger: #e34848;
}

html,
body,
.app-shell {
	width: 100%;
	min-height: 100%;
	margin: 0;
}

body {
	font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	color: var(--ink);
	background: var(--sky) url("/images/scenery.png") center top / cover fixed;
	overflow: hidden;
}

button,
input,
textarea {
	font: inherit;
}

button {
	border: 0;
	cursor: pointer;
}

[hidden] {
	display: none !important;
}

.auth-view {
	min-height: 100vh;
	display: grid;
	place-items: center;
	gap: 28px;
	padding: 32px;
}

.brand-lockup {
	text-align: center;
}

.brand-lockup img {
	width: min(420px, 78vw);
	margin: 0 auto 8px;
}

.brand-lockup p {
	margin: 0;
	font-size: 18px;
	color: rgba(23, 32, 42, 0.72);
}

.auth-card {
	width: min(380px, 100%);
	padding: 22px;
	border-radius: 18px;
	background: var(--paper);
	box-shadow: 0 20px 60px rgba(23, 32, 42, 0.16);
	backdrop-filter: blur(14px);
}

.auth-tabs {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-bottom: 18px;
}

.auth-tabs button,
.primary-action,
.text-button,
.detail-actions button,
.duck-fields button {
	min-height: 40px;
	border-radius: 10px;
	padding: 0 14px;
	background: #eef8fc;
	color: var(--ink);
}

.auth-tabs .active,
.primary-action,
.duck-fields button {
	background: var(--ink);
	color: #fff;
}

label {
	display: grid;
	gap: 6px;
	margin-bottom: 14px;
	font-size: 13px;
	color: var(--muted);
}

input,
textarea {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 11px 12px;
	color: var(--ink);
	background: #fff;
	outline: 0;
}

textarea {
	resize: vertical;
}

input:focus,
textarea:focus {
	border-color: var(--water);
	box-shadow: 0 0 0 3px rgba(0, 169, 238, 0.16);
}

.form-error {
	margin: 0 0 12px;
	color: var(--danger);
	font-size: 14px;
}

.town-view {
	position: relative;
	display: grid;
	grid-template-columns: 300px 1fr;
	height: 100vh;
	min-width: 960px;
	background: rgba(143, 227, 143, 0.35);
}

.pond-sidebar {
	overflow: auto;
	background: rgba(255, 255, 255, 0.94);
	border-right: 1px solid var(--line);
}

.sidebar-top {
	position: sticky;
	top: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: 42px 1fr;
	align-items: center;
	gap: 14px;
	min-height: 78px;
	padding: 16px;
	background: rgba(255, 255, 255, 0.96);
	border-bottom: 1px solid var(--line);
}

.text-button {
	display: block;
	min-height: 0;
	padding: 3px 0;
	color: var(--water-dark);
	background: transparent;
}

.icon-button {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--ink);
	color: #fff;
	font-size: 22px;
	font-weight: 700;
}

.pond-list {
	padding-bottom: 24px;
}

.pond-item {
	position: relative;
	display: grid;
	grid-template-columns: 42px 1fr;
	gap: 12px;
	align-items: center;
	width: 100%;
	min-height: 82px;
	padding: 18px 18px 18px 14px;
	text-align: left;
	background: transparent;
	border-bottom: 1px solid var(--line);
}

.pond-item.active {
	background: #e4f7ff;
}

.pond-count {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 14px;
	color: #fff;
	background: var(--water);
	font-weight: 700;
}

.pond-name {
	display: block;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	color: var(--ink);
}

.pond-meta {
	display: block;
	margin-top: 4px;
	color: var(--muted);
	font-size: 12px;
}

.workspace {
	position: relative;
	overflow: hidden;
}

.pond-header {
	position: absolute;
	z-index: 20;
	top: 18px;
	left: 42px;
	right: 42px;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) 42px;
	align-items: center;
	gap: 16px;
}

.menu-button {
	display: none;
	width: 42px;
	height: 42px;
	border-radius: 12px;
	background: rgba(255, 255, 255, 0.7);
}

.menu-button span,
.menu-button span::before,
.menu-button span::after {
	display: block;
	width: 18px;
	height: 2px;
	margin: auto;
	background: var(--ink);
}

.menu-button span::before,
.menu-button span::after {
	content: "";
	position: relative;
}

.menu-button span::before {
	top: -7px;
}

.menu-button span::after {
	top: 5px;
}

.pond-title {
	border: 0;
	background: transparent;
	text-align: center;
	color: var(--water-dark);
	font-size: 32px;
	font-weight: 300;
	box-shadow: none;
}

.pond-title:focus {
	box-shadow: none;
}

.delete-pond {
	background: #fff url("/images/trash.svg") center / 18px auto no-repeat;
	filter: grayscale(1);
}

.pond-stage {
	--pond-radius: 58px 64px 54px 70px / 62px 54px 68px 56px;
	position: absolute;
	top: 96px;
	left: 52px;
	right: 52px;
	bottom: 176px;
	min-height: 360px;
	background: transparent;
}

.pond-shape {
	position: absolute;
	z-index: 0;
	inset: -18px;
	width: calc(100% + 36px);
	height: calc(100% + 36px);
	pointer-events: none;
	overflow: visible;
}

.pond-water {
	fill: var(--water);
	stroke: var(--water);
	stroke-width: 4;
	stroke-linejoin: round;
}

.pond-shine {
	fill: none;
	stroke: rgba(255, 255, 255, 0.14);
	stroke-width: 1.4;
	transform: translate(-1.2px, -1px) scale(0.96, 0.94);
	transform-origin: center;
}

.pond-shade {
	fill: none;
	stroke: rgba(0, 120, 183, 0.16);
	stroke-width: 1.6;
	transform: translate(1.4px, 1.2px) scale(0.97, 0.95);
	transform-origin: center;
}

.pond-stage.empty::after {
	content: "";
	position: absolute;
	z-index: 1;
	inset: 16%;
	background: url("/images/smile.svg") center / contain no-repeat;
	opacity: 0.9;
}

.duck-in-pond {
	position: absolute;
	z-index: 2;
	display: block;
	width: 30%;
	height: 24%;
	min-width: 120px;
	min-height: 90px;
	padding: 0;
	background: url("/images/ducky-float.png") center / contain no-repeat;
	transition: transform 160ms ease, opacity 180ms ease;
}

.duck-in-pond.left {
	background-image: url("/images/ducky-float2.png");
}

.duck-in-pond:hover {
	transform: translateY(-4px);
}

.duck-label {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 0;
	overflow: hidden;
	color: #fff;
	text-align: center;
	white-space: nowrap;
	text-overflow: ellipsis;
	font-size: 14px;
}

.duck-row {
	position: absolute;
	left: 42px;
	right: 42px;
	bottom: 12px;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	height: 136px;
	gap: 2px;
}

.duck-row:empty::before {
	content: "line 'em up";
	color: rgba(23, 32, 42, 0.28);
	font-size: 32px;
	font-weight: 300;
}

.duck-in-row {
	position: relative;
	z-index: 2;
	display: block;
	flex: 0 0 88px;
	width: 88px;
	height: 128px;
	padding: 0;
	background: url("/images/ducky-stand.png") center bottom / contain no-repeat;
}

.duck-in-row:hover::after {
	content: attr(data-title);
	position: absolute;
	left: 50%;
	bottom: 100%;
	width: 170px;
	min-height: 68px;
	transform: translateX(-50%);
	padding: 14px;
	border-radius: 16px 16px 16px 4px;
	background: #fff;
	box-shadow: 0 12px 30px rgba(23, 32, 42, 0.18);
	font-size: 14px;
}

.add-duck-panel {
	position: absolute;
	z-index: 30;
	top: 22px;
	right: 104px;
}

.duck-toggle {
	width: 48px;
	height: 48px;
	border-radius: 999px;
	background: transparent;
}

.duck-toggle::before {
	content: "+";
	position: absolute;
	right: -7px;
	top: 0;
	font-size: 22px;
	font-weight: 800;
}

.duck-toggle::after {
	content: "";
	position: absolute;
	right: 0;
	top: 0;
	width: 44px;
	height: 44px;
	background: url("/images/ducky-silhouette.png") center / contain no-repeat;
}

.add-duck-panel.open .duck-toggle::before {
	color: var(--water-dark);
	transform: rotate(45deg);
}

.duck-fields {
	pointer-events: none;
	position: absolute;
	top: 48px;
	right: 8px;
	display: grid;
	gap: 10px;
	width: 230px;
	padding: 16px;
	border-radius: 18px 6px 18px 18px;
	background: var(--paper);
	opacity: 0;
	transform: translateY(-8px);
	box-shadow: 0 18px 45px rgba(23, 32, 42, 0.16);
	backdrop-filter: blur(14px);
	transition: opacity 160ms ease, transform 160ms ease;
}

.add-duck-panel.open .duck-fields {
	pointer-events: auto;
	opacity: 1;
	transform: translateY(0);
}

.add-duck-panel.limit .duck-toggle {
	opacity: 0.45;
	pointer-events: none;
}

.add-duck-panel.limit .duck-toggle::before {
	content: "12";
	font-size: 13px;
}

.duck-detail {
	position: fixed;
	z-index: 100;
	inset: 0;
	display: grid;
	place-items: center;
	padding: 28px;
	background: rgba(0, 169, 238, 0.26);
	backdrop-filter: blur(10px);
}

.detail-card {
	display: grid;
	gap: 14px;
	width: min(640px, 100%);
	padding: 24px;
	border-radius: 24px;
	background: rgba(255, 255, 255, 0.42);
	box-shadow: 0 24px 70px rgba(23, 32, 42, 0.2);
	backdrop-filter: blur(18px);
}

.detail-title {
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 30px;
	font-weight: 300;
}

.detail-notes {
	min-height: 220px;
	background: rgba(255, 255, 255, 0.86);
}

.detail-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.danger-action {
	color: #fff !important;
	background: var(--danger) !important;
}

@media (max-width: 840px) {
	body {
		overflow: hidden;
	}

	.town-view {
		display: block;
		min-width: 0;
	}

	.pond-sidebar {
		position: fixed;
		z-index: 80;
		inset: 0 auto 0 0;
		width: min(300px, 82vw);
		transform: translateX(-100%);
		transition: transform 180ms ease;
	}

	.town-view.menu-open .pond-sidebar {
		transform: translateX(0);
		box-shadow: 20px 0 60px rgba(23, 32, 42, 0.2);
	}

	.menu-button {
		display: block;
	}

	.pond-header {
		left: 14px;
		right: 14px;
		gap: 8px;
	}

	.pond-title {
		font-size: 22px;
	}

	.pond-stage {
		left: 34px;
		right: 34px;
		top: 98px;
		bottom: 170px;
		min-height: 0;
		border-radius: 38px;
	}

	.duck-in-pond {
		min-width: 86px;
	}

	.duck-row {
		left: 14px;
		right: 14px;
		height: 122px;
		justify-content: flex-start;
		overflow-x: auto;
	}

	.duck-in-row {
		flex: 0 0 72px;
		height: 112px;
	}

	.add-duck-panel {
		right: 60px;
	}
}
