/* Harvest & Home — vintage botanical field-guide UI */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=JetBrains+Mono:wght@400;500;600;700&family=Caveat:wght@400;600;700&display=swap');

:root {
  /* Paper & ink — pulled from the existing plant card SVG palette */
  --paper:        #fbf5e8;
  --paper-warm:   #f6efd9;
  --paper-deep:   #ebe1c0;
  --paper-shade:  #ede2bf;
  --ink:          #2c2417;
  --ink-soft:     #6a5b3f;
  --ink-faded:    #9b8b66;
  --rule:         #b9aa8a;
  --rule-soft:    #d9caa0;
  --sepia:        #8a5a2a;
  --sepia-soft:   #a87544;
  --ochre:        #b8843a;
  --gold:         #c08b3e;
  --forest:       #496f48;
  --forest-leaf:  #9fbd82;
  --meadow:       #8b7434;
  --meadow-flower:#d8bd5e;
  --wetland:      #477981;
  --wetland-leaf: #89bdbe;
  --disturbed:    #8a664e;
  --mountain:     #697176;
  --edge:         #587142;
  --accent:       #b84d3f;
  --accent-deep:  #9a3f33;
  --bad:          #9a3b2a;
  --good:         #4f7a3f;
  --warn:         #a8682c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "EB Garamond", "Garamond", serif;
  font-size: 16px;
  line-height: 1.45;
  min-height: 100vh;
}

body {
  /* Subtle paper noise + warm corner washes */
  background-image:
    radial-gradient(circle at 12% 8%,  rgba(184, 132, 58, 0.06)  0%, transparent 45%),
    radial-gradient(circle at 88% 92%, rgba(74, 110, 70, 0.05)   0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(160, 130, 80, 0.03)  0%, transparent 70%);
  background-attachment: fixed;
}

img { max-width: 100%; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* Common atoms */

.hh-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hh-rule {
  height: 1px;
  background: var(--rule);
  width: 100%;
}

.hh-rule-double {
  height: 4px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

.hh-smallcaps {
  font: 600 11px/1 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sepia);
}

.hh-smallcaps.muted { color: var(--ink-faded); }
.hh-smallcaps.ink   { color: var(--ink); }
.hh-smallcaps.accent{ color: var(--accent); }

.hh-handwritten {
  font-family: "Caveat", "Marker Felt", cursive;
  font-weight: 600;
}

.hh-serif {
  font-family: "EB Garamond", serif;
}

.hh-mono {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* Buttons */

.hh-btn {
  appearance: none;
  font: 600 12px/1 "JetBrains Mono", monospace;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 11px 18px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 0;
  transition: background 0.15s, color 0.15s, transform 0.05s;
}
.hh-btn:hover { background: var(--ink); color: var(--paper); }
.hh-btn:active { transform: translateY(1px); }
.hh-btn:disabled { color: var(--ink-faded); border-color: var(--rule); background: var(--paper); cursor: not-allowed; }
.hh-btn:disabled:hover { background: var(--paper); color: var(--ink-faded); }

.hh-btn.primary {
  background: var(--ink);
  color: var(--paper);
}
.hh-btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.hh-btn.ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink-soft);
}
.hh-btn.ghost:hover { color: var(--ink); border-color: var(--ink); background: transparent; }

.hh-btn.lg {
  padding: 16px 28px;
  font-size: 13px;
  letter-spacing: 0.24em;
}

.hh-btn.xl {
  padding: 20px 36px;
  font-size: 14px;
  letter-spacing: 0.28em;
}

.hh-btn.icon-btn {
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Plus / minus stepper */

.hh-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.hh-stepper button {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--ink);
  font: 500 28px/1 "EB Garamond", serif;
  width: 52px;
  height: 52px;
  cursor: pointer;
  transition: background 0.15s;
}
.hh-stepper button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.hh-stepper button:disabled { color: var(--ink-faded); cursor: not-allowed; }
.hh-stepper .count {
  font: 600 30px/1 "EB Garamond", serif;
  min-width: 56px;
  text-align: center;
  padding: 0 4px;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  background: var(--paper-warm);
}

/* Inputs */

.hh-input {
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--rule);
  font: 600 18px "EB Garamond", serif;
  color: var(--ink);
  padding: 4px 2px;
  outline: none;
  transition: border-color 0.15s;
}
.hh-input:focus { border-bottom-color: var(--ink); }
.hh-input::placeholder { color: var(--ink-faded); font-style: italic; font-weight: 400; }

/* Page chrome */

.hh-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--rule);
  background: rgba(251, 245, 232, 0.92);
  backdrop-filter: blur(2px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hh-topbar .brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.hh-topbar .brand h1 {
  margin: 0;
  font: 500 22px/1 "EB Garamond", serif;
  color: var(--ink);
}
.hh-topbar .brand .sub {
  font: italic 400 13px "EB Garamond", serif;
  color: var(--ink-soft);
}

/* Plates (the section frames) */

.hh-plate {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 16px 20px;
  position: relative;
}
.hh-plate.tight { padding: 12px 16px; }

.hh-plate header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin-bottom: 12px;
}
.hh-plate header h2 {
  margin: 0;
  font: 500 18px/1.1 "EB Garamond", serif;
}
.hh-plate header h2 .scientific {
  font-style: italic;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 13px;
  margin-left: 8px;
}

/* Ring meeples */

