/* exp-structure.css
   Stitch "Soft-Modernist" STRUCTURE layer for the in-game gameplay components.

   This is a companion to exp-activities.css / exp-collections.css / exp-social-map.css
   / exp-chrome.css. Those files reskinned colour, surface and shape on the existing
   DOM. This file styles the NEW structural pieces added to the components so they
   match the Stitch mocks beyond a recolour: the quiz banner + XP chip + Continue
   pill, the hidden-carvings "Found x/y" counter, the trail-marks Check pill, the
   creature detail bottom sheet, the finish certificate hero card, the leaderboard
   podium, the "you" highlight on crew rosters, and the shared-photo tabs + Add.

   LOAD ORDER (wiring is the coordinator's job, outside this lane): link this LAST,
   after exp-chrome.css in index.html, and add it to the service worker precache, so
   its additive rules win on ties. It reuses each family's tokens:
     - activities  --exp-a-*   (inherited from the .puzzle root)
     - collections --c-*       (inherited from .certificate-panel; redeclared on the
                                body-level .dex-detail sheet)
     - social      --exp-*     (inherited from .standings-card / .ch-card / etc.)

   Scope: every rule is keyed on a real in-game component root, none of which appear
   on the platform front door (.platform-screen), so the platform chrome is never
   touched. No em dashes or en dashes anywhere. */

/* ================================================================== *
 *  QUIZ / MULTIPLE CHOICE   ->  .puzzle.puzzle-mc
 *  New: .mc-head (XP + category chips), .mc-banner (illustration + chip),
 *       .mc-continue (persistent accent primary that drives the advance).
 * ================================================================== */

/* Header row: an optional category chip on the left, the XP chip on the right. */
.puzzle-mc .mc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.puzzle-mc .mc-head .mc-xp { margin-left: auto; }

