:root {
	color-scheme: light;
}

* {
	box-sizing: border-box;
}

html {
	background: #f2f6f0;
	height: 100%;
}

body {
	color: #111827;
	font-family: Arial, sans-serif;
	margin: 0;
	min-height: 100%;
}

body.play-page {
	background: #f6f1e5;
	height: 100%;
	overflow: hidden;
	touch-action: none;
	width: 100%;
}

body.site-page {
	background:
		linear-gradient(180deg, rgba(31, 138, 112, 0.1), rgba(31, 138, 112, 0) 260px),
		#f2f6f0;
	overflow-x: hidden;
}

a {
	color: #1f6b5c;
	font-weight: 800;
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

.play-page canvas {
	display: block;
	height: 100vh;
	height: 100dvh;
	width: 100vw;
}

.site-header {
	align-items: center;
	background: rgba(255, 250, 242, 0.94);
	border-bottom: 1px solid rgba(17, 24, 39, 0.12);
	display: flex;
	gap: 18px;
	justify-content: space-between;
	min-height: 68px;
	padding: 12px clamp(16px, 4vw, 44px);
	position: sticky;
	top: 0;
	z-index: 5;
}

.brand {
	align-items: center;
	color: #111827;
	display: inline-flex;
	font-size: 22px;
	gap: 10px;
	letter-spacing: 0;
	line-height: 1;
	white-space: nowrap;
}

.brand:hover {
	text-decoration: none;
}

.brand-mark {
	align-items: center;
	background: #263238;
	border-radius: 8px;
	color: #f8fbf8;
	display: inline-flex;
	font-size: 18px;
	height: 36px;
	justify-content: center;
	width: 36px;
}

.primary-nav,
.account-nav,
.account-panel-actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.primary-nav {
	margin-left: auto;
}

.account-nav,
.account-panel-actions {
	color: #40515a;
	font-size: 14px;
	justify-content: flex-end;
}

.account-panel-actions {
	justify-content: flex-start;
	margin-top: 12px;
}

.account-summary {
	align-items: center;
	display: inline-flex;
	gap: 8px;
	min-width: 0;
}

.account-name {
	color: #111827;
	font-weight: 800;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.account-pearls {
	background: #fff7d6;
	border: 1px solid rgba(149, 107, 16, 0.28);
	border-radius: 999px;
	color: #6f4e08;
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 900;
	line-height: 1;
	padding: 5px 8px;
	white-space: nowrap;
}

.site-main {
	margin: 0 auto;
	max-width: 1120px;
	min-width: 0;
	padding: clamp(28px, 5vw, 58px) clamp(16px, 4vw, 44px) 64px;
	width: 100%;
}

.site-footer {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	color: #40515a;
	font-size: 13px;
	margin: 0 auto;
	max-width: 1120px;
	padding: 22px clamp(16px, 4vw, 44px) 32px;
	width: 100%;
}

.site-footer p {
	margin: 0;
}

.page-title {
	border-bottom: 1px solid rgba(17, 24, 39, 0.12);
	margin-bottom: 30px;
	padding-bottom: 24px;
}

.eyebrow {
	color: #1f6b5c;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 0;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.page-title h1 {
	color: #111827;
	font-size: clamp(38px, 7vw, 72px);
	letter-spacing: 0;
	line-height: 0.95;
	margin: 0;
}

.page-title p:last-of-type {
	color: #40515a;
	font-size: clamp(16px, 2vw, 20px);
	font-weight: 700;
	line-height: 1.45;
	margin: 16px 0 0;
	max-width: 680px;
}

.title-action {
	align-items: center;
	background: #1f8a70;
	border: 1px solid #146655;
	border-radius: 8px;
	color: #ffffff;
	display: inline-flex;
	font-size: 14px;
	font-weight: 900;
	height: 44px;
	justify-content: center;
	margin-top: 18px;
	padding: 0 18px;
	text-align: center;
}

.title-action:hover {
	background: #146655;
	text-decoration: none;
}

.home-grid {
	align-items: start;
	display: grid;
	gap: clamp(28px, 5vw, 56px);
	grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
	min-width: 0;
}

.news-section,
.home-links,
.link-section,
.puzzle-list-section,
.leaderboard-section {
	min-width: 0;
}

.news-section h2,
.link-section h2,
.puzzle-list-section h2,
.leaderboard-section h2 {
	color: #111827;
	font-size: 22px;
	line-height: 1.15;
	margin: 0 0 16px;
}

.announcement-list,
.puzzle-list {
	display: grid;
	gap: 14px;
}

.announcement-card,
.puzzle-card {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	min-width: 0;
}

.announcement-card {
	padding: 22px;
}

.announcement-date {
	color: #7c3f12;
	font-size: 12px;
	font-weight: 900;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.announcement-card h3,
.puzzle-card h3 {
	color: #111827;
	font-size: 22px;
	line-height: 1.15;
	margin: 0;
}

.announcement-card p:last-child,
.link-section p,
.puzzle-subtitle {
	color: #40515a;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
	margin: 10px 0 0;
	overflow-wrap: anywhere;
}

.home-links {
	display: grid;
	gap: 28px;
}

.link-section {
	border-top: 3px solid #263238;
	padding-top: 16px;
}

.primary-action,
.puzzle-action {
	align-items: center;
	background: #1f8a70;
	border: 1px solid #146655;
	border-radius: 8px;
	color: #ffffff;
	display: inline-flex;
	font-size: 14px;
	font-weight: 900;
	height: 44px;
	justify-content: center;
	margin-top: 16px;
	padding: 0 18px;
	text-align: center;
}

.primary-action:hover,
.puzzle-action:hover {
	background: #146655;
	text-decoration: none;
}

.puzzle-list {
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.puzzle-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 176px;
	padding: 22px;
}

.puzzle-card-text {
	display: grid;
	gap: 10px;
}

.puzzle-subtitle {
	color: #1f6b5c;
	font-weight: 900;
	margin: 0;
}

.puzzle-action {
	align-self: flex-start;
}

.puzzle-solves {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	margin-top: 18px;
	padding-top: 16px;
}

.puzzle-solves h4 {
	color: #111827;
	font-size: 14px;
	line-height: 1.2;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.solve-list {
	display: grid;
	gap: 10px;
	list-style: none;
	margin: 0;
	max-height: 340px;
	overflow: auto;
	padding: 0;
}

.solve-entry {
	align-items: start;
	display: grid;
	gap: 4px 10px;
	grid-template-columns: minmax(0, 1fr) auto;
	min-width: 0;
}

.solve-player {
	color: #111827;
	font-size: 14px;
	font-weight: 800;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.solve-meta {
	color: #40515a;
	font-size: 12px;
	font-weight: 700;
	grid-column: 1 / -1;
	line-height: 1.35;
}

.solve-analysis-link {
	font-size: 12px;
	grid-column: 2;
	grid-row: 1;
	white-space: nowrap;
}

.solve-message {
	color: #40515a;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.35;
	margin: 0;
}

.site-main > .leaderboard-section {
	margin-top: 34px;
}

.leaderboard-panel {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	min-width: 0;
	overflow: hidden;
}

.leaderboard-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.leaderboard-entry {
	align-items: center;
	border-bottom: 1px solid rgba(17, 24, 39, 0.1);
	display: grid;
	gap: 12px;
	grid-template-columns: 32px minmax(0, 1fr) auto;
	min-height: 54px;
	padding: 12px 14px;
}

.leaderboard-entry:last-child {
	border-bottom: 0;
}

.leaderboard-rank,
.leaderboard-count {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.leaderboard-rank {
	color: #7c3f12;
	font-size: 14px;
	font-weight: 900;
	text-align: center;
}

.leaderboard-name {
	color: #111827;
	font-size: 15px;
	font-weight: 800;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.leaderboard-count {
	color: #1f6b5c;
	font-size: 13px;
	font-weight: 900;
	text-align: right;
}

.leaderboard-message {
	color: #40515a;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0;
	padding: 18px;
}

.profile-main {
	max-width: 1180px;
}

.profile-status {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	color: #40515a;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0 0 18px;
	padding: 14px 16px;
}

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

.profile-status.error {
	color: #b3261e;
}

.profile-stats {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 30px;
}

.profile-stat,
.profile-card,
.profile-message {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	min-width: 0;
}

.profile-stat {
	display: grid;
	gap: 6px;
	padding: 18px;
}

.profile-stat strong {
	color: #111827;
	font-size: 30px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.profile-stat span {
	color: #40515a;
	font-size: 12px;
	font-weight: 900;
	line-height: 1.25;
	text-transform: uppercase;
}

.profile-layout {
	align-items: start;
	display: grid;
	gap: 24px;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.profile-section {
	min-width: 0;
}

.profile-section h2 {
	color: #111827;
	font-size: 22px;
	line-height: 1.15;
	margin: 0 0 16px;
}

.profile-list {
	display: grid;
	gap: 14px;
}

.profile-card {
	padding: 18px;
}

.profile-card-header {
	align-items: start;
	display: flex;
	gap: 14px;
	justify-content: space-between;
}

.profile-card h3 {
	color: #111827;
	font-size: 21px;
	line-height: 1.15;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.profile-card-subtitle {
	color: #1f6b5c;
	font-size: 13px;
	font-weight: 900;
	line-height: 1.4;
	margin: 8px 0 0;
}

.profile-meta {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	display: grid;
	gap: 8px 14px;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 14px 0 0;
	padding-top: 14px;
}

.profile-meta dt {
	color: #40515a;
	font-size: 12px;
	font-weight: 900;
	text-transform: uppercase;
}

.profile-meta dd {
	color: #111827;
	font-size: 14px;
	font-weight: 800;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.profile-message {
	color: #40515a;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0;
	padding: 18px;
}

.contest-section,
.rules-section,
.admin-form-section,
.admin-list-section {
	min-width: 0;
}

.contest-section h2,
.rules-section h2,
.admin-form-section h2,
.admin-list-section h2 {
	color: #111827;
	font-size: 22px;
	line-height: 1.15;
	margin: 0 0 16px;
}

.rules-main {
	max-width: 960px;
}

.rules-list {
	counter-reset: rules;
	display: grid;
	gap: 14px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rule-item {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	counter-increment: rules;
	display: grid;
	gap: 8px;
	grid-template-columns: 34px minmax(0, 1fr);
	min-width: 0;
	padding: 18px;
}

.rule-item::before {
	align-items: center;
	background: #263238;
	border-radius: 8px;
	color: #f8fbf8;
	content: counter(rules);
	display: flex;
	font-size: 14px;
	font-weight: 900;
	height: 34px;
	justify-content: center;
	width: 34px;
}

.rule-item h3 {
	color: #111827;
	font-size: 19px;
	line-height: 1.2;
	margin: 0;
}

.rule-item p {
	color: #40515a;
	font-size: 15px;
	font-weight: 700;
	grid-column: 2;
	line-height: 1.5;
	margin: 0;
}

.contest-list,
.admin-contest-list {
	display: grid;
	gap: 18px;
}

.contest-card,
.admin-contest-card,
.admin-form-section,
.admin-list-section {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	min-width: 0;
}

.contest-card,
.admin-form-section,
.admin-list-section {
	padding: 22px;
}

.contest-card-header {
	align-items: start;
	display: flex;
	gap: 16px;
	justify-content: space-between;
}

.contest-title-group {
	min-width: 0;
}

.contest-card h3,
.admin-contest-card h3 {
	color: #111827;
	font-size: 24px;
	line-height: 1.15;
	margin: 0;
	overflow-wrap: anywhere;
}

.contest-status {
	border: 1px solid rgba(17, 24, 39, 0.14);
	border-radius: 999px;
	color: #111827;
	flex: 0 0 auto;
	font-size: 12px;
	font-weight: 900;
	padding: 7px 10px;
	text-transform: uppercase;
}

.contest-status.active {
	background: #dff3e6;
	color: #175c38;
}

.contest-status.upcoming {
	background: #e8eef7;
	color: #244a7a;
}

.contest-status.ended {
	background: #f1e7df;
	color: #7c3f12;
}

.contest-status.pending {
	background: #fff1c7;
	color: #835400;
}

.contest-status.finalized {
	background: #e7f5ef;
	color: #1f6b5c;
}

.contest-status.hidden {
	background: #fff2ef;
	color: #b3261e;
}

.contest-meta {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	display: grid;
	gap: 8px 16px;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 18px 0 0;
	padding-top: 16px;
}

.contest-meta dt {
	color: #40515a;
	font-size: 12px;
	font-weight: 900;
	text-transform: uppercase;
}

.contest-meta dd {
	color: #111827;
	font-size: 14px;
	font-weight: 800;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

[data-contest-countdown] {
	font-variant-numeric: tabular-nums;
}

.contest-puzzles,
.contest-scoreboard {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	margin-top: 18px;
	padding-top: 16px;
}

.contest-puzzles h4,
.contest-scoreboard h4,
.admin-fieldset-header h3 {
	color: #111827;
	font-size: 14px;
	line-height: 1.2;
	margin: 0 0 10px;
	text-transform: uppercase;
}

.contest-puzzle-list,
.contest-scoreboard-list {
	display: grid;
	gap: 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.contest-puzzle-entry,
.contest-scoreboard-entry {
	align-items: center;
	display: grid;
	gap: 8px 12px;
	min-width: 0;
}

.contest-puzzle-entry {
	grid-template-columns: minmax(0, 1fr) auto auto;
}

.contest-scoreboard-entry {
	border-bottom: 1px solid rgba(17, 24, 39, 0.1);
	grid-template-columns: 32px minmax(0, 1fr) auto auto;
	padding-bottom: 10px;
}

.contest-scoreboard-entry:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.contest-puzzle-name {
	color: #111827;
	font-size: 14px;
	font-weight: 800;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.contest-puzzle-points,
.contest-pearl-count,
.contest-rank-time {
	color: #40515a;
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
}

.contest-pearl-count {
	color: #7c3f12;
}

.contest-puzzle-action {
	font-size: 12px;
	white-space: nowrap;
}

.contest-rank-time {
	grid-column: 2 / -1;
}

.contest-scoreboard-solves {
	display: grid;
	gap: 6px;
	grid-column: 2 / -1;
	list-style: none;
	margin: 2px 0 0;
	padding: 0;
}

.contest-scoreboard-solve {
	align-items: center;
	background: rgba(31, 107, 92, 0.07);
	border: 1px solid rgba(31, 107, 92, 0.14);
	border-radius: 6px;
	display: grid;
	gap: 6px 10px;
	grid-template-columns: minmax(0, 1fr) auto auto;
	min-width: 0;
	padding: 8px 10px;
}

.contest-scoreboard-solve-name {
	color: #111827;
	font-size: 12px;
	font-weight: 900;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.contest-scoreboard-solve-meta {
	color: #40515a;
	font-size: 12px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.contest-scoreboard-solve-analysis {
	font-size: 12px;
	white-space: nowrap;
}

.contest-message,
.admin-status {
	color: #40515a;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0;
}

.contest-message {
	padding: 18px 0 0;
}

.contest-reward-summary {
	background: #fff7df;
	border: 1px solid rgba(124, 63, 18, 0.18);
	border-radius: 8px;
	color: #7c3f12;
	font-size: 14px;
	font-weight: 900;
	line-height: 1.4;
	margin: 0 0 12px;
	padding: 12px;
}

.contest-reward-summary.pending {
	background: #f7efe8;
	color: #40515a;
}

[data-contest-list] > .contest-message,
[data-admin-contest-list] > .contest-message,
[data-admin-puzzle-list] > .contest-message {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	padding: 18px;
}

.admin-status {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	margin-bottom: 18px;
	padding: 14px 16px;
}

.admin-section-header .admin-status {
	margin: 0;
}

.admin-status.error {
	color: #b3261e;
}

.admin-main {
	max-width: 1180px;
}

.admin-visibility-section {
	border-bottom: 1px solid rgba(17, 24, 39, 0.12);
	margin-bottom: 28px;
	padding-bottom: 28px;
}

.admin-section-header {
	align-items: start;
	display: grid;
	gap: 16px;
	grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
	margin-bottom: 16px;
}

.admin-section-header h2 {
	font-size: 24px;
	line-height: 1.15;
	margin: 0;
}

.admin-section-header p:not(.admin-status) {
	color: #40515a;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.45;
	margin: 8px 0 0;
}

.admin-puzzle-list {
	display: grid;
	gap: 10px;
}

.admin-puzzle-visibility-row {
	align-items: center;
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	display: grid;
	gap: 14px;
	grid-template-columns: minmax(0, 1fr) auto auto auto;
	padding: 14px;
}

.admin-puzzle-visibility-row.hidden-puzzle {
	border-color: rgba(179, 38, 30, 0.32);
}

.admin-puzzle-visibility-text {
	min-width: 0;
}

.admin-puzzle-visibility-text h3 {
	font-size: 17px;
	line-height: 1.2;
	margin: 0;
	overflow-wrap: anywhere;
}

.admin-puzzle-visibility-text p {
	color: #40515a;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	margin: 6px 0 0;
	overflow-wrap: anywhere;
}

.admin-puzzle-state {
	background: #eef6f2;
	border: 1px solid rgba(31, 107, 92, 0.2);
	border-radius: 8px;
	color: #1f6b5c;
	font-size: 12px;
	font-weight: 900;
	min-width: 68px;
	padding: 8px 10px;
	text-align: center;
	text-transform: uppercase;
}

.hidden-puzzle .admin-puzzle-state {
	background: #fff2ef;
	border-color: rgba(179, 38, 30, 0.24);
	color: #b3261e;
}

.admin-puzzle-visibility-row .secondary-action {
	text-decoration: none;
}

.admin-contest-layout {
	align-items: start;
	display: grid;
	gap: 24px;
	grid-template-columns: minmax(300px, 1fr) minmax(260px, 380px);
}

.admin-contest-form {
	display: grid;
	gap: 14px;
}

.admin-contest-form label {
	color: #30434b;
	display: grid;
	font-size: 13px;
	font-weight: 800;
	gap: 7px;
}

.admin-contest-form input,
.admin-contest-form select {
	background: #ffffff;
	border: 1px solid rgba(17, 24, 39, 0.22);
	border-radius: 8px;
	color: #111827;
	font: 600 16px Arial, sans-serif;
	min-height: 44px;
	padding: 0 12px;
	width: 100%;
}

.admin-contest-form .checkbox-field {
	align-items: center;
	display: flex;
	gap: 10px;
}

.admin-contest-form .checkbox-field input {
	min-height: auto;
	width: auto;
}

.admin-puzzle-fieldset {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	margin-top: 4px;
	padding-top: 16px;
}

.admin-fieldset-header {
	align-items: center;
	display: flex;
	gap: 12px;
	justify-content: space-between;
	margin-bottom: 12px;
}

.admin-fieldset-header h3 {
	margin: 0;
}

.admin-puzzle-rows {
	display: grid;
	gap: 10px;
}

.admin-puzzle-row {
	align-items: end;
	display: grid;
	gap: 10px;
	grid-template-columns: minmax(0, 1fr) 120px 40px;
}

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

.admin-form-actions .primary-action {
	margin-top: 0;
}

.admin-contest-card {
	display: grid;
	gap: 12px;
	padding: 18px;
}

.admin-contest-card.hidden-contest {
	border-color: rgba(179, 38, 30, 0.32);
}

.admin-contest-card-header {
	align-items: start;
	display: flex;
	gap: 12px;
	justify-content: space-between;
}

.admin-contest-statuses {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: end;
}

.admin-contest-meta {
	color: #40515a;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0;
}

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

.admin-contest-actions .primary-action {
	cursor: pointer;
	font: 900 13px Arial, sans-serif;
	margin-top: 0;
}

.secondary-action,
.icon-action {
	align-items: center;
	background: #ffffff;
	border: 1px solid rgba(17, 24, 39, 0.18);
	border-radius: 8px;
	color: #111827;
	cursor: pointer;
	display: inline-flex;
	font: 900 13px Arial, sans-serif;
	justify-content: center;
	min-height: 40px;
	padding: 0 14px;
}

.icon-action {
	background: #263238;
	color: #f8fbf8;
	font-size: 18px;
	padding: 0;
	width: 40px;
}

.secondary-action:disabled,
.icon-action:disabled,
.primary-action:disabled,
.admin-contest-form button:disabled {
	cursor: wait;
	opacity: 0.68;
}

.auth-modal {
	align-items: center;
	background: rgba(17, 24, 39, 0.64);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 18px;
	position: fixed;
	touch-action: manipulation;
	z-index: 10;
}

.auth-modal[hidden] {
	display: none;
}

.auth-dialog {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.18);
	border-radius: 8px;
	box-shadow: 0 18px 54px rgba(17, 24, 39, 0.28);
	color: #111827;
	display: flex;
	flex-direction: column;
	font-family: Arial, sans-serif;
	gap: 14px;
	max-width: 380px;
	padding: 22px;
	width: min(100%, 380px);
}

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

.auth-header h1 {
	font-size: 24px;
	line-height: 1;
	margin: 0;
}

#auth-close {
	align-items: center;
	background: #263238;
	border: 0;
	border-radius: 8px;
	color: #f8fbf8;
	cursor: pointer;
	display: flex;
	font-size: 24px;
	font-weight: 800;
	height: 38px;
	justify-content: center;
	line-height: 1;
	padding: 0;
	width: 38px;
}

.auth-message {
	color: #40515a;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	margin: 0;
	min-height: 19px;
}

.auth-message.error {
	color: #b3261e;
}

.auth-dialog label {
	color: #30434b;
	display: flex;
	flex-direction: column;
	font-size: 13px;
	font-weight: 800;
	gap: 7px;
}

.auth-dialog label[hidden] {
	display: none;
}

.auth-dialog input {
	background: #ffffff;
	border: 1px solid rgba(17, 24, 39, 0.22);
	border-radius: 8px;
	color: #111827;
	font: 600 16px Arial, sans-serif;
	height: 44px;
	padding: 0 12px;
	touch-action: manipulation;
	width: 100%;
}

.auth-actions {
	display: grid;
	gap: 10px;
	grid-template-columns: 1fr 1fr;
}

.auth-actions button {
	border: 1px solid rgba(17, 24, 39, 0.18);
	border-radius: 8px;
	cursor: pointer;
	font: 800 14px Arial, sans-serif;
	height: 44px;
	touch-action: manipulation;
}

#auth-submit {
	background: #1f8a70;
	color: #ffffff;
}

#auth-mode {
	background: #ffffff;
	color: #111827;
}

.auth-dialog button:disabled {
	cursor: wait;
	opacity: 0.68;
}

.analysis-main {
	max-width: 1180px;
}

.analysis-status {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	color: #40515a;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	margin: 0;
	padding: 18px;
}

.analysis-layout {
	align-items: start;
	display: grid;
	gap: 24px;
	grid-template-columns: minmax(320px, 1fr) minmax(260px, 340px);
}

.analysis-board-panel,
.analysis-sidebar {
	background: #fffaf2;
	border: 1px solid rgba(17, 24, 39, 0.12);
	border-radius: 8px;
	box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
	min-width: 0;
}

.analysis-board-panel {
	padding: clamp(10px, 3vw, 22px);
}

.analysis-grid {
	aspect-ratio: 1;
	background: #ffffff;
	border: 3px solid #111827;
	display: grid;
	grid-template-columns: repeat(9, minmax(0, 1fr));
	margin: 0 auto;
	max-width: 640px;
	width: 100%;
}

.analysis-cell {
	align-items: center;
	border-bottom: 1px solid rgba(17, 24, 39, 0.42);
	border-right: 1px solid rgba(17, 24, 39, 0.42);
	color: #18212f;
	display: flex;
	font-size: 28px;
	font-weight: 600;
	justify-content: center;
	line-height: 1;
	min-height: 0;
	min-width: 0;
}

.analysis-cell.given {
	background: rgba(24, 33, 47, 0.06);
	color: #0f172a;
	font-weight: 900;
}

.analysis-cell.box-right {
	border-right: 3px solid #111827;
}

.analysis-cell.box-bottom {
	border-bottom: 3px solid #111827;
}

.analysis-notes {
	color: #455a64;
	display: grid;
	font-size: 11px;
	font-weight: 700;
	grid-template-columns: repeat(3, 1fr);
	height: 82%;
	line-height: 1;
	text-align: center;
	width: 82%;
}

.analysis-notes span {
	align-items: center;
	display: flex;
	justify-content: center;
	min-width: 0;
}

.analysis-sidebar {
	display: grid;
	gap: 18px;
	padding: 20px;
}

.analysis-summary dl {
	display: grid;
	gap: 8px 14px;
	grid-template-columns: auto minmax(0, 1fr);
	margin: 0;
}

.analysis-summary dt {
	color: #40515a;
	font-size: 13px;
	font-weight: 900;
	text-transform: uppercase;
}

.analysis-summary dd {
	color: #111827;
	font-size: 14px;
	font-weight: 800;
	margin: 0;
	min-width: 0;
	overflow-wrap: anywhere;
}

.analysis-step {
	border-top: 1px solid rgba(17, 24, 39, 0.12);
	padding-top: 16px;
}

.analysis-step-label {
	color: #111827;
	font-size: 18px;
	font-weight: 900;
	line-height: 1.25;
	margin: 0;
}

.analysis-step-time,
.analysis-count {
	color: #1f6b5c;
	font-size: 14px;
	font-weight: 900;
	margin: 8px 0 0;
}

.analysis-controls {
	display: grid;
	gap: 8px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analysis-controls button {
	background: #1f8a70;
	border: 1px solid #146655;
	border-radius: 8px;
	color: #ffffff;
	cursor: pointer;
	font: 900 13px Arial, sans-serif;
	height: 42px;
}

.analysis-controls button:disabled {
	background: #dfe6e1;
	border-color: rgba(113, 128, 121, 0.2);
	color: #718079;
	cursor: default;
}

.analysis-range-label {
	color: #30434b;
	display: grid;
	font-size: 13px;
	font-weight: 900;
	gap: 8px;
	text-transform: uppercase;
}

.analysis-range-label input {
	accent-color: #1f8a70;
	width: 100%;
}

@media (max-width: 760px) {
	.site-header {
		align-items: flex-start;
		display: grid;
		grid-template-columns: 1fr;
	}

	.primary-nav {
		margin-left: 0;
	}

	.account-nav {
		justify-content: flex-start;
	}

	.home-grid {
		grid-template-columns: 1fr;
	}

	.page-title h1 {
		font-size: 42px;
		line-height: 1;
	}

	.analysis-layout {
		grid-template-columns: 1fr;
	}

	.profile-layout {
		grid-template-columns: 1fr;
	}

	.profile-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.admin-contest-layout {
		grid-template-columns: 1fr;
	}

	.admin-section-header,
	.admin-puzzle-visibility-row {
		grid-template-columns: 1fr;
	}

	.admin-puzzle-state {
		text-align: left;
	}

	.admin-puzzle-row {
		grid-template-columns: 1fr;
	}

	.icon-action {
		width: 100%;
	}

	.contest-card-header,
	.admin-contest-card-header {
		display: grid;
	}

	.profile-card-header {
		display: grid;
	}

	.contest-puzzle-entry {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.contest-puzzle-action {
		grid-column: 1 / -1;
	}

	.contest-scoreboard-solve {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.contest-scoreboard-solve-analysis {
		grid-column: 1 / -1;
	}

	.analysis-cell {
		font-size: 24px;
	}

	.analysis-controls {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
