/* The client page. Sections: hero with the walking player, the playable preview, the client's
   features as small working demos, the live shop, how coins are bought, the closing call. */

.hero__title { font-size: clamp(4.5rem, 11vw, 9rem); }
.stage__mark { position: absolute; inset-block-start: -10%; inset-inline-end: -18%; width: 125%; z-index: 0; color: var(--mist-3); pointer-events: none; }
.stage__mark svg { width: 100%; height: auto; }
.stage {
	position: relative;
	z-index: 1;
	width: min(100%, 460px);
	aspect-ratio: 4 / 5.2;
	border-radius: var(--r-lg);
	background: linear-gradient(180deg, color-mix(in srgb, var(--card) 70%, transparent), color-mix(in srgb, var(--mist-2) 80%, transparent));
	box-shadow: var(--shadow-3);
}
.stage__canvas, .stage__still { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; touch-action: pan-y; }
.stage__still { object-fit: contain; image-rendering: pixelated; padding: 14%; }
.stage__info { position: absolute; inset-inline: var(--s-4); inset-block-start: var(--s-4); display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-3); pointer-events: none; }
.stage__info > * { pointer-events: auto; }
.stage__name { font-weight: 700; font-size: var(--t-md); line-height: 1.5; }
.stage__sub { display: flex; gap: var(--s-2); align-items: center; }
.stage__rail { position: absolute; inset-inline: var(--s-3); inset-block-end: var(--s-3); display: flex; justify-content: center; gap: var(--s-2); padding: var(--s-2); border-radius: var(--r-pill); background: color-mix(in srgb, var(--card) 80%, transparent); transform: translateZ(30px); }
.stage__rail button { width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; background: var(--mist-1); display: grid; place-items: center; transition: transform var(--d-2) var(--ease), box-shadow var(--d-2) var(--ease); }
.stage__rail button img { width: 30px; height: 30px; image-rendering: pixelated; }
.stage__rail button:hover { transform: translateY(-3px); }
.stage__rail button[aria-selected="true"] { background: var(--card); box-shadow: 0 0 0 2.5px var(--pink); }

/* The client's features -------------------------------------------------- */
.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-5); }
.tile {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: var(--s-5);
	min-height: 280px;
	padding: var(--s-6);
	border-radius: var(--r-lg);
	background: var(--card);
	box-shadow: var(--shadow-1);
}
.tile h3 { font-size: var(--t-md); margin-block-end: var(--s-2); }
.tile__body { max-width: 30em; }
.tile--keys { grid-column: span 7; }
.tile--hud { grid-column: span 5; background: var(--mist-1); }
.tile--versions { grid-column: span 4; background: linear-gradient(150deg, var(--mist-2), var(--card)); }
.tile--theme { grid-column: span 4; background: linear-gradient(150deg, var(--card), var(--pink-soft)); }
.tile--chat { grid-column: span 4; }
.tile--private { grid-column: span 12; min-height: 200px; background: linear-gradient(120deg, var(--violet-soft), var(--mist-1)); justify-content: center; }
.tile--private h3 { font-family: var(--font-display); font-size: var(--t-xl); line-height: 1.3; }

/* Keystrokes and CPS */
.keys { direction: ltr; display: grid; grid-template-columns: 1fr repeat(3, 56px); grid-template-rows: repeat(3, 56px); gap: var(--s-2); align-items: center; }
.keys kbd {
	display: grid;
	place-items: center;
	height: 56px;
	border-radius: var(--r-md);
	background: var(--paper);
	color: var(--ink-2);
	font: 700 var(--t-base) var(--font-mono);
	box-shadow: 0 4px 0 var(--mist-3), 0 12px 16px -8px rgba(0, 0, 0, 0.7);
	transition: transform 80ms linear, box-shadow 80ms linear, background-color 120ms linear, color 120ms linear;
}
.keys kbd.is-down { transform: translateY(4px); box-shadow: 0 0 0 var(--mist-3), 0 4px 8px -4px rgba(0, 0, 0, 0.7); background: var(--pink-soft); color: var(--pink-deep); }
.keys kbd[data-key="KeyW"] { grid-column: 3; grid-row: 1; }
.keys kbd[data-key="KeyA"] { grid-column: 2; grid-row: 2; }
.keys kbd[data-key="KeyS"] { grid-column: 3; grid-row: 2; }
.keys kbd[data-key="KeyD"] { grid-column: 4; grid-row: 2; }
.keys .keys__space { grid-column: 2 / 5; grid-row: 3; font-family: var(--font-text); font-size: var(--t-sm); }
.cps {
	grid-column: 1;
	grid-row: 1 / 4;
	justify-self: center;
	width: 148px;
	height: 148px;
	border: 0;
	border-radius: 50%;
	display: grid;
	align-content: center;
	justify-items: center;
	gap: 0;
	background: radial-gradient(circle at 35% 30%, var(--mist-3), var(--violet-soft) 62%, var(--mist-1));
	box-shadow: var(--shadow-2), inset 0 -6px 14px rgba(0, 0, 0, 0.35);
	color: var(--ink);
	transition: transform 90ms linear;
}
.cps:active { transform: scale(0.95); }
.cps__value { font-size: var(--t-2xl); font-weight: 700; line-height: 1.2; }
.cps__label { font-size: var(--t-xs); color: var(--ink-3); }

