/**
 * Wordle Stylesheet for EXS.LV
 */

#wordle-container {
	padding: 15px;
	background: #f8fafc;
	border-radius: 8px;
}

.wdl-wrapper {
	max-width: 500px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.wdl-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	margin-bottom: 15px;
}

.wdl-mode-selector {
	display: flex;
	gap: 6px;
}

.wdl-mode-btn {
	padding: 6px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #ffffff;
	font-weight: bold;
	font-size: 13px;
	color: #334155;
	cursor: pointer;
	transition: background 0.15s;
}

.wdl-mode-btn.active {
	background: #10b981;
	color: #ffffff;
	border-color: #059669;
}

.wdl-stats {
	display: flex;
	gap: 8px;
}

.wdl-stat-badge {
	background: #e2e8f0;
	padding: 6px 12px;
	border-radius: 6px;
	font-size: 13px;
	color: #334155;
}

/* Toast alert message */
.wdl-toast {
	position: fixed;
	top: 80px;
	left: 50%;
	transform: translateX(-50%) translateY(-20px);
	background: #0f172a;
	color: #ffffff;
	padding: 10px 20px;
	border-radius: 6px;
	font-weight: bold;
	font-size: 14px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s, transform 0.25s;
	z-index: 9999;
}

.wdl-toast.show {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* 6x5 Grid */
.wdl-grid-container {
	margin-bottom: 15px;
	user-select: none;
}

.wdl-grid {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.wdl-row {
	display: flex;
	gap: 6px;
}

.wdl-row.shake {
	animation: shakeRow 0.5s ease-in-out;
}

@keyframes shakeRow {
	0%, 100% { transform: translateX(0); }
	20%, 60% { transform: translateX(-6px); }
	40%, 80% { transform: translateX(6px); }
}

.wdl-tile {
	width: 52px;
	height: 52px;
	border: 2px solid #cbd5e1;
	border-radius: 4px;
	display: flex;
	justify-content: center;
	align-items: center;
	font-size: 26px;
	font-weight: 900;
	color: #0f172a;
	text-transform: uppercase;
	background: #ffffff;
	box-sizing: border-box;
	transition: transform 0.15s, background-color 0.2s, border-color 0.2s;
}

.wdl-tile.filled {
	border-color: #64748b;
}

.wdl-tile.pop {
	animation: tilePop 0.1s ease-in-out;
}

@keyframes tilePop {
	0% { transform: scale(1); }
	50% { transform: scale(1.12); }
	100% { transform: scale(1); }
}

.wdl-tile.flip {
	animation: tileFlip 0.5s ease-in-out forwards;
}

@keyframes tileFlip {
	0% { transform: rotateX(0deg); }
	50% { transform: rotateX(90deg); }
	100% { transform: rotateX(0deg); }
}

/* Tile Colors */
.wdl-tile.correct {
	background: #10b981 !important;
	border-color: #10b981 !important;
	color: #ffffff !important;
}

.wdl-tile.present {
	background: #f59e0b !important;
	border-color: #f59e0b !important;
	color: #ffffff !important;
}

.wdl-tile.absent {
	background: #64748b !important;
	border-color: #64748b !important;
	color: #ffffff !important;
}

/* Action Bar */
.wdl-action-bar {
	margin-bottom: 15px;
}

.wdl-btn {
	padding: 8px 16px;
	font-size: 14px;
	font-weight: bold;
	border-radius: 6px;
	border: 1px solid #3b82f6;
	background: #3b82f6;
	color: #ffffff;
	cursor: pointer;
	transition: background 0.15s;
}

.wdl-btn:hover {
	background: #2563eb;
}

/* Keyboard */
.wdl-keyboard {
	display: flex;
	flex-direction: column;
	gap: 6px;
	width: 100%;
	user-select: none;
}

.wdl-key-row {
	display: flex;
	justify-content: center;
	gap: 4px;
	width: 100%;
}

.wdl-key {
	height: 48px;
	padding: 0 8px;
	min-width: 28px;
	font-size: 14px;
	font-weight: bold;
	border-radius: 4px;
	border: 1px solid #cbd5e1;
	background: #e2e8f0;
	color: #0f172a;
	cursor: pointer;
	display: flex;
	justify-content: center;
	align-items: center;
	transition: background 0.15s, color 0.15s;
}

.wdl-key-wide {
	padding: 0 10px;
	font-size: 11px;
}

.wdl-key.correct {
	background: #10b981 !important;
	border-color: #10b981 !important;
	color: #ffffff !important;
}

.wdl-key.present {
	background: #f59e0b !important;
	border-color: #f59e0b !important;
	color: #ffffff !important;
}

.wdl-key.absent {
	background: #475569 !important;
	border-color: #475569 !important;
	color: #94a3b8 !important;
}

/* Guide Box */
.wdl-guide-box {
	margin-top: 20px;
	padding: 15px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	color: #475569;
	width: 100%;
	box-sizing: border-box;
}

.wdl-guide-box h4 {
	margin: 0 0 10px 0;
	color: #0f172a;
	font-size: 15px;
}

.wdl-guide-box ul {
	margin: 0;
	padding-left: 20px;
}

.wdl-guide-box li {
	margin-bottom: 6px;
	font-size: 13px;
}

.wdl-demo-tile {
	display: inline-block;
	width: 24px;
	height: 24px;
	line-height: 24px;
	text-align: center;
	font-weight: bold;
	border-radius: 4px;
	font-size: 13px;
}

.wdl-demo-tile.correct {
	background: #10b981;
	color: #fff;
}

.wdl-demo-tile.present {
	background: #f59e0b;
	color: #fff;
}

.wdl-demo-tile.absent {
	background: #64748b;
	color: #fff;
}

/* Responsive Scaling */
@media (max-width: 480px) {
	.wdl-tile {
		width: 42px;
		height: 42px;
		font-size: 20px;
	}

	.wdl-key {
		height: 42px;
		padding: 0 4px;
		min-width: 20px;
		font-size: 12px;
	}

	.wdl-key-wide {
		font-size: 10px;
		padding: 0 6px;
	}
}

/* Dark Mode Overrides */
@media (prefers-color-scheme: dark) {
	#wordle-container {
		background: #181c24;
	}

	.wdl-mode-btn {
		background: #252d3a;
		border-color: #3b4658;
		color: #e2e8f0;
	}

	.wdl-stat-badge {
		background: #252d3a;
		color: #cbd5e1;
	}

	.wdl-tile {
		background: #1e293b;
		border-color: #334155;
		color: #f8fafc;
	}

	.wdl-tile.filled {
		border-color: #94a3b8;
	}

	.wdl-key {
		background: #2d3748;
		border-color: #4a5568;
		color: #f8fafc;
	}

	.wdl-guide-box {
		background: #1e2430;
		border-color: #2e3848;
		color: #cbd5e1;
	}

	.wdl-guide-box h4 {
		color: #10b981;
	}
}
