:root {
	--bg: #080d1f;
	--panel: rgba(17, 28, 64, 0.78);
	--panel-strong: rgba(21, 35, 81, 0.95);
	--line: rgba(132, 244, 255, 0.26);
	--ink: #eef8ff;
	--muted: #9eb7d8;
	--accent: #68e1fd;
	--hot: #ff4fd8;
	--success: #7dffb2;
	--warning: #ffd166;
}

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

body {
	margin: 0;
	min-height: 100vh;
	min-height: 100dvh;
	font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
	color: var(--ink);
	background: radial-gradient(circle at 15% 10%, rgba(104, 225, 253, 0.25), transparent 28%),
		radial-gradient(circle at 82% 20%, rgba(255, 79, 216, 0.18), transparent 28%),
		linear-gradient(135deg, #060816 0%, #101934 55%, #080d1f 100%);
}

button,
a {
	font: inherit;
}

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

.app-shell::before {
	content: '';
	position: fixed;
	inset: 0;
	background-image: linear-gradient(rgba(104, 225, 253, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(104, 225, 253, 0.05) 1px, transparent 1px);
	background-size: 44px 44px;
	pointer-events: none;
}

.toolbar,
.mission-card,
.decoder-panel,
.history-panel,
.bottom-actions {
	position: relative;
	border: 1px solid var(--line);
	background: var(--panel);
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(16px);
}

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

.eyebrow,
.label {
	margin: 0;
	color: var(--accent);
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.22em;
	text-transform: uppercase;
}

h1,
h2,
p {
	margin: 0;
}

h1 {
	font-size: clamp(1.8rem, 5vw, 3rem);
	line-height: 1;
}

h2 {
	font-size: 1rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

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

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

button,
#goBack {
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
	padding: 0.65rem 1rem;
	background: linear-gradient(135deg, rgba(104, 225, 253, 0.22), rgba(255, 79, 216, 0.18));
	color: var(--ink);
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

button:hover,
button:focus-visible,
#goBack:hover,
#goBack:focus-visible {
	outline: none;
	transform: translateY(-2px);
	border-color: rgba(104, 225, 253, 0.8);
}

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

#missionText {
	margin-top: 0.2rem;
	color: var(--muted);
}

.score-chip {
	white-space: nowrap;
	border-radius: 999px;
	padding: 0.6rem 0.85rem;
	background: rgba(104, 225, 253, 0.13);
	color: var(--accent);
	font-weight: 700;
}

.game-layout {
	display: grid;
	grid-template-columns: minmax(280px, 0.85fr) minmax(320px, 1.15fr);
	gap: 1rem;
}

.decoder-panel,
.history-panel {
	border-radius: 1.5rem;
	padding: clamp(1rem, 3vw, 1.4rem);
}

.current-guess {
	display: grid;
	grid-template-columns: repeat(3, minmax(54px, 1fr));
	gap: 0.7rem;
	margin-bottom: 1rem;
}

.guess-slot,
.symbol-button,
.history-symbol {
	display: grid;
	place-items: center;
	border-radius: 1rem;
	aspect-ratio: 1;
	font-size: clamp(1.8rem, 8vw, 2.7rem);
}

.guess-slot {
	border: 1px dashed rgba(238, 248, 255, 0.28);
	background: rgba(255, 255, 255, 0.05);
}

.guess-slot.filled {
	border-style: solid;
	background: var(--panel-strong);
	box-shadow: inset 0 0 24px rgba(104, 225, 253, 0.12);
}

.symbol-bank {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0.7rem;
	margin-bottom: 0.85rem;
}

.symbol-button {
	border-radius: 1.1rem;
	padding: 0;
	background: rgba(255, 255, 255, 0.08);
}

.scan-help {
	margin: 0 0 1rem;
	color: var(--muted);
	font-size: 0.9rem;
	line-height: 1.45;
}

.scan-help strong {
	color: var(--accent);
}

.history-panel {
	min-height: 430px;
}

.history-list {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	margin-top: 1rem;
}

.history-empty {
	color: var(--muted);
	padding: 2rem 0;
	text-align: center;
}

.history-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.8rem;
	align-items: center;
	border-radius: 1rem;
	padding: 0.75rem;
	background: rgba(255, 255, 255, 0.06);
}

.history-code {
	display: grid;
	grid-template-columns: repeat(3, minmax(42px, 1fr));
	gap: 0.45rem;
}

.history-symbol {
	font-size: 1.45rem;
	background: rgba(255, 255, 255, 0.08);
}

.feedback {
	display: grid;
	gap: 0.3rem;
	min-width: 150px;
	color: var(--muted);
	font-size: 0.88rem;
	font-weight: 700;
}

.feedback strong {
	color: var(--success);
}

.feedback span:last-child strong {
	color: var(--warning);
}

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

.confetti-piece {
	position: absolute;
	top: -8vh;
	width: 12px;
	height: 20px;
	border-radius: 999px;
	animation: confetti-fall var(--duration, 1800ms) 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 confetti-fall {
	0% { opacity: 0; transform: translate3d(var(--x, 0), -8vh, 0) rotate(0deg); }
	10% { opacity: 1; }
	100% { opacity: 0; transform: translate3d(var(--x, 0), 112vh, 0) rotate(var(--spin, 540deg)); }
}

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

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

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

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

	.history-panel {
		min-height: auto;
	}
}
@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); }
	.mission-card { gap: .4rem; margin: .45rem 0; padding: .5rem .6rem; border-radius: 1rem; }
	.decoder-panel, .history-panel { border-radius: 1rem; padding: .55rem; }
	.current-guess, .symbol-bank { gap: .45rem; margin-bottom: .55rem; }
	.guess-slot, .symbol-button { border-radius: .75rem; font-size: clamp(1.55rem, 7vw, 2.15rem); }
	.history-symbol { border-radius: .7rem; font-size: 1.15rem; }
	.scan-help { display: none; }
	.action-row, .bottom-actions { flex-direction: row; gap: .42rem; }
	.bottom-actions { align-items: center; margin-top: .5rem; padding: .55rem; }
	.bottom-actions button, .bottom-actions #goBack { flex: 1 1 7rem; }
	.action-row button, .bottom-actions button, #goBack { padding: .55rem .7rem; }
	.history-panel h2 { font-size: .82rem; }
	.history-list { gap: .4rem; margin-top: .45rem; }
	.history-row { gap: .45rem; padding: .45rem; border-radius: .75rem; }
}
#goBack{display:inline-flex;align-items:center;justify-content:center;text-align:center}
