:is(.post-map-page, .play-screen[data-mode="wind-post"], .game-dialog[data-wind-post-panel]) {
  --post-challenge-serif: "Wind Post Letter Type", "Songti SC", "Noto Serif SC", "Noto Serif CJK SC", serif;
  --post-challenge-gold: #f6d597;
  --post-challenge-ink: #fff1d3;
  --post-challenge-muted: #c0cec5;
}

.post-map-page {
  --post-route-art: url("assets/wind-post-route-normal-expanded.webp");
  isolation: isolate;
  overflow: hidden;
  padding: 0;
  background: #102825;
  color: var(--post-challenge-ink);
}
.post-map-page[data-difficulty="hard"] { --post-route-art: url("assets/wind-post-route-hard-expanded.webp"); }
.post-map-board {
  position: absolute;
  inset: 0;
  container-type: size;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scroll-padding-block: calc(var(--post-back-top) + var(--post-back-size) + 7px) calc(var(--bottom) + 60px);
}
.post-map-art {
  --post-scene-height: max(100cqw, 100cqh, 35rem);
  position: relative;
  height: var(--post-scene-height);
  overflow: clip;
  background:
    linear-gradient(180deg, #081b25d9 0%, #112a3010 18% 78%, #0a211bce 100%),
    var(--post-route-art) center / auto 100% no-repeat;
}
.post-map-header {
  position: relative;
  z-index: 2;
  display: grid;
  align-items: center;
  min-height: calc(var(--post-back-top) + var(--post-back-size));
  padding: var(--post-back-top) calc(var(--post-back-inset) + 84px) 0;
  pointer-events: none;
}
.post-map-header button { pointer-events: auto; }
.post-map-header h2 {
  margin: 0;
  text-align: center;
  white-space: nowrap;
  font: 700 clamp(1.35rem, 6.1vw, 2.15rem)/1.1 var(--post-challenge-serif);
  text-shadow: 0 2px 5px #061b21, 0 0 20px #0b262f;
}
.post-attempt-chip {
  position: absolute;
  top: calc(var(--post-back-top) + 1px);
  right: var(--post-back-inset);
  display: inline-flex;
  min-width: 72px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 8px);
  padding: 4px clamp(6px, 1.9vw, 10px);
  border: 1px solid #bc9a65;
  border-radius: 12px 4px;
  background: linear-gradient(150deg, #2b5051, #102d34);
  box-shadow: inset 0 0 0 2px #a6c6ad1a, 0 3px 9px #0b1d2190;
  font-size: var(--text-label);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.post-attempt-chip .icon {
  width: 19px;
  height: 19px;
  border: 1px solid #e3bc7a74;
  border-radius: 50%;
  color: var(--post-challenge-gold);
  background: #e7be6e17;
}

#post-map-nodes {
  /* Waypoints are expressed in the original 9:16 strip at the center of the expanded art. */
  --post-route-width: calc(var(--post-scene-height) * 9 / 16);
  --post-stop-width: clamp(128px, min(44cqw, 44cqh), 216px);
  --post-art-inset: calc((var(--post-route-width) - 100cqw + var(--post-stop-width)) / 2 + 6px);
  position: absolute;
  inset: 0 auto 0 50%;
  width: var(--post-route-width);
  transform: translateX(-50%);
  margin: 0;
  padding: 0;
  list-style: none;
}
#post-map-nodes li {
  position: absolute;
  top: var(--post-y);
  left: clamp(var(--post-art-inset), var(--post-x), 100% - var(--post-art-inset));
  transform: translate(-50%, -50%);
}
.post-stage-node {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  width: var(--post-stop-width);
  min-height: 44px;
  scroll-margin-block-end: 11px;
  aspect-ratio: 576 / 159;
  padding: 0 7% 0 26%;
  border: 0;
  border-radius: 18px 6px;
  color: #fff0ce;
  background: transparent;
  text-shadow: 0 1px 2px #091a1f;
  transition: transform .15s ease;
}
.post-stage-node::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  background: url("assets/wind-post-route-stop.webp") center / contain no-repeat;
  filter: drop-shadow(0 3px 4px #061316d6);
}
.post-stage-node[data-state="open"]::before {
  filter: brightness(1.21) drop-shadow(0 0 8px #ffb44ebb) drop-shadow(0 3px 4px #061316);
}
.post-map-page[data-difficulty="hard"] .post-stage-node::before {
  filter: hue-rotate(24deg) drop-shadow(0 3px 4px #061316d6);
}
.post-map-page[data-difficulty="hard"] .post-stage-node[data-state="open"]::before {
  filter: hue-rotate(24deg) brightness(1.26) drop-shadow(0 0 8px #80cedbbb) drop-shadow(0 3px 4px #061316);
}
.post-map-page .post-stage-node[data-state="locked"] { color: #dce6dc; }
.post-map-page .post-stage-node[data-state="locked"]::before {
  filter: grayscale(.76) brightness(.8) drop-shadow(0 3px 4px #09171ae0);
}
.post-stage-node:active, .post-attempt-chip:active, .post-map-modes button:active { transform: scale(.96); }
.post-node-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .43em;
  font-size: clamp(11px, min(3.4cqw, 3.7cqh), 16px);
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}
.post-node-title b {
  padding-inline-end: .43em;
  border-inline-end: 1px solid #d9b47963;
  color: var(--post-challenge-gold);
  font-size: .82em;
  font-variant-numeric: tabular-nums;
}
[data-state="locked"] .post-node-title b { color: #c6c7b6; }
.post-node-stars, .post-node-lock {
  position: absolute;
  left: 59%;
  bottom: 1px;
  display: grid;
  place-items: center;
  transform: translate(-50%, 38%);
  border: 1px solid #b29561;
  border-radius: 99px;
  background: #153336;
  box-shadow: 0 2px 3px #0613169e;
}
.post-node-stars { padding: 1px 5px; }
.post-node-stars .carved-stars {
  --star-size: clamp(10px, min(3.2cqw, 3.6cqh), 14px);
  gap: 2px;
}
.post-node-stars .carved-stars i:not(.earned)::before { background: #a89369; }
.post-node-lock {
  width: 19px;
  height: 18px;
  border-color: #b8b5a386;
  color: #e2dfca;
  background: #283938;
}
.post-node-lock .icon { width: 12px; height: 12px; }
.post-map-modes {
  position: absolute;
  z-index: 1;
  bottom: var(--bottom);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(86%, 16.5rem);
  gap: 4px;
  padding: 4px;
  border: 1px solid #ad9568;
  border-top-color: #f3d597;
  border-radius: 17px 9px;
  background: radial-gradient(ellipse at 50% 0%, #61758847, transparent 65%), linear-gradient(145deg, #294149, #112a35);
  box-shadow: inset 0 0 0 1px #dbc18d40, 0 3px 0 #0b1d27, 0 6px 15px #0a1c27a6;
  white-space: nowrap;
}
.post-map-modes button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1.7vw, 9px);
  min-width: 0;
  min-height: 44px;
  padding: 3px 4px;
  border: 1px solid #a7babb32;
  border-radius: 12px 6px;
  background: linear-gradient(147deg, #42616959, #172f38bd);
  color: #f0eadc;
  font-weight: 850;
  font-size: var(--text-body);
  text-shadow: 0 1px 3px #14262b;
}
.post-map-modes img {
  width: clamp(24px, 6vw, 35px);
  height: clamp(24px, 6vw, 35px);
  object-fit: contain;
  filter: drop-shadow(0 2px 2px #1421248c);
}
.post-map-modes button > span { display: grid; gap: 1px; text-align: left; line-height: 1.12; }
.post-map-modes small { color: #d4c8ac; font-size: .61rem; font-weight: 700; }
.post-map-modes [data-locked="true"] { color: #e1dacb; background: linear-gradient(155deg, #263f4c, #20363f); }
.post-map-modes button[aria-pressed="true"] {
  border-color: #e4c78b;
  color: #fff2cf;
  background: radial-gradient(ellipse at 22% -10%, #7c92748c, transparent 72%), linear-gradient(145deg, #586d61, #28494b);
  box-shadow: inset 0 0 0 2px #e3c4825c, 0 2px 4px #101f24b8;
}
.post-map-modes [data-post-difficulty="hard"][aria-pressed="true"] {
  border-color: #cfdaee;
  color: #f0f6ff;
  background: radial-gradient(ellipse at 26% 0%, #6a85a8, transparent 72%), linear-gradient(145deg, #536b87, #293d58);
  box-shadow: inset 0 0 0 2px #c3daf256, 0 2px 4px #101f249e;
}
:is(.post-stage-node, .post-attempt-chip, .post-map-modes button):focus-visible {
  outline: 2px solid #ffe4a5;
  outline-offset: 2px;
}

.game-dialog[data-wind-post-panel] {
  --dialog-width: 24.5rem;
  --post-panel-line: #bc9a655c;
  --post-panel-shade: #233c3e;
  padding: 0;
  border: 1px solid #c5a578;
  border-radius: 19px 7px;
  color: var(--post-challenge-ink);
  background: linear-gradient(145deg, #253f40, #132c31 70%);
  box-shadow: 0 20px 54px #081a21c2, 0 4px 0 #0a212a;
}
.game-dialog[data-wind-post-panel][data-difficulty="hard"] {
  --post-challenge-gold: #b7daee;
  --post-panel-line: #b5d3df56;
  --post-panel-shade: #202f46;
  border-color: #9ebcd0;
  background: linear-gradient(145deg, #273a50, #132939 74%);
}
.game-dialog[data-wind-post-panel]::backdrop { background: #071b23b8; }
.post-dialog-heading {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 4px;
  min-height: 76px;
  padding: 15px 53px 11px 16px;
  border-bottom: 1px solid var(--post-panel-line);
  background: linear-gradient(100deg, #0d282d, #294445);
}
.post-dialog-heading::after {
  content: "";
  width: 29px;
  height: 2px;
  margin-top: 4px;
  margin-bottom: -12px;
  background: var(--post-challenge-gold);
}
.game-dialog[data-wind-post-panel] .post-dialog-heading h2 {
  margin: 0;
  padding: 0;
  color: var(--post-challenge-ink);
  font: 700 clamp(1.35rem, 6vw, 1.9rem)/1.15 var(--post-challenge-serif);
  text-align: start;
  text-shadow: 0 2px 4px #091b23;
}
.post-dialog-heading p {
  margin: 0;
  color: var(--post-challenge-gold);
  font-size: var(--text-small);
  font-weight: 750;
}
[data-wind-post-panel="stage"] .post-dialog-heading {
  background: linear-gradient(90deg, #0d242bf7 16%, #102930b3 62%, #0f27333b),
    url("assets/wind-post-route-normal.webp") center 19% / cover;
}
[data-wind-post-panel="stage"][data-difficulty="hard"] .post-dialog-heading {
  background: linear-gradient(90deg, #0d2034f5 16%, #142b45ad 62%, #172f473b),
    url("assets/wind-post-route-hard.webp") center 23% / cover;
}
[data-wind-post-panel="purchase"] .post-dialog-heading {
  min-height: clamp(96px, 17dvh, 120px);
  background: linear-gradient(90deg, #0d2631ef 1%, #0d263160 52%, #0d263100),
    url("assets/wind-post-attempt-counter.webp") center / cover;
}
.game-dialog[data-wind-post-panel="difficulty"] {
  --dialog-width: 25rem;
  --post-panel-line: #bca67779;
  border-color: #c3a672;
  border-top-color: #f3dda7;
  border-radius: 13px 30px 13px 27px;
  background: radial-gradient(ellipse at 75% 0%, #4d778b45, transparent 69%), linear-gradient(154deg, #243c49, #142935);
  box-shadow: 0 5px 0 #132830, 0 20px 47px #071823c2, inset 0 0 0 2px #e5c68b22;
}
[data-wind-post-panel="difficulty"] .post-dialog-heading {
  min-height: clamp(6.25rem, 17dvh, 9rem);
  justify-content: center;
  padding: 15px 49px 15px 17px;
  background:
    linear-gradient(90deg, #132a3bd9, #162a39a8 39%, #162a3922 72%),
    url("assets/garden-ui/wind-post-hard-lock-header.webp") center / cover;
}
[data-wind-post-panel="difficulty"] .post-dialog-heading::after {
  width: 34px;
  margin-bottom: 0;
  background: linear-gradient(90deg, #f8dba0, transparent);
}
.game-dialog[data-wind-post-panel="difficulty"] .post-dialog-heading h2 {
  font-size: clamp(1.36rem, 5.55vw, 1.72rem);
  letter-spacing: .036em;
}
.game-dialog[data-wind-post-panel] .dialog-close {
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--post-challenge-ink);
  border-radius: 9px 4px;
}
.game-dialog[data-wind-post-panel] .collection-close-icon {
  width: 30px;
  height: 30px;
  border: 1px solid var(--post-panel-line);
  border-radius: 8px 3px;
  background: #11272dc9;
}
.game-dialog[data-wind-post-panel] .dialog-close:hover { transform: none; }
.game-dialog[data-wind-post-panel] .dialog-scroll { padding: 13px 15px 2px; }
.game-dialog[data-wind-post-panel] .dialog-body { color: var(--post-challenge-ink); }
.game-dialog[data-wind-post-panel] .dialog-actions {
  gap: 6px;
  margin: 0;
  padding: 9px 15px 14px;
}
.game-dialog[data-wind-post-panel] .dialog-actions .game-button {
  min-height: 44px;
  border: 1px solid #e9c486;
  border-radius: 10px 4px;
  color: #392e22;
  background: linear-gradient(140deg, #f9e4b3, #d3aa69);
  box-shadow: 0 2px 0 #071b21, inset 0 0 0 2px #fff1ce40;
  text-shadow: none;
}
.game-dialog[data-wind-post-panel] .dialog-actions .game-button-alt {
  color: var(--post-challenge-ink);
  background: linear-gradient(145deg, #315255, #1d383f);
  border-color: var(--post-panel-line);
  box-shadow: 0 2px 0 #071b21;
}
.game-dialog[data-wind-post-panel] .dialog-actions .game-button:disabled {
  color: #bdc9c5;
  border-color: #a0b1ad66;
  background: #294044;
  opacity: 1;
}
.game-dialog[data-wind-post-panel="difficulty"] .collection-close-icon {
  border: 1px solid #e0c18da6;
  border-radius: 50%;
  background: radial-gradient(ellipse at 26% 0%, #526571, #142a39);
}
.game-dialog[data-wind-post-panel="difficulty"] .post-difficulty-message {
  margin: 0;
  padding: .7rem .75rem;
  border-top: 1px solid #d3b78943;
  border-bottom: 1px solid #d3b78943;
  background: linear-gradient(90deg, transparent, #aecce51b, transparent);
  text-align: center;
  line-height: 1.55;
}
.post-difficulty-message strong { margin-inline: .15em; color: #ffe7af; white-space: nowrap; }
.game-dialog[data-wind-post-panel="difficulty"] .dialog-actions { justify-content: center; padding-top: 12px; }
.game-dialog[data-wind-post-panel="difficulty"] .dialog-actions .game-button {
  flex: 0 1 min(76%, 12.4rem);
  border-radius: 20px;
  background: radial-gradient(ellipse at 22% -10%, #fffae6, transparent 70%), linear-gradient(150deg, #f2d9a7, #c59a66);
  box-shadow: inset 0 0 0 2px #fff0c968, 0 3px 0 #7a5c3b, 0 5px 8px #12232daa;
}
.game-dialog[data-wind-post-panel] button:focus-visible { outline: 2px solid #ffe4a5; outline-offset: 1px; }
.game-dialog[data-wind-post-panel] .post-panel-note, .post-stage-summary {
  color: var(--post-challenge-muted);
  font-size: var(--text-small);
}
.post-stage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  color: var(--post-challenge-gold);
  font-weight: 750;
}
.post-panel-warning {
  padding: 7px 9px;
  border-inline-start: 2px solid #edbb78;
  color: #ffdbad;
  background: #c9824326;
  font-size: var(--text-small);
}
.post-stage-objective {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--post-panel-line);
  border-radius: 10px 4px;
  background: var(--post-panel-shade);
}
.post-delivery-mark { object-fit: contain; }
.post-stage-objective .post-delivery-mark { width: 42px; height: 42px; }
.post-stage-objective > div { display: grid; line-height: 1.15; }
.post-stage-objective span { color: var(--post-challenge-muted); font-size: var(--text-small); font-weight: 750; }
.post-stage-objective strong { font-size: var(--text-heading); font-variant-numeric: tabular-nums; }
.post-stage-objective strong small { color: var(--post-challenge-muted); font-size: var(--text-label); }
.post-stage-duration { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.post-stage-duration .icon { width: 15px; height: 15px; color: var(--post-challenge-gold); }
.post-stage-payout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 10px 0 0;
  padding: 7px 0;
  border-block: 1px solid var(--post-panel-line);
  list-style: none;
}
.post-stage-payout li { display: grid; justify-items: center; gap: 3px; font-size: var(--text-label); }
.post-stage-payout li + li { border-inline-start: 1px solid var(--post-panel-line); }
.post-stage-payout .carved-stars { --star-size: clamp(12px, 3.6vw, 16px); gap: 2px; }
.post-stage-payout .carved-stars i:not(.earned)::before,
.post-stage-result-stars .carved-stars i:not(.earned)::before { background: #8c8068; }
.post-stage-result-stars { display: flex; justify-content: center; margin-bottom: 11px; }
.post-stage-result-stars .carved-stars { --star-size: clamp(1.85rem, 8vw, 2.65rem); }
.post-purchase-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid #b99b6294;
  border-radius: 4px 12px;
  background: linear-gradient(115deg, #d6b37622, #e8bf802f);
  color: var(--post-challenge-gold);
  font-size: var(--text-label);
  font-weight: 750;
}
.post-purchase-ticket strong { display: inline-flex; align-items: center; gap: 5px; color: var(--post-challenge-ink); }
.post-purchase-ticket img { width: 27px; height: 27px; object-fit: contain; }
.post-purchase-ticket b { font-size: var(--text-heading); line-height: 1; font-variant-numeric: tabular-nums; }
.post-purchase-balances { margin: 8px 0 4px; font-size: var(--text-label); }
.post-purchase-balances > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 1px;
  border-bottom: 1px solid var(--post-panel-line);
}
.post-purchase-balances dt { color: var(--post-challenge-muted); }
.post-purchase-balances dd { margin: 0; font-weight: 850; text-align: end; font-variant-numeric: tabular-nums; }
@media (max-height: 425px) {
  .post-dialog-heading { min-height: 62px; padding-top: 9px; }
  [data-wind-post-panel="purchase"] .post-dialog-heading { min-height: 74px; }
  .game-dialog[data-wind-post-panel] .dialog-scroll { padding-top: 9px; }
  .game-dialog[data-wind-post-panel] .dialog-actions { padding-bottom: 10px; }
}