/* HUD editor */
.hudbox { position: relative; height: 170px; border-radius: var(--r-md); overflow: hidden; background: linear-gradient(180deg, #8fb4ff 0%, #cfe2ff 55%, #7a9e5a 55%, #5e7f45 100%); touch-action: none; }
.hudw {
	position: absolute;
	inset-inline-start: var(--x);
	inset-block-start: var(--y);
	padding: 0.1em 0.75em;
	border-radius: 8px;
	background: rgba(24, 14, 48, 0.62);
	color: #fff;
	font-size: var(--t-xs);
	font-weight: 600;
	cursor: grab;
	user-select: none;
	white-space: nowrap;
}
.hudw.is-drag { cursor: grabbing; background: rgba(214, 19, 111, 0.78); }

/* Server versions */
.servers { display: grid; gap: var(--s-3); }
.servers li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-3); border-radius: var(--r-md); background: rgba(255, 255, 255, 0.07); }
.servers__name { margin-inline-end: auto; font-weight: 600; font-size: var(--t-sm); }
.ver { padding: 0.1em 0.8em; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--lilac); font-size: var(--t-xs); font-weight: 600; transition: background-color var(--d-1), color var(--d-1); }
.ver:hover { background: rgba(255, 255, 255, 0.1); }
.ver.is-on { background: var(--pink); color: #fff; }

/* Theme */
.hue { --h: 330; display: grid; gap: var(--s-4); }
.hue input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: var(--r-pill); background: linear-gradient(90deg in oklch longer hue, oklch(0.7 0.2 0), oklch(0.7 0.2 360)); outline-offset: 6px; }
.hue input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-2); border: 3px solid oklch(0.62 0.2 var(--h)); cursor: grab; }
.hue input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow-2); border: 3px solid oklch(0.62 0.2 var(--h)); cursor: grab; }
.hue__swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--s-2); }
.hue__swatches i { height: 44px; border-radius: var(--r-md); }
.hue__swatches i:nth-child(1) { background: oklch(0.28 0.08 var(--h)); }
.hue__swatches i:nth-child(2) { background: oklch(0.45 0.16 var(--h)); }
.hue__swatches i:nth-child(3) { background: oklch(0.62 0.2 var(--h)); }
.hue__swatches i:nth-child(4) { background: oklch(0.84 0.1 var(--h)); }
.hue__swatches i:nth-child(5) { background: oklch(0.95 0.03 var(--h)); }

/* Chat */
.chat { display: grid; gap: var(--s-2); padding: var(--s-3); border-radius: var(--r-md); background: var(--mist-1); color: var(--ink); font-size: var(--t-sm); }
.chat__line { line-height: 1.7; }
.chat__line b { color: var(--lilac); margin-inline-end: 0.5em; }
.chat__react { display: flex; gap: var(--s-2); }
.react { display: inline-flex; align-items: center; gap: 0.4em; padding: 0.05em 0.7em; border: 0; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.1); color: #f4efff; font-size: var(--t-xs); font-weight: 600; transition: background-color var(--d-1), transform var(--d-1) var(--ease); }
.react svg { width: 1.1em; height: 1.1em; }
.react:hover { background: rgba(255, 255, 255, 0.18); }
.react.is-on { background: var(--pink); }
.react.pop { animation: pop 320ms var(--ease); }
@keyframes pop { 40% { transform: scale(1.18); } }

/* The shop ---------------------------------------------------------------- */
.shop__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5); }
.shop__grid .item:first-child { grid-column: span 2; grid-row: span 2; grid-template-rows: 1fr auto auto; }
.shop__grid .item:first-child .item__art { aspect-ratio: auto; min-height: 280px; }
.shop__grid .item:first-child .item__art img { width: 52%; height: 52%; }
.shop__grid .item:first-child .item__name { font-size: var(--t-lg); font-family: var(--font-display); line-height: 1.3; }
.shop__more { margin-block-start: var(--s-6); }

/* Paying with Telegram ---------------------------------------------------- */
.pay { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s-7) var(--s-8); align-items: start; }
.pay .section__head { grid-column: 1 / -1; margin-block-end: 0; }
.pay__bubble { padding: var(--s-5); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 4px; background: var(--card); box-shadow: var(--shadow-2); display: grid; gap: var(--s-3); align-self: center; }
.pay__msg { font-size: var(--t-base); line-height: 2; }
.pay > p:last-child { grid-column: 1 / -1; }

@media (max-width: 1100px) {
	.tile--keys { grid-column: span 12; }
	.tile--hud, .tile--versions, .tile--theme, .tile--chat { grid-column: span 6; }
}
@media (max-width: 1000px) {
	.stage__mark { inset-inline-end: -8%; width: 100%; }
	.shop__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pay { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
	.tile--hud, .tile--versions, .tile--theme, .tile--chat { grid-column: span 12; }
}
@media (max-width: 560px) {
	.keys { grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px) auto; }
	.keys kbd { height: 48px; }
	.keys kbd[data-key="KeyW"] { grid-column: 2; }
	.keys kbd[data-key="KeyA"] { grid-column: 1; }
	.keys kbd[data-key="KeyS"] { grid-column: 2; }
	.keys kbd[data-key="KeyD"] { grid-column: 3; }
	.keys .keys__space { grid-column: 1 / 4; }
	.cps { grid-column: 1 / 4; grid-row: 4; justify-self: center; width: 120px; height: 120px; }
	.shop__grid .item:first-child { grid-column: span 2; grid-row: auto; }
	.shop__grid .item:first-child .item__art { min-height: 200px; }
	.try__placeholder { min-height: 420px; }
}
