* {
	box-sizing: border-box;
}
[hidden] {
	display: none !important;
}
hr {
	width: 100%;
	border: 0;
	border-top: 1px solid #30485a;
	margin: 12px 0;
}
h1 {
	word-break: keep-all !important;
	overflow-wrap: normal !important;
	text-wrap: balance;
}
html,
body {
	margin: 0;
	width: 100%;
	min-height: 100%;
	background: #0c131e;
	color: #e7eeec;
	font-family:
		system-ui,
		-apple-system,
		'Nirmala UI',
		'Segoe UI',
		'Malgun Gothic',
		sans-serif;
	overscroll-behavior: none;
}
button,
input,
select {
	font: inherit;
}
button,
select {
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid #30485a;
	border-radius: 10px;
	background: #162536;
	color: #e7eeec;
	cursor: pointer;
}
button {
	font-weight: 600;
	overflow-wrap: anywhere;
}
button:hover {
	border-color: #91e8ca;
}
button:disabled {
	opacity: 0.45;
	cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
	outline: 3px solid #91e8ca;
	outline-offset: 2px;
}
input {
	width: 100%;
	min-height: 46px;
	border: 1px solid #30485a;
	border-radius: 9px;
	background: #0c131e;
	color: #e7eeec;
	padding: 11px 12px;
}
label {
	display: block;
	margin: 0 0 8px;
	color: #adbec7;
	font-size: 14px;
}
a {
	color: #91e8ca;
}
p {
	line-height: 1.8;
}
h1,
h2,
h3,
p,
small,
bdi {
	overflow-wrap: anywhere;
}
h2 {
	font-size: 23px;
}
h3 {
	font-size: 16px;
	margin: 0 0 8px;
}
small {
	line-height: 1.6;
}
.muted {
	color: #92a8b6;
}
.primary {
	background: #91e8ca;
	color: #0c131e;
	border-color: #91e8ca;
}
.stack {
	display: grid;
	gap: 12px;
}
.row {
	display: flex;
	gap: 10px;
}
.row > * {
	min-width: 0;
	flex: 1;
}
.overlay {
	position: fixed;
	inset: 0;
	overflow-y: auto;
	background: #0c131e;
	z-index: 3;
	padding: 32px 24px 56px;
}
.container {
	max-width: 1000px;
	margin: auto;
}
.brand {
	font-size: 12px;
	font-weight: 750;
	letter-spacing: 0.12em;
	color: #91e8ca;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: calc(100% - 152px);
	min-height: 36px;
}
.brand img {
	width: 32px;
	height: 32px;
}
.intro {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 390px;
	gap: 64px;
	align-items: center;
	margin: 56px 0 60px;
}
h1 {
	font-size: clamp(32px, 4.5vw, 52px);
	line-height: 1.3;
	letter-spacing: -0.04em;
	margin: 16px 0 22px;
	color: #91e8ca;
}
.eyebrow {
	color: #91e8ca;
	font-size: 13px;
}
.lead {
	color: #adbec7;
	max-width: 33em;
}
.card {
	border: 1px solid #283e50;
	background: #111e2c;
	border-radius: 20px;
	padding: 26px;
}
.card h2 {
	margin: 0 0 12px;
}
.code {
	font-family: monospace;
	letter-spacing: 0.18em;
	font-size: 27px;
	color: #91e8ca;
	margin: 4px 0 20px;
}
.player {
	border: 1px solid #283e50;
	border-radius: 10px;
	padding: 14px;
	display: flex;
	justify-content: space-between;
	gap: 12px;
}
.player > * {
	min-width: 0;
}
.player small {
	color: #91e8ca;
}
.note {
	font-size: 13px;
	color: #a5bac7;
	min-height: 20px;
	margin: 8px 0;
}
.preview {
	display: flex;
	align-items: center;
	gap: 22px;
	margin-top: 30px;
}
.keypad {
	display: grid;
	grid-template-columns: repeat(3, 36px);
	gap: 5px;
	flex-shrink: 0;
}
.keypad span {
	border: 1px solid #263646;
	color: #758e9e;
	border-radius: 5px;
	aspect-ratio: 1;
	display: grid;
	place-items: center;
	font: 13px monospace;
}
.keypad .active {
	background: #18343b;
	border-color: #91e8ca;
	color: #91e8ca;
}
.legend {
	font-size: 13px;
	color: #adbec7;
}
.about {
	border-top: 1px solid #263646;
	padding-top: 26px;
}
.rules {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	margin: 25px 0 36px;
}
.rules p {
	font-size: 14px;
	color: #adbec7;
}
.step {
	display: inline-grid;
	place-items: center;
	border: 1px solid #375550;
	border-radius: 50%;
	width: 28px;
	height: 28px;
	color: #91e8ca;
	margin-bottom: 15px;
	font: 13px monospace;
}
.faq {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 28px;
}
.faq details {
	padding: 18px 0;
	border-bottom: 1px solid #263646;
}
.faq summary {
	cursor: pointer;
	font-size: 14px;
	font-weight: 650;
}
.faq p {
	font-size: 14px;
	color: #adbec7;
}
footer {
	color: #758e9e;
	font-size: 12px;
	line-height: 1.8;
	margin-top: 30px;
}
.language-control {
	position: fixed;
	top: 16px;
	inset-inline-end: 24px;
	z-index: 11;
}
.language-control select {
	width: 144px;
	font-size: 14px;
	padding: 9px;
	direction: ltr;
	background: #142332;
}
.game-shell {
	max-width: 1280px;
	margin: auto;
	padding: 20px 24px;
}
.game-top {
	min-height: 60px;
}
.game-top .brand {
	max-width: calc(100% - 155px);
}
.game-top p {
	margin: 0;
	font-size: 13px;
	color: #91e8ca;
}
.game-intro {
	border-top: 1px solid #263646;
	margin: 12px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	font-size: 14px;
	min-height: 48px;
}
.game-intro button {
	font-size: 13px;
}
.game-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 280px;
	gap: 24px;
}
.board-wrap {
	position: relative;
	height: clamp(400px, calc(100dvh - 235px), 700px);
	min-width: 0;
	direction: ltr;
}
.board-wrap canvas {
	display: block;
	width: 100%;
	height: 100%;
	outline: none;
	touch-action: none;
}
.zone-buttons {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	grid-template-rows: repeat(3, minmax(0, 1fr));
	gap: 8px;
	direction: ltr;
	pointer-events: none;
}
.zone-buttons button {
	position: relative;
	background: transparent;
	border: 0;
	border-radius: 12px;
	padding: 0;
	min-height: 0;
	pointer-events: auto;
	box-shadow: none;
	touch-action: manipulation;
}
.zone-buttons button:disabled {
	opacity: 1;
	pointer-events: none;
}
.zone-buttons span {
	position: absolute;
	inset-inline: 30px;
	top: 13px;
	font-size: 10px;
	font-weight: 400;
	color: #91e8ca;
	line-height: 1.3;
	direction: inherit;
}
.zone-buttons .locked span {
	top: 45%;
	inset-inline: 5px;
	color: #758e9e;
}
.board-notice {
	position: absolute;
	inset: 0;
	background: #0c131ed9;
	display: grid;
	place-content: center;
	border-radius: 12px;
	text-align: center;
	padding: 30px;
	font-size: 24px;
	color: #91e8ca;
	direction: inherit;
	pointer-events: none;
}
.game-sidebar {
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-width: 0;
}
.stats {
	display: grid;
	gap: 22px;
}
.stats h3 {
	color: #91e8ca;
}
.stats p {
	margin: 6px 0;
	font-size: 21px;
}
.stats small {
	display: block;
	color: #a5bac7;
}
.stats bdi {
	font-size: 13px;
	color: #ff777f;
}
.action-row {
	display: grid;
	gap: 10px;
}
.movement {
	direction: ltr;
}
.game-footer {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 14px;
}
.game-footer button {
	font-size: 13px;
}
.game-sidebar > small {
	font-size: 12px;
}
.board-wrap .zone-buttons button:hover {
	box-shadow: inset 0 0 0 1px #91e8ca;
}
#results {
	z-index: 4;
	display: grid;
	place-items: center;
	background: #0c131ef5;
}
#results .card {
	max-width: 560px;
	width: 100%;
}
#result-0,
#result-1 {
	line-height: 1.8;
	padding: 14px;
	background: #0c131e;
	border-radius: 10px;
	font-size: 14px;
	unicode-bidi: plaintext;
}
#network-banner {
	position: fixed;
	top: 66px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	background: #fad272;
	color: #0c131e;
	border-radius: 10px;
	padding: 10px 18px;
	font-size: 13px;
	text-align: center;
	max-width: 95%;
	width: max-content;
}
#return-lobby {
	position: fixed;
	bottom: 18px;
	inset-inline-end: 18px;
	z-index: 5;
}
#loading {
	position: fixed;
	inset: 0;
	display: grid;
	place-content: center;
	padding: 28px;
	text-align: center;
	background: #0c131e;
	z-index: 10;
}
#loading h2 {
	letter-spacing: 0.1em;
	font-weight: 500;
}
#loading p {
	color: #91e8ca;
	max-width: 38em;
}
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}
dialog {
	color: #e7eeec;
	background: #142332;
	border: 1px solid #30485a;
	border-radius: 18px;
	width: min(540px, calc(100% - 32px));
	max-height: 85dvh;
	overflow: auto;
	padding: 24px;
}
dialog::backdrop {
	background: #000b;
}
dialog p {
	font-size: 14px;
}
dialog small {
	display: block;
	margin-bottom: 16px;
}
dialog h2 {
	font-size: 21px;
}
#help-close {
	width: 100%;
}
html[dir='rtl'] .board-notice,
html[dir='rtl'] .zone-buttons span {
	direction: rtl;
}
html[dir='rtl'] h1 {
	letter-spacing: normal;
}
@media (max-width: 760px) {
	.overlay {
		padding: 22px 16px 40px;
	}
	.language-control {
		inset-inline-end: 16px;
	}
	.intro {
		grid-template-columns: 1fr;
		gap: 28px;
		margin: 28px 0 40px;
	}
	.card {
		padding: 20px;
	}
	.rules,
	.faq {
		grid-template-columns: 1fr;
	}
	.rules {
		gap: 12px;
	}
	.preview {
		margin-top: 16px;
	}
	.game-shell {
		padding: 18px 12px;
	}
	.game-layout {
		grid-template-columns: 1fr;
		gap: 12px;
	}
	.board-wrap {
		height: clamp(330px, 50svh, 540px);
	}
	.stats {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}
	.stats h3 {
		font-size: 13px;
	}
	.stats p {
		font-size: 16px;
		margin: 2px 0;
	}
	.stats small {
		font-size: 11px;
	}
	.stats bdi {
		font-size: 11px;
	}
	.game-sidebar {
		gap: 8px;
	}
	.action-row {
		grid-template-columns: 1fr 1fr;
	}
	.game-intro {
		font-size: 12px;
	}
	.game-footer {
		margin-top: 12px;
	}
	.game-sidebar .note {
		margin: 0;
		min-height: 0;
	}
	.game-sidebar > small {
		display: none;
	}
	.zone-buttons span {
		inset-inline: 24px;
		font-size: 9px;
	}
	.board-notice {
		font-size: 20px;
	}
}