.hh-meeple {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.hh-meeple .rings {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}
.hh-meeple .ring {
  width: 22px;
  height: 3px;
  border: 1px solid var(--sepia);
  background: transparent;
}
.hh-meeple .ring.filled { background: var(--ochre); }
.hh-meeple .body { color: var(--ink); }
.hh-meeple.exhausted { opacity: 0.4; }

/* Cards & artwork frames */

.hh-art-frame {
  background: var(--paper-warm);
  border: 1px solid var(--rule-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.hh-art-frame img {
  width: 92%;
  height: 92%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Plant cards */

.hh-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s;
}
.hh-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(60, 50, 20, 0.1);
}
.hh-card .head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hh-card .head .name {
  font: 500 17px/1 "EB Garamond", serif;
  color: var(--ink);
}
.hh-card .head .sci {
  font: italic 400 11px "EB Garamond", serif;
  color: var(--ink-soft);
  margin-top: 2px;
}
.hh-card .layer-tag {
  font: 600 9px "JetBrains Mono", monospace;
  letter-spacing: 0.16em;
  color: var(--sepia);
  text-transform: uppercase;
  border: 1px solid var(--rule);
  padding: 2px 6px;
}
.hh-card .yields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  font: 600 11px "JetBrains Mono", monospace;
}
.hh-card .yields .col {
  border: 1px dashed var(--rule-soft);
  padding: 4px 4px 5px;
  text-align: center;
  color: var(--ink-soft);
}
.hh-card .yields .col.active {
  border: 1px solid var(--accent);
  background: var(--paper-warm);
  color: var(--ink);
}
.hh-card .yields .col .s {
  display: block;
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faded);
  margin-bottom: 2px;
}
/* Resource yields rendered as icon + count chips (flame / tincture / seed). */
.hh-card .yield-icons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px 5px;
  justify-content: center;
  align-items: center;
}
.hh-card .yield-chip {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.hh-card .res-icon {
  width: 13px;
  height: 13px;
  object-fit: contain;
  vertical-align: middle;
}
.hh-card .res-n {
  font: 600 10px "JetBrains Mono", monospace;
  color: inherit;
}
.hh-card .yield-none { color: var(--ink-faded); }
.hh-card .id-note {
  font: italic 400 12px/1.4 "EB Garamond", serif;
  color: var(--ink-soft);
  border-top: 1px dashed var(--rule-soft);
  padding-top: 6px;
}
.hh-card .id-note .id-line { margin-bottom: 4px; }
.hh-card .id-note .id-line strong { color: var(--sepia); margin-right: 3px; }
/* Foraging factoids — the field-guide bullet list, like the printed card. */
.fg-tidbits {
  margin: 4px 0 0;
  padding-left: 16px;
  list-style: none;
  font: italic 400 11.5px/1.4 "EB Garamond", serif;
  color: var(--ink-soft);
}
.fg-tidbits li { position: relative; margin-bottom: 3px; }
.fg-tidbits li::before {
  content: "❦";
  position: absolute; left: -14px;
  font-style: normal; font-size: 9px; color: var(--sepia); top: 1px;
}
.hh-card .controls {
  display: flex;
  gap: 6px;
  border-top: 1px dashed var(--rule-soft);
  padding-top: 8px;
}
.hh-card .controls button {
  flex: 1;
  font-size: 10px;
  padding: 7px 4px;
  letter-spacing: 0.14em;
}

/* Hex board container */

.hh-board {
  position: relative;
  width: 100%;
}

.hh-board svg {
  display: block;
  width: 100%;
  height: auto;
}

.hh-hex-tile-art {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Overlay (rulebook / modal) */

.hh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 16, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
  animation: hh-fade 0.18s ease-out;
  animation-fill-mode: both;
}

@keyframes hh-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hh-overlay .panel {
  background: var(--paper);
  border: 1px solid var(--ink);
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 30px 60px rgba(20, 16, 10, 0.4);
}

.hh-overlay .panel header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 24px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-warm);
}
.hh-overlay .panel header h2 {
  margin: 0;
  font: 500 24px/1 "EB Garamond", serif;
}
.hh-overlay .panel .body {
  padding: 24px 32px;
  overflow: auto;
  flex: 1;
}

/* Rulebook content styling */
.hh-rulebook h2 {
  font: 500 22px/1.15 "EB Garamond", serif;
  margin: 24px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
.hh-rulebook h3 {
  font: 500 17px/1.15 "EB Garamond", serif;
  margin: 18px 0 4px;
  color: var(--sepia);
}
.hh-rulebook p, .hh-rulebook li {
  font: 400 15px/1.55 "EB Garamond", serif;
  color: var(--ink);
}
.hh-rulebook ul, .hh-rulebook ol {
  padding-left: 22px;
}
/* "Anatomy of a card" plate: sample card beside its legend. The column
   matches the fixed .fg-card width (260px); on narrow screens the pair
   stacks so the legend keeps full width instead of a squeezed sliver. */
.hh-anatomy {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
@media (max-width: 640px) {
  .hh-anatomy { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}
.hh-rulebook table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 14px;
  font-size: 13px;
}
.hh-rulebook table th, .hh-rulebook table td {
  border: 1px solid var(--rule-soft);
  padding: 6px 8px;
  text-align: left;
}
.hh-rulebook table th {
  background: var(--paper-warm);
  font: 600 11px "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sepia);
}
.hh-rulebook code {
  font: 500 13px "JetBrains Mono", monospace;
  background: var(--paper-warm);
  padding: 1px 5px;
  border-radius: 2px;
}
.hh-rulebook blockquote {
  border-left: 3px solid var(--sepia);
  padding: 6px 14px;
  margin: 12px 0;
  background: var(--paper-warm);
  font-style: italic;
  color: var(--ink-soft);
}

/* Setup — seat cards */
.hh-seat-card {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  min-height: 168px;
}
.hh-seat-card.human { border-color: var(--ink); }
.hh-seat-card .seat-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.hh-seat-card .name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hh-seat-card .name {
  font: 500 22px/1.1 "EB Garamond", serif;
  color: var(--ink);
}
.hh-seat-card .pencil-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  padding: 2px;
  cursor: pointer;
}
.hh-seat-card .pencil-btn:hover { color: var(--ink); }
.hh-seat-card .footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font: 500 11px "JetBrains Mono", monospace;
  color: var(--ink-soft);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hh-seat-card .meeple-bar {
  display: flex;
  gap: 6px;
}

.hh-bot-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font: 600 10px "JetBrains Mono", monospace;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* Die */

.hh-die {
  width: 56px;
  height: 56px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  display: inline-grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr 1fr;
  padding: 8px;
  gap: 2px;
  box-shadow: 0 2px 0 rgba(60, 50, 20, 0.18), inset 0 0 0 1px rgba(184, 132, 58, 0.08);
}
.hh-die .pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink);
  align-self: center;
  justify-self: center;
}

