/* GM map picker (Jenny, 30 Oct). Full-screen wheel. Colours are the mockup's dark ground and gold. */
@font-face {
  font-family: "Gmp Gelasio";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../fonts/gelasio-700-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Gmp Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/roboto-400-normal-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Gmp Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../../fonts/roboto-500-normal-latin.woff2") format("woff2");
}

.gmp {
  --gmp-gold: #e9bd62;
  --gmp-ink: #f3e6c8;
  --gmp-mut: #b3a48a; /* was #a8977a (31 Oct colour sweep) */
  --gmp-line: rgba(233, 189, 98, 0.28);
  position: absolute;
  inset: 0;
  z-index: 40;
  /* Header, preview (the rest of the height), chips, then a short carousel strip.
     A fixed tall wheel was what collapsed the preview on a landscape Fold. */
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  grid-template-columns: minmax(0, 1fr);
  background: #0d0d0e;
  color: var(--gmp-ink);
  font: 15px/1.35 "Gmp Roboto", Roboto, "Segoe UI", sans-serif;
  overflow: hidden;
}
.gmp button, .gmp input { font: inherit; color: inherit; }
.gmp button { cursor: pointer; }
.gmp svg { display: block; }

.gmp-top {
  flex: 0 0 60px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: linear-gradient(180deg, #141417, #0e0e0f);
  border-bottom: 1px solid var(--gmp-line);
}
.gmp-flame { width: 30px; height: 30px; flex: none; }
.gmp-title { flex: 1; min-width: 0; }
.gmp-title b {
  display: block;
  font: 700 21px/1.1 "Gmp Gelasio", Gelasio, Georgia, serif;
  color: var(--gmp-gold);
}
.gmp-title span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--gmp-mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gmp-chip {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px solid var(--gmp-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gmp-ink);
  font: 500 14px/1 "Gmp Roboto", Roboto, "Segoe UI", sans-serif;
  white-space: nowrap;
  flex: none;
}
.gmp-chip svg { width: 17px; height: 17px; }
.gmp-chip.gmp-x { width: 40px; padding: 0; }
.gmp-search {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: 20px;
  border: 1px solid rgba(233, 189, 98, 0.45);
  background: rgba(0, 0, 0, 0.35);
  color: var(--gmp-ink);
  padding: 0 14px;
  font: 500 15px/1 "Gmp Roboto", Roboto, "Segoe UI", sans-serif;
}

.gmp-stage {
  min-height: 0;
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  padding: 6px 12px 2px;
  gap: 6px;
}
.gmp-fit {
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gmp-pv {
  --gmp-cols: 20;
  --gmp-rows: 15;
  position: relative;
  flex: none;
  /* Pixel size is set in JS to the board's columns/rows, the largest that fits. */
  aspect-ratio: var(--gmp-cols) / var(--gmp-rows);
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(233, 189, 98, 0.35);
  background: #121215;
}
/* The board paints the art at 100% by 100% of the grid, so the preview does too: no crop, no extra zoom. */
.gmp-pv img { width: 100%; height: 100%; object-fit: fill; display: block; }
.gmp-pv .gmp-empty { width: 100%; height: 100%; display: block; }
.gmp-pv .gmp-empty, .gmp-card .gmp-empty {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: #131316;
  color: #fff;
  font: 600 13px/1.2 "Gmp Roboto", Roboto, sans-serif;
  text-align: center;
  padding: 8px;
}
.gmp-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* Same thin black grid the GM battle board draws, one line a square. */
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.6) 1px, transparent 1px);
  background-size:
    calc(100% / var(--gmp-cols, 20)) calc(100% / var(--gmp-rows, 15)),
    calc(100% / var(--gmp-cols, 20)) calc(100% / var(--gmp-rows, 15));
}
.gmp-cap {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
  max-width: 100%;
}
.gmp-cap b {
  font: 700 22px/1.15 "Gmp Gelasio", Gelasio, Georgia, serif;
  color: var(--gmp-ink);
}
.gmp-cap span { color: var(--gmp-mut); font-size: 13px; white-space: nowrap; }

