:root {
	--bg: #2b170b;
	--ember: #ff8a3d;
	--gold: #ffd166;
	--steel: #46535f;
	--ink: #23160f;
	--paper: #fff5df;
	--paper-dark: #f3dcb3;
	--smoke: rgba(64, 41, 25, 0.72);
}

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

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: 'Nunito', 'Segoe UI', sans-serif;
	color: var(--ink);
	background: radial-gradient(circle at 50% 100%, rgba(255, 138, 61, 0.42), transparent 38%),
		radial-gradient(circle at 16% 18%, rgba(255, 209, 102, 0.22), transparent 28%),
		linear-gradient(135deg, #2b170b 0%, #59331e 55%, #1e120a 100%);
}

button,
a {
	font: inherit;
}

.app-shell {
	min-height: 100vh;
	min-height: 100dvh;
	padding: clamp(1rem, 3vw, 2rem);
}

.toolbar,
.status-card,
.forge-panel,
.found-panel,
.bottom-actions {
	border: 2px solid rgba(255, 209, 102, 0.28);
	background: rgba(255, 245, 223, 0.92);
	box-shadow: 0 22px 60px rgba(18, 9, 4, 0.34);
}

.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-radius: 1.4rem;
	padding: 1rem 1.2rem;
}

.eyebrow {
	margin: 0 0 0.15rem;
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: #9d4c19;
}

h1,
h2,
p {
	margin: 0;
}

h1,
h2 {
	font-family: 'Fraunces', Georgia, serif;
}

h1 {
	font-size: clamp(2rem, 6vw, 3.3rem);
	line-height: 1;
}

h2 {
	font-size: 1.4rem;
}

.toolbar-actions,
.action-row,
.score-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
}

.bottom-actions {
	justify-content: center;
	margin: 1rem auto 0;
	border-radius: 1.2rem;
	padding: 1rem;
}

button,
#goBack {
	border: 0;
	border-radius: 999px;
	padding: 0.66rem 1rem;
	background: linear-gradient(135deg, #f97316, #b45309);
	color: #fffaf0;
	font-weight: 800;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 10px 18px rgba(180, 83, 9, 0.28);
}

button:hover,
button:focus-visible,
#goBack:hover,
#goBack:focus-visible {
	outline: none;
	transform: translateY(-2px);
	box-shadow: 0 14px 24px rgba(180, 83, 9, 0.34);
}

.status-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin: 1rem 0;
	border-radius: 1.2rem;
	padding: 1rem 1.2rem;
}

.score-row span {
	border-radius: 999px;
	padding: 0.5rem 0.8rem;
	background: rgba(255, 209, 102, 0.28);
	font-weight: 800;
	white-space: nowrap;
}

.forge-layout {
	display: grid;
	grid-template-columns: minmax(290px, 1fr) minmax(280px, 0.8fr);
	gap: 1rem;
}

.forge-panel,
.found-panel {
	border-radius: 1.4rem;
	padding: clamp(1rem, 3vw, 1.35rem);
}

.current-word {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 88px;
	margin-bottom: 1rem;
	border-radius: 1rem;
	background: linear-gradient(135deg, #3b2a20, #150c08);
	color: var(--gold);
	font-size: clamp(2rem, 8vw, 3.6rem);
	font-weight: 900;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	box-shadow: inset 0 0 28px rgba(255, 138, 61, 0.22);
}

.current-word:empty::before {
	content: 'Tap letters';
	font-size: 1rem;
	letter-spacing: 0.08em;
	color: rgba(255, 209, 102, 0.6);
}

.letter-tiles {
	display: grid;
	grid-template-columns: repeat(4, minmax(58px, 1fr));
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.tile {
	aspect-ratio: 1;
	border-radius: 1rem;
	background: linear-gradient(145deg, #fff9eb, #e7be78);
	color: #3a2112;
	font-size: clamp(1.9rem, 7vw, 3rem);
	box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 12px 0 #a76022;
	text-transform: uppercase;
}

.tile.used {
	opacity: 0.38;
	transform: translateY(8px);
	box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 4px 0 #8b521f;
}

.found-words {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem;
	margin-top: 1rem;
}

.found-words:empty::before {
	content: 'Your found words will appear here.';
	color: rgba(35, 22, 15, 0.62);
}

.word-chip {
	border-radius: 999px;
	padding: 0.5rem 0.72rem;
	background: rgba(255, 209, 102, 0.32);
	font-weight: 800;
	text-transform: uppercase;
}

.word-chip.secret {
	background: linear-gradient(135deg, #ffd166, #f97316);
	color: #2b170b;
}

#confettiLayer {
	position: fixed;
	inset: 0;
	pointer-events: none;
	z-index: 4;
}

.spark {
	position: absolute;
	top: -6vh;
	width: 10px;
	height: 18px;
	border-radius: 999px;
	animation: spark-fall var(--duration, 1600ms) linear forwards;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

@keyframes spark-fall {
	0% { opacity: 0; transform: translate3d(var(--x, 0), -6vh, 0) rotate(0deg); }
	10% { opacity: 1; }
	100% { opacity: 0; transform: translate3d(var(--x, 0), 110vh, 0) rotate(var(--spin, 520deg)); }
}

@media (max-width: 760px) {
	.app-shell {
		padding: 0.8rem;
	}

	.status-card {
		align-items: flex-start;
		flex-direction: column;
	}

	.bottom-actions {
		align-items: stretch;
		flex-direction: column;
	}

	.forge-layout {
		grid-template-columns: 1fr;
	}

	.letter-tiles {
		grid-template-columns: repeat(3, 1fr);
	}
}
@media (max-width: 560px) {
	.app-shell { padding: .5rem; }
	.toolbar { padding: .55rem .7rem; border-radius: 1.1rem; }
	.eyebrow { display: none; }
	h1 { font-size: clamp(1.45rem, 7vw, 2rem); }
	.status-card { gap: .45rem; margin: .5rem 0; padding: .6rem .7rem; border-radius: 1rem; }
	.forge-panel, .found-panel { border-radius: 1rem; padding: .65rem; }
	.current-word { min-height: 56px; margin-bottom: .55rem; border-radius: .8rem; }
	.letter-tiles { gap: .45rem; margin-bottom: .6rem; }
	.tile { border-radius: .8rem; }
}
#goBack{display:inline-flex;align-items:center;justify-content:center;text-align:center}
