/* First stop: reveal the photographs, then celebrate the transformation. */
#gameDialog.land-game .game-board.game-land {
  padding: clamp(8px, 1.25vw, 16px);
  gap: 10px;
  background: #173d31;
  border-color: #3d6951;
  box-shadow: 0 18px 44px #1b392a33, inset 0 0 0 1px #ffffff29;
}

.land-compare {
  --reveal: 0%;
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #496a53;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  isolation: isolate;
}

.land-compare:focus-visible { outline: 3px solid #f4d67e; outline-offset: -5px; }
.land-photo { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 52%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.land-after { position: absolute; inset: 0; z-index: 1; clip-path: inset(0 calc(100% - var(--reveal)) 0 0); will-change: clip-path; }
.land-photo-label { position: absolute; top: clamp(12px, 2vw, 24px); z-index: 1; display: inline-flex; align-items: baseline; gap: 9px; padding: 8px 12px; border: 1px solid #fff9df9c; border-radius: 7px; color: #fffced; background: #173b30c9; box-shadow: 0 4px 18px #10291e3b; backdrop-filter: blur(8px); font: 600 clamp(13px, 1.5vw, 19px) 'Songti SC', serif; white-space: nowrap; pointer-events: none; }
.land-photo-label small { font: 10px Georgia, serif; letter-spacing: .15em; color: #f2d98f; }
.land-before-label { right: clamp(12px, 2vw, 24px); }
.land-after-label { left: clamp(12px, 2vw, 24px); }
.land-divider { position: absolute; z-index: 2; left: var(--reveal); top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: #fffdf2; box-shadow: 0 0 0 1px #183a2e71, 0 0 19px 3px #fff8d6b8; pointer-events: none; }
.land-handle { position: absolute; z-index: 3; left: clamp(54px, var(--reveal), calc(100% - 54px)); top: 50%; display: flex; align-items: center; justify-content: center; gap: 5px; width: 54px; height: 54px; transform: translate(-50%, -50%); border: 2px solid #fdf9e8; border-radius: 50%; color: #285441; background: #fffbeb; box-shadow: 0 4px 18px #0b2f2680, 0 0 0 8px #fff4c533; font: 27px/1 Georgia, serif; pointer-events: none; }
.land-handle i { width: 1px; height: 17px; background: #8caa8f; }
.land-handle b { font-weight: 400; margin-top: -3px; }
.land-drag-hint { position: absolute; z-index: 4; left: clamp(96px, calc(var(--reveal) + 42px), calc(100% - 160px)); top: 50%; transform: translateY(-50%); padding: 11px 18px; border: 2px solid #fff3be; border-radius: 99px; color: #173d31; background: #f8d879; box-shadow: 0 5px 20px #11372c70, 0 0 0 5px #fff4c533; font-size: clamp(14px, 1.3vw, 18px); font-weight: 700; letter-spacing: .08em; white-space: nowrap; pointer-events: none; transition: opacity .2s, transform .2s; animation: land-hint-nudge 1.2s ease-in-out 3; }
.land-drag-hint::before { content: ''; position: absolute; left: -7px; top: calc(50% - 6px); width: 12px; height: 12px; transform: rotate(45deg); background: #f8d879; border-left: 2px solid #fff3be; border-bottom: 2px solid #fff3be; }
@keyframes land-hint-nudge { 50% { transform: translate(6px, -50%); } }
.land-drag-hint span { margin-left: 10px; color: #31583e; font-size: 17px; }
.land-compare.has-reveal .land-drag-hint { opacity: 0; transform: translate(12px, -50%); animation: none; }
.land-caption { display: flex; align-items: center; justify-content: space-between; gap: 15px; width: 100%; min-height: 28px; color: #e4eccf; font-size: 12px; letter-spacing: .09em; }
.land-caption > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; }
.land-caption i { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #e5bd66; box-shadow: 0 0 0 3px #e5bd6630; }
.land-caption > span:last-child i { background: #89c984; box-shadow: 0 0 0 3px #89c98430; }
.land-caption p { margin: 0; color: #c8dcc2; font-size: 12px; line-height: 1.35; text-align: center; }
.land-caption em { color: #e9c776; font-style: normal; margin: 0 5px; }
#gameDialog.land-game .game-board.game-win { border-color: #83b67a; }
#gameDialog.land-game.focused-game .game-board.game-land { gap: 0; padding: 0; border: 0; box-shadow: none; }
#gameDialog.land-game.focused-game .land-caption { display: none; }
#gameDialog.land-game.focused-game .land-before-label { right: 68px; }

@media (orientation:portrait) and (max-width:760px) {
  #gameDialog.land-game .game-board.game-land { gap: 4px; padding: 6px; }
  .land-caption p { display: none; }
  .land-caption { min-height: 18px; font-size: 10px; }
  .land-photo-label { top: 8px; padding: 5px 8px; }
  .land-drag-hint { padding: 7px 12px; }
  .land-handle { width: 42px; height: 42px; font-size: 21px; }
}

@media (max-height:520px) {
  #gameDialog.land-game .game-board.game-land { gap: 4px; padding: 6px; }
  .land-caption { min-height: 18px; font-size: 10px; }
  .land-caption p { font-size: 10px; }
  .land-photo-label { top: 8px; padding: 5px 8px; }
  .land-drag-hint { padding: 7px 12px; }
  .land-handle { width: 42px; height: 42px; font-size: 21px; }
}

@media (prefers-reduced-motion:reduce) {
  .land-drag-hint { transition: none; animation: none; }
}

/* The completed photograph remains the scene; one figure carries the result. */
.land-compare.is-complete { cursor: default; }
.land-compare.is-complete .land-divider,
.land-compare.is-complete .land-handle,
.land-compare.is-complete .land-photo-label { opacity: 0; transition: opacity .35s; }
.land-compare.is-complete .land-after .land-photo { animation: land-photo-settle 1.8s cubic-bezier(.16,1,.3,1) both; }
.land-outcome[hidden], .land-results[hidden] { display: none; }
.land-outcome {
  position: absolute;
  inset: 0;
  z-index: 6;
  container: land-outcome / size;
  overflow: hidden;
  border-radius: 0;
  color: #fff7df;
  background: linear-gradient(90deg, #102e25f7 0%, #173b2df0 30%, #173b2db8 46%, #173b2d38 66%, transparent 82%);
  animation: land-veil-in .65s ease-out both;
  pointer-events: none;
}
.land-outcome::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(108deg, transparent 35%, #fff1bc24 49%, transparent 62%);
  animation: land-light-sweep 1.5s ease-out both;
}
.land-success {
  position: absolute; top: 7cqh; left: 5cqw;
  display: flex; align-items: center; gap: .6em;
  color: #f4d990; font-size: clamp(12px, 3cqh, 20px); font-weight: 600; letter-spacing: .16em;
  animation: land-results-in .55s cubic-bezier(.16,1,.3,1) both;
}
.land-success svg { width: 1.4em; height: 1.4em; padding: .25em; border: 1px solid #e4ce8866; border-radius: 50%; box-sizing: content-box; background: #e4ce8810; }
.land-success path { stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: land-check-draw .45s .15s ease-out forwards; }
#gameDialog.land-game .land-results {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  gap: 4cqh; width: 100%; height: 100%; min-height: 0;
  padding: 20cqh 5cqw 7cqh; box-sizing: border-box;
  animation: land-results-in .7s cubic-bezier(.16,1,.3,1) both;
}
.land-hero-label { display: block; margin-bottom: 1.8cqh; font-size: clamp(12px, 3.6cqh, 23px); letter-spacing: .13em; color: #e3e7ce; }
.land-hero-number { display: flex; align-items: baseline; gap: 1.2cqw; white-space: nowrap; }
.land-hero-number strong {
  min-width: 4ch; color: #ffe5a1;
  font: 500 clamp(48px, min(14cqw, 24cqh), 168px)/1 Georgia, 'Times New Roman', serif;
  letter-spacing: -.055em; font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 24px #eaca6620;
}
.land-hero-number small { color: #f2e7c8; font: 500 clamp(16px, 4.6cqh, 30px)/1.2 'Songti SC', serif; }
.land-supporting { display: flex; gap: 3cqw; padding-top: 3cqh; border-top: 1px solid #e5d49a45; }
.land-stat + .land-stat { padding-left: 3cqw; border-left: 1px solid #e5d49a30; }
.land-stat > span { display: block; margin-bottom: 1.4cqh; color: #cbd8c5; font-size: clamp(10px, 2.6cqh, 16px); letter-spacing: .06em; }
.land-stat > div { display: flex; align-items: baseline; gap: .5cqw; white-space: nowrap; }
.land-stat strong { color: #fff3d3; font: 400 clamp(18px, min(4cqw, 7cqh), 40px)/1 Georgia, serif; font-variant-numeric: tabular-nums; }
.land-stat small { color: #dce2c9; font-size: clamp(10px, 2.5cqh, 15px); }
.land-period { margin: 0; color: #bacbb8; font-size: clamp(10px, 2.3cqh, 14px); line-height: 1.4; letter-spacing: .05em; }
/* Keep the watercolor controls in their existing rail, including during the reveal. */
#gameDialog.land-game.land-results-ready .game-foot #gameNext { animation: land-next-in .45s ease-out both; }
@container land-outcome (max-height: 300px) {
  #gameDialog.land-game .land-results { gap: 3cqh; padding-top: 21cqh; padding-bottom: 6cqh; }
  .land-hero-label { margin-bottom: 1.5cqh; }
  .land-supporting { padding-top: 2.5cqh; }
  .land-success { top: 6cqh; }
}
@keyframes land-veil-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes land-photo-settle { from { transform: scale(1.035); } to { transform: scale(1); } }
@keyframes land-check-draw { to { stroke-dashoffset: 0; } }
@keyframes land-light-sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes land-results-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes land-next-in { from { opacity: 0; translate: 0 5px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .land-outcome, .land-outcome::after, .land-success, .land-success path,
  #gameDialog.land-game .land-results,
  .land-compare.is-complete .land-after .land-photo,
  #gameDialog.land-game.land-results-ready .game-foot #gameNext { animation: none; }
  .land-success path { stroke-dashoffset: 0; }
  .land-compare.is-complete .land-divider,
  .land-compare.is-complete .land-handle, .land-compare.is-complete .land-photo-label { transition: none; }
}
