/* =========================================
   1. GLOBAL & RESET
   ========================================= */
@charset "UTF-8";

body,
html {
	height: 100%;
	margin: 0;
	overflow: hidden;
	font-family: var(--font-all);
	-webkit-font-smoothing: antialiased;
	background-color: #000000 !important;
	color: var(--neon-cyan);
}

/* =========================================
   2. APP LAYOUT
   ========================================= */
.app-container {
	display: flex;
	flex-direction: column;
	height: 100dvh;
	max-width: 600px;
	margin: 0 auto;
	background-color: var(--bg-main) !important;
	border-left: 1px solid #222;
	border-right: 1px solid #222;
	position: relative;
}

header.main-header,
.main-header {
	height: var(--header-height);
	background-color: var(--bg-header) !important;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2px;
	border-bottom: 2px solid var(--topic-line);
	/* Consolidated styling rule */
	flex-shrink: 0;
}

.header-side {
	flex: 1;
	min-width: 60px;
}

.header-center {
	flex: 2;
}

.main-title {
	font-family: var(--font-all);
	font-weight: 600;
	font-size: 1.8rem;
	text-transform: uppercase;
	color: var(--neon-cyan) !important;
	text-decoration: none;
	letter-spacing: 8px;
}

.italic-le {
	font-family: var(--font-all);
	font-weight: 600;
	font-size: 1.8rem;
	text-transform: uppercase;
	color: var(--neon-grey) !important;
	text-decoration: none;
	letter-spacing: 8px;
}

.le {
	color: var(--neon-grey) !important;
}

.edition-subtitle {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 2px;
	margin-top: 0px;
	color: var(--topic-text) !important;
}

.line-height-1 {
	line-height: 1;
}

.header-side i,
.logo-text {
	color: var(--neon-cyan) !important;
}

.team-banner {
	background-color: var(--bg-strap);
	color: var(--topic-text) !important;
	text-align: center;
	padding: 6px 0;
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	border-top: 2px solid var(--topic-line, var(--neon-cyan));
	border-bottom: 2px solid var(--topic-line, var(--neon-cyan));
	position: relative;
	z-index: 1;
}

.game-toolbar,
#game-toolbar {
	display: flex;
	background-color: var(--bg-strap);
	color: var(--topic-text) !important;
	text-align: center;
	padding: 6px;
	font-size: 0.9rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 1px;
	position: relative;
	z-index: 1;
	border: none !important;
	margin-bottom: 1px !important;
}

.dropdown {
	text-transform: uppercase;
}

.dropdown-menu {
	background-color: var(--bg-header);
	border: 1px solid var(--neon-cyan);
}

.dropdown-menu .dropdown-item {
	color: #ffffff;
	padding: 10px 20px;
}

.dropdown-menu .dropdown-item:hover {
	background-color: var(--bg-strap);
	color: var(--topic-text);
}

.dropdown-menu .dropdown-item.strike {
	opacity: 0.5;
}

/* =========================================
   3. GAME BOARD & ELEMENTS
   ========================================= */
main#game-container {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	padding: 4px;
	overflow: visible !important;
	background-color: transparent !important;
}

.letter-row {
	display: flex;
	justify-content: center;
	gap: 2px;
	width: 100%;
}

.letter-box {
	flex: 1;
	aspect-ratio: 1 / 1;
	gap: 1px;
	max-width: 60px;
	min-width: 0;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	text-transform: uppercase;
	font-size: clamp(1rem, 4vw, 2rem);
	line-height: 1;
	background-color: var(--letterbox-bg);
	border: 1px solid var(--neon-cyan);
	color: var(--neon-cyan);
	background-clip: padding-box;
	transition: all 0.3s ease;
	border-radius: var(--radius);
}

.letter-box.is-clue {
	border-color: var(--key-clue) !important;
	color: var(--key-clue) !important;
}

.strike {
	text-decoration: line-through;
}

/* Typing Animation */
.letter-box.pop {
	animation: pop 0.1s ease-in-out;
}

@keyframes pop {
	0% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.08);
	}

	100% {
		transform: scale(1);
	}
}

/* =========================================
   4. KEYBOARD
   ========================================= */
.footer {
	padding: 1px;
	padding-bottom: calc(5px + env(safe-area-inset-bottom));
	background-color: var(--bg-strap);
	flex-shrink: 0;
}

.color-separator {
	height: 1px;
	background-color: var(--topic-line);
	width: 100%;
	margin-bottom: 2px;
}

