:root {
	--ink: #2c241c;
	--ink-soft: #5a4e42;
	--paper: #f3eadb;
	--paper-strong: #fff8ec;
	--line: #c9b79a;
	--moss: #5d6b4a;
	--cinnabar: #9a4336;
	--cinnabar-deep: #7d3328;
	--gold: #d8b56a;
	--shadow: 0 18px 40px rgba(60, 42, 28, 0.14);
	--serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "KaiTi", "SimSun", "Times New Roman", serif;
	--sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	min-height: 100%;
	background: #d9cbb3;
	color: var(--ink);
	font-family: var(--serif);
}

body {
	min-height: 100dvh;
}

button,
input,
select {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

.app {
	min-height: 100dvh;
	display: grid;
	grid-template-rows: auto 1fr auto;
	background:
		radial-gradient(1200px 500px at 50% -10%, rgba(255, 248, 232, 0.7), transparent 60%),
		#d9cbb3;
}

.masthead {
	text-align: center;
	padding: 1.1rem 1.25rem 0.4rem;
}

.eyebrow,
.sheet-kicker,
.dock-kicker {
	margin: 0;
	letter-spacing: 0.28em;
	text-indent: 0.28em;
	font-size: 0.72rem;
	color: var(--ink-soft);
	font-family: var(--sans);
}

.masthead h1,
.sheet h2 {
	margin: 0.25rem 0 0;
	font-weight: 500;
	font-size: 1.7rem;
	letter-spacing: 0.18em;
	text-indent: 0.18em;
}

.status {
	margin: 0.35rem 0 0;
	font-size: 0.85rem;
	color: var(--ink-soft);
	font-family: var(--sans);
}

.stage {
	position: relative;
	display: flex;
	align-items: stretch;
	justify-content: center;
	padding: 0.4rem 1rem 0;
	min-height: 0;
}

.courtyard {
	width: min(1120px, 100%);
	height: auto;
	max-height: calc(100dvh - 16.5rem);
	overflow: visible;
	filter: drop-shadow(0 16px 24px rgba(70, 50, 30, 0.12));
}

.presence-pill {
	position: absolute;
	left: 50%;
	bottom: 0.7rem;
	transform: translateX(-50%);
	padding: 0.28rem 0.8rem;
	border-radius: 999px;
	background: rgba(255, 248, 236, 0.82);
	border: 1px solid rgba(201, 183, 154, 0.7);
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--ink-soft);
	backdrop-filter: blur(8px);
	pointer-events: none;
}

.figure {
	cursor: pointer;
	outline: none;
}

.figure:focus-visible .hit {
	stroke: var(--cinnabar);
	stroke-width: 2;
}

.figure .label {
	font-family: var(--sans);
	font-size: 15px;
	fill: var(--ink);
}

.figure.is-self .label {
	font-weight: 600;
}

.dock {
	margin: 0.6rem 1rem 1rem;
	padding: 1rem 1.15rem 0.9rem;
	background: rgba(255, 248, 236, 0.92);
	border: 1px solid var(--line);
	border-radius: 18px;
	box-shadow: var(--shadow);
	backdrop-filter: blur(10px);
	max-width: 920px;
	width: calc(100% - 2rem);
	justify-self: center;
}

.dock-inner.hidden,
.hidden,
[hidden] {
	display: none !important;
}

.dock-kicker + .choices {
	margin-top: 0.45rem;
}

.choices {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem;
	margin: 0 0 0.85rem;
}

.choice {
	appearance: none;
	border: 1px solid var(--line);
	background: var(--paper-strong);
	border-radius: 999px;
	padding: 0.4rem 0.9rem;
	letter-spacing: 0.08em;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.choice[aria-pressed="true"] {
	background: #3d342b;
	border-color: #3d342b;
	color: #f7efe2;
}

.countdown-row {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	margin: 0 0 0.9rem;
	font-family: var(--sans);
	font-size: 0.9rem;
}

.countdown-row select {
	border: 1px solid var(--line);
	background: var(--paper-strong);
	border-radius: 10px;
	padding: 0.35rem 0.6rem;
}

.dock-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.85rem;
}

