/* One-time cartridge-style title screen. Artwork is the same valley as the farm. */
#market-opening {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  border: 0;
  padding: 0;
  width: min(960px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  margin: auto;
  color: #fbefd3;
  background: #172b29;
  scrollbar-color: #976849 #172b29;
  outline: 1px solid #d9a567;
  box-shadow: 0 0 0 6px #142321, 0 16px 70px #0a1715;
}
#market-opening::backdrop { background: #101e1def; }
.opening-spread {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  min-height: min(510px, 80dvh);
}
.opening-valley {
  display: flex;
  position: relative;
  min-height: 200px;
  background: #857e96 url('../resources/ui/desktop-meadow.webp') 19% 53% / cover no-repeat;
  border-right: 1px solid #8b7250;
  align-items: end;
}
.opening-caption {
  color: #fff0ca;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  background: #192c25ed;
  padding: 12px 15px;
  font: 600 10px/1.35 ui-monospace, monospace;
  letter-spacing: .13em;
}
.opening-copy {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(23px, 4.5vw, 52px);
}
.opening-stamp {
  color: #f1be79;
  border-bottom: 1px solid #8a6f54;
  padding: 0 0 8px;
  margin: 0 0 18px;
  font: bold 10px/1.3 ui-monospace, monospace;
  letter-spacing: .14em;
}
#market-opening-title {
  margin: 0 0 15px;
  font: 800 clamp(34px, 5.2vw, 67px)/.94 Georgia, serif;
  letter-spacing: -.055em;
  color: #fff1cf;
  text-wrap: balance;
}
#market-opening-title span { display: block; color: #ffd08a; }
#market-opening-description {
  max-width: 27ch;
  margin: 0 0 24px;
  color: #e0d9bb;
  font: 400 clamp(15px, 2vw, 19px)/1.45 Georgia, serif;
  text-wrap: pretty;
}
#market-opening button {
  min-width: min(100%, 175px);
  min-height: 46px;
  background: #f5c482;
  border: 1px solid #40301f;
  box-shadow: 2px 3px #101915;
  border-radius: 0;
  color: #241e17;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 13px;
  font: bold 14px/1.2 ui-monospace, monospace;
  touch-action: manipulation;
}
#market-opening button:hover { background: #ffdb9e; }
#market-opening button:focus-visible { outline: 2px solid #f2e4bf; outline-offset: 4px; }
#market-opening button img { width: 23px; height: 23px; object-fit: contain; image-rendering: pixelated; }
.opening-credit { margin: 18px 0 0; color: #aeb7a1; font: 10px/1.3 ui-monospace, monospace; letter-spacing: .08em; }
@media (max-width: 650px) {
  #market-opening { width: min(500px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); }
  .opening-spread { grid-template-columns: 1fr; min-height: 0; }
  .opening-valley { min-height: clamp(126px, 31dvh, 244px); background-position: 32% 55%; border: 0; }
  .opening-copy { padding: 20px 23px 24px; }
  .opening-stamp { margin-bottom: 12px; }
  #market-opening-title { font-size: clamp(36px, 11vw, 57px); margin-bottom: 11px; }
  #market-opening-description { margin-bottom: 17px; }
  .opening-credit { margin-top: 13px; }
}
@media (max-height: 445px) and (min-width: 520px) {
  .opening-spread { grid-template-columns: 1fr 1fr; }
  .opening-copy { padding: 12px 21px; }
  #market-opening-description { margin-bottom: 12px; }
  .opening-valley { min-height: 140px; }
  .opening-stamp { margin-bottom: 9px; }
  #market-opening-title { font-size: clamp(30px, 9dvh, 48px); margin-bottom: 9px; }
}

/* The paper seed packet in First Light follows the player onto the farm. */
#first-seed-ticket {
  order: 2;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  min-height: 44px;
  background: #263b30;
  color: #ffedcc;
  border: 1px solid #a8794a;
  box-shadow: inset 0 0 0 2px #344c38;
  padding: 4px 9px;
}
#first-seed-ticket[hidden] { display: none !important; }
#first-seed-ticket .seed-ticket-icon { width: 26px; height: 26px; object-fit: contain; image-rendering: pixelated; }
#first-seed-ticket .seed-ticket-copy { flex: 1; min-width: 0; }
#first-seed-ticket .seed-ticket-title { display: block; font-weight: bold; font-size: 14px; }
#first-seed-ticket .seed-ticket-note { display: block; color: #ead4a6; font-size: 11px; }
#first-seed-ticket .seed-ticket-button {
  min-height: 36px;
  min-width: 0;
  padding: 4px 11px;
  color: #271c15;
  background: #f5c482;
  border: 1px solid #422f25;
  box-shadow: 2px 2px #17271f;
  white-space: nowrap;
}
#first-seed-ticket .seed-ticket-button[hidden] { display: none !important; }
#first-seed-ticket .seed-ticket-button:focus-visible,
#grid .starter-seed-plot:focus-visible { outline: 2px solid #ffde93; outline-offset: 2px; }
#grid .starter-seed-plot {
  box-shadow: inset 0 0 0 2px #ffc471, 0 0 0 1px #8c623c;
  cursor: pointer;
}
#grid .starter-seed-plot .seed-plot-ghost {
  width: 55%; height: 55%;
  opacity: .78; pointer-events: none;
  image-rendering: pixelated;
  filter: drop-shadow(1px 1px #243225);
}
@media (max-width: 650px) {
  #first-seed-ticket { min-height: 46px; }
  #first-seed-ticket .seed-ticket-button { min-height: 44px; }
}
/* The real seed action replaces the older, collapsible pointing instruction. */
#farm-panel:has(#first-seed-ticket:not([hidden])) #guidance-panel { display: none; }
