/* Drop Duel site. Tokens mirror scripts/ui/ui_style.gd and scripts/ui/palette.gd; keep them in sync. */

@font-face {
	font-family: "Righteous";
	src: url("/assets/fonts/Righteous-Regular.ttf") format("truetype");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

:root {
	color-scheme: dark;

	/* ui_style.gd */
	--bg: #0d0f17;
	--surface: rgb(255 255 255 / 0.02);
	--surface-active: rgb(255 255 255 / 0.05);
	--border: #595c61;
	--border-hover: #7a7d85;
	--border-active: #dbdee6;
	--text: #ccd1db;
	--text-strong: #f5f7fa;
	--text-muted: #8c919c;
	--online: #66d980;

	/* palette.gd */
	--rose: #ff5c94;
	--coral: #ff734d;
	--amber: #ffb53b;
	--lime: #b5e34a;
	--mint: #3de1b0;
	--azure: #4aa8ff;
	--violet: #a37dff;
	--slate: #73787f;

	/* ACCENT_IDLE_DARKEN 0.35, ACCENT_HOVER_DARKEN 0.10, ACCENT_LIT_LIGHTEN 0.40 */
	--c: var(--azure);

	--radius: 16px;
	--radius-btn: 14px;
	--bw: 3px;

	--font-title: "Righteous", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--gutter: 16px;
	--wrap: 1120px;
	--ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 720px) {
	:root { --gutter: 32px; }
}

/* Re-resolved per element so each takes its own --c. */
.btn, .tile, .chip, .phone, .callout {
	--c-idle: color-mix(in srgb, var(--c) 65%, black);
	--c-hover: color-mix(in srgb, var(--c) 90%, black);
	--c-lit: color-mix(in srgb, var(--c) 60%, white);
}

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

html {
	background: var(--bg);
	scroll-behavior: smooth;
	scrollbar-color: var(--border) var(--bg);
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--bg);
	color: var(--text);
	font: 400 1.0625rem/1.6 var(--font-body);
	-webkit-font-smoothing: antialiased;
	caret-color: var(--c);
}

::selection { background: color-mix(in srgb, var(--azure) 40%, transparent); color: var(--text-strong); }

img, svg, canvas { display: block; max-width: 100%; }

a {
	color: var(--text-strong);
	text-decoration-color: var(--border-hover);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}
a:hover { text-decoration-color: var(--text-strong); }

:focus-visible {
	outline: 3px solid var(--azure);
	outline-offset: 3px;
	border-radius: 6px;
}

.skip {
	position: absolute;
	left: var(--gutter);
	top: -64px;
	z-index: 10;
	padding: 10px 16px;
	background: var(--bg);
	border: var(--bw) solid var(--amber);
	border-radius: var(--radius-btn);
	color: var(--text-strong);
}
.skip:focus { top: 12px; }

.wrap {
	width: 100%;
	max-width: calc(var(--wrap) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

h1, h2, h3, h4 {
	margin: 0;
	font-family: var(--font-title);
	font-weight: 400;
	color: var(--text-strong);
	line-height: 1.1;
	text-wrap: balance;
}
h1 { font-size: clamp(2.75rem, 9vw, 5rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.9rem, 5vw, 2.75rem); }
h3 { font-size: 1.5rem; }
p { margin: 0; }

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

/* ---------- Header ---------- */

.site-header { padding-block: 18px; }
.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px 24px;
	flex-wrap: wrap;
}
.brand {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	font-family: var(--font-title);
	font-size: 1.5rem;
	color: var(--text-strong);
	text-decoration: none;
}
.brand img { width: 36px; height: 36px; }
.nav { display: flex; gap: 4px 20px; flex-wrap: wrap; }
.nav a {
	padding: 8px 2px;
	color: var(--text);
	text-decoration: none;
	font-size: 0.9375rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text-strong); text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: 3px; text-underline-offset: 0.5em; }

/* ---------- Buttons (the in-game menu button) ---------- */

