/* Star ground: the US map with "good ground here" markers, the grower cards and the field detail. */

.sg-wrap {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #0009;
}
.sg-box {
  width: min(1180px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--fh-bg);
  color: var(--fh-ink);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px #0007;
}
.sg-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 20px;
  background: linear-gradient(120deg, #14291e, #2c4a2a);
  color: #f0efdc;
}
.sg-head > div {
  flex: 1;
}
.sg-head .eyebrow {
  color: var(--lime);
}
.sg-head h3 {
  margin: 2px 0 4px;
  font-size: 26px;
}
.sg-head p {
  margin: 0;
  max-width: 70ch;
  color: #d6dccb;
}
.sg-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  overflow: hidden;
}
.sg-mapcol {
  padding: 16px;
  overflow: auto;
}
.sg-mapwrap {
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 40%, var(--fh-surface), var(--fh-bg));
  border: 1px solid var(--fh-line);
  padding: 8px;
}
.sg-map {
  width: 100%;
  height: auto;
  display: block;
}
.sg-map path {
  fill: color-mix(in srgb, var(--fh-ink) 8%, var(--fh-surface));
  stroke: var(--fh-surface);
  stroke-width: 1;
}
.sg-map path.sg-has {
  fill: color-mix(in srgb, var(--lime) 34%, var(--fh-surface));
  cursor: pointer;
}
.sg-map path.sg-has:hover,
.sg-map path.sg-on {
  fill: color-mix(in srgb, var(--lime) 60%, var(--fh-surface));
}
.sg-pin {
  cursor: pointer;
  outline: none;
}
.sg-pin > path {
  fill: #c0392b;
  stroke: #fff;
  stroke-width: 1.6;
  filter: drop-shadow(0 2px 2px #0006);
  transition: transform 0.2s;
}
.sg-pin .sg-dot {
  fill: #fff;
}
.sg-pin:hover > path,
.sg-pin:focus-visible > path,
.sg-pin.on > path {
  transform: scale(1.25);
  fill: #e67e22;
}
.sg-pulse {
  fill: #c0392b;
  opacity: 0;
  transform-origin: 0 0;
  animation: sg-pulse 2.4s ease-out infinite;
}
@keyframes sg-pulse {
  0% {
    opacity: 0.45;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(1.6);
  }
}
@media (prefers-reduced-motion: reduce) {
  .sg-pulse {
    animation: none;
  }
}
html[data-motion='calm'] .sg-pulse {
  animation: none;
}
.sg-privacy {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--fh-muted);
}
.sg-loading,
.sg-empty,
.sg-hint {
  color: var(--fh-muted);
  font-size: 13px;
}
.sg-side {
  overflow: auto;
  padding: 16px 18px;
  background: var(--fh-surface);
  border-left: 1px solid var(--fh-line);
}
.sg-side h4 {
  margin: 0 0 6px;
}
.sg-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.sg-card {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--fh-line);
  background: var(--fh-bg);
  color: var(--fh-ink);
  text-align: left;
  cursor: pointer;
}
.sg-card:hover,
.sg-card:focus-visible {
  border-color: var(--fh-accent-ink);
}
.sg-card img,
.sg-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  display: grid;
  place-items: center;
  background: var(--fh-accent-soft);
  font-size: 22px;
}
.sg-card > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.sg-card small {
  color: var(--fh-muted);
  font-size: 12px;
}
.sg-card em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: var(--fh-good);
}
.sg-who {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 10px 0;
}
.sg-who > div {
  flex: 1;
}
.sg-who img {
  border-radius: 50%;
  object-fit: cover;
}
.sg-who h4 {
  margin: 0;
  font-size: 20px;
}
.sg-who p {
  margin: 2px 0 0;
  color: var(--fh-muted);
}
.sg-shape {
  width: 72px;
  height: 72px;
  flex: none;
}
.sg-shape path,
.sg-field .rg-field-shape path {
  fill: color-mix(in srgb, var(--lime) 30%, transparent);
  stroke: var(--fh-accent-ink);
  stroke-width: 2;
}
.sg-bench {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--fh-warn-bg);
  color: var(--fh-ink);
}
.sg-bench span {
  color: var(--fh-muted);
}
.sg-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}
.sg-actions small {
  color: var(--fh-muted);
}
.sg-note {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--fh-info-bg);
  font-size: 13px;
}
.sg-note.ok {
  background: var(--fh-good-bg);
  color: var(--fh-good);
}
.sg-board h5 {
  margin: 14px 0 6px;
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--fh-muted);
}
.sg-board tr.you td {
  font-weight: 700;
}
.sg-board small {
  color: var(--fh-muted);
}
.sg-store {
  border-color: color-mix(in srgb, var(--lime) 50%, transparent);
}
@media (max-width: 860px) {
  .sg-body {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .sg-side {
    border-left: 0;
    border-top: 1px solid var(--fh-line);
    overflow: visible;
  }
  .sg-wrap {
    padding: 0;
  }
  .sg-box {
    border-radius: 0;
    height: 100%;
  }
}

/* Front page: "Farm with the greats" card at the top of the landing rail (star-teaser.js). */
.star-teaser {
  position: relative;
  display: grid;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 14px 16px 14px;
  border: 1px solid #e5c27866;
  border-radius: 6px;
  background: linear-gradient(150deg, #12291ff2, #1d3f2ce8 60%, #2c3f1de6);
  box-shadow: 0 12px 45px #0003;
  backdrop-filter: blur(12px);
  color: #f3efdf;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.25s,
    border-color 0.25s,
    box-shadow 0.25s;
}
.star-teaser[hidden] {
  display: none;
}
.star-teaser:hover,
.star-teaser:focus-visible {
  border-color: #e6bd70;
  box-shadow: 0 14px 50px #0005;
}
.star-teaser:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 2px;
}
.star-teaser .st-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.star-teaser .eyebrow {
  font-size: 9px;
  letter-spacing: 2px;
  color: #e8c985;
}
.star-teaser .st-new {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 2px 7px;
  border-radius: 99px;
  background: #e6bd70;
  color: #14261b;
}
.st-mapbox {
  position: relative;
  display: block;
  margin: 2px -4px 0;
}
.st-map {
  display: block;
  width: 100%;
  height: auto;
}
.st-map > path {
  fill: #ffffff14;
  stroke: #12291f;
  stroke-width: 1.2;
}
.st-map > path.st-has {
  fill: #e6bd7055;
}
.st-pin .st-drop > path {
  fill: #e6bd70;
  stroke: #14261b;
  stroke-width: 2;
}
.st-pin .st-drop > circle {
  fill: #14261b;
}
.st-pin .st-drop {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.st-pin.on .st-drop {
  transform: scale(1.45);
}
.st-pin.on .st-drop > path {
  fill: #fff3c8;
}
.st-pulse {
  fill: #e6bd70;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
}
.st-count {
  position: absolute;
  left: 4px;
  bottom: 0;
  font-size: 10px;
  letter-spacing: 0.6px;
  color: #d6dccb;
}
.st-count b {
  color: #f3e0b0;
}
.st-head {
  font-family: 'Barlow Condensed', Impact, sans-serif;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: 0.3px;
}
.st-head em {
  font-style: normal;
  color: #e6bd70;
}
.st-sub {
  font-size: 12px;
  color: #d6dccb;
}
.st-sub b {
  color: #fff;
}
.st-spot {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #0000002e;
}
.st-spot img,
.st-spot i {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e6bd70;
  display: grid;
  place-items: center;
  font-style: normal;
}
.st-spot span {
  display: grid;
  min-width: 0;
}
.st-spot b {
  font-size: 13px;
}
.st-spot small {
  font-size: 10.5px;
  color: #cfd6c4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-cta {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: #e6bd70;
}
.st-cta span {
  display: inline-block;
  transition: transform 0.2s;
}
.star-teaser:hover .st-cta span {
  transform: translateX(4px);
}
body.entering .star-teaser {
  pointer-events: none;
}

/* Motion only on Full motion without a reduced-motion request. */
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion='calm']) .st-pulse {
    animation: st-pulse 2.6s ease-out infinite;
    animation-delay: var(--d, 0s);
  }
  html:not([data-motion='calm']) .st-spot.st-in {
    animation: st-in 0.45s ease-out;
  }
  html:not([data-motion='calm']) .star-teaser.st-first {
    animation: st-glow 2.8s ease-in-out 1.2s 3;
  }
  html:not([data-motion='calm']) .star-teaser.st-first .st-drop {
    animation: st-drop 0.6s cubic-bezier(0.3, 1.5, 0.5, 1) both;
    animation-delay: calc(0.5s + var(--d, 0s) * 2);
  }
  html:not([data-motion='calm']) .star-teaser:hover {
    transform: translateY(-2px);
  }
}
@keyframes st-pulse {
  0% {
    opacity: 0.55;
    transform: scale(0.3);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}
@keyframes st-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}
@keyframes st-drop {
  from {
    opacity: 0;
    transform: translateY(-40px) scale(0.6);
  }
}
@keyframes st-glow {
  0%,
  100% {
    box-shadow: 0 12px 45px #0003;
  }
  50% {
    box-shadow:
      0 0 0 2px #e6bd70aa,
      0 0 34px #e6bd7066;
  }
}
.star-teaser.st-first {
  border-color: #e6bd70;
}

