/*
 * Sedecordle facelift, using the Word Nerd (wordnerd.co) look.
 * Based on wordnerd.co assets/common.css, style.css and assets/keyboard.css,
 * changed to fit this page (theme vars moved to :root, the wordnerd
 * `.button` renamed to `.btn` because `.button` sizes the board tiles here).
 */
@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

/* ---------- Theming (wordnerd common.css) ---------- */
:root {
	--background-color: #ebe8e0;
	--card-color: #f5f5f5;
	--text-color: #333333;
	--border-color: #00000022;
	--black: #000000;
	--white: #ffffff;
	--yellow: #fbda03;
	--green: #58a351;
	--muted: #a2a2a2;

	/* Game colors */
	--tile-bg: var(--card-color);
	--tile-border: #00000026;
	/* Tile state colors copied from septle.com main.css */
	--tile-green: #79b851;
	--tile-yellow: #f3c237;
	--tile-absent: #a4aec4;
	--tile-hit-text: #ffffff;
	--tile-gray: #a4aec4;
	--logo-text: #1a1a1b;
	--tile-typed-border: #878a8c;
	--invalid: #e5484d;
	--key-bg: #e2ded3;
	--key-used: var(--tile-absent);
	--key-used-text: #ffffff;
	--win-bg: #d6ead2;
	--loss-bg: #f1d5d1;
	color-scheme: light;
}

:root.theme-dark {
	--background-color: #121212;
	--card-color: #1e1e1e;
	--text-color: #ccc;
	--border-color: #ffffff22;
	--black: #ffffff;
	--white: #000000;

	--tile-border: #ffffff26;
	--tile-absent: #3d4054;
	--tile-gray: #818384;
	--tile-typed-border: #565758;
	--key-bg: #2c2c2c;
	--win-bg: #1b3320;
	--loss-bg: #3a1c1c;
	color-scheme: dark;
}

html,
body {
	background: var(--background-color);
	color: var(--text-color);
	height: 100%;
}

* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
	font-family: 'Source Sans 3', sans-serif;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

h1,
h2,
h3 {
	font-weight: 700 !important;
}

body {
	font-size: 1.375rem;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
	font-weight: 600;
	text-align: center;
	touch-action: manipulation;
}

a {
	color: inherit;
	text-decoration: none;
}

.hidden {
	display: none !important;
}

@media (max-width: 500px) {
	html {
		font-size: 80%;
	}
}

/* ---------- Page container ---------- */
#body {
	max-width: 550px;
	margin: auto;
	height: 100%;
	display: flex;
	padding: 10px;
}

.body-ios {
	height: calc(100% - 25px) !important;
	bottom: 25px;
}

/* ---------- Header (wordnerd .header, Dec 2025) ---------- */
.header {
	background-color: var(--card-color);
	margin-bottom: 10px;
	padding: 10px;
	border-radius: 10px;
	position: relative;
	height: 60px;
	color: var(--text-color);
	border: 0.5px solid var(--border-color);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex: 0 0 auto;
	font-size: 1.375rem;
}

.header .title {
	font-family: "Bungee", sans-serif;
	font-weight: 400;
	font-size: 1.5rem;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-wrap: nowrap;
	white-space: nowrap;
	pointer-events: none;
}

.header .group {
	display: flex;
	gap: 6px;
	z-index: 1;
}

.hbtn {
	border-radius: 25%;
	background: var(--background-color);
	border: none;
	cursor: pointer;
	font-size: 1.25rem;
	height: 40px;
	width: 40px;
	display: flex;
	justify-content: center;
	align-items: center;
	color: var(--text-color);
	flex: 0 0 auto;
}

.hbtn:hover {
	filter: brightness(95%);
}

.theme-dark .hbtn:hover {
	filter: brightness(130%);
}

/* ---------- Cards / buttons (wordnerd common.css + style.css) ---------- */
.card {
	background: var(--card-color);
	color: var(--text-color);
	border-radius: 10px;
	padding: 15px;
	border: 0.5px solid var(--border-color);
	width: 100%;
	margin: 0 auto 15px;
	display: block;
}

.btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 10px 15px;
	color: var(--text-color);
	background: var(--background-color);
	border-radius: 10px;
	border: none;
	border-bottom: 5px solid rgba(0, 0, 0, .1);
	cursor: pointer;
	font-size: 1.25rem;
	font-weight: 600;
	text-align: center;
	-webkit-tap-highlight-color: transparent;
}

.btn:hover {
	filter: invert(10%);
}

.btn.playnow {
	background: var(--green) !important;
	color: white !important;
}

/* ---------- Title screen ---------- */
#title {
	margin: 0 auto;
	flex: 1;
	width: 100%;
	max-width: 500px;
}

.logo-row {
	display: flex;
	gap: 4px;
	justify-content: center;
	margin: 10px auto 12px;
	width: 100%;
	max-width: 420px;
}

.logo-row .logo-tile {
	flex: 1;
	aspect-ratio: 1;
	border-radius: 7px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--logo-text);
	font-weight: 800;
	font-size: clamp(1rem, 5.5vw, 1.75rem);
	overflow: hidden;
}

.title-tools {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 20px;
}

.title-tools .hbtn {
	background: var(--card-color);
	border: 0.5px solid var(--border-color);
}

.mode {
	text-align: left;
}

.mode h2 {
	font-size: 1.5rem;
	margin-bottom: 2px;
}

.mode h2 i {
	margin-right: 6px;
	font-size: 1.25rem;
}

.mode .mode-desc {
	font-size: 1.05rem;
	color: var(--muted);
	margin-bottom: 12px;
	font-weight: 600;
}

.mode-actions {
	display: flex;
	gap: 8px;
}

.mode-actions .btn {
	flex: 1;
	min-width: 0;
	gap: 8px;
	padding: 10px 8px;
}

@media (max-width: 340px) {
	.mode-actions .btn {
		font-size: 1.1rem;
		gap: 6px;
	}
}

.mode .new-tag {
	font-size: 0.8rem;
	background: var(--green);
	color: white;
	border-radius: 999px;
	padding: 1px 8px;
	vertical-align: middle;
	margin-left: 6px;
}

.other-game .mode-desc {
	margin-bottom: 2px;
}

.other-game h2 {
	margin-bottom: 12px;
}

.btn.share,
.btn.other-game-btn {
	background: #007AFF;
	color: white;
	text-decoration: none;
}

.site-footer {
	font-size: 1rem;
	padding: 30px 0 40px;
	color: var(--muted);
}

.site-footer a {
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Quad-colored logo tiles ---------- */
.bg-quad {
	color: var(--logo-text);
	background-size: 51% 51%;
	background-position: 0% 0%, 0% 100%, 100% 0%, 100% 100%;
	background-repeat: no-repeat;
}

.bg11 { background-image: linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-yellow), var(--tile-yellow)), linear-gradient(var(--tile-green), var(--tile-green)), linear-gradient(var(--tile-yellow), var(--tile-yellow)); }
.bg22 { background-image: linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-green), var(--tile-green)), linear-gradient(var(--tile-green), var(--tile-green)); }
.bg33 { background-image: linear-gradient(var(--tile-green), var(--tile-green)), linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-yellow), var(--tile-yellow)), linear-gradient(var(--tile-green), var(--tile-green)); }
.bg44 { background-image: linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-yellow), var(--tile-yellow)), linear-gradient(var(--tile-yellow), var(--tile-yellow)), linear-gradient(var(--tile-gray), var(--tile-gray)); }
.bg55 { background-image: linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-green), var(--tile-green)), linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-gray), var(--tile-gray)); }
.bg66 { background-image: linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-gray), var(--tile-gray)), linear-gradient(var(--tile-yellow), var(--tile-yellow)); }

/* ---------- Board tiles ---------- */
:root {
	--boxsize: 50px;
	--spacing: 2px;
	--collapse: separate;
}

table {
	font-size: inherit;
}

.button {
	width: var(--boxsize);
	height: var(--boxsize);
}

