/**
 * Five Letter Word Finder — frontend styles.
 * Clean & minimal, scoped under .flwf-wrap so it won't leak into themes.
 */

.flwf-wrap {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: #222;
	max-width: 600px;
	padding: 18px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
}

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

.flwf-title {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 600;
	color: #111;
}

.flwf-form {
	margin: 0 0 12px;
}

.flwf-row {
	display: flex;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.flwf-field {
	flex: 1 1 45%;
	min-width: 140px;
	display: flex;
	flex-direction: column;
}

.flwf-field-full {
	flex: 1 1 100%;
}

.flwf-field label {
	font-size: 13px;
	font-weight: 500;
	margin-bottom: 4px;
	color: #374151;
}

.flwf-input {
	padding: 8px 10px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	background: #fff;
	color: #111;
	outline: none;
	transition: border-color 0.15s, box-shadow 0.15s;
	width: 100%;
}

.flwf-input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* ─── Wordle-style tile section ─── */

.flwf-wordle-section {
	margin: 16px 0;
	padding: 12px;
	background: #f9fafb;
	border-radius: 6px;
}

.flwf-section-label {
	margin: 0 0 10px;
	font-size: 13px;
	color: #4b5563;
}

.flwf-tiles {
	display: flex;
	gap: 6px;
	justify-content: center;
	margin-bottom: 10px;
}

.flwf-tile {
	width: 48px;
	height: 48px;
	border: 2px solid #d1d5db;
	border-radius: 4px;
	position: relative;
	cursor: pointer;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.15s;
}

.flwf-tile-input {
	width: 100%;
	height: 100%;
	border: none;
	outline: none;
	background: transparent;
	text-align: center;
	font-size: 22px;
	font-weight: 700;
	text-transform: uppercase;
	color: inherit;
	font-family: inherit;
	padding: 0;
	cursor: pointer;
}

.flwf-tile[data-state="gray"] {
	background: #6b7280;
	border-color: #6b7280;
	color: #fff;
}

.flwf-tile[data-state="yellow"] {
	background: #eab308;
	border-color: #eab308;
	color: #fff;
}

.flwf-tile[data-state="green"] {
	background: #16a34a;
	border-color: #16a34a;
	color: #fff;
}

.flwf-hint {
	margin: 6px 0 0;
	font-size: 12px;
	text-align: center;
	color: #6b7280;
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

.flwf-legend::before {
	content: "";
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 2px;
	margin-right: 4px;
	vertical-align: middle;
}

.flwf-legend-gray::before   { background: #6b7280; }
.flwf-legend-yellow::before { background: #eab308; }
.flwf-legend-green::before  { background: #16a34a; }

/* ─── Buttons ─── */

.flwf-actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
}

.flwf-btn {
	padding: 9px 16px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	transition: background-color 0.15s, border-color 0.15s;
	font-family: inherit;
}

.flwf-btn-search {
	background: #111827;
	color: #fff;
}

.flwf-btn-search:hover {
	background: #1f2937;
}

.flwf-btn-reset {
	background: #fff;
	color: #374151;
	border-color: #d1d5db;
}

.flwf-btn-reset:hover {
	background: #f3f4f6;
}

.flwf-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* ─── Results ─── */

.flwf-results {
	margin-top: 14px;
}

.flwf-results-meta {
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 8px;
	min-height: 18px;
}

.flwf-results-meta.is-error {
	color: #b91c1c;
}

.flwf-results-list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.flwf-results-list li {
	background: #f3f4f6;
	color: #111;
	padding: 5px 10px;
	border-radius: 4px;
	font-size: 14px;
	font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	letter-spacing: 0.5px;
	text-transform: lowercase;
}

/* ─── Mobile ─── */

@media (max-width: 480px) {
	.flwf-wrap { padding: 14px; }
	.flwf-field { flex: 1 1 100%; }
	.flwf-tile { width: 42px; height: 42px; }
	.flwf-tile-input { font-size: 18px; }
}
