/* Cục Bông hái sao · giao diện theo bộ nhận diện CB Family (nền tối, chữ Cormorant, điểm nhấn vàng) */
:root {
	--bg: #0a0908;
	--bg-2: #0f0e0c;
	--surface: #151311;
	--line: #262220;
	--line-strong: #3a342e;
	--text: #efe8dc;
	--text-2: #a9a094;
	--text-3: #6f685e;
	--gold: #c9a35c;
	--gold-2: #e8cb8e;
	--warn: #b4664f;
	--serif: "Cormorant Garamond", "Times New Roman", serif;
	--sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
	--ease: cubic-bezier(.2, .7, .2, 1);
	color-scheme: dark;
}

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

html, body { height: 100%; overscroll-behavior: none; }

body {
	margin: 0;
	overflow: hidden;
	background: var(--bg);
	color: var(--text);
	font: 300 15px/1.6 var(--sans);
	/* Cormorant mặc định dùng số kiểu cổ (số 1 giống chữ I) → bật số thẳng hàng.
	   Dùng font-feature-settings vì khai báo "font:" gộp ở các phần tử con không xoá thuộc tính này. */
	font-feature-settings: "lnum" 1;
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
	-webkit-tap-highlight-color: transparent;
	-webkit-user-select: none;
	user-select: none;
}
/* Ánh vàng mờ + lớp hạt nhiễu giống trang chủ */
body::before {
	content: "";
	position: fixed;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(60% 45% at 50% -8%, rgba(201, 163, 92, .14), transparent 70%),
		radial-gradient(40% 30% at 100% 100%, rgba(201, 163, 92, .05), transparent 70%);
}
body::after {
	content: "";
	position: fixed;
	inset: 0;
	z-index: 100;
	pointer-events: none;
	opacity: .05;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; text-decoration: none; }
em { font-style: italic; color: var(--gold-2); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }
input, textarea { -webkit-user-select: text; user-select: text; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Khung chơi ---------- */
.stage {
	position: fixed;
	inset: 0;
	display: grid;
	place-items: center;
}
.game {
	position: relative;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	overflow: hidden;
	background: var(--bg);
	isolation: isolate;
}
@media (min-width: 560px) and (min-height: 560px) {
	.game {
		height: calc(100vh - 48px);
		height: calc(100dvh - 48px);
		width: min(calc((100vh - 48px) * .52), calc(100vw - 48px));
		width: min(calc((100dvh - 48px) * .52), calc(100vw - 48px));
		border: 1px solid var(--line);
		box-shadow: 0 50px 100px -50px rgba(0, 0, 0, .95), 0 0 0 1px rgba(201, 163, 92, .05);
	}
}
#cv {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
}

/* Logo về trang chủ (màn hình rộng) */
.brandbar {
	position: fixed;
	top: 26px;
	left: 30px;
	z-index: 5;
	display: none;
	align-items: center;
	gap: 14px;
	transition: opacity .3s var(--ease);
}
.brandbar:hover .brand-name em { color: var(--gold); }
.monogram {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	border: 1px solid var(--gold);
	border-radius: 50%;
	color: var(--gold-2);
	font: 600 15px/1 var(--serif);
	letter-spacing: .04em;
}
.monogram.small { width: 30px; height: 30px; font-size: 11px; }
.brand-name { font: 500 22px/1 var(--serif); letter-spacing: .02em; }
@media (min-width: 1080px) and (min-height: 600px) {
	.brandbar { display: inline-flex; }
	.back-home { visibility: hidden; }
}

/* ---------- Chữ & nút ---------- */
.eyebrow {
	margin: 0;
	color: var(--gold);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .32em;
	text-transform: uppercase;
}
h2 {
	margin: 12px 0 18px;
	font: 500 40px/1.02 var(--serif);
	letter-spacing: -.005em;
}
h3 {
	margin: 24px 0 12px;
	color: var(--gold);
	font: 500 11px/1 var(--sans);
	letter-spacing: .26em;
	text-transform: uppercase;
}
.muted { margin: 0; color: var(--text-2); font-size: 14px; }
.small { font-size: 12.5px; }
.gold { color: var(--gold-2); font-weight: 500; }

.btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 50px;
	padding: 0 22px;
	border: 1px solid var(--line-strong);
	border-radius: 0;
	background: rgba(10, 9, 8, .45);
	color: var(--text);
	font: 500 11.5px/1.2 var(--sans);
	letter-spacing: .2em;
	text-transform: uppercase;
	text-align: center;
	cursor: pointer;
	touch-action: manipulation;
	transition: border-color .3s var(--ease), color .3s var(--ease), background-color .3s var(--ease), transform .2s var(--ease);
}
.btn:hover { border-color: var(--gold); color: var(--gold-2); }
.btn:active { transform: translateY(1px); }
.btn-primary {
	border-color: var(--gold-2);
	background: var(--gold-2);
	color: #15110b;
	font-weight: 600;
}
.btn-primary:hover { border-color: #f3dba6; background: #f3dba6; color: #15110b; }
.btn-ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn-ghost:hover { border-color: transparent; }
.btn-play {
	min-height: 58px;
	font-size: 13px;
	letter-spacing: .3em;
	box-shadow: 0 18px 40px -18px rgba(232, 203, 142, .6);
}
.btn-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn-row.two { grid-template-columns: 1fr 1fr; }
.btn-row .btn { padding: 0 6px; font-size: 10.5px; letter-spacing: .12em; }
.stack { display: grid; gap: 10px; margin-top: 22px; }
.link {
	appearance: none;
	padding: 0;
	border: 0;
	background: none;
	color: var(--gold-2);
	font: inherit;
	text-decoration: underline;
	text-decoration-color: rgba(232, 203, 142, .4);
	text-underline-offset: 3px;
	cursor: pointer;
}
.link:hover { text-decoration-color: var(--gold-2); }

.icon-btn {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1px solid var(--line-strong);
	border-radius: 50%;
	background: rgba(10, 9, 8, .5);
	color: var(--text);
	cursor: pointer;
	touch-action: manipulation;
	transition: border-color .3s var(--ease), color .3s var(--ease);
}
.icon-btn:hover { border-color: var(--gold); color: var(--gold-2); }
.icon-btn svg, .close svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
}

