/* ============================================
   Thakey — first-time onboarding (welcome carousel + floating "?" help)
   On-brand, dark-teal + gold; re-themes with the rest of the UI via tokens.
   ============================================ */

/* Lock background scroll while the welcome is open. */
body.thk-ob-lock { overflow: hidden; }

/* ── Overlay ───────────────────────────────────────────────── */
.thk-ob-overlay {
	position: fixed;
	inset: 0;
	background: rgba(6, 22, 21, 0.66);
	-webkit-backdrop-filter: blur(5px);
	backdrop-filter: blur(5px);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--space-lg, 1.5rem);
	z-index: 2000; /* above modals (1000) + nav, but only when open */
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}
.thk-ob-overlay[hidden] { display: none; }

/* ── Dialog card ───────────────────────────────────────────── */
.thk-ob-dialog {
	position: relative;
	background: var(--color-surface, #103835);
	color: var(--color-text, #F2ECDD);
	border: 1px solid var(--color-line, #1F524D);
	border-radius: var(--radius-xl, 16px);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
	width: 100%;
	max-width: 420px;
	padding: 2rem 1.75rem 1.5rem;
	text-align: center;
	animation: thkObIn 0.28s ease;
}
@keyframes thkObIn {
	from { transform: translateY(12px) scale(0.97); opacity: 0; }
	to { transform: translateY(0) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.thk-ob-dialog { animation: none; }
}

/* gold hairline at the top edge */
.thk-ob-dialog::before {
	content: "";
	position: absolute;
	top: 0;
	left: 12%;
	right: 12%;
	height: 2px;
	border-radius: 0 0 4px 4px;
	background: linear-gradient(90deg, transparent, var(--thk-gold, #C8A24C), transparent);
}

/* ── Close (X) ─────────────────────────────────────────────── */
.thk-ob-close {
	position: absolute;
	top: 0.6rem;
	inset-inline-end: 0.6rem;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: var(--radius-full, 50%);
	background: transparent;
	color: var(--color-text-muted, #9FC2BA);
	cursor: pointer;
	transition: background var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease);
}
.thk-ob-close:hover { background: var(--color-surface-hover, #16433F); color: var(--color-text, #F2ECDD); }
.thk-ob-close:focus-visible { outline: 2px solid var(--thk-gold, #C8A24C); outline-offset: 2px; }

/* ── Brand kicker ──────────────────────────────────────────── */
.thk-ob-kicker {
	font-family: var(--font-display, 'Cairo', serif);
	font-size: 0.72rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--thk-gold, #C8A24C);
	margin-bottom: 0.75rem;
}

/* ── Step icon ─────────────────────────────────────────────── */
.thk-ob-icon {
	width: 78px;
	height: 78px;
	margin: 0 auto 1rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-full, 50%);
	color: var(--thk-gold, #C8A24C);
	background: radial-gradient(circle at 50% 35%, rgba(200, 162, 76, 0.18), rgba(200, 162, 76, 0.04) 70%);
	border: 1px solid var(--color-line, #1F524D);
}

/* ── Title + body ──────────────────────────────────────────── */
.thk-ob-title {
	font-family: var(--font-display, 'Cairo', serif);
	font-size: 1.4rem;
	line-height: 1.3;
	margin: 0 0 0.55rem;
	color: var(--color-text, #F2ECDD);
}
.thk-ob-body {
	font-size: 0.98rem;
	line-height: 1.7;
	color: var(--color-text-secondary, #C9C2B2);
	margin: 0 auto 1.25rem;
	max-width: 34ch;
}

/* ── Dots ──────────────────────────────────────────────────── */
.thk-ob-dots {
	display: flex;
	gap: 0.45rem;
	justify-content: center;
	margin-bottom: 1.25rem;
}
.thk-ob-dot {
	width: 8px;
	height: 8px;
	border-radius: var(--radius-full, 50%);
	background: var(--color-line, #1F524D);
	transition: background var(--transition-fast, 150ms ease), width var(--transition-fast, 150ms ease);
}
.thk-ob-dot.is-active {
	width: 22px;
	border-radius: 5px;
	background: var(--thk-gold, #C8A24C);
}

/* ── Nav row ───────────────────────────────────────────────── */
.thk-ob-nav {
	display: flex;
	gap: 0.6rem;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 0.75rem;
}
.thk-ob-back,
.thk-ob-next { flex: 1; justify-content: center; }
.thk-ob-back {
	background: transparent;
	color: var(--color-text-secondary, #C9C2B2);
	border: 1px solid var(--color-line, #1F524D);
}
.thk-ob-back:hover:not(:disabled) { background: var(--color-surface-hover, #16433F); color: var(--color-text, #F2ECDD); }
.thk-ob-back:disabled { opacity: 0; pointer-events: none; }
.thk-ob-next:focus-visible,
.thk-ob-back:focus-visible { outline: 2px solid var(--thk-gold-soft, #E6C878); outline-offset: 2px; }

/* ── Skip ──────────────────────────────────────────────────── */
.thk-ob-skip {
	background: none;
	border: none;
	color: var(--color-text-muted, #9FC2BA);
	font-size: 0.85rem;
	cursor: pointer;
	padding: 0.3rem 0.5rem;
	border-radius: var(--radius-sm, 4px);
	text-decoration: underline;
	text-underline-offset: 3px;
}
.thk-ob-skip:hover { color: var(--color-text, #F2ECDD); }
.thk-ob-skip:focus-visible { outline: 2px solid var(--thk-gold, #C8A24C); outline-offset: 2px; }

/* ── Floating "?" help button ──────────────────────────────── */
.thk-ob-help {
	position: fixed;
	bottom: 1.1rem;
	inset-inline-end: 1.1rem;
	width: 46px;
	height: 46px;
	border-radius: var(--radius-full, 50%);
	border: 1px solid var(--thk-gold-deep, #A6822F);
	background: linear-gradient(135deg, var(--thk-gold-soft, #E6C878), var(--thk-gold, #C8A24C));
	color: #14302C;
	cursor: pointer;
	z-index: 1500;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
	transition: transform var(--transition-fast, 150ms ease), box-shadow var(--transition-fast, 150ms ease);
}
.thk-ob-help:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4); }
.thk-ob-help:focus-visible { outline: 2px solid var(--thk-gold-soft, #E6C878); outline-offset: 3px; }
.thk-ob-help-mark {
	font-family: var(--font-display, 'Cairo', serif);
	font-weight: 700;
	font-size: 1.35rem;
	line-height: 1;
}

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 480px) {
	.thk-ob-dialog { padding: 1.75rem 1.25rem 1.25rem; max-width: 100%; }
	.thk-ob-title { font-size: 1.25rem; }
	.thk-ob-icon { width: 66px; height: 66px; }
	.thk-ob-help { width: 42px; height: 42px; bottom: 0.9rem; inset-inline-end: 0.9rem; }
}

/* ============================================================
   Add-to-Home-Screen (A2HS) — a slim, calm bottom bar.
   Out of the way, dismissible, never blocks gameplay.
   ============================================================ */
.thk-a2hs {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1400; /* below the onboarding overlay (2000), above page chrome */
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.7rem 0.9rem;
	padding-bottom: calc(0.7rem + env(safe-area-inset-bottom, 0px));
	background: var(--color-surface, #103835);
	color: var(--color-text, #F2ECDD);
	border-top: 1px solid var(--color-line, #1F524D);
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.28);
	transform: translateY(110%);
	transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}
.thk-a2hs.is-in { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
	.thk-a2hs { transition: none; }
}

/* gold hairline along the top edge, on-brand */
.thk-a2hs::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 14%;
	right: 14%;
	height: 2px;
	border-radius: 0 0 4px 4px;
	background: linear-gradient(90deg, transparent, var(--thk-gold, #C8A24C), transparent);
}

.thk-a2hs-mark {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: var(--radius-md, 10px);
	color: var(--thk-gold, #C8A24C);
	background: radial-gradient(circle at 50% 35%, rgba(200, 162, 76, 0.16), rgba(200, 162, 76, 0.03) 70%);
	border: 1px solid var(--color-line, #1F524D);
}

.thk-a2hs-text {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	line-height: 1.4;
}
.thk-a2hs-title {
	font-family: var(--font-display, 'Cairo', serif);
	font-weight: 700;
	font-size: 0.92rem;
	color: var(--color-text, #F2ECDD);
}
.thk-a2hs-msg {
	font-size: 0.82rem;
	color: var(--color-text-secondary, #C9C2B2);
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.25rem;
}
.thk-a2hs-share {
	display: inline-flex;
	align-items: center;
	color: var(--thk-gold, #C8A24C);
	vertical-align: middle;
}

.thk-a2hs-actions {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}
.thk-a2hs-install { white-space: nowrap; }
.thk-a2hs-notnow {
	background: none;
	border: none;
	color: var(--color-text-muted, #9FC2BA);
	font-size: 0.82rem;
	cursor: pointer;
	padding: 0.35rem 0.45rem;
	border-radius: var(--radius-sm, 4px);
	white-space: nowrap;
}
.thk-a2hs-notnow:hover { color: var(--color-text, #F2ECDD); }
.thk-a2hs-notnow:focus-visible { outline: 2px solid var(--thk-gold, #C8A24C); outline-offset: 2px; }

.thk-a2hs-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: var(--radius-full, 50%);
	background: transparent;
	color: var(--color-text-muted, #9FC2BA);
	cursor: pointer;
	transition: background var(--transition-fast, 150ms ease), color var(--transition-fast, 150ms ease);
}
.thk-a2hs-close:hover { background: var(--color-surface-hover, #16433F); color: var(--color-text, #F2ECDD); }
.thk-a2hs-close:focus-visible { outline: 2px solid var(--thk-gold, #C8A24C); outline-offset: 2px; }

@media (max-width: 480px) {
	.thk-a2hs { gap: 0.55rem; padding-left: 0.7rem; padding-right: 0.7rem; }
	.thk-a2hs-mark { width: 34px; height: 34px; }
	.thk-a2hs-title { font-size: 0.86rem; }
	.thk-a2hs-msg { font-size: 0.78rem; }
	.thk-a2hs-notnow { display: none; } /* the X is enough on very small screens */
}