/* Active player banner */

.hh-active-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--paper-warm);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  font: 500 14px "EB Garamond", serif;
}
.hh-active-banner.bot { border-left-color: var(--wetland); }

/* Mini meeple-pinned-on-tile */

.hh-villager-pin {
  display: inline-block;
  cursor: pointer;
}

/* ============================================================
   Forage — the card-only game screen
   ============================================================ */
.fg-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.fg-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 20px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  overflow: hidden;
}
/* Status ribbon: a slim row of compact summary chips that expand into floating
   panels on demand, so the cards below keep the full screen. */
.fg-statusbar {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  z-index: 6;
}
.fg-chip-wrap { position: relative; }
.fg-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--rule-soft);
  background: var(--paper-warm);
  padding: 6px 11px;
  font: 500 13px 'EB Garamond', serif;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.fg-chip:hover { background: var(--paper); border-color: var(--ink-soft); }
.fg-chip-wrap.open .fg-chip { background: var(--paper); border-color: var(--ink); }
.fg-chip-glyph { font-size: 14px; line-height: 1; }
.fg-chip-stat { font: 600 12px 'JetBrains Mono', monospace; color: var(--ink); }
.fg-chip-stat i { color: var(--ink-faded); font-style: normal; }
.fg-chip-rivals-label { color: var(--ink-soft); }
.fg-chip-rival {
  display: inline-flex; align-items: center; gap: 3px;
  font: 600 12px 'JetBrains Mono', monospace; color: var(--ink-soft);
}
.fg-chip-caret { color: var(--ink-faded); font-size: 9px; margin-left: 1px; }
/* Tone accent on the event chip — a small left marker keyed to the event mood. */
.fg-chip-good { border-left: 3px solid var(--forest, #496f48); }
.fg-chip-bad { border-left: 3px solid var(--accent); }
.fg-chip-social { border-left: 3px solid var(--gold, #8a5a2a); }
.fg-chip-calm { border-left: 3px solid var(--sepia); }
.fg-chip-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  max-width: min(440px, 92vw);
  background: var(--paper-warm);
  border: 1px solid var(--ink);
  box-shadow: 0 12px 28px rgba(44,36,23,0.18);
  z-index: 20;
  animation: fg-chip-drop 130ms ease;
}
.fg-chip-panel.right { left: auto; right: 0; }
.fg-panel-pad { padding: 12px; }
.fg-log-panel { max-height: 230px; margin-top: 6px; }
@keyframes fg-chip-drop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fg-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 8px;
}
.fg-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule-soft);
  padding-bottom: 4px;
}
.fg-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  align-items: flex-start;
}
/* The hand scrolls sideways like the market (was wrapping to extra rows,
   which made it scroll downward on mobile). */
.fg-hand { flex-wrap: nowrap; overflow-x: auto; }

/* Market split into two equally-weighted, titled groups — the draw pile and
   the marketplace — with a divider rule between them. */
.fg-market-layout { display: flex; gap: 18px; align-items: stretch; }
.fg-market-deck { flex: 0 0 auto; }
.fg-market-shop { flex: 1 1 0; min-width: 0; }
.fg-market-divider { flex: 0 0 auto; align-self: stretch; width: 1px; background: var(--rule); }
/* Direction + cumulative-cost rule for the slot market. */
.fg-market-rule {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 8px; padding: 5px 10px;
  background: var(--paper-warm); border: 1px solid var(--rule-soft);
  font: italic 400 12.5px/1.3 'EB Garamond', serif; color: var(--ink-soft);
}
.fg-market-rule-end { font: 600 10px 'JetBrains Mono', monospace; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sepia); white-space: nowrap; }
.fg-market-rule-mid { text-align: center; }
.fg-market-rule-mid strong { color: var(--ink); font-weight: 600; font-style: normal; }
@media (max-width: 760px) {
  .fg-market-layout { flex-direction: column; gap: 12px; }
  .fg-market-divider { width: auto; height: 1px; }
  .fg-market-rule { flex-wrap: wrap; }
}
.fg-cardwrap { display: flex; flex-direction: column; gap: 6px; }
/* Cards follow the printed 63x88mm (5:7) proportions: a compact 4-row grid
   of title / art+info / notes / seasonal yields — not a tall stack. */
