@import url('https://fonts.googleapis.com/css2?family=BenchNine:wght@400;700&display=swap');

:root {
	--wf-ink: #1d2430;
	--wf-muted: #5b6575;
	--wf-line: #d7dde6;
	--wf-surface: #f6f8fb;
	--wf-panel: #ffffff;
	--wf-accent: #1aa7e0;
	--wf-accent-hover: #0f8fc4;
	--wf-wrong: #e6c200;
	--wf-right: #2f9e44;
	--wf-danger: #a10f0f;
	--wf-menu: #2f3542;
	--wf-radius: 10px;
	--wf-max: 42rem;
	--wf-touch: 44px;
}

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

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	padding: 0;
	color: var(--wf-ink);
	background:
		radial-gradient(circle at top left, rgba(26, 167, 224, 0.12), transparent 28rem),
		linear-gradient(180deg, #eef3f8 0%, #f8fafc 40%, #ffffff 100%);
	font-family: BenchNine, "Trebuchet MS", sans-serif;
	line-height: 1.35;
	min-height: 100vh;
}

p {
	text-align: left;
	color: var(--wf-muted);
	font-size: 1.15rem;
	line-height: 1.45;
	margin: 0.65rem 0;
}

div, button, select, input, h1, h2, h3, h4, h5, h6, a, li {
	font-family: BenchNine, "Trebuchet MS", sans-serif;
}

h1, h2, h3, h4, h5, h6 {
	text-align: center;
	margin: 0.4rem 0;
	letter-spacing: 0.02em;
	color: var(--wf-ink);
}

h1 {
	font-size: clamp(2rem, 6vw, 2.8rem);
	font-weight: 700;
}

h1 i {
	font-style: normal;
	color: var(--wf-accent);
}

h2 {
	font-size: clamp(1.55rem, 4vw, 2rem);
}

h3 {
	font-size: clamp(1.25rem, 3.5vw, 1.6rem);
	color: var(--wf-muted);
	font-weight: 400;
}

ul {
	margin: 0.25rem;
	padding: 0.25rem;
}

li {
	list-style: none;
}

a {
	color: var(--wf-accent-hover);
}

.container {
	min-height: 100vh;
}

#Main,
.content-wrap {
	text-align: center;
	padding: 0.75rem 0.85rem 2.5rem;
}

#Top,
#MainWelcome,
#FooterMenu,
#Bottom {
	width: 100%;
	max-width: var(--wf-max);
	margin-left: auto;
	margin-right: auto;
}

#TopCenter {
	background: var(--wf-panel);
	border: 1px solid var(--wf-line);
	border-radius: calc(var(--wf-radius) + 4px);
	padding: 1rem 1rem 1.15rem;
	box-shadow: 0 10px 28px rgba(29, 36, 48, 0.06);
}

.finder-brand {
	margin-bottom: 0.35rem;
}

.finder-controls {
	display: grid;
	gap: 0.75rem;
	margin-top: 0.85rem;
	text-align: left;
}

.control-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
}

.control-row label {
	font-size: 1.15rem;
	color: var(--wf-muted);
}

#InstructionsLink {
	margin: 0.35rem 0 0.6rem;
}

#InstructionsLink a {
	font-size: 1.05rem;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.ErrorClass {
	color: var(--wf-danger);
	font-weight: 700;
	font-size: 1.15rem;
}

#MainWelcome {
	margin-top: 1.25rem;
	padding: 1rem 1.1rem 1.2rem;
	background: rgba(255, 255, 255, 0.78);
	border: 1px solid var(--wf-line);
	border-radius: var(--wf-radius);
	text-align: left;
}

#MainWelcome h2 {
	text-align: left;
	margin-top: 0.9rem;
}

#MainWelcome h2:first-child {
	margin-top: 0;
}

#FooterMenu {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.35rem 0.85rem;
	padding: 1.25rem 0.75rem 2rem;
}

#FooterMenu li {
	display: inline-block;
	margin: 0;
}