.box {
	border: 2px solid var(--tile-border);
	border-radius: 5px;
	padding: 0;
	text-align: center;
	background-color: var(--tile-bg);
	overflow: hidden;
	color: var(--text-color);
	font-weight: 700;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

.table_guesses {
	border-collapse: var(--collapse);
	border-spacing: var(--spacing);
	table-layout: fixed;
}

/* Board tiles: constant square size whether empty or filled.
   Height matches the column width: each board is 50% of .boards minus
   5px padding per side, split into 5 tiles with 6 gaps of --spacing. */
.boards {
	container-type: inline-size;
}

.boards .table_guesses .box,
.page .table_guesses .box {
	width: 20%;
	height: var(--boxsize);
	font-size: calc(var(--boxsize) * 0.6);
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
}

.boards .table_guesses .box {
	--tile: calc((50cqw - 10px - 6 * var(--spacing)) / 5);
	height: var(--tile);
	max-height: var(--tile);
	font-size: calc(var(--tile) * 0.6);
}

.boards .table_guesses .box:not(:empty) {
	border-color: var(--tile-typed-border);
}

.t-green {
	background-color: var(--tile-green) !important;
	color: var(--tile-hit-text) !important;
	border-color: transparent !important;
}

.t-yellow {
	background-color: var(--tile-yellow) !important;
	color: var(--tile-hit-text) !important;
	border-color: transparent !important;
}

/* ---------- Game screen ---------- */
#game {
	width: 100%;
	flex-direction: column;
}

#game_title {
	font-size: 1.25rem;
}

.nav-card {
	background: var(--card-color);
	border: 0.5px solid var(--border-color);
	border-radius: 10px;
	padding: 3px;
	margin-bottom: 8px;
	flex: 0 0 auto;
}

.nav-table {
	width: 100%;
	border-spacing: 2px;
	table-layout: fixed;
}

.nav-table .box {
	font-size: 50%;
	height: calc(var(--boxsize) * 0.8);
	border: none;
	border-radius: 6px;
	background-color: var(--background-color);
	cursor: pointer;
	line-height: 1;
}

.nav-table .box:hover {
	filter: brightness(95%);
}

.nav-table #box-guesses {
	width: 11%;
	cursor: default;
	font-size: 42%;
	background: transparent;
}

.boards {
	width: 100%;
	flex: 1;
	overflow: auto;
	border-radius: 10px;
}

.boards > table {
	width: 100%;
	border-spacing: 0;
}

.boards td[id^="box-holder"] {
	width: 50%;
	padding: 0 5px;
}

/* ---------- Post game: result card ---------- */
#post_game {
	flex: 0 0 auto;
	margin-top: 8px;
}

.result-card {
	background: var(--card-color);
	border: 0.5px solid var(--border-color);
	border-radius: 10px;
	padding: 12px;
	font-size: 1rem;
	text-align: left;
}

.result-head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.result-icon {
	flex: 0 0 44px;
	height: 44px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.4rem;
	color: white;
	background: var(--tile-green);
}

.result-card.lost .result-icon {
	background: var(--invalid);
}

.result-title {
	font-family: "Bungee", sans-serif;
	font-weight: 400;
	font-size: 1.35rem;
	line-height: 1.1;
}

.result-sub {
	color: var(--muted);
	font-size: 1rem;
	margin-top: 2px;
}

.answer-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 5px;
}

.answer-chip {
	position: relative;
	border-radius: 7px;
	padding: 5px 4px 4px;
	text-align: center;
	cursor: pointer;
	border-bottom: 3px solid rgba(0, 0, 0, .12);
	min-width: 0;
}

.answer-chip.hit {
	background: var(--tile-green);
	color: white;
}

.answer-chip.miss {
	background: var(--background-color);
	color: var(--text-color);
	box-shadow: inset 0 0 0 2px var(--invalid);
}

.answer-chip .chip-word {
	display: block;
	font-weight: 800;
	font-size: 1rem;
	letter-spacing: 1px;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Guess number the word was solved on (or an x when missed) */
.answer-chip .chip-badge {
	position: absolute;
	top: -5px;
	right: -3px;
	min-width: 16px;
	height: 16px;
	padding: 0 3px;
	border-radius: 8px;
	background: var(--card-color);
	color: var(--tile-green);
	box-shadow: 0 0 0 1.5px var(--tile-green);
	font-size: 0.65rem;
	font-weight: 800;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}

.answer-chip .chip-badge i {
	font-size: 0.6rem;
	line-height: 1;
	display: block;
}

.answer-chip.miss .chip-badge {
	color: var(--invalid);
	box-shadow: 0 0 0 1.5px var(--invalid);
}

.answer-grid {
	padding-top: 4px;
}

.result-next {
	margin-top: 10px;
	text-align: center;
	color: var(--muted);
	font-size: 0.95rem;
}

.result-actions {
	display: flex;
	gap: 6px;
	margin-top: 10px;
}

.result-actions .btn,
#play_more {
	font-size: 1.05rem;
	padding: 8px 6px;
	gap: 6px;
	min-width: 0;
}