/* Short desktop screens: keep the rail on screen by trimming the card. */
@media (max-height: 800px) and (min-width: 701px) {
  .star-teaser {
    padding: 11px 13px;
    gap: 4px;
  }
  .st-head {
    font-size: 21px;
  }
  .st-head br {
    display: none;
  }
}
@media (max-height: 680px) and (min-width: 701px) {
  .st-mapbox,
  .st-spot {
    display: none;
  }
}
/* Phones: a slim strip (map, headline, arrow) under the countdown. */
@media (max-width: 700px) {
  .star-teaser {
    grid-template-columns: 84px 1fr;
    grid-template-areas:
      'map top'
      'map head'
      'map sub';
    align-items: center;
    column-gap: 10px;
    row-gap: 1px;
    padding: 8px 12px;
  }
  .star-teaser .st-top {
    grid-area: top;
  }
  .st-mapbox {
    grid-area: map;
    margin: 0;
  }
  .st-head {
    grid-area: head;
    font-size: 17px;
  }
  .st-head br {
    display: none;
  }
  .st-sub {
    grid-area: sub;
    font-size: 11px;
  }
  .st-count,
  .st-spot,
  .st-cta {
    display: none;
  }
  /* Make room under the rail for the strip (library.css puts the intro at 262px). */
  body.has-star-teaser:not(.playing) #world {
    min-height: 920px;
  }
  body.has-star-teaser:not(.playing) #world .intro {
    top: 332px;
  }
}

/* Desktop screens up to 1150 px tall: the teaser becomes a slim card (small map beside the headline) so the
   premiere countdown under it stays on screen. */
@media (max-height: 1150px) and (min-width: 701px) {
  .star-teaser {
    grid-template-columns: 96px 1fr;
    grid-template-areas:
      'map top'
      'map head'
      'map sub'
      'map cta';
    align-items: center;
    column-gap: 12px;
    row-gap: 2px;
    padding: 10px 14px;
  }
  .star-teaser .st-top {
    grid-area: top;
  }
  .st-mapbox {
    grid-area: map;
    margin: 0;
  }
  .st-head {
    grid-area: head;
    font-size: 19px;
  }
  .st-head br {
    display: none;
  }
  .st-sub {
    grid-area: sub;
    font-size: 11px;
  }
  .st-cta {
    grid-area: cta;
    font-size: 9px;
  }
  .st-count,
  .st-spot {
    display: none;
  }
}
@media (max-height: 680px) and (min-width: 701px) {
  .star-teaser {
    grid-template-columns: 1fr;
    grid-template-areas: 'top' 'head' 'sub' 'cta';
  }
}