.ButtonStyle,
.ButtonStyleSmall,
.Nav {
	appearance: none;
	border: 0;
	background: var(--wf-accent);
	color: #fff;
	font-weight: 700;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.ButtonStyle {
	min-height: var(--wf-touch);
	padding: 0.45rem 0.95rem;
	font-size: 1.2rem;
	margin: 0;
}

.ButtonStyleSmall {
	min-height: 2.25rem;
	padding: 0.35rem 0.7rem;
	font-size: 0.95rem;
	margin: 0;
}

.ButtonStyle:hover,
.ButtonStyleSmall:hover,
.Nav:hover {
	background: var(--wf-accent-hover);
}

.ButtonStyle:active,
.ButtonStyleSmall:active {
	transform: translateY(1px);
}

select.ButtonStyle,
select.ButtonStyleSmall {
	padding-right: 1.5rem;
}

.Margin10 {
	margin: 0;
}

#UsedWord,
#Letters {
	height: var(--wf-touch);
	font-size: 1.25rem;
	min-width: 7.5rem;
	padding: 0.35rem 0.55rem;
	border: 1px solid var(--wf-line);
	border-radius: 8px;
	text-align: center;
	text-transform: uppercase;
}

#PuzzlesOptions,
#PuzzlesNum {
	font-size: 1.2rem;
}

#ClearWordList {
	margin-left: 0;
}

#WordAdd {
	justify-content: center;
}

#Inline-key {
	display: none;
	margin-top: 0.85rem;
	padding-top: 0.85rem;
	border-top: 1px solid var(--wf-line);
}

#Inline-key .key-help {
	color: var(--wf-muted);
	font-size: 1.05rem;
	margin-bottom: 0.45rem;
}

#Inline-key .key-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.55rem 0.9rem;
	font-size: 1.05rem;
	margin-bottom: 0.75rem;
}

#ButtonRow {
	text-align: center;
	position: sticky;
	bottom: 0.65rem;
	z-index: 20;
	padding: 0.35rem 0;
}

#ButtonRow .ButtonStyle {
	min-width: 10rem;
	box-shadow: 0 8px 20px rgba(26, 167, 224, 0.28);
}

.LetterBoxesCell {
	margin: 0.2rem;
	text-align: center;
	display: inline-block;
}

.LetterBoxes {
	font-size: 1.5rem;
	height: var(--wf-touch);
	width: 2.4rem;
	margin: 0.15rem;
	text-align: center;
	text-transform: uppercase;
	border: 1px solid var(--wf-line);
	border-radius: 8px;
}

#Puzzles {
	margin-top: 1rem;
	display: flex;
	flex-flow: row wrap;
	justify-content: center;
	gap: 0.65rem;
}

.Puzzle {
	border: 1px solid var(--wf-line);
	background: var(--wf-panel);
	border-radius: var(--wf-radius);
	padding: 0.65rem 0.7rem 0.8rem;
	margin: 0;
	box-shadow: 0 6px 16px rgba(29, 36, 48, 0.05);
}

.Puzzle h4 {
	margin: 0 0 0.45rem;
	font-size: 1.25rem;
}

.PuzzleWord {
	display: flex;
	justify-content: center;
	gap: 0.2rem;
	margin: 0.2rem 0;
}

.CharCell {
	display: block;
}

.Char {
	margin: 0;
	padding: 0;
	font-size: clamp(1.45rem, 4.5vw, 2rem);
	border: 1px solid #9aa7b8;
	border-radius: 6px;
	text-align: center;
	min-width: 2.15rem;
	min-height: 2.15rem;
	line-height: 2.15rem;
	cursor: pointer;
	user-select: none;
	background: #fff;
	transition: background 0.12s ease, color 0.12s ease;
}

.Char:hover {
	border-color: var(--wf-accent);
}

.CharIndex {
	display: table-cell;
	padding: 3px;
	height: 10px;
	width: 15px;
	border: solid black 1px;
}

.IndexRow {
	height: 20px;
	vertical-align: middle;
	display: table-row;
}

.IndexText {
	display: table-cell;
	padding-left: 5px;
}

.GoodLetterWrongPlaceKey {
	color: var(--wf-wrong);
}

.GoodLetterRightPlaceKey {
	color: var(--wf-right);
}

.GoodLetterWrongPlace {
	background-color: var(--wf-wrong);
	color: #1d2430;
}

.GoodLetterRightPlace {
	background-color: var(--wf-right);
	color: #fff;
}

.FoundWordsHeader {
	margin: 1rem auto;
	max-width: var(--wf-max);
	text-align: left;
}

.FoundWordsTitle {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.35rem 0.15rem;
	font-size: 1.45rem;
	max-height: none;
}

.FoundWordCount {
	padding-left: 0;
	font-size: 1rem;
	color: var(--wf-muted);
}

.NavWrap {
	display: inline-flex;
	gap: 0.35rem;
	float: none;
}