#play_more {
	margin-top: 6px;
}

.share-source {
	position: fixed;
	left: -9999px;
	top: 0;
	width: 300px;
	opacity: 0;
	pointer-events: none;
}

/* ---------- Keyboard (wordnerd keyboard.css, Jan 2026) ---------- */
.keyboard {
	width: 100%;
	background: var(--card-color);
	border: 0.5px solid var(--border-color);
	border-radius: 10px;
	padding: 5px 4px;
	user-select: none;
	overflow: hidden;
	position: relative;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	flex: 0 0 auto;
	margin-top: 8px;

	display: grid;
	grid-template-columns: repeat(10, 1fr);
	grid-auto-rows: 50px;
	gap: 5px 4px;
}

.keyboard .key {
	font-size: 20px;
	font-weight: 700;
	border-radius: 5px;
	display: flex;
	justify-content: center;
	align-items: center;
	background-color: var(--key-bg);
	color: var(--text-color);
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	transition: filter 0.05s ease;
	min-width: 0;
}

.keyboard .key:active {
	filter: brightness(85%);
}

/* L-shaped enter key spanning rows 2-3, like the original layout */
.keyboard #enter3 {
	grid-column: 10;
	grid-row: 2;
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
	margin-bottom: -5px;
}

.keyboard #enter1 {
	grid-column: 9 / span 2;
	grid-row: 3;
	border-top-right-radius: 0;
}

.keyboard #enter1,
.keyboard #enter3 {
	background: var(--tile-green);
	color: white;
}

.keyboard #bs {
	font-size: 18px;
}

@media (max-width: 400px) {
	.keyboard {
		grid-auto-rows: 46px;
		gap: 5px 3px;
	}

	.keyboard .key {
		font-size: 18px;
	}
}

/* ---------- Tutorial / patch notes ---------- */
.page {
	width: 100%;
	height: 100%;
	overflow: auto;
	font-size: 50%;
	text-align: left;
}

.page .card {
	font-size: 1.1rem;
	line-height: 1.45;
	font-weight: 600;
}

.page h2 {
	font-size: 1.35rem;
	margin: 6px 0 8px;
}

.page h3 {
	font-size: 1.2rem;
	margin: 6px 0 8px;
}

.page p {
	margin-bottom: 10px;
}

.page ol,
.page ul {
	padding-left: 22px;
	margin-bottom: 10px;
}

.page .demo {
	font-size: 1.6rem;
	border-spacing: 0;
	margin: 6px 0 4px;
}

/* ---------- Ads (unchanged spacing for the sticky footer ad, ZD 270459) ---------- */
#keyboard,
.keyboard,
#post_game,
.result {
	margin-bottom: 150px !important;
}

@media only screen and (max-width: 767px) {
	#keyboard,
	.keyboard,
	#post_game,
	.result {
		margin-bottom: 100px !important;
	}
}

.ads-about {
	margin-bottom: 102px !important;
}

@media only screen and (max-width: 767px) {
	.ads-about {
		margin-bottom: 52px !important;
	}
}

.boards tr.spacer td {
	font-size: 12%;
}

/* Faint divider with the board number above each board */
.board-label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 var(--spacing) 3px;
	color: var(--text-color);
	opacity: 0.35;
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1;
}

.board-label::before,
.board-label::after {
	content: "";
	flex: 1;
	height: 1px;
	background: currentColor;
}

/* Jump buttons land with the label in view */
.boards .table_guesses tr:first-child td {
	scroll-margin-top: 20px;
}

/* Game header: title sits between the button groups so it never overlaps them */
#game .header .title {
	position: static;
	transform: none;
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: clip;
	padding: 0 6px;
	line-height: 1.2;
}



