:root {
  color-scheme: light;
  --ink: #183546;
  --muted: #5e7480;
  --panel: #f8fcfb;
  --line: #c7dedb;
  --accent: #2c7886;
  --accent-2: #e2b65b;
  --good: #23765a;
  --try: #a55b37;
}

* { box-sizing: border-box; }

html, body, #app { width: 100%; min-height: 100%; }

html { background: #e8efe8; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(circle at 15% 0, #d8eef0, #eef6f2 50%, #e8efe8);
  color: var(--ink);
  font-family: ui-rounded, "Avenir Next", system-ui, sans-serif;
}

button, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.screen {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: clamp(16px, 4vw, 40px);
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.loader-mark { color: var(--accent); font-size: 4rem; }

.panel {
  background: #ffffffc9;
  border: 1px solid #cfe1dd;
  border-radius: 28px;
  box-shadow: 0 14px 38px #35606a18;
}

.main-screen { min-height: 0; }

.main-header {
  width: 100%;
  min-height: 64px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.main-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 1.1rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-return {
  width: 58px;
  height: 48px;
  display: grid;
  grid-template-columns: 16px 28px;
  place-items: center;
  gap: 4px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff8d8, #ffba58);
  color: #4a2918;
  box-shadow: 0 7px 0 #9d5626, 0 12px 20px rgb(86 45 20 / 22%);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
  overflow: hidden;
}

.main-return img { width: 28px; height: 28px; object-fit: contain; }

.icon-btn, .close-btn {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffffb8;
  color: var(--ink);
  font-size: 1.25rem;
}

.main-copy { max-width: 720px; margin: 0 auto; }

.cover-wrap {
  position: relative;
  width: min(100%, 390px);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  border-radius: 24px;
  background: #c4e1e4;
  overflow: hidden;
}

@media (min-width: 700px) {
  .cover-wrap { width: 420px; }
}

.cover-wrap img { display: block; width: 100%; height: 100%; object-fit: cover; }

.cover-badge {
  position: absolute;
  left: 16px;
  bottom: 14px;
  max-width: calc(100% - 32px);
  padding: 8px 12px;
  border-radius: 999px;
  background: #ffffffde;
  font-size: .85rem;
}

.eyebrow {
  margin: .2rem 0 .45rem;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

h1, h2, h3 { line-height: 1.1; }
h1, h2 { margin: .15rem 0 .7rem; }
h1 { font-size: clamp(2rem, 6vw, 3.7rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.25rem); }
h3 { margin: 1.2rem 0 .5rem; }

.intro, .prompt, .rule { max-width: 680px; color: var(--muted); font-size: 1.08rem; line-height: 1.55; }

.main-progress {
  min-height: 42px;
  display: grid;
  align-items: center;
  margin: 18px 0 0;
  padding: 8px 14px;
  border: 1px solid #b9d9d5;
  border-radius: 15px;
  background: #e5f1ef;
  color: var(--accent);
  font-weight: 700;
}

.main-actions, .battle-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.primary, .secondary {
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 15px;
  padding: 11px 17px;
  font-weight: 700;
}

#startBtn { min-height: 52px; }
.primary { background: var(--accent); color: #fff; }
.secondary { border-color: var(--line); background: #fff; color: var(--ink); }
button:disabled { opacity: .48; cursor: not-allowed; }
.best { margin-top: 20px; color: var(--muted); }

[data-wp-standard-stage-screen] {
  padding: 14px 18px 12px;
  background: linear-gradient(180deg, #edf8f5, #d8ece8);
  color: var(--ink);
}

.stage-header, .battle-header {
  min-height: 56px;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 10px;
}

.stage-header > div, .battle-header > div { min-width: 0; text-align: center; }
.stage-header .eyebrow, .battle-header .eyebrow { margin: 0; }
.stage-header h2, .battle-header h2 { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.7rem; }
.stage-utility { width: 48px; height: 48px; }

.stage-tabs {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px auto 2px;
}

.stage-tabs span {
  min-height: 48px;
  display: inline-grid;
  place-items: center;
  padding: 8px 18px;
  border: 1px solid #b9d9d5;
  border-radius: 999px;
  background: #ffffffb8;
  color: var(--accent);
  font-weight: 800;
}

.stage-list { margin-top: 4px; }
.stage-card { color: var(--ink); text-align: start; }
.stage-card small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.35; }
.arrow { color: var(--accent); font-size: 1.5rem; }

/* Keep the previous card's hit point inside the clipped rail after the
   shared scaler centers the recommended final forecast. */
body[data-wp-game-id="animal-weather-watch"].wp-stage-select-active [data-wp-stage-rail] > .stage-card {
  flex-basis: 252px !important;
  width: 252px !important;
  min-width: 252px !important;
  max-width: 252px !important;
}

body[data-wp-game-id="animal-weather-watch"].wp-stage-select-active [data-wp-stage-rail] {
  gap: 0 !important;
}

@media (min-width: 1400px) and (min-height: 900px) {
  body[data-wp-game-id="animal-weather-watch"].wp-stage-select-active [data-wp-stage-rail] {
    padding-inline: 0 !important;
  }
}

[data-wp-logical-battle-canvas] {
  padding: 14px 18px 18px;
  background-color: #e9f5f1;
}

.battle-screen { color: var(--ink); }
.pill { justify-self: end; display: block; width: max-content; margin: 8px 0 0 auto; padding: 8px 12px; border-radius: 999px; background: #e5f1ef; color: var(--accent); font-weight: 700; white-space: nowrap; }
.prompt { margin-bottom: 8px; }
.rule { margin-top: 0; }
.sequence { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 22px 0; }
.sign { min-width: 84px; min-height: 88px; display: grid; place-content: center; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: 18px; background: #fff; text-align: center; }
.sign-icon { font-size: 2.2rem; }
.sign small { color: var(--muted); }
.sign.next { border-style: dashed; background: #f6faf8; color: var(--muted); }
.choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.choice { min-height: 100px; display: grid; place-content: center; gap: 3px; border: 2px solid var(--line); border-radius: 18px; background: #fff; color: var(--ink); text-align: center; }
.choice[aria-pressed="true"] { border-color: var(--accent); background: #e5f3f0; box-shadow: 0 0 0 3px #2c788622; }
.choice .sign-icon { font-size: 2rem; }
.selection { min-height: 1.5em; color: var(--accent); font-weight: 700; }
.status { min-height: 1.7em; margin: 18px 0 0; font-weight: 700; }
.status.good { color: var(--good); }
.status.try { color: var(--try); }

.battle-ad-reserve { display: none; height: 56px; }
body[data-screen="battle"] .battle-ad-reserve {
  display: block;
  position: fixed;
  inset: auto 0 0;
  width: 100%;
  height: 56px;
  min-height: 56px;
  pointer-events: none;
}

.result-panel {
  position: relative;
  z-index: 2;
  min-height: 100%;
  padding: 24px;
  border: 1px solid #cfe1dd;
  border-radius: 22px;
  background: #f8fcfbf7;
  overflow: auto;
}

/* The shared compact-landscape Result rule targets panels without a legacy
   `.hidden` class. Keep this owner state explicit so a hidden Result cannot
   become a full-canvas hit target while Battle is active. */
body[data-wp-game-id="animal-weather-watch"] #resultScreen {
  display: none !important;
}

body[data-wp-game-id="animal-weather-watch"][data-weather-state="result"] #resultScreen {
  display: grid !important;
}

.result-icon { color: var(--accent-2); font-size: 4rem; text-align: center; }
.result-icon.result-guide-wrap { width: min(100%, 240px); height: 230px; display: grid; place-items: end center; margin: 0 auto 16px; background: transparent; font-size: 0; }
.result-guide { display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }

/* Result replaces the challenge in the same logical Battle Canvas. The
   shared scaler intentionally stretches the Result panel to the full canvas,
   so remove the challenge hit targets while the replacement is open. */
body[data-wp-game-id="animal-weather-watch"][data-weather-state="result"] #battleScreen > :is(
  .battle-header,
  #progressPill,
  #prompt,
  #rule,
  #sequence,
  #selection,
  #choiceGrid,
  .battle-actions,
  #status
) {
  display: none !important;
}

.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #17374655; }
.modal-card { position: relative; width: min(100%, 420px); padding: 24px; border-radius: 22px; background: var(--panel); }
.close-btn { position: absolute; top: 14px; right: 14px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.toggle { min-width: 64px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
select { min-height: 44px; max-width: 62%; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; color: var(--ink); }

@media (max-width: 700px) {
  .screen { border-radius: 22px; }
  .choice-grid { gap: 8px; }
  .choice { min-height: 88px; }
}

@media (max-width: 480px) {
  .screen { padding: 18px 14px; }
  .main-header { gap: 8px; }
  .sequence { gap: 6px; }
  .sign { min-width: calc(25% - 5px); padding: 7px; }
  .sign-icon { font-size: 1.8rem; }
  .main-actions, .battle-actions { flex-direction: column; }
  .primary, .secondary { width: 100%; }
}