.btn {
	--c: var(--azure);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	padding: 10px 24px;
	background: var(--surface);
	border: var(--bw) solid var(--c-idle);
	border-radius: var(--radius-btn);
	box-shadow: 0 8px 18px -10px rgb(0 0 0 / 0.7);
	color: var(--text-strong);
	font: 400 1.125rem/1.2 var(--font-title);
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	transition: border-color 0.18s var(--ease), background-color 0.18s var(--ease), box-shadow 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover { border-color: var(--c-hover); background: var(--surface-active); }
.btn:active, .btn.is-pressed {
	border-color: var(--c-lit);
	background: var(--surface-active);
	transform: translateY(1px);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 30%, transparent), 0 0 14px 2px color-mix(in srgb, var(--c) 28%, transparent);
}
.btn small { display: block; font: 400 0.75rem/1.2 var(--font-body); letter-spacing: 0.02em; text-transform: none; color: var(--text-muted); }
.btn-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.btn.is-soon { cursor: default; border-color: var(--border); }
.btn.is-soon:hover { border-color: var(--border-hover); }
.btn.is-soon:active { transform: none; box-shadow: 0 8px 18px -10px rgb(0 0 0 / 0.7); border-color: var(--border-hover); }
.btn.rose { --c: var(--rose); } .btn.coral { --c: var(--coral); } .btn.amber { --c: var(--amber); }
.btn.lime { --c: var(--lime); } .btn.mint { --c: var(--mint); } .btn.azure { --c: var(--azure); } .btn.violet { --c: var(--violet); }

.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Hero ---------- */

.hero { padding-block: clamp(24px, 5vw, 64px) clamp(56px, 9vw, 112px); }
.hero .wrap {
	display: grid;
	gap: 48px;
	align-items: center;
}
@media (min-width: 940px) {
	.hero .wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 64px; }
}

.hero-copy { position: relative; }
.mark {
	position: relative;
	width: clamp(104px, 22vw, 148px);
	aspect-ratio: 1;
	margin-bottom: 20px;
	isolation: isolate;
}
/* One soft glow in the colours of the three pieces; it reads as a single light. */
.mark::before {
	content: "";
	position: absolute;
	inset: -35%;
	z-index: -1;
	background:
		radial-gradient(ellipse 34% 28% at 50% 36%, rgb(255 181 59 / 0.10), transparent 100%),
		radial-gradient(ellipse 26% 38% at 34% 64%, rgb(163 125 255 / 0.10), transparent 100%),
		radial-gradient(ellipse 26% 38% at 66% 64%, rgb(255 115 77 / 0.09), transparent 100%);
	filter: blur(14px);
	pointer-events: none;
}
.mark img { width: 100%; height: 100%; }

.hero h1 .l2 { color: var(--amber); }
.lead { margin-top: 20px; max-width: 34ch; font-size: clamp(1.25rem, 3.4vw, 1.625rem); line-height: 1.35; color: var(--text-strong); text-wrap: balance; }
.sub { margin-top: 14px; max-width: 52ch; }
.hero .btn-row { margin-top: 32px; }
.hero .note { margin-top: 14px; font-size: 0.875rem; color: var(--text-muted); }

/* ---------- Duel demo ---------- */

