#game-window > #page-meadow { position: relative; }
#game-window > #page-meadow:has(.meadow-hex) { padding-top: 0; }
#game-window:has(.meadow-hex) > .scene-title { visibility: hidden; }

#game-window .meadow-hex,
#game-window .meadow-hex-dock {
  --linen: #f3e4d4;
  --linen-deep: #efe0cc;
  --ink: #4a3024;
  --berry: #9b1c22;
  --stitch: #c4a882;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

#game-window .meadow-hex-dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  background: transparent;
}

#game-window .meadow-hex-launch,
#game-window .meadow-hex button {
  font: 600 16px/1.2 Georgia, serif;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
}

#game-window .meadow-hex-launch {
  pointer-events: auto;
  padding: 10px 18px;
  color: var(--ink);
  background: #f6eadc;
  border: 1px solid var(--berry);
  border-radius: 999px;
  box-shadow: 0 8px 18px #8b5a3233;
}

#game-window .meadow-hex-launch:disabled,
#game-window .meadow-hex button:disabled { opacity: 0.55; cursor: default; }

#game-window .meadow-hex-note {
  margin: 8px 0 0;
  color: var(--berry);
  background: transparent;
  text-align: center;
}

#game-window .meadow-hex {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: linear-gradient(180deg, #f7ecdf 0%, #f3e4d4 42%, #efe0cc 100%);
  overflow: hidden;
}

#game-window .meadow-hex-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px 18px 10px;
  background: transparent;
  border-bottom: 1px solid #e6d3bc;
  flex: none;
}

#game-window .meadow-hex-bar h2 {
  margin: 0;
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #5c3b28;
  white-space: nowrap;
}

#game-window .meadow-hex-counts {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  color: #5c3b28;
}

#game-window .meadow-hex-counts span { display: inline-flex; align-items: center; gap: 6px; }

#game-window .meadow-hex-counts img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

#game-window .meadow-hex-counts b {
  font-weight: 600;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}

#game-window .meadow-hex-extra {
  font-size: 15px;
  color: #5c3b28;
}

#game-window .meadow-hex-camp {
  justify-self: end;
  background: #f8f1e6;
  color: #5c3b28;
  border: 1px solid #b08968;
  border-radius: 10px;
  padding: 8px 16px;
  box-shadow: inset 0 0 0 1px #fff8ee;
  white-space: nowrap;
}

#game-window .meadow-hex-main {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-rows: minmax(0, 1fr);
  padding: 4px 8px 8px 2px;
}

#game-window .meadow-hex-map {
  min-width: 0;
  min-height: 0;
  height: 100%;
  position: relative;
  background: transparent;
}

#game-window .meadow-hex-map svg {
  width: 100%;
  height: 100%;
  display: block;
}

#game-window .meadow-hex-card {
  align-self: center;
  max-height: 100%;
  overflow: auto;
  margin: 6px 6px 6px 0;
  padding: 16px 14px 16px;
  background: linear-gradient(180deg, #fbf3e7 0%, #f4e6d4 100%);
  border: 1px solid #c6a37c;
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 1px #f8f1e6,
    inset 0 0 0 5px #f3e4d4,
    inset 0 0 0 6px #d7b894,
    0 10px 22px #8b5a3224;
  text-align: center;
}

#game-window .meadow-hex-plate {
  position: relative;
  margin: 2px 6px 8px;
  border-radius: 12px;
  overflow: hidden;
  background: #f6ead8;
  box-shadow: inset 0 0 0 1px #e6d3b8;
}

#game-window .meadow-hex-art {
  width: 100%;
  height: auto;
  aspect-ratio: 400 / 268;
  object-fit: cover;
  object-position: center;
  display: block;
}

#game-window .meadow-hex-plate.is-haze::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, rgba(255, 248, 228, 0.42), rgba(246, 212, 138, 0.74));
  pointer-events: none;
}

#game-window .meadow-hex-card h3 {
  margin: 2px 8px 4px;
  font-size: 26px;
  font-weight: 600;
  color: #5a3828;
}

#game-window .meadow-hex-card p { margin: 6px 8px; color: #5c4032; }
#game-window .meadow-hex-flavor { margin: 0 10px 8px; color: #6d5344; font-size: 15px; line-height: 1.35; }
#game-window .meadow-hex-rare { margin: 0 8px 2px; color: #8e2433; font-size: 14px; }

#game-window .meadow-hex-pips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 4px 0 2px;
  min-height: 28px;
}

#game-window .meadow-hex-pips img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

#game-window .meadow-hex-pips .pip-off { opacity: 0.28; }

#game-window .meadow-hex-clock {
  margin: 2px 0 0;
  color: #6a4632;
  font-size: 20px;
  letter-spacing: 0.04em;
}

#game-window .meadow-hex-gather {
  width: calc(100% - 12px);
  margin: 10px auto 0;
  display: block;
  background: #8e2433;
  color: #fff8ef;
  border: 0;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 18px;
  box-shadow: inset 0 -2px 0 #6d1826;
}

#game-window .meadow-hex button.meadow-hex-gather:disabled {
  opacity: 1;
  cursor: default;
  filter: saturate(0.86);
}

#game-window .meadow-hex-ghost {
  width: calc(100% - 12px);
  margin: 8px auto 0;
  display: block;
  background: #f8f1e6;
  color: var(--ink);
  border: 1px solid #8d6b52;
  border-radius: 10px;
}

#game-window .meadow-hex-skarb { color: var(--berry); font-weight: 700; }
#game-window .meadow-hex-card[role="alert"] { border-color: #e0a15a; box-shadow: inset 0 0 0 1px #f8f1e6, inset 0 0 0 5px #f3e4d4, inset 0 0 0 6px #e0a15a, 0 10px 22px #8b5a3224; }

#game-window .hex-cell { cursor: pointer; }
#game-window .hex-cell[aria-disabled="true"] { cursor: default; }
#game-window .hex-cell:focus-visible { outline: none; }
#game-window .hex-cell:focus-visible polygon { stroke: #8e2433; stroke-width: 2.6; stroke-opacity: 1; }
#game-window .hex-cell.is-selected polygon { stroke: #fff6df; stroke-width: 2.2; stroke-opacity: 0.95; }

@media (max-width: 800px) {
  #game-window .meadow-hex-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 0; }
  #game-window .meadow-hex-card { margin: 8px; padding: 10px; align-self: stretch; }
  #game-window .meadow-hex-art { aspect-ratio: 400 / 180; }
  #game-window .meadow-hex-card h3 { font-size: 18px; margin: 2px 0; }
  #game-window .meadow-hex-card p { margin: 2px 0; }
  #game-window .meadow-hex-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }
  #game-window .meadow-hex-bar h2 { font-size: 18px; }
  #game-window .meadow-hex-counts { grid-column: 1 / -1; justify-content: flex-start; gap: 12px; }
  #game-window .meadow-hex-counts b { font-size: 18px; }
  #game-window .meadow-hex button { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  #game-window .meadow-hero { transition: none !important; }
}