.btn {
	border: 1px solid var(--line);
	background: var(--paper-strong);
	border-radius: 999px;
	padding: 0.48rem 1.15rem;
	letter-spacing: 0.12em;
}

.btn.primary {
	background: var(--cinnabar);
	border-color: var(--cinnabar);
	color: #fff8f4;
}

.btn.primary:hover:not(:disabled) {
	background: var(--cinnabar-deep);
	border-color: var(--cinnabar-deep);
}

.btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.check {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-family: var(--sans);
	font-size: 0.84rem;
	color: var(--ink-soft);
}

.timer {
	margin: 0.15rem 0 0.15rem;
	font-size: 2rem;
	letter-spacing: 0.06em;
}

.timer-hint {
	margin: 0 0 0.8rem;
	font-family: var(--sans);
	font-size: 0.82rem;
	color: var(--ink-soft);
}

.dock-tools {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 0.8rem;
	margin-top: 0.9rem;
	padding-top: 0.75rem;
	border-top: 1px solid rgba(201, 183, 154, 0.7);
}

.icon-btn,
.text-btn {
	border: 0;
	background: none;
	padding: 0;
	font-family: var(--sans);
	font-size: 0.84rem;
	color: var(--ink-soft);
	letter-spacing: 0.04em;
}

.icon-btn[aria-pressed="true"] {
	color: var(--cinnabar);
}

.popover {
	position: fixed;
	z-index: 5;
	min-width: 10rem;
	padding: 0.75rem 0.9rem 0.6rem;
	background: var(--paper-strong);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: var(--shadow);
}

.popover-label,
.end-duration {
	margin: 0;
	letter-spacing: 0.08em;
}

.popover-time {
	margin: 0.2rem 0 0.45rem;
	font-family: var(--sans);
	font-size: 0.86rem;
	color: var(--ink-soft);
}

.sheet {
	width: min(28rem, calc(100% - 2rem));
	border: 1px solid var(--line);
	border-radius: 20px;
	padding: 1.3rem 1.3rem 1.15rem;
	background: var(--paper-strong);
	box-shadow: var(--shadow);
	color: var(--ink);
}

.sheet::backdrop {
	background: rgba(44, 36, 28, 0.28);
}

.sheet h2 {
	font-size: 1.35rem;
}

.end-duration {
	margin: 0.55rem 0 1rem;
	font-size: 1.35rem;
}

.note-label,
.notes-hint {
	display: block;
	margin: 0 0 0.45rem;
	font-family: var(--sans);
	font-size: 0.86rem;
	color: var(--ink-soft);
}

#reflection {
	width: 100%;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 0.6rem 0.7rem;
	background: #fffaf1;
	margin-bottom: 1rem;
}

.sheet-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	justify-content: flex-end;
}

.notes-list {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	max-height: 16rem;
	overflow: auto;
}

.notes-list li {
	padding: 0.65rem 0;
	border-bottom: 1px solid rgba(201, 183, 154, 0.7);
}

.notes-list .meta {
	margin: 0 0 0.2rem;
	font-family: var(--sans);
	font-size: 0.78rem;
	color: var(--ink-soft);
}

.notes-list .empty {
	color: var(--ink-soft);
	font-family: var(--sans);
}

@media (max-width: 720px) {
	.masthead h1 {
		font-size: 1.4rem;
	}

	.courtyard {
		max-height: calc(100dvh - 21rem);
	}

	.dock {
		margin: 0.4rem 0.7rem 0.7rem;
		width: calc(100% - 1.4rem);
		padding: 0.85rem 0.85rem 0.75rem;
		border-radius: 16px;
	}

	.timer {
		font-size: 1.6rem;
	}
}

.preview-switch {
	margin: 0;
	font-family: var(--sans);
	font-size: 0.84rem;
	color: var(--ink-soft);
	letter-spacing: 0.04em;
	text-decoration: none;
}

.preview-switch:hover,
.preview-switch:focus-visible {
	color: var(--ink);
}