.stage {
	margin: 0;
	padding: 18px;
	background: var(--surface);
	border: 2px solid var(--border);
	border-radius: var(--radius);
}
.duel { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.pane { min-width: 0; }
.pane-label {
	display: flex;
	justify-content: space-between;
	margin-bottom: 8px;
	font: 400 0.9375rem/1 var(--font-title);
	letter-spacing: 0.06em;
	color: var(--text-strong);
}
.pane-label .lines { color: var(--text-muted); font-family: var(--font-body); font-variant-numeric: tabular-nums; font-size: 0.8125rem; }
.pane.you .pane-label span:first-child { color: var(--mint); }
.pane.rival .pane-label span:first-child { color: var(--rose); }
.board {
	position: relative;
	background: #0a0c12;
	border: 2px solid var(--border);
	border-radius: 10px;
	overflow: hidden;
	aspect-ratio: 10 / 18;
}
.board canvas { width: 100%; height: 100%; }
.board .ko {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgb(13 15 23 / 0.72);
	font: 400 2rem/1 var(--font-title);
	letter-spacing: 0.08em;
	color: var(--text-strong);
	opacity: 0;
	transition: opacity 0.25s var(--ease);
}
.board.is-ko .ko { opacity: 1; }
.vs { align-self: center; font: 400 1.25rem/1 var(--font-title); color: var(--text-muted); }
.stage figcaption { margin-top: 14px; font-size: 0.8125rem; color: var(--text-muted); }

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 9vw, 104px); }
.section-head { max-width: 40rem; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head p { margin-top: 14px; }

.bento { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.tile {
	--c: var(--azure);
	grid-column: span 12;
	padding: 24px;
	background: var(--surface);
	border: 2px solid var(--c-idle);
	border-radius: var(--radius);
}
.tile h3 { color: var(--c); margin-bottom: 10px; }
.tile p + p { margin-top: 10px; }
.tile.rose { --c: var(--rose); } .tile.azure { --c: var(--azure); } .tile.amber { --c: var(--amber); }
.tile.lime { --c: var(--lime); } .tile.violet { --c: var(--violet); } .tile.mint { --c: var(--mint); }
@media (min-width: 760px) {
	.tile { padding: 30px; }
	.t-7 { grid-column: span 7; } .t-5 { grid-column: span 5; } .t-6 { grid-column: span 6; }
}
.tile.big h3 { font-size: clamp(1.75rem, 3.5vw, 2.25rem); }
.tile.big p { max-width: 46ch; font-size: 1.125rem; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding: 0; list-style: none; }
.chip {
	--c: var(--azure);
	display: inline-flex;
	gap: 8px;
	align-items: baseline;
	padding: 6px 14px;
	border: 2px solid var(--c-idle);
	border-radius: 999px;
	font-size: 0.9375rem;
	color: var(--text-strong);
}
.chip b { font: 400 0.9375rem/1 var(--font-title); letter-spacing: 0.04em; color: var(--c); text-transform: uppercase; }
.chip span { color: var(--text-muted); }
.chip.azure { --c: var(--azure); } .chip.amber { --c: var(--amber); } .chip.lime { --c: var(--lime); }
.chip.violet { --c: var(--violet); } .chip.rose { --c: var(--rose); } .chip.mint { --c: var(--mint); }

/* ---------- Controls ---------- */

.controls-grid { display: grid; gap: 32px; }
@media (min-width: 900px) {
	.controls-grid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 56px; align-items: start; }
	.pad-col { position: sticky; top: 24px; }
}
.seg {
	display: inline-grid;
	grid-template-columns: 1fr 1fr;
	padding: 4px;
	gap: 4px;
	border: 2px solid var(--border);
	border-radius: var(--radius-btn);
	background: var(--surface);
}
.seg button {
	min-height: 48px;
	padding: 8px 28px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--text);
	font: 400 1rem/1 var(--font-title);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}
.seg button:hover { color: var(--text-strong); }
.seg button[aria-pressed="true"] { background: var(--surface-active); color: var(--amber); box-shadow: inset 0 0 0 2px var(--border-hover); }
.layout-blurb { margin-top: 18px; max-width: 40ch; }
.pad { margin-top: 22px; width: 100%; max-width: 360px; }
.pad svg { width: 100%; height: auto; }
.pad .zone { fill: rgb(255 255 255 / 0.02); stroke-width: 3; }
.pad text { font: 400 13px var(--font-title); letter-spacing: 0.05em; fill: var(--text-strong); text-anchor: middle; dominant-baseline: middle; }
.pad-note { margin-top: 10px; font-size: 0.8125rem; color: var(--text-muted); }

.gestures { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.gesture { padding: 20px 0; border-top: 2px solid #23262e; }
.gesture:first-child { border-top: 0; padding-top: 0; }
.gesture h3 { font-size: 1.25rem; letter-spacing: 0.02em; }
.gesture p { margin-top: 6px; max-width: 56ch; }
.gesture .chips { margin-top: 10px; }
.gesture .chip { padding: 3px 12px; font-size: 0.875rem; }
.js .layout-panel[hidden] { display: none; }
.no-js .layout-panel + .layout-panel { margin-top: 40px; }

/* ---------- Screenshots ---------- */

.shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(10px, 3vw, 28px); }
.shot { margin: 0; }
.phone {
	aspect-ratio: 9 / 19;
	display: grid;
	place-items: center;
	padding: 12px;
	text-align: center;
	background: var(--surface);
	border: var(--bw) solid var(--c-idle);
	border-radius: clamp(18px, 4vw, 34px);
	overflow: hidden;
}
.phone img { width: 100%; height: 100%; object-fit: cover; border-radius: clamp(10px, 2.5vw, 22px); }
.phone span { font: 400 clamp(0.75rem, 2.4vw, 1rem)/1.3 var(--font-title); letter-spacing: 0.05em; color: var(--text-muted); text-transform: uppercase; }
.shot:nth-child(1) .phone { --c: var(--rose); }
.shot:nth-child(2) .phone { --c: var(--amber); }
.shot:nth-child(3) .phone { --c: var(--mint); }
.shot figcaption { margin-top: 12px; font-size: 0.875rem; color: var(--text-muted); }

/* ---------- Auth-link notice (only shown when the page is opened from an account e-mail link) ---------- */

.notice {
	display: none;
	margin: 0 auto 8px;
	padding: 14px 18px;
	border: 2px solid var(--amber);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text-strong);
}
.notice.is-on { display: block; }

