/* Global boards for Farmgate Market. Page-level UI only: the game files are untouched. */
#fgBoardsBtn,
#fgBoardsLayer {
  --fgb-cream: #fffaf0;
  --fgb-card: #f7ecd6;
  --fgb-ink: #3b2a22;
  --fgb-soft: #806553;
  --fgb-line: #ead9b8;
  --fgb-green: #3fb95a;
  --fgb-gold: #f6c640;
  font-family: Fredoka, "Trebuchet MS", system-ui, sans-serif;
}

#fgBoardsBtn {
  position: fixed;
  z-index: 40;
  top: 5.4rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  border: 0;
  border-radius: 1rem;
  background: var(--fgb-cream, #fffaf0);
  color: var(--fgb-ink, #3b2a22);
  box-shadow: 0 .18rem 0 #3b2a2229, 0 .5rem 1.2rem #28180c26;
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease;
}
#fgBoardsBtn:hover {
  background: #fff;
  transform: translateY(-.1rem);
}
#fgBoardsBtn:active {
  transform: translateY(.06rem);
}
#fgBoardsBtn .fgb-ic {
  width: 1.35rem;
  height: 1.2rem;
  flex: none;
}

#fgBoardsLayer {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: .5rem;
  background: #241c1880;
  font-family: Fredoka, "Trebuchet MS", system-ui, sans-serif;
  color: var(--fgb-ink, #3b2a22);
}
#fgBoardsLayer.fgb-open {
  display: flex;
}
#fgBoardsCard {
  display: flex;
  flex-direction: column;
  width: min(34rem, 100vw - 1rem);
  max-height: min(94vh, 52rem);
  overflow: hidden;
  border-radius: 1.3rem;
  background: var(--fgb-cream, #fffaf0);
  box-shadow: 0 .6rem 2.4rem #28180c59;
  animation: fgbRise .16s ease-out;
}
@keyframes fgbRise {
  from { opacity: 0; transform: translateY(.6rem) scale(.98); }
  to { opacity: 1; transform: none; }
}

#fgBoardsCard header {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .85rem .9rem .6rem 1.1rem;
}
#fgBoardsCard header .fgb-crown {
  width: 1.7rem;
  height: 1.45rem;
  flex: none;
}
#fgBoardsCard h2 {
  flex: 1;
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}
#fgBoardsClose,
#fgBoardsRefresh {
  display: grid;
  place-items: center;
  border: 0;
  background: var(--fgb-card, #f7ecd6);
  color: var(--fgb-ink, #3b2a22);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#fgBoardsClose {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
}
#fgBoardsClose:hover,
#fgBoardsRefresh:hover {
  background: #f0dfc0;
}

#fgBoardsBody {
  flex: 1;
  overflow-y: auto;
  padding: .2rem 1rem 1rem;
  background: #fff;
  scrollbar-width: thin;
}
#fgBoardsBody .fgb-lead {
  margin: .55rem 0 .9rem;
  color: var(--fgb-soft, #806553);
  font-size: .86rem;
  font-weight: 500;
  line-height: 1.35;
}
#fgBoardsBody .fgb-lead b {
  color: var(--fgb-ink, #3b2a22);
}

.fgb-section {
  margin-bottom: 1.1rem;
}
.fgb-section h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .35rem .6rem;
  margin: 0 0 .45rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}
.fgb-dir {
  padding: .08rem .55rem;
  border-radius: 1rem;
  background: var(--fgb-card, #f7ecd6);
  color: var(--fgb-soft, #806553);
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
}
.fgb-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.fgb-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 2.2rem;
  padding: .28rem .45rem;
  border-radius: .65rem;
  font-size: .95rem;
  line-height: 1.15;
}
.fgb-row + .fgb-row {
  border-top: .06rem solid #f1e8d6;
}
.fgb-row.fgb-mine {
  background: #e5f8e8;
}
.fgb-rank {
  min-width: 1.55rem;
  color: var(--fgb-soft, #806553);
  font-size: .84rem;
  font-weight: 700;
  text-align: right;
}
.fgb-row:first-child .fgb-rank {
  color: #b97f0f;
}
.fgb-who {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.fgb-who a {
  color: inherit;
  text-decoration: none;
}
.fgb-who a:hover {
  text-decoration: underline;
}
.fgb-guest {
  color: var(--fgb-soft, #806553);
  font-weight: 500;
}
.fgb-val {
  flex: none;
  color: #8a5a0a;
  font-weight: 700;
  white-space: nowrap;
}
.fgb-empty,
.fgb-error {
  margin: .3rem 0 .1rem;
  color: var(--fgb-soft, #806553);
  font-size: .9rem;
  line-height: 1.35;
}
.fgb-mine-note {
  margin: .35rem 0 0;
  padding: .3rem .5rem;
  border-radius: .55rem;
  background: #e5f8e8;
  color: #226b33;
  font-size: .82rem;
  font-weight: 600;
}
.fgb-skel {
  height: .95rem;
  margin: .5rem 0;
  border-radius: .5rem;
  background: linear-gradient(90deg, #f4eddf, #fbf6ec, #f4eddf);
  background-size: 200% 100%;
  animation: fgbShine 1.1s linear infinite;
}
@keyframes fgbShine {
  to { background-position: -200% 0; }
}
#fgBoardsFoot {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .9rem .65rem 1.1rem;
  border-top: .07rem solid var(--fgb-line, #ead9b8);
  background: var(--fgb-cream, #fffaf0);
}
#fgBoardsFoot small {
  flex: 1;
  color: var(--fgb-soft, #806553);
  font-size: .72rem;
  line-height: 1.25;
}
#fgBoardsRefresh {
  padding: .42rem .85rem;
  border-radius: .8rem;
  box-shadow: inset 0 -.18rem 0 #3b2a221f;
  font-size: .82rem;
}

@media (max-width: 760px) {
  #fgBoardsBtn span {
    display: none;
  }
  #fgBoardsBtn {
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
  }
  #fgBoardsCard {
    width: min(34rem, 100vw - 1rem);
  }
}
@media (pointer: coarse) {
  #fgBoardsBtn {
    min-height: 44px;
  }
}
@media (max-height: 430px) {
  #fgBoardsBtn {
    top: 4.9rem;
  }
  #fgBoardsCard {
    max-height: calc(100vh - .6rem);
  }
  #fgBoardsCard header {
    padding: .55rem .8rem .35rem 1rem;
  }
  #fgBoardsBody .fgb-lead {
    margin: .35rem 0 .6rem;
  }
}