/* ---------- Thanh trạng thái ---------- */
.hud {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 3;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: calc(env(safe-area-inset-top) + 12px) 14px 0;
	pointer-events: none;
}
.hud[hidden] { display: none; }
.hud-h {
	font: 500 38px/1 var(--serif);
	letter-spacing: .01em;
	text-shadow: 0 2px 14px rgba(0, 0, 0, .65);
	font-variant-numeric: lining-nums;
}
.hud-h small {
	margin-left: 5px;
	color: var(--text-3);
	font: 500 11px/1 var(--sans);
	letter-spacing: .22em;
	text-transform: uppercase;
}
.hud-right { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.hud-stars {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 42px;
	padding: 0 15px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: rgba(10, 9, 8, .5);
	color: var(--gold-2);
	font: 500 15px/1 var(--sans);
	font-variant-numeric: tabular-nums;
}
.hud-stars svg { width: 15px; height: 15px; fill: var(--gold-2); }
.power {
	position: absolute;
	top: calc(env(safe-area-inset-top) + 60px);
	left: 14px;
	display: flex;
	gap: 8px;
}
.chip {
	--p: 1;
	width: 38px;
	height: 38px;
	padding: 2px;
	border-radius: 50%;
	background: conic-gradient(var(--gold-2) calc(var(--p) * 360deg), rgba(239, 232, 220, .12) 0);
}
.chip[hidden] { display: none; }
.chip canvas {
	display: block;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(10, 9, 8, .88);
}

.hint {
	position: absolute;
	left: 50%;
	bottom: calc(env(safe-area-inset-bottom) + 26px);
	z-index: 3;
	width: max-content;
	max-width: calc(100% - 32px);
	margin: 0;
	padding: 10px 16px;
	transform: translateX(-50%);
	border: 1px solid var(--line-strong);
	background: rgba(10, 9, 8, .72);
	color: var(--text);
	font-size: 13px;
	text-align: center;
	pointer-events: none;
	animation: hintIn .5s var(--ease) both;
	transition: opacity .5s var(--ease);
}
.hint.out { opacity: 0; }
.hint[hidden] { display: none; }

.banner {
	position: absolute;
	top: 31%;
	left: 0;
	right: 0;
	z-index: 3;
	padding: 0 16px;
	text-align: center;
	opacity: 0;
	pointer-events: none;
}
.banner.show { animation: banner 3s var(--ease) both; }
.banner-title {
	margin: 10px 0 0;
	font: 500 52px/1 var(--serif);
	text-shadow: 0 4px 28px rgba(0, 0, 0, .75);
}

.toasts {
	position: absolute;
	top: calc(env(safe-area-inset-top) + 112px);
	left: 0;
	right: 0;
	z-index: 30;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 0 16px;
	pointer-events: none;
}
.toast {
	max-width: 100%;
	padding: 8px 16px;
	border: 1px solid var(--line-strong);
	background: rgba(14, 12, 10, .88);
	color: var(--text);
	font-size: 12.5px;
	font-weight: 500;
	letter-spacing: .03em;
	text-align: center;
	animation: toastIn .35s var(--ease) both;
	transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.toast.gold { border-color: rgba(201, 163, 92, .5); color: var(--gold-2); }
.toast.out { opacity: 0; transform: translateY(-8px); }

/* ---------- Các màn hình ---------- */
.screen {
	position: absolute;
	inset: 0;
	z-index: 10;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
}
.screen[hidden] { display: none !important; }
.sheet {
	background: rgba(8, 7, 6, .68);
	animation: fadeIn .25s var(--ease) both;
}
.panel {
	position: relative;
	width: 100%;
	max-width: 384px;
	max-height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: 30px 24px 24px;
	border: 1px solid var(--line);
	outline: 1px solid rgba(232, 203, 142, .09);
	outline-offset: -9px;
	background: rgba(21, 19, 17, .97);
	box-shadow: 0 40px 80px -40px rgba(0, 0, 0, .95);
	animation: rise .45s var(--ease) both;
	-webkit-user-select: none;
	user-select: none;
}
.panel-small { max-width: 340px; }
.close {
	position: sticky;
	top: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: -18px -12px -22px auto;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(21, 19, 17, .9);
	color: var(--text-2);
	cursor: pointer;
}
.close:hover { color: var(--gold-2); }
.closable .panel > .eyebrow { padding-right: 34px; }

/* Màn hình chính */
.menu {
	justify-content: flex-start;
	padding: calc(env(safe-area-inset-top) + 14px) 20px calc(env(safe-area-inset-bottom) + 24vh);
	padding-bottom: calc(env(safe-area-inset-bottom) + clamp(130px, 24dvh, 240px));
	background: linear-gradient(180deg, rgba(10, 9, 8, .62) 0%, rgba(10, 9, 8, .2) 50%, transparent 66%);
	text-align: center;
}
.menu-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	align-self: stretch;
}
.back-home {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: var(--text-2);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .22em;
	text-transform: uppercase;
	transition: color .3s var(--ease);
}
.back-home:hover { color: var(--gold-2); }
.menu-head { margin-top: auto; }
.title {
	margin: 16px 0 0;
	font: 500 clamp(54px, 16vw, 80px)/.9 var(--serif);
	letter-spacing: -.01em;
	text-shadow: 0 6px 30px rgba(0, 0, 0, .55);
}
.title em { display: block; }
.rule {
	display: block;
	width: 1px;
	height: 40px;
	margin: 22px auto 18px;
	background: linear-gradient(var(--gold), transparent);
}
.lead {
	max-width: 300px;
	margin: 0 auto;
	color: var(--text-2);
	font-size: 14px;
	line-height: 1.7;
}
.menu-actions {
	display: grid;
	gap: 10px;
	width: 100%;
	max-width: 330px;
	margin: 30px 0 auto;
}
.menu-stats {
	margin: 6px 0 0;
	color: var(--text-3);
	font-size: 12px;
	letter-spacing: .03em;
}
.menu .eyebrow, .menu .title, .menu .rule, .menu .lead, .menu-actions { animation: rise 1s var(--ease) both; }
.menu .title { animation-delay: .08s; }
.menu .rule { animation-delay: .2s; }
.menu .lead { animation-delay: .28s; }
.menu-actions { animation-delay: .38s; }

/* Kết thúc lượt */
.score {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0;
	color: var(--gold-2);
	font: 500 66px/1 var(--serif);
	font-variant-numeric: lining-nums;
}
.score small {
	color: var(--text-3);
	font: 500 11px/1 var(--sans);
	letter-spacing: .24em;
	text-transform: uppercase;
}
.stats {
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin: 18px 0 0;
	border-top: 1px solid var(--line);
}
.stats div { padding: 11px 0; border-bottom: 1px solid var(--line); }
.stats div:nth-child(odd) { padding-right: 12px; border-right: 1px solid var(--line); }
.stats div:nth-child(even) { padding-left: 16px; }
.stats dt {
	color: var(--text-3);
	font-size: 10.5px;
	font-weight: 500;
	letter-spacing: .2em;
	text-transform: uppercase;
}
.stats dd { margin: 3px 0 0; font: 500 23px/1.1 var(--serif); }
.best { margin: 14px 0 0; color: var(--text-2); font-size: 13.5px; }
.unlock {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 16px;
	padding: 10px 14px 10px 8px;
	border: 1px solid rgba(201, 163, 92, .35);
	background: rgba(201, 163, 92, .06);
	text-align: left;
}
.unlock[hidden] { display: none; }
.unlock canvas { flex: none; width: 64px; height: 64px; }
.unlock-name { margin: 4px 0 2px; font: 500 22px/1.1 var(--serif); }
.unlock .link { font-size: 13px; }
.name-form { margin-top: 18px; }
.name-form[hidden] { display: none; }
.name-form label { display: block; margin-bottom: 8px; color: var(--text-2); font-size: 13.5px; }
.name-form > .link { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.inline { display: flex; gap: 8px; }
.inline input {
	flex: 1;
	min-width: 0;
	height: 48px;
	padding: 0 14px;
	border: 1px solid var(--line-strong);
	border-radius: 0;
	background: #0f0d0b;
	color: var(--text);
	font: 400 16px/1 var(--sans);
}
.inline input::placeholder { color: var(--text-3); }
.inline input:focus { outline: none; border-color: var(--gold); }
.inline .btn { min-height: 48px; padding: 0 18px; }
.status {
	margin: 16px 0 0;
	padding: 10px 12px;
	border-left: 2px solid var(--line-strong);
	background: rgba(10, 9, 8, .35);
	color: var(--text-2);
	font-size: 13px;
	line-height: 1.55;
}
.status[hidden] { display: none; }
.status.ok { border-color: var(--gold); color: var(--text); }
.status.warn { border-color: var(--warn); }

/* Bảng vàng */
.tabs { display: flex; margin: 0 0 4px; border-bottom: 1px solid var(--line); }
.tabs button {
	appearance: none;
	flex: 1;
	height: 44px;
	margin-bottom: -1px;
	border: 0;
	border-bottom: 1px solid transparent;
	background: none;
	color: var(--text-3);
	font: 500 11px/1 var(--sans);
	letter-spacing: .2em;
	text-transform: uppercase;
	cursor: pointer;
	transition: color .3s var(--ease), border-color .3s var(--ease);
}
.tabs button[aria-selected="true"] { border-bottom-color: var(--gold); color: var(--gold-2); }
.board-list { min-height: 120px; margin: 0; padding: 0; list-style: none; }
.board-list li {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 12px 6px 12px 2px;
	border-bottom: 1px solid var(--line);
}
.board-list .rank { color: var(--text-3); font: italic 500 19px/1 var(--serif); }
.board-list li.top .rank { color: var(--gold); }
.board-list .who { display: flex; flex-direction: column; min-width: 0; }
.board-list .who b {
	overflow: hidden;
	font: 500 21px/1.15 var(--serif);
	text-overflow: ellipsis;
	white-space: nowrap;
}
.board-list .who small { color: var(--text-3); font-size: 11.5px; }
.board-list .pts { color: var(--gold-2); font: 500 23px/1 var(--serif); font-variant-numeric: lining-nums; }
.board-list li.me { background: linear-gradient(90deg, rgba(201, 163, 92, .12), transparent 85%); }
.board-list li.me .who b::after {
	content: "  bạn";
	color: var(--gold);
	font: 500 9.5px/1 var(--sans);
	letter-spacing: .16em;
	text-transform: uppercase;
	vertical-align: middle;
}
.board-list li.empty { display: block; padding: 22px 2px; color: var(--text-2); font-size: 13.5px; }
#board-foot { margin-top: 14px; }

/* Tủ mũ */
#ward-next { margin-top: 6px; }
.hats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.hat {
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 3px;
	padding: 8px 4px 12px;
	border: 1px solid var(--line);
	background: rgba(10, 9, 8, .4);
	color: var(--text);
	font: inherit;
	cursor: pointer;
	transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.hat:hover { border-color: var(--line-strong); }
.hat canvas { width: 76px; height: 76px; }
.hat-name { font: 500 16px/1.15 var(--serif); }
.hat-state { color: var(--text-3); font-size: 9.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.hat.on { border-color: var(--gold); background: rgba(201, 163, 92, .09); }
.hat.on .hat-state { color: var(--gold-2); }
.hat.locked { cursor: default; }
.hat.locked canvas { opacity: .55; filter: grayscale(1) brightness(.6); }
.hat.locked .hat-name { color: var(--text-3); }

/* Cách chơi */
.steps { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.steps li { margin: 0 0 8px; padding-left: 4px; }
.steps li::marker { color: var(--gold); font-family: var(--serif); font-style: italic; }
.steps b { color: var(--text); font-weight: 500; }
.steps i { color: var(--gold-2); }
.legend { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 44px 1fr; align-items: center; gap: 14px; }
.legend canvas { width: 44px; height: 44px; }
.legend span { color: var(--text-2); font-size: 13px; line-height: 1.5; }
.legend b { display: block; color: var(--text); font: 500 17px/1.25 var(--serif); }

/* Cài đặt */
.field { margin: 0; padding: 14px 0; border: 0; border-bottom: 1px solid var(--line); min-width: 0; }
.field[hidden] { display: none; }
.field:last-child { border-bottom: 0; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch-row label { color: var(--text); font-size: 14px; cursor: pointer; }
.switch {
	appearance: none;
	position: relative;
	flex: none;
	width: 46px;
	height: 26px;
	margin: 0;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: #0f0d0b;
	cursor: pointer;
	transition: background-color .3s var(--ease), border-color .3s var(--ease);
}
.switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--text-3);
	transition: transform .3s var(--ease), background-color .3s var(--ease);
}
.switch:checked { border-color: var(--gold); background: rgba(201, 163, 92, .25); }
.switch:checked::after { transform: translateX(20px); background: var(--gold-2); }
legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; color: var(--text); font-size: 14px; }
.seg { clear: both; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-strong); }
.seg label { position: relative; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; }
.seg span {
	display: grid;
	place-items: center;
	height: 44px;
	color: var(--text-2);
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: .14em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color .3s var(--ease), color .3s var(--ease);
}
.seg label + label span { border-left: 1px solid var(--line-strong); }
.seg input:checked + span { background: rgba(201, 163, 92, .14); color: var(--gold-2); }
.seg input:focus-visible + span { outline: 1px solid var(--gold); outline-offset: -4px; }
#control-note { margin-top: 10px; }
.field.name-form label { color: var(--text); font-size: 14px; }
#name-note { margin-top: 10px; }

/* Nhắc xoay dọc điện thoại */
.rotate {
	position: absolute;
	inset: 0;
	z-index: 60;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: var(--bg);
	color: var(--text-2);
	text-align: center;
}
.rotate[hidden] { display: none; }
.rotate svg { width: 42px; height: 42px; fill: none; stroke: var(--gold); stroke-width: 1.3; animation: turn 2.4s var(--ease) infinite; }
.rotate p { margin: 0; font: 500 24px/1.2 var(--serif); color: var(--text); }
.noscript { position: absolute; inset: auto 16px 40px; z-index: 70; margin: 0; color: var(--text); text-align: center; }

/* ---------- Chuyển động ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes hintIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes banner {
	0% { opacity: 0; transform: translateY(14px); }
	14% { opacity: 1; transform: none; }
	72% { opacity: 1; transform: none; }
	100% { opacity: 0; transform: translateY(-10px); }
}
@keyframes turn { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------- Màn hình thấp ---------- */
@media (max-height: 720px) {
	.title { font-size: clamp(46px, 13vw, 62px); }
	.rule { height: 22px; margin: 14px auto 12px; }
	.lead { font-size: 13px; }
	.menu-actions { margin-top: 22px; }
	.btn-play { min-height: 52px; }
	h2 { font-size: 34px; }
	.score { font-size: 54px; }
	.panel { padding: 24px 20px 20px; }
}
@media (max-height: 600px) {
	.lead, .rule { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
	.banner.show { animation: none; opacity: 1; }
}
