/* ===========================================================
   Reset
   =========================================================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

/* ===========================================================
   Selection
   =========================================================== */
::selection {
	background: orange;
	color: white;
	text-shadow: none;
}

/* ===========================================================
   External Links
   =========================================================== */

a[target="_blank"]:not(:empty):not(:has(*))::after {
	content: "↗";
	display: inline-block;
	margin-inline-start: 0.125rem;
	font-size: 0.75em;
	vertical-align: super;
}
/* ===========================================================
   Typography
   =========================================================== */
body {
	font-family: "DotGothic16", sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
	font-family: "Kablammo", cursive;
}

h1 {
	font-size: 72px;
}

.site-title {
	font-family: "Nabla";
	text-align: center;
	padding: 0.5rem 0;
}

.tape {
	height: 10px;
	background: url("images/tape-tile.svg");
	background-repeat: repeat;
}

/* ===========================================================
   Layout
   =========================================================== */
.content {
	max-width: 1200px;
	margin: 0 auto;
	padding: 2.5rem 1rem 2rem;
}

.panel {
	border-radius: 8px;
	box-shadow:
		0 2px 6px rgba(0, 0, 0, 0.15),
		inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 320px;
	gap: 2rem;
	align-items: start;
}

.main-column {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	min-width: 0;
}

.feeds {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2rem;
	align-items: start;
}