.fg-card {
  width: 260px;
  height: 364px;
  flex: 0 0 auto;
  display: grid;
  grid-template-rows: auto 112px minmax(0, 1fr) auto;
  gap: 6px;
  overflow: hidden;
  /* Inset content past the antique-plate frame molding. */
  padding: 15px 15px 13px;
  border: 0;
  border-radius: 0;
  background:
    url("/assets/borders/antique-plate-frame.png") center / 100% 100% no-repeat,
    var(--paper-warm);
}
.fg-card.sel { box-shadow: 0 0 0 2px var(--accent), 0 8px 18px rgba(44,36,23,0.14); transform: translateY(-3px); }
.fg-card.guidance {
  background:
    url("/assets/borders/antique-plate-frame.png") center / 100% 100% no-repeat,
    linear-gradient(160deg, #fbf5e8 0%, #f4ead0 100%);
}
.fg-card.guidance .name { color: var(--sepia); }

/* Title */
.fg-c-title { text-align: center; min-width: 0; align-self: center; }
.fg-c-title .name { font: 500 17.5px/1.05 "EB Garamond", serif; color: var(--ink); overflow-wrap: anywhere; }
.fg-c-title .sci { font: italic 400 11px/1.1 "EB Garamond", serif; color: var(--ink-soft); margin-top: 1px; }

/* Art + info, side by side (the key space-saver from the printed cards) */
.fg-c-top { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 8px; min-height: 0; }
.fg-c-art { height: 100%; min-height: 0; }
.fg-c-info { align-self: center; min-width: 0; display: grid; gap: 4px; margin: 0; }
.fg-c-info > div { border-top: 1px solid var(--rule-soft); padding-top: 3px; }
.fg-c-info dt { font: 600 8.5px "JetBrains Mono", monospace; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sepia); line-height: 1; }
.fg-c-info dd { margin: 2px 0 0; font: 700 12px/1.12 "EB Garamond", serif; color: var(--ink); display: flex; align-items: center; }
.fg-c-info .fg-dormant { font-weight: 400; font-style: italic; color: var(--ink-faded); }

/* Field notes — compact like the printed card's note block */
.fg-c-notes { min-height: 0; overflow: hidden; font: 400 13.5px/1.32 "EB Garamond", serif; color: var(--ink-soft); }
.fg-c-notes p { margin: 0 0 4px; border-bottom: 1px solid var(--rule-soft); padding-bottom: 4px; }
.fg-c-notes p strong { color: var(--sepia); text-transform: uppercase; letter-spacing: 0.06em; font: 600 9.5px "JetBrains Mono", monospace; margin-right: 3px; }
.fg-c-notes ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; }
.fg-c-notes li { position: relative; padding-left: 9px; font-style: italic; }
.fg-c-notes li::before { content: "•"; position: absolute; left: 0; color: var(--sepia); }

/* Compact yields row at the foot of the card */
.fg-c-yields { align-self: end; gap: 3px; }
.fg-card .fg-c-yields .res-icon,
.fg-card .fg-c-info .res-icon { width: 13px; height: 13px; }
.fg-card .fg-c-yields .res-n,
.fg-card .fg-c-info .res-n { font-size: 11px; }
.fg-card .fg-c-yields .col { padding: 3px 2px; }

/* Draw pile — a full card showing the BACK (botanical plate) of the next card. */
.fg-card-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}
.fg-card-back .fg-back-art {
  width: 80%;
  max-height: 70%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.fg-card-back .fg-back-motif { font-size: 60px; line-height: 1; color: var(--sepia); opacity: 0.5; }
.fg-card-back .fg-back-label {
  font: 600 9px "JetBrains Mono", monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faded);
}
.fg-take { width: 100%; padding: 6px; font-size: 12px; }
.fg-price {
  display: flex; justify-content: center; align-items: baseline; gap: 4px;
  font: 600 11px 'JetBrains Mono', monospace; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 2px 0;
}
.fg-price.paid { color: var(--accent); }
.fg-price strong { font-size: 14px; color: var(--ink); }
.fg-price.paid strong { color: var(--accent); }
.fg-pay-badge {
  position: absolute; bottom: 6px; right: 6px;
  font: 600 10px 'JetBrains Mono', monospace; letter-spacing: 0.04em;
  background: var(--accent); color: #fff;
  padding: 2px 6px; border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
}

/* Market bundle — the picked card + cheaper ones you'd get together. */
.fg-cardwrap.fg-bundle .fg-slot-tag { color: var(--accent); border-color: var(--accent); }
.fg-cardwrap.fg-bundle .fg-price { color: var(--accent); }

/* Bundle-cost popup — explains how much you must trade in. Non-blocking so the
   highlighted bundle stays visible behind it. */
