/**
 * Spot the Difference — Greenhouse Edition.
 */

.psd-page {
	--psd-cream: #fff6e0;
	--psd-edge: #e3cf9c;
	--psd-ink: #3b2a14;
	--psd-green: #4e9a2c;
	--psd-green-dark: #2f6f14;
	--psd-gold: #f4c542;
	--psd-wood-dark: #5e3a17;
	color: var(--psd-ink);
}

.psd-page button {
	font-family: inherit;
}

.psd-page [hidden] {
	display: none !important;
}

/* --------------------------------------------------------------- Scene --- */

.psd-scene {
	position: relative;
	overflow: hidden;
	margin-top: 16px;
	padding: 20px 26px 30px;
	border-radius: 28px;
	background-color: #8fcf9a;
	background-image:
		radial-gradient(circle at 12% 14%, rgba(255, 244, 176, .85) 0 2%, rgba(255, 244, 176, 0) 7%),
		radial-gradient(circle at 78% 10%, rgba(255, 255, 255, .45) 0 3%, rgba(255, 255, 255, 0) 9%),
		radial-gradient(circle at 92% 46%, rgba(255, 244, 176, .4) 0 2%, rgba(255, 244, 176, 0) 7%),
		radial-gradient(ellipse 70% 50% at 50% 0%, #e7f6f6 0, rgba(231, 246, 246, 0) 70%),
		linear-gradient(180deg, #b9e3ee 0%, #9bd7a9 40%, #5aa866 100%);
	box-shadow: 0 10px 30px rgba(20, 55, 42, .18);
}

.psd-page[style] .psd-scene {
	background-image: var(--psd-bg);
	background-size: cover;
	background-position: center;
}

.psd-scene::before,
.psd-scene::after {
	content: "";
	position: absolute;
	width: 260px;
	height: 260px;
	pointer-events: none;
	background-repeat: no-repeat;
	background-size: contain;
	opacity: .9;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='%233a9a1e'%3E%3Cpath d='M20 10C60 0 110 30 100 80 70 90 20 70 20 10z'/%3E%3Cpath d='M0 70C30 50 80 70 90 120 50 130 0 120 0 70z' fill='%234aa52a'/%3E%3Cpath d='M70 0C110 -10 150 20 140 60 110 70 70 50 70 0z' fill='%232f8217'/%3E%3C/g%3E%3Cg stroke='%231d5f0c' stroke-width='2' fill='none'%3E%3Cpath d='M22 12C50 30 80 55 100 80M2 72C30 90 60 105 88 120M72 2C95 20 120 40 140 60'/%3E%3C/g%3E%3Ccircle cx='128' cy='92' r='11' fill='%23f2658f'/%3E%3Ccircle cx='128' cy='92' r='4' fill='%23ffd34d'/%3E%3C/svg%3E");
}

.psd-scene::before { left: -60px; top: -50px; }
.psd-scene::after { right: -60px; bottom: -70px; transform: rotate(180deg); }

.psd-scene > * { position: relative; z-index: 1; }

/* --------------------------------------------------------------- Title --- */

.psd-head {
	display: flex;
	justify-content: center;
	margin-bottom: 14px;
}

.psd-title {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 0;
	text-align: center;
}

.psd-title--img img {
	display: block;
	max-width: min(100%, 700px);
	height: auto;
}

.psd-sign {
	display: inline-block;
	padding: 6px 44px 18px;
	border-radius: 26px 26px 34px 34px;
	background: linear-gradient(180deg, #a66b32 0%, #86521f 100%);
	border: 4px solid #5e3a17;
	box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), 0 6px 14px rgba(40, 20, 0, .3);
}

.psd-sign > span {
	font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	font-style: italic;
	font-weight: 800;
	font-size: clamp(2rem, 5.6vw, 3.8rem);
	line-height: 1.05;
	color: #fff3cf;
	-webkit-text-stroke: 2px #4a2a0c;
	paint-order: stroke fill;
	text-shadow: 0 3px 0 #4a2a0c, 0 5px 8px rgba(0, 0, 0, .35);
}

.psd-ribbon {
	margin-top: -16px;
	padding: 7px 40px 8px;
	font-size: clamp(.95rem, 2.2vw, 1.35rem);
	font-weight: 800;
	color: #fff;
	background: linear-gradient(180deg, #7c4cc0, #5f349c);
	clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 50%, 100% 100%, 0 100%, 16px 50%);
	text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
}

/* -------------------------------------------------------------- Layout --- */

.psd-layout {
	display: grid;
	grid-template-columns: 210px minmax(0, 1fr);
	gap: 22px;
	align-items: start;
}

.psd-left,
.psd-stage { min-width: 0; }

.psd-menu {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 14px;
	background: linear-gradient(180deg, #fffaf0, #fff3d6);
	border: 2px solid var(--psd-edge);
	border-radius: 22px;
	box-shadow: 0 6px 16px rgba(60, 40, 10, .18), inset 0 2px 0 rgba(255, 255, 255, .8);
}

.psd-menu-item {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	padding: 9px 12px;
	border: 0;
	border-radius: 14px;
	background: transparent;
	color: var(--psd-ink);
	font-size: 1rem;
	font-weight: 700;
	text-align: left;
	text-decoration: none;
	cursor: pointer;
}

.psd-menu-item + .psd-menu-item {
	border-top: 1px solid rgba(139, 105, 40, .12);
	border-radius: 0 0 14px 14px;
}

.psd-menu-item:hover { background: rgba(78, 154, 44, .1); color: var(--psd-ink); }

.psd-menu-item.is-current,
.psd-menu-item.is-current:hover {
	background: linear-gradient(180deg, #5ea834, #3f8a22);
	color: #fff;
	border-radius: 14px;
	box-shadow: 0 3px 0 #2c6a16;
}

.psd-menu-icon { width: 26px; height: 26px; flex: 0 0 auto; color: #5e3a17; }

.psd-mascot { display: flex; justify-content: center; margin-top: 16px; }
.psd-mascot svg, .psd-mascot img { width: 190px; height: auto; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .25)); }

/* --------------------------------------------------------------- Pills --- */

.psd-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 12px;
}

.psd-pill {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	border: 2px solid var(--psd-edge);
	border-radius: 999px;
	background: linear-gradient(180deg, #fffaf0, #fff0cf);
	box-shadow: 0 3px 8px rgba(60, 40, 10, .18);
	font-weight: 800;
	white-space: nowrap;
}

.psd-pill svg { width: 24px; height: 24px; flex: 0 0 auto; }
.psd-pill--level { flex: 1 1 200px; min-width: 0; }
.psd-pill--level span { overflow: hidden; text-overflow: ellipsis; }
.psd-pill--find { flex: 1 1 190px; }
.psd-pill--time { margin-left: auto; font-size: 1.15rem; }
.psd-pill--time strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.psd-pill--time.is-low strong { color: #d33; animation: psd-pulse .8s infinite; }

.psd-pill-leaf { fill: #58b030; }

.psd-leaf { width: 26px; height: 26px; fill: #d9cdb0; }
.psd-leaf.is-on { fill: #58b030; }
.psd-pill--leaves { gap: 2px; padding: 8px 14px; }

@keyframes psd-pulse { 50% { opacity: .55; } }

/* ---------------------------------------------------------------- Pics --- */

.psd-pics {
	position: relative;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 14px;
}

.psd-pic { margin: 0; }

.psd-frame {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--psd-ar, 4 / 3);
	border: 5px solid #fff8e6;
	border-radius: 18px;
	background: #e9efe0;
	box-shadow: 0 6px 16px rgba(30, 50, 20, .35), 0 0 0 2px rgba(255, 255, 255, .4);
	cursor: crosshair;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.psd-frame img {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	user-select: none;
	-webkit-user-drag: none;
	pointer-events: none;
}

.psd-marks { position: absolute; inset: 0; pointer-events: none; }

.psd-ring {
	position: absolute;
	aspect-ratio: 1;
	transform: translate(-50%, -50%);
	border: 4px solid #ff3d6e;
	border-radius: 50%;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, .85), 0 0 12px rgba(255, 61, 110, .6);
	animation: psd-pop .35s cubic-bezier(.3, 1.6, .5, 1);
}

.psd-ring.is-bonus { border-color: #f4b400; border-style: dashed; box-shadow: 0 0 0 2px #fff, 0 0 14px rgba(244, 180, 0, .8); }
.psd-ring.is-hint { border-color: #3d8bff; box-shadow: 0 0 0 2px #fff, 0 0 16px rgba(61, 139, 255, .8); animation: psd-hint 1s ease-in-out infinite; }

@keyframes psd-pop { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes psd-hint { 50% { transform: translate(-50%, -50%) scale(1.18); } }

.psd-cross {
	position: absolute;
	width: 38px;
	height: 38px;
	transform: translate(-50%, -50%);
	animation: psd-fade .7s forwards;
}

.psd-cross svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5)); }
@keyframes psd-fade { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1.3); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(.9); } }

.psd-page.is-shake .psd-pics { animation: psd-shake .3s; }
@keyframes psd-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.psd-ready {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	padding: 14px;
	border-radius: 18px;
	background: rgba(236, 246, 228, .72);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
}

.psd-ready-box {
	width: min(440px, 100%);
	padding: 22px 24px 24px;
	border: 3px solid var(--psd-edge);
	border-radius: 24px;
	background: linear-gradient(180deg, #fffaf0, #fff0cf);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
	text-align: center;
}

.psd-ready-level { margin: 0; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: .8rem; color: var(--psd-green-dark); }
.psd-ready-box h2 { margin: 2px 0 6px; font-size: 1.7rem; color: var(--psd-ink); }
.psd-ready-box p { margin: 0 0 8px; }
.psd-ready-bonus { color: #8a5a00; font-weight: 700; }
.psd-ready-note { font-size: .88rem; color: #6a5330; }
.psd-ready-note:empty, .psd-ready-bonus:empty { display: none; }

.psd-status {
	min-height: 1.6em;
	margin: 10px 0 0;
	text-align: center;
	font-weight: 800;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 40, 10, .7);
}

/* ----------------------------------------------------------------- Bar --- */

.psd-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-top: 6px;
}

.psd-found {
	display: flex;
	flex: 1 1 340px;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	border: 3px solid #d6b878;
	border-radius: 999px;
	background: linear-gradient(180deg, #fff6df, #ffe9b6);
	box-shadow: 0 5px 12px rgba(60, 40, 10, .25), inset 0 2px 0 rgba(255, 255, 255, .8);
	font-weight: 800;
	min-width: 0;
}

.psd-found > svg { width: 28px; height: 28px; flex: 0 0 auto; }
.psd-found strong { font-variant-numeric: tabular-nums; }

.psd-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 6px; }
.psd-dots i { width: 22px; height: 22px; border: 2px solid #bda776; border-radius: 50%; background: #fff; }
.psd-dots i.is-on { border-color: #2f6f14; background: #5ea834 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/80% no-repeat; }

.psd-hint {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 26px;
	border: 3px solid #e8f5d6;
	border-radius: 999px;
	background: linear-gradient(180deg, #5ea834, #3f8a22);
	color: #fff;
	font-size: 1.15rem;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 4px 0 #2c6a16, 0 6px 12px rgba(0, 0, 0, .25);
}

.psd-hint svg { width: 24px; height: 24px; }
.psd-hint b {
	position: absolute;
	top: -10px;
	right: -6px;
	display: grid;
	place-items: center;
	min-width: 26px;
	height: 26px;
	padding: 0 4px;
	border: 2px solid #fff;
	border-radius: 50%;
	background: #14372a;
	font-size: .9rem;
}

.psd-hint:disabled { filter: grayscale(.8); opacity: .65; cursor: not-allowed; }

/* ------------------------------------------------------------- Buttons --- */

.psd-btn {
	display: inline-block;
	padding: 11px 26px;
	border: 2px solid var(--psd-green-dark);
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
}

.psd-btn--primary { background: linear-gradient(180deg, #5ea834, #3f8a22); color: #fff; box-shadow: 0 3px 0 #2c6a16; }
.psd-btn--ghost { background: #fff; color: var(--psd-green-dark); }
.psd-btn:hover { filter: brightness(1.06); }
.psd-btn--primary:hover { color: #fff; }

/* -------------------------------------------------------------- Modals --- */

.psd-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: grid;
	place-items: center;
	padding: 20px;
	background: rgba(30, 20, 5, .55);
}

.psd-modal-box {
	width: min(480px, 100%);
	max-height: 90vh;
	overflow: auto;
	padding: 26px;
	border: 3px solid var(--psd-edge);
	border-radius: 26px;
	background: linear-gradient(180deg, #fffaf0, #fff0cf);
	box-shadow: 0 20px 50px rgba(0, 0, 0, .4);
	text-align: center;
	animation: psd-pop-box .3s cubic-bezier(.3, 1.4, .5, 1);
}

.psd-modal-box--wide { width: min(760px, 100%); }
.psd-modal-box h2 { margin: 0 0 12px; font-size: 1.7rem; color: var(--psd-ink); }
.psd-modal-sub { margin: -6px 0 14px; color: #6a5330; }

@keyframes psd-pop-box { from { transform: scale(.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.psd-steps { margin: 0 0 18px; padding-left: 22px; text-align: left; }
.psd-steps li { margin-bottom: 8px; }

.psd-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 12px;
	margin-bottom: 18px;
	text-align: left;
}

.psd-season-h { grid-column: 1 / -1; margin: 6px 0 0; font-size: 1.1rem; color: var(--psd-ink); }
.psd-season-h.is-now::after { content: " · now open"; font-size: .8rem; font-weight: 700; color: var(--psd-green-dark); }

.psd-tile {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
	border: 3px solid var(--psd-edge);
	border-radius: 16px;
	background: #fff;
	color: var(--psd-ink);
	text-align: left;
	cursor: pointer;
}

.psd-tile:hover { border-color: var(--psd-green); }
.psd-tile.is-current { border-color: var(--psd-gold); box-shadow: 0 0 0 2px #fff, 0 0 12px rgba(244, 197, 66, .8); }
.psd-tile.is-locked { opacity: .6; cursor: not-allowed; }
.psd-tile.is-locked .psd-tile-art img { filter: grayscale(1) brightness(.85); }

.psd-tile-art { position: relative; display: block; aspect-ratio: 4 / 3; background: #e9efe0; }
.psd-tile-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.psd-tile-check { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #4e9a2c; color: #fff; font-style: normal; font-weight: 800; }

.psd-tile-body { position: relative; display: block; padding: 8px 10px 10px; }
.psd-tile-body strong { display: block; font-size: .95rem; line-height: 1.2; }
.psd-tile-body em { display: block; font-style: normal; font-size: .8rem; color: #6a5330; }
.psd-tile-n { position: absolute; top: -18px; left: 8px; display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #fff; border-radius: 50%; background: var(--psd-green); color: #fff; font-size: .95rem; }
.psd-tile-leaves { display: flex; gap: 1px; margin-top: 4px; }
.psd-tile-leaves .psd-leaf { width: 16px; height: 16px; }

.psd-stars { display: flex; justify-content: center; gap: 6px; margin-bottom: 4px; }
.psd-star { width: 54px; height: 54px; fill: #e5dcc3; stroke: #cdbf9d; stroke-width: 1; stroke-linejoin: round; }
.psd-star.is-on { fill: #f6b92b; stroke: #c8861a; animation: psd-star .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes psd-star { from { transform: scale(0) rotate(-40deg); } to { transform: scale(1) rotate(0); } }

.psd-result-sub { margin: 0 0 14px; color: #6a5330; }
.psd-result-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 14px; }
.psd-result-list div { flex: 1 1 90px; padding: 8px 6px; border-radius: 14px; background: rgba(255, 255, 255, .7); }
.psd-result-list dt { font-size: .8rem; font-weight: 700; color: #6a5330; }
.psd-result-list dd { margin: 0; font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.psd-result-award { display: inline-block; margin: 0 0 12px; padding: 8px 20px; border-radius: 999px; background: #fde7f0; color: #b02b61; font-size: 1.25rem; font-weight: 800; }
.psd-result-note { margin: 0 0 12px; font-size: .92rem; color: #6a5330; }
.psd-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.psd-empty { padding: 30px; text-align: center; background: #fff6e0; border-radius: 20px; }

/* ---------------------------------------------------------- Responsive --- */

@media (max-width: 1000px) {
	.psd-layout { grid-template-columns: minmax(0, 1fr); }
	.psd-menu { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 8px; }
	.psd-menu-item { width: auto; padding: 8px 12px; }
	.psd-menu-item + .psd-menu-item { border-top: 0; border-radius: 14px; }
	.psd-mascot { display: none; }
}

@media (max-width: 720px) {
	.psd-scene { padding: 14px 12px 22px; border-radius: 20px; }
	.psd-sign { padding: 6px 22px 12px; }
	.psd-pics { grid-template-columns: minmax(0, 1fr); gap: 10px; }
	.psd-pill { padding: 7px 12px; font-size: .9rem; }
	.psd-pill--time { margin-left: 0; }
	.psd-menu-item span { font-size: .88rem; }
	.psd-menu-icon { width: 20px; height: 20px; }
	.psd-menu-item { gap: 6px; padding: 7px 10px; }
	.psd-found { padding: 9px 12px; flex-basis: 100%; }
	.psd-dots i { width: 18px; height: 18px; }
	.psd-hint { margin-left: auto; }
}

@media (prefers-reduced-motion: reduce) {
	.psd-ring, .psd-cross, .psd-star.is-on, .psd-modal-box, .psd-page.is-shake .psd-pics, .psd-pill--time.is-low strong { animation: none; }
	.psd-ring.is-hint { animation: none; }
}