.updates {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.update {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.update p {
	font-family: "DotGothic16", sans-serif;
	font-size: 14px;
	color: #3a3226;
}

.update img,
.update video {
	display: block;
	max-width: 100%;
}

.update video {
	max-width: 260px;
}

.updates hr {
	border: none;
	border-top: 1px solid #d8c9a3;
	margin: 0;
}

.shame h2 {
	color: #a33;
}

.shame img {
	height: auto;
}

.sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	min-width: 0;
}

.site-counter {
	padding: 0.6rem 0.9rem;
	background: #1a1a1a;
	color: #ccc;
	font-family: "DotGothic16", sans-serif;
	font-size: 14px;
}

.site-counter strong {
	color: orange;
	font-size: 1.15em;
}

@media (max-width: 760px) {
	.layout,
	.feeds {
		grid-template-columns: 1fr;
	}
}

/* ===========================================================
   Widgets
   =========================================================== */

.leaderboard {
	padding: 1rem;
	background: #fdf6e3;
	border: 1px solid #e3d5a8;
	font-family: "DotGothic16", sans-serif;
	color: #5c4a1e;
}

.leaderboard-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.leaderboard h3 {
	font-size: 1.1em;
	color: #3a3226;
}

.leaderboard-form {
	display: none;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 0.75rem;
}

.leaderboard-form.visible {
	display: flex;
}

.leaderboard-pending {
	flex: 1 0 100%;
	font-weight: bold;
	color: #3a3226;
}

.leaderboard-form input {
	flex: 1;
	min-width: 0;
	padding: 0.5rem;
	border: 1px solid #e3d5a8;
	background: #fffdf7;
	font-family: inherit;
	font-size: 14px;
}

.leaderboard-form button {
	padding: 0.5rem 0.9rem;
	border: none;
	border-radius: 2px;
	background: #e4942a;
	color: #fff;
	font-family: "Kablammo", cursive;
	font-size: 13px;
	cursor: pointer;
}

.leaderboard-list {
	list-style: none;
	display: flex;
	flex-direction: column;
}

.leaderboard-list li {
	display: flex;
	align-items: baseline;
	gap: 0.5em;
	padding: 0.4rem 0;
	border-top: 1px solid #ece0bb;
	font-size: 13px;
}

.leaderboard-list li:first-child {
	border-top: none;
}

.leaderboard-rank {
	font-weight: bold;
	color: #a9823a;
}

.leaderboard-name-cell {
	flex: 1;
	font-weight: bold;
	color: #3a3226;
}

.leaderboard-time {
	color: #85734f;
}

.plushie-row {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.game-button {
	display: flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #c9a65a;
	background: linear-gradient(180deg, #fffdf5 0%, #ffe9c2 100%);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.9),
		inset 0 -3px 6px rgba(169, 130, 58, 0.25),
		0 1px 2px rgba(0, 0, 0, 0.15),
		0 4px 10px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	transition:
		transform 0.05s ease-out,
		box-shadow 0.05s ease-out,
		background 0.07s ease-out;
}

.game-button:hover {
	background: linear-gradient(180deg, #fffefa 0%, #fff0cf 100%);
}

.game-button:active {
	transform: translateY(2px);
	box-shadow: inset 0 2px 4px rgba(169, 130, 58, 0.35);
}

.plushie-button {
	width: 90px;
	aspect-ratio: 1 / 1;
	padding: 6px;
	border-radius: 14px;
	touch-action: manipulation;
}

.plushie-button img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
	pointer-events: none;
}

.plushie-count {
	flex: 1;
	padding: 0.6rem 0.9rem;
	background: #1a1a1a;
	color: #ccc;
	font-family: "DotGothic16", sans-serif;
	font-size: 14px;
}

.plushie-count strong {
	color: orange;
	font-size: 1.15em;
}

/* ===========================================================
   Images
   =========================================================== */

.art-frame {
	border-width: 32px;
	border-style: solid;
	border-image-source: url("images/frame.svg");
	border-image-slice: 40;
	border-image-width: 32px;
	border-image-repeat: round;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.art-window {
	position: relative;
	background-image: url("images/frame.svg");
	background-size: 160px 160px;
	background-repeat: repeat;
}

#eletenshi {
	display: block;
	width: 100%;
	height: auto;
	transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.art-frame.puzzle-active #eletenshi {
	opacity: 0;
}

.puzzle-grid {
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.art-frame.puzzle-active .puzzle-grid {
	opacity: 1;
	pointer-events: auto;
}

.puzzle-tile {
	position: absolute;
	width: 25%;
	height: 25%;
	background-size: 400% 400%;
	background-repeat: no-repeat;
	border: 4px outset #3a2510;
	cursor: pointer;
	touch-action: manipulation;
	-webkit-tap-highlight-color: transparent;
	-webkit-touch-callout: none;
	user-select: none;
	-webkit-user-select: none;
	transition:
		left 0.12s cubic-bezier(0.22, 1, 0.36, 1),
		top 0.12s cubic-bezier(0.22, 1, 0.36, 1);
}

.puzzle-tile-number {
	position: absolute;
	top: 2px;
	left: 4px;
	font-family: "Kablammo", sans-serif;
	font-size: 50px;
	line-height: 1;
	color: #ffa000;
	-webkit-text-stroke: 4px black;
	paint-order: stroke fill;
	pointer-events: none;
}

.art-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.75rem;
}

.plate {
	display: flex;
	justify-content: center;
	gap: 0.5em;
	padding: 0.6rem 1.25rem;
	background: #f1e9d8;
	border: 1px solid #a89674;
	font-family: "DotGothic16", sans-serif;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #3a3226;
}

.puzzle-stats {
	display: none;
	align-items: center;
	gap: 1em;
	padding: 0.6rem 1.25rem;
	background: #f1e9d8;
	border: 1px solid #a89674;
	font-family: "DotGothic16", sans-serif;
	font-size: 14px;
	color: #3a3226;
}

.puzzle-stats.visible {
	display: flex;
	margin-bottom: 0.75rem;
}

.puzzle-toggle {
	width: 44px;
	height: 44px;
	font-size: 1.3rem;
	line-height: 1;
	border-radius: 8px;
}

.puzzle-toggle.active {
	background: linear-gradient(180deg, #ffe3b0 0%, #f6c877 100%);
	border-color: #a9823a;
}

.plate-label {
	color: #85734f;
}

.plate a {
	color: inherit;
}

/* ===========================================================
   Footer
   =========================================================== */
.site-footer {
	margin-top: 2rem;
	font-size: 14px;
	color: #777;
}

.footer-text {
	display: flex;
	justify-content: center;
	align-items: baseline;
	padding: 1.5rem 1rem 0.5rem;
}

.made-by {
	color: inherit;
}

.footer-badges {
	display: flex;
	justify-content: center;
	padding: 0 1rem 2rem;
}