.Nav {
	padding: 0;
	height: 2.25rem;
	width: 2.25rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.FoundWordsWrapper {
	display: flex;
	flex-flow: row wrap;
	justify-content: flex-start;
	gap: 0.35rem 0.55rem;
	border: 1px solid var(--wf-line);
	background: var(--wf-surface);
	border-radius: var(--wf-radius);
	margin: 0.5rem 0 0.85rem;
	padding: 0.75rem;
}

.FoundWords {
	margin: 0;
	padding: 0.25rem 0.45rem;
	font-size: 1.15rem;
	background: #fff;
	border: 1px solid var(--wf-line);
	border-radius: 6px;
	letter-spacing: 0.04em;
}

.DailyUsed {
	color: var(--wf-danger);
	font-style: italic;
	border-color: #efb4b4;
	background: #fff5f5;
}

.PuzzleWordsHeader h4 {
	display: inline-block;
}

.LinkList {
	column-count: 2;
}

.LinkList li,
.LinkListSingle li {
	margin: 10px;
}

.TwoColums {
	column-count: 2;
}

/* Simple modal (replaces jQuery UI dialog) */
.wf-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 2000;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.wf-modal.is-open {
	display: flex;
}

.wf-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(20, 26, 36, 0.55);
}

.wf-modal-panel {
	position: relative;
	z-index: 1;
	width: min(100%, 22rem);
	max-height: min(80vh, 32rem);
	overflow: auto;
	background: #fff;
	border-radius: 12px;
	padding: 1rem 1rem 1.1rem;
	box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
	text-align: left;
}

.wf-modal-panel h3 {
	text-align: left;
	margin: 0 0 0.65rem;
}

.wf-modal-panel ul {
	margin: 0.6rem 0;
}

.wf-modal-panel li {
	margin: 0.35rem 0;
	font-size: 1.1rem;
}

.wf-modal-actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 0.9rem;
}

body.modal-open {
	overflow: hidden;
}

#Instructions,
#ErrorAlertPop {
	display: none;
}

/* Side menu */
.menu-wrap a {
	color: #c9cdd6;
	text-decoration: none;
}

.menu-wrap a:hover,
.menu-wrap a:focus {
	color: #7fd4f5;
}

.menu-button {
	position: fixed;
	z-index: 1000;
	top: 0.55rem;
	left: 0.55rem;
	margin: 0;
	padding: 0.45rem;
	min-width: var(--wf-touch);
	min-height: var(--wf-touch);
	border: none;
	color: var(--wf-ink);
	background: rgba(255, 255, 255, 0.85);
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(29, 36, 48, 0.12);
}

.menu-button:hover {
	opacity: 0.85;
}

.close-button {
	position: absolute;
	right: 1em;
	top: 1em;
	overflow: hidden;
	border: none;
	background: transparent;
	color: white;
	cursor: pointer;
}

.MenuHeaders {
	color: white;
	margin: 0.75rem 0 0.25rem;
	text-align: left;
}

.menu-wrap {
	position: fixed;
	z-index: 1001;
	top: 0;
	left: 0;
	width: min(300px, 86vw);
	height: 100%;
	background: var(--wf-menu);
	padding: 2.5em 1.5em 0;
	font-size: 1.15em;
	transform: translate3d(-105%, 0, 0);
	transition: transform 0.35s cubic-bezier(0.7, 0, 0.3, 1);
	overflow: auto;
}

.menu,
.icon-list {
	height: auto;
}

.icon-list {
	transform: none;
}

.icon-list li {
	display: block;
	padding: 0.45em 0.2em;
	transform: none;
	transition: none;
}

.icon-list a span {
	margin-left: 0;
	font-weight: 700;
}

.show-menu .menu-wrap {
	transform: translate3d(0, 0, 0);
}

.show-menu .icon-list,
.show-menu .icon-list li {
	transform: none;
}

@media screen and (min-width: 700px) {
	:root {
		--wf-max: 44rem;
	}

	#TopCenter {
		padding: 1.25rem 1.35rem 1.4rem;
	}

	.Char {
		min-width: 2.4rem;
		min-height: 2.4rem;
		line-height: 2.4rem;
	}
}

@media screen and (min-width: 1000px) {
	:root {
		--wf-max: 48rem;
	}
}

@media print {
	body {
		background: #fff;
	}

	.menu-button,
	.menu-wrap,
	#ButtonRow {
		position: static;
		box-shadow: none;
	}

	#Top,
	#MainWelcome,
	#FooterMenu {
		max-width: 1000px !important;
		padding: 10px;
		margin: auto;
	}
}
