.ny-countdown,
.ny-modal,
.ny-toast {
	--accent: #a8a2ff;
	--accent-rgb: 168, 162, 255;
	--accent-text: #bbb6ff;
	--accent-gradient: linear-gradient(#b8b4fb, #908aef);
	--accent-ink: #181831;
	--accent-glow: 0 6px 20px rgba(151, 142, 255, .22);
	--surface: #181a26;
	--surface-2: #222535;
	--border: #303447;
	--hud-border: #383c51;
	--text: #dddfee;
	--text-muted: #969bb6;
	--text-strong: #f0f1fa;
	--radius-s: 10px;
	--radius-m: 16px;
	--radius-l: 22px;
	--ease: ease-out;
	--font-display: inherit;
	--font-body: inherit;
	--ny-red: #ff5d6c;
	--ny-green: #55d67a;
	--ny-blue: #4aa8ff;
	--ny-gold: #ffc53d;
	--ny-ice: #7cf0ff;
	--ny-overlay: rgba(5, 9, 18, .74);
	--ny-night: linear-gradient(180deg, #071022 0%, #13284a 60%, #22406b 100%);
	--ny-snowcap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 12' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff'/%3E%3Cstop offset='1' stop-color='%23dbe7f5'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 12C2 7 6 5 12 5c10 0 14-3 24-3s16 3 28 3 18-4 30-4 16 4 26 4 18-3 30-3 14 3 26 3 18-4 30-4 16 3 28 3 14-2 24-2c10 0 18 3 28 3 6 0 10 2 14 7z' fill='url(%23g)'/%3E%3C/svg%3E");
	--ny-hat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cpath d='M6 24C8 12 16 3 27 4c5 1 8 5 9 10-4-3-8-3-10 1-3 5-4 9-4 9z' fill='%23e5484d'/%3E%3Cpath d='M27 4c5 1 8 5 9 10-4-3-8-3-10 1z' fill='%23b8323d'/%3E%3Crect x='3' y='21' width='24' height='8' rx='4' fill='%23fff'/%3E%3Ccircle cx='35' cy='16' r='4.5' fill='%23fff'/%3E%3C/svg%3E");
}

.ny-countdown {
	position: relative;
	margin: 0 0 20px;
	padding: clamp(14px, 1.6vw, 24px);
	border: 1px solid var(--border);
	border-radius: 16px;
	background: var(--surface);
	color: var(--text);
}

.ny-countdown__title {
	margin-bottom: 16px;
	color: var(--text-strong);
	font-size: 18px;
	font-weight: 700;
}
.ny-countdown .btn, .ny-modal .btn {
	padding: 6px 10px;
	border-radius: 9px;
	font-weight: 600;
}
.ny-countdown .btn-primary, .ny-modal .btn-primary {
	background: var(--accent-gradient);
	border: 1px solid var(--accent);
	color: var(--accent-ink);
}
.ny-countdown .btn-outline-primary, .ny-modal .btn-outline-primary {
	background: var(--surface);
	border: 1px solid var(--border);
	color: var(--text-strong);
}
.ny-modal [hidden] { display: none !important; }
body.ny-modal-open {
	overflow: hidden;
}

.ny-countdown::before {
	content: "";
	position: absolute;
	top: -6px;
	left: 10px;
	right: 10px;
	z-index: 2;
	height: 11px;
	background: var(--ny-snowcap) 0 0 / 100% 100% no-repeat;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .22));
	pointer-events: none;
}

.ny-ava--hat::after {
	content: "";
	position: absolute;
	z-index: 2;
	background: var(--ny-hat) center / contain no-repeat;
	transform: rotate(-18deg);
	pointer-events: none;
}
.ny-countdown__grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	margin-bottom: 16px;
}

.ny-countdown__cell {
	padding: 10px 4px 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-s);
	background: var(--surface-2);
	text-align: center;
}

.ny-countdown__cell b {
	display: block;
	color: var(--accent-text, var(--accent));
	font-family: var(--font-display);
	font-size: 24px;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	line-height: 1.1;
}

.ny-countdown__cell span {
	color: var(--text-muted);
	font-size: 12px;
}

.ny-countdown__greet {
	margin-bottom: 16px;
	color: var(--text);
	font-size: 15px;
	text-align: center;
}