.gmp-cats {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  padding: 8px 12px 4px;
  overflow: hidden;
}
.gmp-cats button {
  height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 20px;
  border: 1px solid var(--gmp-line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--gmp-ink);
  font: 500 14px/1 "Gmp Roboto", Roboto, sans-serif;
  white-space: nowrap;
  flex: none;
}
.gmp-cats button i { font-style: normal; color: var(--gmp-mut); font-size: 12px; font-weight: 500; }
.gmp-cats button.on {
  background: linear-gradient(180deg, #f2cf7c, #d4a24a);
  color: #2a1a08;
  border-color: #f6d98f;
  font-weight: 700;
}
.gmp-cats button.on i { color: #2a1a08; }

.gmp-wheel {
  position: relative;
  height: 152px;
  max-height: 28%;
  min-height: 128px;
  overflow: hidden;
  background: radial-gradient(120% 100% at 50% 100%, #1c1c1f 0%, #0e0e0f 70%);
  border-top: 1px solid var(--gmp-line);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.gmp-wheel:focus { outline: none; }
.gmp-wheel:focus-visible { outline: 2px solid rgba(233, 189, 98, 0.55); outline-offset: -2px; }
.gmp-rim {
  position: absolute;
  left: 50%;
  width: 2800px;
  height: 2800px;
  margin-left: -1400px;
  top: 28px;
  border-radius: 50%;
  border: 1px dashed rgba(233, 189, 98, 0.22);
  pointer-events: none;
}
.gmp-notch {
  position: absolute;
  left: 50%;
  top: 6px;
  margin-left: -10px;
  z-index: 6;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--gmp-gold);
  pointer-events: none;
}
.gmp-track {
  position: absolute;
  left: 0;
  top: 6px;
  display: flex;
  align-items: flex-start;
  width: max-content;
  column-gap: 8px;
  will-change: transform;
}
.gmp-card {
  position: relative;
  width: 148px;
  height: 96px;
  min-width: 44px;
  min-height: 44px;
  flex: none;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(233, 189, 98, 0.35);
  background: #000;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5);
  transform-origin: 50% 70%;
  transform: translateY(calc(var(--off, 0) * var(--off, 0) * 6px)) rotate(calc(var(--off, 0) * 4deg)) scale(calc(1.02 - min(0.18, abs(var(--off, 0)) * 0.06)));
  z-index: var(--z, 1);
}
.gmp-card img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.gmp-card .nm {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 6px 3px;
  font: 600 11px/1.15 "Gmp Roboto", Roboto, sans-serif;
  text-align: center;
  color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  text-shadow: 0 1px 2px #000;
  pointer-events: none;
}
.gmp:not(.is-browsing) .gmp-card.is-on {
  border: 3px solid var(--gmp-gold);
  box-shadow: 0 0 0 4px rgba(233, 189, 98, 0.25), 0 0 34px rgba(233, 189, 98, 0.45), 0 12px 26px rgba(0, 0, 0, 0.6);
}
.gmp-use, .gmp-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 8;
}
.gmp-use {
  height: 44px;
  min-width: 148px;
  min-height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  border: 2px solid #fbe3a6;
  background: linear-gradient(180deg, #f6d688, #d29d42);
  color: #2a1a08;
  font: 700 16px/1 "Gmp Gelasio", Gelasio, Georgia, serif;
  box-shadow: 0 0 0 6px rgba(233, 189, 98, 0.18), 0 10px 26px rgba(0, 0, 0, 0.6);
}
.gmp-use svg { width: 20px; height: 20px; }
.gmp.is-browsing .gmp-use { visibility: hidden; }
.gmp-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--gmp-mut);
  font-size: 12px;
  white-space: nowrap;
  visibility: hidden;
  pointer-events: none;
}
.gmp.is-browsing .gmp-hint { visibility: visible; }
.gmp-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  display: flex;
  justify-content: center;
  gap: 5px;
  z-index: 6;
}
.gmp-dots i {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: rgba(233, 189, 98, 0.3);
  display: block;
}
.gmp-dots i.on { width: 18px; background: var(--gmp-gold); }
.gmp-emptywheel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--gmp-mut);
}

@media (max-width: 599px) {
  .gmp-title b { font-size: 20px; }
  .gmp-chip .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .gmp-chip { width: 40px; padding: 0; position: relative; }
  .gmp-cats { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .gmp-cats::-webkit-scrollbar { display: none; }
  .gmp-card { width: 112px; height: 72px; }
  .gmp-track { column-gap: 6px; top: 4px; }
  .gmp-rim { width: 1800px; height: 1800px; margin-left: -900px; top: 22px; }
  .gmp-use { min-width: 132px; height: 44px; font-size: 15px; bottom: 16px; }
  .gmp-cap b { font-size: 18px; }
  .gmp-wheel { height: 144px; min-height: 128px; }
}
@media (min-width: 1000px) {
  .gmp-card { width: 120px; height: 72px; }
  .gmp-rim { width: 3200px; height: 3200px; margin-left: -1600px; top: 18px; }
  .gmp-wheel { height: 148px; }
}
/* Short landscape (Galaxy Fold): the strip stays a strip so the preview keeps the height. */
@media (max-height: 820px) {
  .gmp-top { height: 52px; flex-basis: 52px; }
  .gmp-wheel { height: 132px; min-height: 120px; max-height: 26%; }
  .gmp-card { width: 108px; height: 64px; }
  .gmp-track { top: 2px; }
  .gmp-use { bottom: 14px; }
  .gmp-cap b { font-size: 18px; }
  .gmp-stage { padding-top: 4px; gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .gmp-card { transition: none; }
}
/* (1 Nov) audit M8: on a phone "Use map" sat on top of the thumbnails. The strip is taller so the button sits under
   the cards (the preview above has room to spare). */
@media (max-width: 599px) and (min-height: 821px) {
  .gmp-wheel { height: 176px; min-height: 176px; max-height: 32%; flex-shrink: 0; }
  .gmp-use { bottom: 14px; }
}