/* ---------- Prose (legal pages) ---------- */

.page-head { padding-block: clamp(24px, 5vw, 56px) 8px; }
.page-head h1 { font-size: clamp(2.25rem, 7vw, 3.75rem); }
.page-head .meta { margin-top: 14px; color: var(--text-muted); font-size: 0.9375rem; }
.prose { padding-block: 24px clamp(56px, 8vw, 96px); max-width: 44rem; }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2.2em; font-size: 1.75rem; }
.prose h3 { margin-top: 1.8em; font-size: 1.25rem; letter-spacing: 0.02em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.7em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--amber); }
.prose strong { color: var(--text-strong); }
.prose .toc { padding: 18px 22px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); }
.prose .toc ol { margin: 0; columns: 2 16rem; }
.prose .toc a { text-decoration: none; }
.prose .toc a:hover { text-decoration: underline; }
.prose .callout, .callout { padding: 16px 20px; background: var(--surface); border: 2px solid var(--c-idle); border-radius: var(--radius); --c: var(--azure); }
.prose .callout.warn, .callout.warn { --c: var(--amber); }
.prose .callout > * + * { margin-top: 0.6em; }

.table-wrap { overflow-x: auto; border: 2px solid var(--border); border-radius: var(--radius); }
.table-wrap table { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: 0.9375rem; }
.table-wrap th, .table-wrap td { padding: 12px 16px; text-align: left; vertical-align: top; border-top: 2px solid #23262e; }
.table-wrap thead th { border-top: 0; font: 400 0.9375rem/1.2 var(--font-title); letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-strong); }
.table-wrap tbody th { color: var(--text-strong); font-weight: 600; }

/* The marker the owner searches for before launch. */
.ph {
	padding: 1px 6px;
	border-radius: 6px;
	background: rgb(255 181 59 / 0.14);
	box-shadow: inset 0 0 0 1.5px var(--amber);
	color: var(--amber);
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* ---------- Footer ---------- */

.site-footer { margin-top: auto; padding-block: 40px 48px; border-top: 2px solid #1b1e27; }
.site-footer .wrap { display: grid; gap: 28px; }
@media (min-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
.foot-nav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.foot-nav a { padding: 8px 0; color: var(--text); text-decoration: none; }
.foot-nav a:hover { color: var(--text-strong); text-decoration: underline; }
.foot-note { max-width: 46ch; font-size: 0.875rem; color: var(--text-muted); }
.foot-note .brand { margin-bottom: 10px; font-size: 1.25rem; }

/* ---------- 404 ---------- */

.lost { padding-block: clamp(48px, 10vw, 120px); text-align: center; }
.lost .big { font: 400 clamp(5rem, 24vw, 11rem)/1 var(--font-title); color: var(--text-strong); }
.lost .big span:nth-child(1) { color: var(--amber); } .lost .big span:nth-child(2) { color: var(--violet); } .lost .big span:nth-child(3) { color: var(--coral); }
.lost p { margin: 12px auto 32px; max-width: 32ch; font-size: 1.125rem; }
.lost .btn-row { justify-content: center; }

/* ---------- Motion: one entrance for the hero, nothing else ---------- */

@media (prefers-reduced-motion: no-preference) {
	.hero-copy > * { animation: rise 0.7s var(--ease) both; }
	.hero-copy > :nth-child(2) { animation-delay: 0.06s; }
	.hero-copy > :nth-child(3) { animation-delay: 0.12s; }
	.hero-copy > :nth-child(4) { animation-delay: 0.18s; }
	.hero-copy > :nth-child(5) { animation-delay: 0.24s; }
	.hero-copy > :nth-child(6) { animation-delay: 0.3s; }
	.stage { animation: rise 0.9s 0.2s var(--ease) both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	* { transition-duration: 0.01ms !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