.ny-countdown__music {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 8px 12px 8px 8px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-strong);
	font-size: 14px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.ny-countdown__music small {
	display: block;
	color: var(--text-muted);
	font-size: 12px;
	font-weight: 400;
}

.ny-countdown__play {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--accent-gradient);
	color: var(--accent-ink);
	font-size: 13px;
}

.ny-countdown__play .fa-pause,
.is-playing .ny-countdown__play .fa-play {
	display: none;
}

.is-playing .ny-countdown__play .fa-pause {
	display: inline;
}

.ny-countdown__games {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}

.ny-countdown__games .btn {
	flex: 1 1 auto;
}


.ny-toast {
	position: fixed;
	left: 50%;
	bottom: 26px;
	z-index: 2110;
	max-width: calc(100% - 32px);
	padding: 11px 20px;
	border: 1px solid rgba(74, 168, 255, .5);
	border-radius: 14px;
	background: rgba(11, 22, 48, .92);
	box-shadow: 0 0 24px rgba(74, 168, 255, .3), 0 14px 30px -10px rgba(0, 0, 0, .6);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	transform: translate(-50%, 20px);
	opacity: 0;
	transition: opacity .25s, transform .25s var(--ease);
	pointer-events: none;
}

.ny-toast .fa-snowflake {
	color: var(--ny-blue);
}

.ny-toast.is-shown {
	transform: translate(-50%, 0);
	opacity: 1;
}


.ny-modal {
	position: fixed;
	inset: 0;
	z-index: 2100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--ny-overlay);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	animation: ny-fade .2s ease-out;
}

.ny-modal__dialog {
	position: relative;
	width: 100%;
	max-width: 460px;
	max-height: calc(100vh - 32px);
	overflow: auto;
	padding: 20px;
	border: 1px solid var(--border);
	border-radius: var(--radius-l);
	background: var(--surface);
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
	color: var(--text);
	animation: ny-pop .25s var(--ease);
}

.ny-modal--wide .ny-modal__dialog {
	max-width: 980px;
}

.ny-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.ny-modal__title {
	margin: 0;
	color: var(--text-strong);
	font-family: var(--font-display);
	font-size: 20px;
	font-weight: 600;
}

.ny-modal__close {
	flex: none;
	width: 34px;
	height: 34px;
	padding: 0;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-muted);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.ny-modal__close:hover {
	color: var(--text-strong);
}

@keyframes ny-fade {
	from { opacity: 0; }
}

@keyframes ny-pop {
	from { transform: translateY(12px) scale(.98); opacity: 0; }
}


.ny-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.ny-tabs button {
	padding: 6px 14px;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface-2);
	color: var(--text-muted);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ny-tabs button.is-active {
	border-color: transparent;
	background: var(--accent-gradient);
	color: var(--accent-ink);
}

.ny-game__stats {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 10px;
	color: var(--text-muted);
	font-size: 14px;
	font-variant-numeric: tabular-nums;
}

.ny-game__stats b {
	color: var(--text-strong);
}

.ny-game__hint {
	margin: 10px 0 0;
	color: var(--text-muted);
	font-size: 13px;
	text-align: center;
}

.ny-game__hint:empty {
	display: none;
}

.ny-empty {
	margin: 0;
	padding: 18px 8px;
	color: var(--text-muted);
	text-align: center;
}

.ny-modal .text-gold {
	color: var(--ny-gold);
}

.ny-modal .text-red {
	color: var(--ny-red);
}

.ny-round-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, .22);
	border-radius: 50%;
	background: rgba(8, 16, 32, .55);
	color: #fff;
	font-size: 15px;
	cursor: pointer;
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.ny-round-btn:hover,
.ny-round-btn.is-playing {
	border-color: var(--ny-gold);
	color: var(--ny-gold);
}


.ny-ava {
	position: relative;
	flex: none;
	display: inline-block;
	width: 48px;
	height: 48px;
}

.ny-ava img {
	width: 100%;
	height: 100%;
	border-radius: 14px;
	object-fit: cover;
}

.ny-ava--hat::after {
	top: -11px;
	left: -8px;
	width: 32px;
	height: 26px;
}