.keyboard-row {
	display: flex;
	justify-content: center;
	gap: 2px;
	padding: 0 2px;
	margin-bottom: 2px;
	border-radius: var(--radius);
}

.key {
	flex: 1;
	height: 45px;
	max-width: 45px;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: var(--key-bg-normal);
	color: var(--key-normal);
	border: 1px solid var(--key-border);
	border-radius: var(--radius);
	font-family: var(--font-all);
	font-weight: 700;
	font-size: 1.5rem;
	text-transform: uppercase;
	cursor: pointer;
	transition: all 0.2s;
	padding-top: 1px;
	/* Mobile Accessibility & Disables Selection */
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
}

.key.del,
.key.clue,
.key.enter {
	flex: 1.5;
	font-size: 0.8rem;
	background-color: var(--key-bg-long);
	padding-top: 0px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.key.del {
	max-width: 70px;
	background-color: var(--key-bg-del);
}

.key.enter {
	max-width: 70px;
	background-color: var(--key-bg-enter);
}

.key.correct {
	background-color: var(--green) !important;
	color: white !important;
	border: none;
}

.key.present {
	background-color: var(--yellow) !important;
	color: white !important;
	border: none;
}

.key.absent {
	background-color: var(--gray) !important;
	color: #888 !important;
	border: none;
}

.key.del {
	color: var(--key-del);
	border-color: var(--key-del);
}

.key.clue {
	color: var(--key-clue);
	border-color: var(--key-clue);
}

.key.enter {
	color: var(--key-enter);
	border-color: var(--key-enter);
}

/* =========================================
   5. MODALS & CLUES
   ========================================= */
.modal-backdrop {
	background-color: rgba(0, 0, 0, 0.85) !important;
	z-index: 1050 !important;
}

.modal {
	z-index: 1060 !important;
	text-transform: uppercase;
}

.modal.show {
	display: block !important;
}

.white {
	color: #fff;
}

.modal-title {}

.modal-name {
	letter-spacing: 8px;
}

.text-cyan {
	color: var(--neon-cyan);
}

.modal-content {
	background-color: var(--bg-main) !important;
	border: 2px solid var(--neon-cyan) !important;
	border-radius: var(--radius) !important;
	color: var(--neon-cyan) !important;
}

.clue-box {
	border: 1px solid var(--neon-cyan);
	background: rgba(0, 255, 255, 0.05);
	padding: 10px 15px;
	font-family: var(--font-all);
	font-size: 0.9rem;
	color: #fff;
	text-transform: uppercase;
	max-width: 90%;
	margin: 0 auto;
}

/* =========================================
   6. UTILITIES / ANIMATIONS
   ========================================= */
.shake {
	display: inline-block;
	/* Essential for flawless box/transform mechanics */
	animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

	10%,
	90% {
		transform: translate3d(-2px, 1px, 0);
	}

	20%,
	80% {
		transform: translate3d(3px, -3px, 0);
	}

	30%,
	50%,
	70% {
		transform: translate3d(-5px, 4px, 0);
	}

	40%,
	60% {
		transform: translate3d(4px, -2px, 0);
	}
}

.letter-row {
	line-height: 0;
	/* Prevents text-based vertical spacing */
	margin: 0;
	/* Prevents any legacy margins */
}

.letter-box {
	margin: 0;
	/* Ensures the JS gap logic is the only thing controlling space */
	padding: 0;
}

#game-board {
	display: flex !important;
	flex-direction: column !important;
	justify-content: flex-start !important;
	/* Forces rows to the top */
	align-items: center !important;
	gap: 4px !important;
	height: auto !important;
	/* Prevents the board from stretching to fill the screen */
	margin: 0 auto !important;
}

.letter-row {
	display: flex !important;
	flex-direction: row !important;
	justify-content: center !important;
	gap: 4px !important;
	/* MUST MATCH vertical gap */
	width: 100% !important;
	margin: 0 !important;
	line-height: 0 !important;
}

.letter-box {
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

.mobile-clue-badge {
	background-color: #ff4757;
	color: #ffffff;
	font-size: 0.8rem;
	font-weight: bold;
	padding: 2px 8px;
	border-radius: 12px;
	display: inline-block;
	line-height: 1.2;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#clue-btn {
	position: relative;
	animation: cluePulse 1.5s infinite ease-in-out;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.2s ease;
}

#clue-btn:active {
	transform: scale(0.95) !important;
}

@keyframes cluePulse {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.05);
	}
}