.puzzle-mc .mc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: var(--exp-a-pill, 9999px);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
}
/* Category chip: an uppercase label pill (soft white so it reads over the banner). */
.puzzle-mc .mc-cat {
  background: rgba(255, 255, 255, 0.92);
  color: var(--exp-a-ink, #1E293B);
  border: 1px solid var(--exp-a-hairline, #E2E8F0);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: var(--exp-a-lift, 0 4px 20px rgba(0, 0, 0, 0.05));
}
/* XP chip: a soft neutral pill with an accent star, exactly like the mock. */
.puzzle-mc .mc-xp {
  background: var(--exp-a-surface-variant, #F1F1EF);
  color: var(--exp-a-ink, #1E293B);
}
.puzzle-mc .mc-xp::before {
  content: "\2605"; /* star */
  color: var(--exp-a-accent, #f59e0b);
  font-size: 13px;
  line-height: 1;
}

/* Banner: a big friendly rounded illustration with the category chip pinned to the
   lower left. Falls back to a soft neutral block if the image is missing. */
.puzzle-mc .mc-banner {
  position: relative;
  border-radius: var(--exp-a-radius, 24px);
  overflow: hidden;
  margin-bottom: 22px;
  background: var(--exp-a-surface-variant, #F1F1EF);
  box-shadow: var(--exp-a-lift, 0 4px 20px rgba(0, 0, 0, 0.05));
}
.puzzle-mc .mc-banner-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: cover;
}
.puzzle-mc .mc-banner.mc-banner-empty { min-height: 150px; }
.puzzle-mc .mc-cat-on-banner {
  position: absolute;
  left: 14px;
  bottom: 14px;
}

/* Continue: a persistent full-width accent pill after answering. It inherits the
   accent fill from exp-activities.css (.btn-amber); here we set only the layout.
   The JS hides it with an inline display:none and reveals it with display:flex, so
   its visibility never depends on this stylesheet being present. */
.puzzle-mc .mc-continue {
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 26px auto 0;
}
.puzzle-mc .mc-continue-arrow { font-size: 20px; line-height: 1; }

/* ================================================================== *
 *  HIDDEN CARVINGS / TAP   ->  .puzzle.puzzle-it
 *  New: .it-head > .it-progress "Found x/y" counter chip.
 * ================================================================== */
.puzzle-it .it-head {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}
.puzzle-it .it-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--exp-a-card, #FFFFFF);
  color: var(--exp-a-accent, #f59e0b);
  border: 1px solid var(--exp-a-hairline, #E2E8F0);
  border-radius: var(--exp-a-pill, 9999px);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  box-shadow: var(--exp-a-lift, 0 4px 20px rgba(0, 0, 0, 0.05));
}
.puzzle-it .it-progress::before {
  content: "\2605"; /* star */
  color: var(--exp-a-accent, #f59e0b);
  font-size: 14px;
  line-height: 1;
}

/* ================================================================== *
 *  ORDERING / TRAIL MARKS   ->  .puzzle.puzzle-dd
 *  New: optional .dd-check accent pill (never gates the auto-resolve).
 * ================================================================== */
.puzzle-dd .dd-check {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 24px auto 0;
}
.puzzle-dd .dd-check-glyph { display: inline-flex; font-size: 18px; line-height: 1; }

/* ================================================================== *
 *  CREATURE DETAIL SHEET   ->  .overlay.dex-detail-overlay > .overlay-card.dex-detail
 *  A light bottom sheet with art, name, rarity, note and a "Found at" line, shown
 *  when a caught dex creature is tapped. Body-level, so it declares its own tokens.
 * ================================================================== */
.overlay.dex-detail-overlay {
  align-items: flex-end;
  padding: 0;
}
.overlay-card.dex-detail {
  --c-surface: #F9F9F7;
  --c-card: #FFFFFF;
  --c-ink: #1E293B;
  --c-muted: #64748B;
  --c-hairline: #E2E8F0;
  --c-accent: var(--amber, #f5a623);
  --c-on-accent: var(--on-amber, #4a2e00);
  --c-accent-ink: #8A5A00;
  --c-lift: 0 4px 20px rgba(0, 0, 0, 0.05);

  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--c-surface);
  color: var(--c-ink);
  border: 1px solid var(--c-hairline);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
  padding: 10px 20px 22px;
  text-align: center;
  font-family: var(--font-body);
}
.dex-detail .dex-detail-grip {
  display: block;
  width: 44px;
  height: 5px;
  border-radius: 9999px;
  background: var(--c-hairline);
  margin: 6px auto 14px;
}
.dex-detail .dex-detail-art {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  height: 132px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--c-card);
  border: 3px solid var(--rar, var(--c-accent));
  box-shadow: var(--c-lift);
  overflow: hidden;
}
.dex-detail .dex-detail-img { width: 100%; height: 100%; object-fit: cover; }
.dex-detail .dex-detail-emoji { font-size: 64px; line-height: 1; }
.dex-detail .dex-detail-name {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  font-size: 28px;
  margin: 2px 0;
}
.dex-detail .dex-detail-rar {
  color: var(--rar, var(--c-accent-ink));
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.dex-detail .dex-detail-note {
  color: var(--c-ink);
  font-size: 16px;
  line-height: 1.5;
  max-width: 34rem;
  margin: 0 auto 14px;
}
.dex-detail .dex-detail-found {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-card);
  color: #334155;
  border: 1px solid var(--c-hairline);
  border-radius: 9999px;
  padding: 10px 16px;
  font-weight: 600;
  margin-bottom: 16px;
}
.dex-detail .dex-detail-pin { display: inline-flex; color: var(--c-accent-ink); }
.dex-detail .dex-detail-close {
  width: 100%;
  max-width: 420px;
  min-height: 52px;
  border: none;
  border-radius: 9999px;
  background: var(--c-accent);
  color: var(--c-on-accent);
  font-family: var(--font-head);
  font-weight: 800;
  box-shadow: 0 1px 2px rgba(133, 83, 0, 0.18), 0 12px 26px rgba(245, 158, 11, 0.26);
}

/* ================================================================== *
 *  FINISH CERTIFICATE HERO   ->  .certificate-panel .cert-hero
 *  A celebratory light certificate card (seal, eyebrow, title, crew, date) with a
 *  share and a back pill, above the existing canvas export chooser.
 * ================================================================== */
.certificate-panel .cert-hero {
  position: relative;
  background: var(--c-card);
  border: 1px solid var(--c-hairline);
  border-radius: var(--c-radius, 24px);
  box-shadow: inset 0 0 0 1px #F0E6D2, var(--c-lift);
  padding: 40px 22px 22px;
  margin-bottom: 18px;
  text-align: center;
}
.certificate-panel .cert-hero-seal {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--c-accent);
  color: var(--c-on-accent);
  border: 4px solid var(--c-surface);
  box-shadow: var(--c-lift);
}
.certificate-panel .cert-hero-eyebrow {
  color: var(--c-accent-ink);
  font-family: var(--font-head);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  margin-top: 6px;
}
.certificate-panel .cert-hero-title {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--c-ink);
  font-size: 26px;
  line-height: 1.2;
  margin: 8px 0 12px;
}
.certificate-panel .cert-hero-divider {
  width: 64px;
  height: 2px;
  background: var(--c-hairline);
  border-radius: 9999px;
  margin: 0 auto 14px;
}
.certificate-panel .cert-hero-crew { color: var(--c-ink); font-size: 18px; font-weight: 700; }
.certificate-panel .cert-hero-date { color: var(--c-muted); margin-top: 4px; }
.certificate-panel .cert-hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.certificate-panel .cert-hero-share {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  min-height: 52px;
}
.certificate-panel .cert-hero-share-glyph { display: inline-flex; }
.certificate-panel .cert-hero-back {
  width: 100%;
  max-width: 360px;
  min-height: 48px;
}

/* ================================================================== *
 *  LEADERBOARD PODIUM   ->  .standings-card .standing-podium
 *  A 3-up podium (silver left, gold centre and raised, bronze right) above the
 *  ranked list. Built as a sibling above .standings-list so its nth-child medal
 *  tints are untouched.
 * ================================================================== */
.standings-card .standing-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 18px;
}
.standings-card .podium-slot {
  flex: 1 1 0;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: var(--exp-card);
  border: 1px solid var(--exp-hairline);
  border-radius: var(--exp-radius-sm, 16px);
  box-shadow: var(--exp-lift-sm);
  padding: 12px 8px;
  position: relative;
}
/* Gold centre: accent fill and raised. */
.standings-card .podium-slot.rank-1 {
  background: var(--exp-accent);
  border-color: var(--exp-accent);
  padding-top: 22px;
  padding-bottom: 18px;
  box-shadow: 0 1px 2px rgba(133, 83, 0, 0.18), 0 12px 26px rgba(245, 158, 11, 0.26);
}
.standings-card .podium-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--exp-variant);
  color: var(--exp-ink);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 20px;
  border: 2px solid #FFFFFF;
  box-shadow: var(--exp-lift-sm);
}
.standings-card .podium-slot.rank-1 .podium-avatar { width: 60px; height: 60px; }
.standings-card .podium-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  background: var(--exp-variant);
  color: var(--exp-muted);
}
.standings-card .podium-slot.rank-1 .podium-badge { background: #FFFFFF; color: var(--exp-accent); }
.standings-card .podium-slot.rank-2 .podium-badge { background: #E2E8F0; color: #334155; }
.standings-card .podium-slot.rank-3 .podium-badge { background: #F6D9B8; color: #7A4A17; }
.standings-card .podium-name {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--exp-ink);
  font-size: 14px;
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.standings-card .podium-score { color: var(--exp-muted); font-weight: 700; font-size: 12px; }
.standings-card .podium-slot.rank-1 .podium-name,
.standings-card .podium-slot.rank-1 .podium-score { color: var(--exp-on-accent); }

/* ================================================================== *
 *  CREW "YOU" HIGHLIGHT   ->  .ch-card .ch-member.own  /  .crewp-card .crewp-pres-row.own
 *  The current player's roster row reads as a soft accent card (matching the
 *  standings "own" row and the crew_roster mock).
 * ================================================================== */
.ch-card .ch-member.own {
  background: #FFF7EA;
  border: 1px solid var(--exp-accent);
}
.crewp-card .crewp-pres-row.own {
  background: #FFF7EA;
  border-color: var(--exp-accent);
}

/* ================================================================== *
 *  SHARED PHOTO GALLERY   ->  .crew-photos-card
 *  New: a head row with a live count + Add button, and All / Mine / Scenery tabs.
 * ================================================================== */
.crew-photos-card .crew-photos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 6px 4px;
}
.crew-photos-card .crew-photos-count { color: var(--exp-muted); font-weight: 600; }
.crew-photos-card .crew-photos-add {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.crew-photos-card .cp-add-glyph { display: inline-flex; }
.crew-photos-card .crew-photos-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 6px 10px;
}
.crew-photos-card .cp-tab {
  background: var(--exp-card);
  color: var(--exp-ink);
  border: 1.5px solid var(--exp-hairline);
  border-radius: var(--exp-pill, 9999px);
  min-height: 40px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-weight: 600;
}
.crew-photos-card .cp-tab:hover { border-color: var(--exp-accent); }
.crew-photos-card .cp-tab.is-current {
  background: var(--exp-accent);
  border-color: var(--exp-accent);
  color: var(--exp-on-accent);
  font-weight: 700;
}