.fg-popup-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 11vh;
  pointer-events: none;
}
.fg-popup {
  pointer-events: auto;
  width: calc(100% - 40px); max-width: 460px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  box-shadow: 0 18px 50px rgba(44, 36, 23, 0.35);
  padding: 18px 22px 20px;
  border-radius: 4px;
  animation: fg-card-in 200ms ease;
}
.fg-popup-msg {
  font: 500 18px/1.45 'EB Garamond', serif;
  color: var(--ink);
  margin: 8px 0 6px;
}
.fg-popup-msg strong { color: var(--accent); }
.fg-popup-sub {
  font: italic 400 14px/1.5 'EB Garamond', serif;
  color: var(--ink-soft);
  margin: 0 0 14px;
}
.fg-popup-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* Trade-in running tally — prominent strip above the hand while paying. */
.fg-trade-tally {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px;
  margin-bottom: 10px; padding: 8px 12px;
  border: 1px solid var(--accent); border-left-width: 4px; border-radius: 6px;
  background: rgba(184, 77, 63, 0.08);
}
.fg-trade-tally.ok {
  border-color: var(--forest, #496f48);
  background: rgba(79, 122, 63, 0.10);
}
.fg-trade-count {
  font: 600 11px 'JetBrains Mono', monospace; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.fg-trade-meter {
  font: 500 16px 'EB Garamond', serif; color: var(--ink);
}
.fg-trade-meter strong {
  font-size: 22px; font-weight: 700; color: var(--accent);
  margin: 0 2px;
}
.fg-trade-tally.ok .fg-trade-meter strong { color: var(--forest, #496f48); }
.fg-trade-need { color: var(--ink-soft); font-size: 14px; }
.fg-trade-hint {
  margin-left: auto;
  font: italic 400 13px 'EB Garamond', serif; color: var(--ink-soft);
}
.fg-trade-tally.ok .fg-trade-hint { color: var(--forest, #496f48); }

/* Dock running total — make the selected/needed numbers pop. */
.fg-dock-total {
  display: inline-flex; align-items: baseline; gap: 2px;
  margin: 0 6px; padding: 1px 8px; border-radius: 4px;
  background: var(--paper-warm); font-style: normal;
}
.fg-dock-total strong { font: 700 17px 'JetBrains Mono', monospace; }
.fg-dock-total strong.ok { color: var(--forest, #496f48); }
.fg-dock-total strong.short { color: var(--accent); }
.fg-dock-total-need { color: var(--ink-soft); font: 600 12px 'JetBrains Mono', monospace; }

/* Build composer tally — sepia by default, green once it qualifies. */
.fg-build-tally { border-color: var(--sepia); background: rgba(138, 90, 42, 0.08); }
.fg-build-tally .fg-trade-meter strong { color: var(--sepia); }
.fg-build-tally.ok { border-color: var(--forest, #496f48); background: rgba(79, 122, 63, 0.10); }
.fg-build-score { color: var(--forest, #496f48); font-weight: 700; }
.fg-slot-tag {
  text-align: center;
  font: 600 9px 'JetBrains Mono', monospace; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--sepia);
}
.fg-mode-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 5px; overflow: hidden; }
.fg-mode-toggle button {
  font: 600 10px 'JetBrains Mono', monospace; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 5px 9px; border: none; cursor: pointer;
  background: var(--paper); color: var(--ink-soft);
}
.fg-mode-toggle button + button { border-left: 1px solid var(--rule); }
.fg-mode-toggle button.on { background: var(--ink); color: var(--paper); }

/* Setup screen */
/* min-height:0 + overflow-y lets the panel scroll inside the 100vh screen;
   margin:auto centres it when it fits but stays fully scrollable (top AND
   bottom reachable) when it's taller than the viewport — e.g. several human
   name fields on a phone, where flex-centering would clip the Start button. */
.fg-setup { flex: 1; min-height: 0; display: flex; padding: 32px 20px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.fg-setup-panel { margin: auto; width: 100%; max-width: 460px; padding: 24px 26px; }
.fg-setup-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0; border-top: 1px solid var(--rule-soft);
}
.fg-setup-row:first-of-type { border-top: none; }
.fg-stepper { display: inline-flex; align-items: center; gap: 10px; }
.fg-stepper .hh-btn { min-width: 38px; padding: 6px 10px; font-size: 18px; line-height: 1; }
.fg-stepper-val { font-size: 20px; min-width: 24px; text-align: center; color: var(--ink); }

/* Per-player name inputs (multi-human setup) */
.fg-setup-names {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 0 4px; border-top: 1px solid var(--rule-soft);
}
.fg-setup-name-row { display: flex; align-items: center; gap: 10px; }
.fg-setup-name-input {
  flex: 1; min-width: 0;
  font: 500 16px 'EB Garamond', serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule);
  padding: 8px 11px; border-radius: 2px;
  transition: border-color .12s ease, background .12s ease;
}
.fg-setup-name-input:focus {
  outline: none; border-color: var(--ink); background: var(--paper-warm);
}
.fg-setup-name-input::placeholder { color: var(--ink-faded); font-style: italic; }

/* Player dots */
.fg-opp-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* Hidden-hand placeholder (hot-seat) */
.fg-hand-hidden {
  padding: 28px 18px; text-align: center;
  font: italic 400 14px 'EB Garamond', serif; color: var(--ink-faded);
  border: 1px dashed var(--rule); border-radius: 6px;
  background: repeating-linear-gradient(135deg, var(--paper), var(--paper) 14px, var(--paper-warm) 14px, var(--paper-warm) 28px);
}

/* Pass-the-device handoff overlay */
.fg-handoff {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(28, 24, 16, 0.92);
  backdrop-filter: blur(3px);
}
.fg-handoff-card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--paper); border: 1px solid var(--rule);
  border-radius: 10px; padding: 34px 32px; max-width: 440px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.4);
}
.fg-handoff-dot { width: 22px; height: 22px; border-radius: 50%; margin-bottom: 12px; }

/* Season-change card: the full event card every player must read + dismiss. */
.fg-season-modal { max-width: 420px; }
.fg-season-modal-card { width: 100%; margin: 14px 0 6px; display: flex; justify-content: center; }
.fg-season-modal-card .fg-event { width: 100%; box-sizing: border-box; }
.fg-season-modal-action {
  font: italic 400 15px/1.5 'EB Garamond', serif;
  color: var(--ink-soft); margin: 4px 0 18px; max-width: 360px;
}
.fg-season-modal-action.do { font-style: normal; color: var(--ink); }
.fg-season-modal-action strong { color: var(--accent); }

/* --- Motion ----------------------------------------------------------- */
@keyframes fg-card-in {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}
.fg-card { animation: fg-card-in 240ms ease; }

@keyframes fg-event-in {
  0%   { opacity: 0; transform: translateX(-14px); }
  100% { opacity: 1; transform: none; }
}
.fg-event { animation: fg-event-in 320ms ease; }

/* Floating "+N" when a build scores. */
@keyframes fg-float-up {
  0%   { opacity: 0; transform: translate(-50%, 6px) scale(0.85); }
  18%  { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -34px) scale(1.12); }
}
.fg-score-pop {
  position: absolute; top: -6px; left: 50%;
  font: 700 22px 'EB Garamond', serif; color: var(--good);
  text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  pointer-events: none; z-index: 5;
  animation: fg-float-up 1100ms ease-out forwards;
}

/* Soft press feedback on the card-game buttons. */
.fg-screen .hh-btn { transition: transform 90ms ease, background 160ms ease, color 160ms ease; }
.fg-screen .hh-btn:active:not(:disabled) { transform: translateY(1px) scale(0.98); }

@media (prefers-reduced-motion: reduce) {
  .fg-card, .fg-event, .fg-score-pop { animation: none; }
  .fg-score-pop { opacity: 1; }
  /* Skip the flip entirely — show the event card front at once. */
  .fg-flip-inner { transition: none; transform: rotateY(180deg); }
  .fg-flip-hint { display: none; }
}
.fg-codex-art {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 46px; color: var(--gold);
  background: radial-gradient(circle at 50% 40%, #fdf8ec, #efe2c4);
}
.fg-myco {
  position: absolute; top: 6px; right: 6px; font-size: 15px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.2));
}

/* opponents */
.fg-opp {
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--rule-soft);
  background: var(--paper-warm);
  padding: 7px 9px; border-radius: 2px; flex: 1; min-width: 130px;
}

/* journal/log */
.fg-log {
  margin-top: 6px;
  overflow-y: auto;
  flex: 1;
  font: 400 13px/1.5 'EB Garamond', serif;
  color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 3px;
}
.fg-log-line { padding-bottom: 2px; border-bottom: 1px dotted var(--rule-soft); }
.fg-log-t { color: var(--ink-faded); font-size: 10px; margin-right: 5px; }

/* action dock */
.fg-dock {
  border-top: 1px solid var(--ink);
  background: var(--paper-warm);
  box-shadow: 0 -4px 14px rgba(44,36,23,0.06);
}
.fg-dock-inner {
  max-width: 1480px; margin: 0 auto; padding: 12px 20px;
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
  justify-content: space-between;
}
.fg-dock-builds { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.fg-dock-core { display: flex; gap: 8px; align-items: center; }
.fg-plus { font-family: 'JetBrains Mono', monospace; font-size: 11px; opacity: 0.85; margin-left: 2px; }

/* game over */
.fg-over { max-width: 560px; margin: 24px auto; text-align: center; }
.fg-final { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.fg-final-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--rule-soft); background: var(--paper);
  padding: 10px 14px;
  width: 100%; font: inherit; color: inherit; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.fg-final-row:hover { background: var(--paper-warm); border-color: var(--ink-soft); }
.fg-final-rank {
  font: 700 15px 'JetBrains Mono', monospace; color: var(--ink-faded);
  width: 22px; text-align: center;
}

/* opponents become buttons → reset, and a hover affordance */
button.fg-opp {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
button.fg-opp:hover { background: var(--paper); border-color: var(--ink-soft); }
.fg-opp-view {
  font: 700 11px 'JetBrains Mono', monospace; color: var(--ink-faded); flex: 0 0 auto;
}

/* committed-builds chips in the harvest rail */
.fg-built {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px;
}
.fg-built-chip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--rule-soft); background: var(--paper);
  padding: 3px 8px; border-radius: 2px; cursor: pointer;
  font: 500 12px 'EB Garamond', serif; color: var(--ink);
  transition: background .12s ease, border-color .12s ease;
}
.fg-built-chip:hover { background: var(--paper-warm); border-color: var(--ink-soft); }
.fg-built-chip-label { white-space: nowrap; }
.fg-built-chip-score { font: 700 11px 'JetBrains Mono', monospace; color: var(--forest, #496f48); }

/* set recap (another player's build) */
.fg-recap .body { padding: 20px 24px; }
.fg-recap-score { color: var(--forest, #496f48); font-weight: 600; margin-left: 6px; }
.fg-recap-foot {
  display: flex; justify-content: flex-end;
  padding: 12px 24px; border-top: 1px solid var(--rule);
  background: var(--paper-warm);
}

/* build inspector overlay groups */
.fg-build-group { margin-bottom: 22px; }
.fg-build-group:last-child { margin-bottom: 0; }
.fg-build-group-head {
  display: flex; align-items: baseline; gap: 8px;
  padding-bottom: 6px; margin-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}
.fg-build-glyph { font-size: 16px; }
.fg-build-meta { font: italic 400 13px 'EB Garamond', serif; color: var(--ink-soft); margin-left: auto; }
.fg-build-meta strong { color: var(--forest, #496f48); font-style: normal; }
.fg-build-cards { gap: 10px; }

@media (max-width: 880px) {
  /* The status chips wrap on their own; let an expanded panel span the row. */
  .fg-chip-panel { max-width: 92vw; }
}

/* Forage — onboarding help + selected-card detail + hover */
.fg-help {
  position: relative;
  border: 1px solid var(--gold);
  background: linear-gradient(180deg, #fbf5e8, #f4ead0);
  padding: 12px 36px 12px 14px;
}
.fg-help p {
  font: 400 14px/1.55 'EB Garamond', serif;
  color: var(--ink);
  margin: 6px 0 0;
}
.fg-help strong { color: var(--sepia); font-weight: 600; }
.fg-help-x {
  position: absolute; top: 8px; right: 10px;
  border: none; background: none; cursor: pointer;
  color: var(--ink-faded); font-size: 14px; line-height: 1;
}
.fg-help-x:hover { color: var(--accent); }
.fg-detail-contrib { font: 500 13px/1.5 'EB Garamond', serif; color: var(--ink); margin: 6px 0 0; }
.fg-detail-tidbits { font: italic 400 13px/1.5 'EB Garamond', serif; color: var(--ink-soft); margin: 6px 0 0; }
.fg-card { cursor: pointer; }
.fg-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(44,36,23,0.12); }
.fg-card.sel:hover { transform: translateY(-3px); }

/* Forage — building-toward hint + turn indicator */
.fg-hint {
  margin-top: 8px;
  font: italic 400 13px/1.45 'EB Garamond', serif;
  color: var(--ink-soft);
  border-left: 2px solid var(--gold);
  padding-left: 8px;
}
.fg-hint strong { color: var(--sepia); font-style: normal; }
.fg-turn {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 11px 'JetBrains Mono', monospace;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-faded);
}
.fg-turn.mine { color: var(--accent); }
.fg-turn-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink-faded);
}
.fg-turn.mine .fg-turn-dot { background: var(--accent); animation: fg-pulse 1.4s ease-in-out infinite; }
@keyframes fg-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,77,63,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(184,77,63,0); }
}

/* Forage — event card */
.fg-event {
  display: flex; gap: 12px; align-items: flex-start;
  border: 1px solid var(--rule); border-left-width: 4px;
  background: var(--paper); padding: 11px 13px;
}
.fg-event-calm   { border-left-color: var(--ink-faded); }
.fg-event-good   { border-left-color: #5d7b3e; background: linear-gradient(180deg, #fbf5e8, #f1f4e4); }
.fg-event-bad    { border-left-color: var(--accent); background: linear-gradient(180deg, #fbf5e8, #f7ece6); }
.fg-event-social { border-left-color: var(--gold); background: linear-gradient(180deg, #fbf5e8, #f4ead0); }
.fg-event-glyph { font-size: 26px; line-height: 1; margin-top: 2px; }
.fg-event-name { font: 600 17px 'EB Garamond', serif; color: var(--ink); margin-top: 1px; }
.fg-event-desc { font: italic 400 13px/1.45 'EB Garamond', serif; color: var(--ink-soft); margin-top: 3px; }

/* ===== Full event card — a real card (5:7), shown in the season-change flip.
   Identity mirrors the printed event deck: the herbarium engraved frame
   (assets/borders/herbarium-tarot-bleed.png) with a tone keyline just inside
   it, a tone-tinted title, the event art (multiply, like the plant plates),
   and the rule text as the body. Tone palette matches print:
   good = green · bad = rust · calm = sepia · social = indigo. ===== */
.fg-ecard {
  --etone: #6a5c48;
  position: relative;
  width: 260px;
  height: 364px;
  flex: 0 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
  padding: 26px 24px 24px;
  border: 0;
  border-radius: 0;
  background: var(--paper-warm);
  /* tone keyline just inside the engraved band */
  box-shadow: inset 0 0 0 9px transparent, inset 0 0 0 10px var(--etone);
}
.fg-ecard::before {
  content: "";
  position: absolute; inset: 0;
  background: url("/assets/borders/herbarium-tarot-bleed.png") center / 100% 100% no-repeat;
  z-index: 3; pointer-events: none;
}
.fg-ecard > * { position: relative; z-index: 1; }
.fg-ecard-good   { --etone: #3f7d3a; }
.fg-ecard-bad    { --etone: #b04a36; }
.fg-ecard-calm   { --etone: #8a7d5e; }
.fg-ecard-social { --etone: #3f5e7d; }

.fg-ecard-title { text-align: center; min-width: 0; align-self: start; }
.fg-ecard-kicker { color: var(--etone); }
.fg-ecard-name {
  font: 500 21px/1.06 'EB Garamond', serif; color: var(--etone);
  margin-top: 2px; overflow-wrap: anywhere;
}
.fg-ecard-art {
  height: 100%; min-height: 0;
  background: transparent; border: 0;
}
.fg-ecard-art img { width: 96%; height: 96%; mix-blend-mode: normal; }
.fg-ecard-glyph { font-size: 64px; line-height: 1; color: var(--etone); opacity: 0.8; }
.fg-ecard-body {
  align-self: end; text-align: center;
  border-top: 1px solid var(--rule-soft); padding-top: 8px;
}
.fg-ecard-desc { margin: 0; font: italic 400 14px/1.45 'EB Garamond', serif; color: var(--ink-soft); }

/* Face-down state: the herbarium frame + centered art only, no text. */
.fg-ecard-back {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  --etone: #6a5c48;
}
.fg-ecard-back .fg-back-art {
  width: 84%; max-height: 70%; object-fit: contain; mix-blend-mode: normal;
}
.fg-ecard-back .fg-back-motif { font-size: 64px; line-height: 1; color: var(--sepia); opacity: 0.5; }
.fg-ecard-back .fg-back-label {
  font: 600 9px 'JetBrains Mono', monospace; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-faded);
}

/* ===== 3-D flip container. Parent gives perspective; the inner block holds
   two stacked faces and rotates rotateY(0)->(180deg) to reveal the front.
   The front face is pre-rotated 180deg so it reads correctly once flipped. */
.fg-flip {
  position: relative;
  width: 260px; height: 364px;
  margin: 0 auto;
  perspective: 1400px;
  cursor: pointer;
  outline: none;
}
.fg-flip.is-revealed { cursor: default; }
.fg-flip:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.fg-flip-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform 720ms cubic-bezier(0.34, 1.2, 0.4, 1);
  transform: rotateY(0deg);
}
.fg-flip.is-revealed .fg-flip-inner { transform: rotateY(180deg); }
.fg-flip-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.fg-flip-front { transform: rotateY(180deg); }
.fg-flip-hint {
  position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%);
  color: var(--paper); opacity: 0.85;
  animation: fg-flip-pulse 1.4s ease-in-out infinite;
  pointer-events: none;
}
@keyframes fg-flip-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.95; }
}
/* The card-entry animation on .hh-card would fight the flip transform — the
   flip faces own their own motion. */
.fg-flip .fg-ecard { animation: none; }
/* Reduced motion: no flip, front shown at once (back face is moot). */
.fg-flip.no-anim .fg-flip-inner { transition: none; transform: rotateY(180deg); }

/* Dialogue box under the face-down card prompting the tap-to-flip. */
.fg-season-modal-gate {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 12px auto 2px; padding: 9px 16px;
  border: 1px solid var(--rule-soft); border-radius: 9px;
  background: var(--paper-warm); color: var(--ink-soft);
  font: 500 13px/1.3 'EB Garamond', serif;
}
.fg-gate-glyph { font-size: 15px; color: var(--accent); }

/* Cards gained from an event (draws / free takes / a passed card), shown on
   the season card so the player sees exactly what landed in their hand. */
.fg-season-gained { margin: 10px 0 2px; }
.fg-season-gained-row {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px;
}
.fg-gained-card {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--rule-soft); border-radius: 8px;
  background: var(--paper); padding: 4px 10px 4px 5px;
  font: 500 13.5px/1.1 'EB Garamond', serif; color: var(--ink);
}
.fg-gained-card img { width: 28px; height: 28px; object-fit: contain; mix-blend-mode: multiply; }
/* Lost-card variant (Rot / Sudden Storm auto-discards) reads as a loss. */
.fg-season-lost .hh-smallcaps { color: var(--accent); }
.fg-season-lost .fg-gained-card { border-color: rgba(184, 77, 63, 0.5); }

/* ============================================================= */
/* Landing forms: signup / playtest / feedback                   */
/* ============================================================= */

/* Boxed input variant (multi-field forms read better boxed than underlined). */
.hh-input--box {
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  font: 400 16px "EB Garamond", serif;
  color: var(--ink);
  padding: 9px 11px;
  width: 100%;
}
.hh-input--box:focus { border-color: var(--ink); background: var(--paper); }

select.hh-input--box { appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236a5b3f'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px;
}

.hh-textarea {
  border: 1px solid var(--rule);
  background: var(--paper-warm);
  font: 400 16px/1.5 "EB Garamond", serif;
  color: var(--ink);
  padding: 10px 12px;
  width: 100%;
  resize: vertical;
  min-height: 96px;
}
.hh-textarea:focus { border-color: var(--ink); background: var(--paper); outline: none; }

/* Rating stars */
.hh-star {
  appearance: none; border: none; background: transparent;
  font-size: 24px; line-height: 1; cursor: pointer; padding: 0 1px;
  transition: transform 0.08s;
}
.hh-star:hover { transform: scale(1.15); }

/* Floating feedback button — always reachable, on the splash and in-game. */
.hh-feedback-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  display: inline-flex; align-items: center; gap: 8px;
  font: 600 11px/1 "JetBrains Mono", monospace; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 11px 15px;
  background: var(--ink); color: var(--paper);
  border: 1px solid var(--ink); border-radius: 999px;
  box-shadow: 0 4px 14px rgba(44, 36, 23, 0.22);
  transition: background 0.15s, transform 0.06s;
}
.hh-feedback-fab:hover { background: var(--accent); border-color: var(--accent); }
.hh-feedback-fab:active { transform: translateY(1px); }
/* In game the action dock sits along the bottom — lift the feedback button
   above it so it never covers the dock's buttons. */
.hh-app.in-game .hh-feedback-fab { bottom: 78px; }

/* Modal */
.hh-modal-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(44, 36, 23, 0.42);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.hh-modal {
  background: var(--paper); border: 1px solid var(--ink);
  box-shadow: 0 18px 50px rgba(44, 36, 23, 0.35);
  padding: 20px 22px; width: 100%; max-width: 460px;
  max-height: 90vh; overflow-y: auto;
}
.hh-icon-btn {
  appearance: none; background: transparent; border: 1px solid transparent;
  color: var(--ink-soft); padding: 4px; cursor: pointer; line-height: 0;
}
.hh-icon-btn:hover { color: var(--ink); }

/* Footer */
.hh-footer {
  border-top: 1px solid var(--rule);
  margin-top: 40px; padding-top: 18px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  font: 400 13px "EB Garamond", serif; color: var(--ink-soft);
}
.hh-footer a { color: var(--sepia); text-decoration: none; }
.hh-footer a:hover { text-decoration: underline; }

@media (max-width: 720px) {
  .hh-feedback-fab span { display: none; }
  .hh-feedback-fab { right: 14px; bottom: 14px; padding: 12px; }
  /* On phones an open status-chip panel (incl. the tapped-card detail) was
     anchoring to its chip and running off the screen edge. Pin it as a
     full-width bottom sheet above the action dock so it always fits. */
  .fg-chip-panel, .fg-chip-panel.right {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 96px;
    width: auto;
    min-width: 0;
    max-width: none;
    max-height: 56vh;
    overflow-y: auto;
  }
}