/* ---------- Feedback ---------- */
.feedback-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border-radius: 10px;
	background: var(--card-color);
	color: var(--text-color);
	font-size: 1.1rem;
	font-weight: 700;
}

.feedback-btn:hover {
	filter: brightness(95%);
}

.feedback-banner {
	position: relative;
	text-align: left;
	border: 2px solid var(--tile-yellow);
}

.feedback-banner p {
	font-size: 1.05rem;
	padding-right: 30px;
	margin-bottom: 12px;
}

.feedback-banner p i {
	color: var(--tile-yellow);
	margin-right: 4px;
}

.feedback-close {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 8px;
	background: var(--background-color);
	color: var(--text-color);
	font-size: 1rem;
	cursor: pointer;
}

/* ---------- Old site link in the feedback popup ---------- */
.feedback-banner .old-site {
	margin-top: 8px;
}

.feedback-banner .old-note {
	font-size: 0.9rem;
	color: var(--muted);
	margin: 8px 0 0;
	padding: 0;
	text-align: center;
}

button.feedback-btn {
	border: 0.5px solid var(--border-color);
	cursor: pointer;
	font-family: inherit;
}

/* ---------- Stats modal (wordnerd .modal, septle stats layout) ---------- */
.modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: #00000022;
	z-index: 99998;
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

.theme-dark .modal {
	background: #ffffff22;
}

.modalinner {
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	max-height: calc(100% - 40px);
	max-width: calc(500px - 40px);
	width: calc(100% - 40px);
	padding: 20px;
	border-radius: 10px;
	background: var(--card-color);
	color: var(--text-color);
	text-align: left;
	overflow-y: auto;
	z-index: 99999;
	font-size: 1rem;
}

.modalinner.stats h2 {
	font-size: 1.6rem;
	margin: 0;
}

.modalinner.stats h3 {
	font-size: 1.15rem;
	margin: 16px 0 8px;
}

.stats-sub {
	color: var(--muted);
	font-size: 1rem;
}

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

.stats-row .stat {
	flex: 1;
	background: var(--background-color);
	border-radius: 10px;
	padding: 8px 4px;
	text-align: center;
	font-size: 0.9rem;
	color: var(--text-color);
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.stats-row .stat strong {
	font-size: 1.5rem;
	line-height: 1.2;
}

.stats-row .stat.bar {
	min-height: 70px;
	justify-content: flex-end;
	font-size: 1rem;
}

.stats-row .stat.bar strong {
	font-size: 1.2rem;
}

.stats-row .stat.today {
	outline: 2px solid var(--tile-yellow);
}

.share-row {
	margin-top: 18px;
}

.share-row .btn {
	flex: 1;
	font-size: 1.1rem;
	font-family: inherit;
}

.social-row {
	margin-top: 8px;
}

.social-row .social {
	flex: 1;
	height: 44px;
	border: none;
	border-radius: 10px;
	color: white;
	font-size: 1.25rem;
	cursor: pointer;
}

.social.telegram { background: #179cde; }
.social.twitter { background: #000000; }
.social.bluesky { background: rgb(5, 96, 255); }
.social.facebook { background: #39569c; }
.social.email { background: #86888a; }

.theme-dark .social.twitter {
	background: #333333;
}

/* ---------- Toast + shake for invalid / repeated guesses ---------- */
.toast {
	position: fixed;
	top: 90px;
	left: 50%;
	transform: translate(-50%, -10px);
	background: var(--text-color);
	color: var(--card-color);
	padding: 10px 18px;
	border-radius: 10px;
	font-size: 1.1rem;
	font-weight: 700;
	z-index: 99997;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
	white-space: nowrap;
}

.toast.show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* wordnerd secretword .error shake */
tr.shake {
	animation: shake 0.5s ease-in-out;
}

tr.shake td {
	border-color: var(--invalid) !important;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-3px); }
	20%, 40%, 60%, 80% { transform: translateX(3px); }
}

/* Narrow phones: slimmer header buttons leave room for the title */
@media (max-width: 420px) {
	#game .header {
		padding: 8px;
	}

	#game .header .group {
		gap: 4px;
	}

	#game .header .hbtn {
		width: 36px;
		height: 36px;
		font-size: 1.1rem;
	}

	#game .header .title {
		padding: 0 4px;
	}
}