.ny-user {
	display: block;
	overflow: hidden;
	color: var(--text-strong);
	font-weight: 700;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ny-user:hover {
	color: var(--link-hover, var(--accent));
}

.ny-rank {
	display: block;
	font-size: 12px;
	font-weight: 700;
}

.ny-rank--ge { color: #ffb02e; }
.ny-rank--le { color: #e0a84a; }
.ny-rank--mg { color: #7cb7ff; }
.ny-rank--gn { color: #e6c35c; }
.ny-rank--silver { color: #a8b3c2; }

.ny-tir {
	position: relative;
	height: clamp(340px, 34vw, 430px);
	overflow: hidden;
	border: 1px solid var(--hud-border);
	border-radius: var(--radius-l);
	background: var(--ny-night);
	box-shadow: 0 20px 50px -24px rgba(0, 0, 0, .8);
	color: #fff;
	-webkit-user-select: none;
	user-select: none;
}

.ny-modal .ny-tir {
	height: clamp(320px, 62vh, 520px);
}

.ny-tir__canvas {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
}

.ny-tir.is-playing .ny-tir__canvas {
	cursor: none;
	touch-action: none;
}

.ny-tir__screen {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 24px 20px;
	text-align: center;
	text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}


.ny-tir__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 580px;
	padding: 20px 26px;
	border: 1px solid rgba(255, 255, 255, .1);
	border-radius: var(--radius-l);
	background: rgba(6, 10, 22, .62);
	box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .7);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.ny-tir__card > :last-child {
	margin-bottom: 0;
}

.ny-tir__eyebrow {
	margin: 0 0 6px;
	color: var(--accent);
	font-family: var(--font-display);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
}

.ny-tir__title {
	margin: 0 0 14px;
	color: #fff;
	font-family: var(--font-display);
	font-size: clamp(24px, 3.4vw, 36px);
	font-weight: 700;
	line-height: 1.1;
}

.ny-tir__rules {
	display: grid;
	grid-template-columns: repeat(2, auto);
	gap: 6px 18px;
	margin: 0 0 18px;
	padding: 0;
	color: #dbe6f5;
	font-size: 14px;
	list-style: none;
	text-align: left;
}

.ny-tir__rules b {
	display: inline-block;
	min-width: 30px;
	color: var(--accent);
	font-family: var(--font-display);
}

.ny-tir__start {
	min-width: 180px;
	font-family: var(--font-display);
	letter-spacing: .06em;
	text-transform: uppercase;
	box-shadow: var(--accent-glow);
}

.ny-tir__best {
	margin: 12px 0 0;
	color: #c3cfdf;
	font-size: 14px;
}

.ny-tir__best b {
	color: var(--accent);
}

.ny-tir__best a,
.ny-tir__save a {
	color: var(--accent);
	text-decoration: underline;
}

.ny-tir__score {
	color: var(--accent);
	font-family: var(--font-display);
	font-size: clamp(52px, 8vw, 78px);
	font-weight: 800;
	line-height: 1;
	text-shadow: 0 0 28px rgba(var(--accent-rgb), .45);
}

.ny-tir__screen .ny-rank {
	margin-top: 4px;
	font-family: var(--font-display);
	font-size: 15px;
	letter-spacing: .04em;
}

.ny-tir__summary {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 12px 0 8px;
}

.ny-tir__summary span {
	min-width: 70px;
	padding: 6px 10px;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: var(--radius-s);
	background: rgba(5, 10, 20, .5);
	color: #b9c6d8;
	font-size: 12px;
}

.ny-tir__summary b {
	display: block;
	color: #fff;
	font-family: var(--font-display);
	font-size: 18px;
}

.ny-tir__save {
	margin: 0 0 14px;
	color: #c3cfdf;
	font-size: 14px;
}

.ny-tir__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

.ny-tir__screen .btn-outline-primary {
	border-color: rgba(255, 255, 255, .35);
	background: rgba(5, 10, 20, .45);
	color: #fff;
}


.ny-tir__hud {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: end;
	gap: 10px;
	padding: 12px 16px;
	background: linear-gradient(0deg, rgba(5, 10, 20, .55), transparent);
	color: var(--accent);
	font-family: var(--font-display);
	pointer-events: none;
	text-shadow: 0 0 8px rgba(var(--accent-rgb), .45);
}

.ny-hud small {
	display: block;
	color: rgba(var(--accent-rgb), .75);
	font-size: 11px;
	letter-spacing: .12em;
	text-transform: uppercase;
}

.ny-hud--score b {
	font-size: 34px;
	line-height: 1;
}

.ny-hud--time {
	text-align: center;
}

.ny-hud--time b {
	display: block;
	font-size: 28px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.ny-hud__bar {
	display: block;
	width: 120px;
	height: 3px;
	margin-top: 6px;
	overflow: hidden;
	border-radius: 999px;
	background: rgba(var(--accent-rgb), .2);
}

.ny-hud__bar i {
	display: block;
	height: 100%;
	background: var(--accent);
	transition: width .1s linear;
}

.ny-hud--time.is-low {
	color: var(--ny-red);
	animation: ny-low .5s ease-in-out infinite alternate;
}

.ny-hud--time.is-low .ny-hud__bar i {
	background: var(--ny-red);
}

@keyframes ny-low {
	to { opacity: .55; }
}

.ny-hud--stats {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	font-size: 14px;
}

.ny-hud--stats b {
	font-size: 20px;
}

.ny-tir__tools {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	display: flex;
	gap: 8px;
}

.ny-modal .text-ice {
	color: var(--ny-ice) !important;
}

.ny-top {
	display: grid;
	gap: 8px;
}

.ny-top__row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-m);
	background: var(--surface-2);
}

.ny-top__row.is-podium {
	border-color: rgba(255, 197, 61, .45);
}

.ny-top__row .ny-ava {
	width: 40px;
	height: 40px;
}

.ny-top__place {
	flex: none;
	width: 28px;
	color: var(--text-muted);
	font-size: 20px;
	font-weight: 700;
	text-align: center;
}

.ny-top__place span {
	font-size: 15px;
}

.ny-top__who {
	flex: 1;
	min-width: 0;
}

.ny-top__score {
	flex: none;
	color: var(--accent-text, var(--accent));
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 800;
	text-align: right;
}

.ny-top__score small {
	display: block;
	color: var(--text-muted);
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 400;
}


.ny-menu {
	display: grid;
	gap: 10px;
}

.ny-menu__item {
	display: grid;
	grid-template-columns: 48px 1fr;
	grid-template-rows: auto auto;
	column-gap: 12px;
	align-items: center;
	padding: 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-m);
	background: var(--surface-2);
	color: var(--text-strong);
	text-align: left;
	cursor: pointer;
	transition: border-color .2s, transform .2s var(--ease);
}

.ny-menu__item:hover {
	border-color: var(--accent);
	transform: translateY(-1px);
}

.ny-menu__icon {
	grid-row: span 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 14px;
	background: var(--ny-night);
	font-size: 24px;
}

.ny-menu__item small {
	color: var(--text-muted);
}


.ny-catch {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: var(--radius-m);
	background: var(--ny-night);
	touch-action: none;
	cursor: pointer;
}


.ny-memory {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 8px;
	perspective: 800px;
}

.ny-memory__card {
	position: relative;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	transform-style: preserve-3d;
	transition: transform .35s var(--ease);
}

.ny-memory__card > span {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-s);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	font-size: 28px;
}

.ny-memory__back {
	background: var(--ny-night);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
	color: rgba(255, 255, 255, .45);
	font-size: 20px !important;
}

.ny-memory__face {
	border: 1px solid var(--border);
	background: var(--surface-2);
	transform: rotateY(180deg);
}

.ny-memory__card.is-open,
.ny-memory__card.is-done {
	transform: rotateY(180deg);
}

.ny-memory__card.is-done .ny-memory__face {
	border-color: var(--ok-border, var(--border));
	background: var(--ok-bg, var(--surface-2));
}

@media (max-width: 767.98px) {
	.ny-tir__rules {
		font-size: 13px;
	}
}

@media (max-width: 575.98px) {
	.ny-tir {
		height: 470px;
	}

	.ny-tir__screen {
		padding: 56px 12px 16px;
	}

	.ny-tir__card {
		width: 100%;
		padding: 16px 14px;
	}

	.ny-tir__title {
		font-size: 22px;
	}

	.ny-tir__rules {
		grid-template-columns: 1fr;
		gap: 4px;
		margin-bottom: 14px;
	}

	.ny-tir__summary span {
		min-width: 0;
		flex: 1 1 40%;
	}

	.ny-hud--score b {
		font-size: 26px;
	}

	.ny-hud--stats {
		flex-direction: column;
		align-items: flex-end;
		gap: 0;
	}

}

@media (prefers-reduced-motion: reduce) {
	.ny-modal, .ny-modal__dialog, .ny-memory__card {
		animation: none;
		transition: none;
	}
}
