/*
 * LORE Console — the app's chrome, on a browser.
 *
 * Cloned from the phone rather than invented: the map is full-bleed satellite
 * imagery with expedition zones drawn over it, everything else floats on top as
 * a parchment card, and the gold coin in the corner is the way around. The
 * palette is App.tsx's navigation theme verbatim, so a legend drafted here
 * looks like it belongs to the product that publishes it.
 */

:root {
  --parchment: #F6EFE5;
  --paper: #FBF6EE;
  --header: #D6E3D3;
  --ink: #3A2C1F;
  --body: #374035;
  --forest: #31513D;
  --saddle: #855B34;
  --primary: #5E432A;
  --muted: #6E5B49;
  --rule: #C6B59B;
  --sand: #E8DED0;
  --moss: #E8EFE4;
  --oxide: #8C2F16;
  --gold: #DFA83B;
  --coinBorder: #FFF2CD;
  --coinFill: #5B351D;
}

* { box-sizing: border-box; }

/*
 * `hidden` loses to any explicit display, and most things here are flex —
 * so without this the attribute silently does nothing.
 */
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--parchment);
  color: var(--body);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
}

/* --- the map is the app --- */

#map { position: fixed; inset: 0; background: #1A120A; }

/* Leaflet's own chrome, restyled to the app's palette. */
.leaflet-control-zoom a {
  background: rgba(246, 239, 229, .94) !important;
  color: var(--primary) !important;
  border-color: var(--rule) !important;
}
.leaflet-control-attribution {
  background: rgba(246, 239, 229, .82) !important;
  font-size: 10px !important;
}

/* --- masthead --- */

.masthead {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  background: rgba(214, 227, 211, .93);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 11px; }
.brandCoin { width: 34px; height: 34px; }
.title { font-weight: 900; color: var(--ink); font-size: 16px; line-height: 1.1; }
.subtitle {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--primary);
}
.who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--primary); }
.badge {
  background: var(--saddle); color: var(--parchment);
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 7px; border-radius: 4px;
}

/* --- zone legend, same four modes as the app --- */

.zoneLegend {
  position: fixed;
  left: 14px; bottom: 14px;
  z-index: 550;
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  padding: 9px 13px;
  border-radius: 12px;
  background: rgba(246, 239, 229, .93);
  border: 1px solid var(--rule);
  font-size: 12px; font-weight: 800; color: var(--primary);
  max-width: 46vw;
}
.zoneItem { display: flex; align-items: center; gap: 6px; }
.zoneItem i {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--c); border: 1.5px solid rgba(255,255,255,.8);
}

/* --- sheets that float over the map --- */

.sheet {
  position: fixed;
  top: 62px; bottom: 0; right: 0;
  width: min(560px, 100%);
  z-index: 580;
  overflow-y: auto;
  padding: 14px 14px 120px;
}
.sheet.centred {
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}
.sheet.centred .card { max-width: 620px; }

.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 18px 44px rgba(42, 22, 8, .3);
}

.sheetHead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

h1 { font-size: 26px; color: var(--ink); margin: 0 0 10px; line-height: 1.2; }
h2 { font-size: 18px; color: var(--ink); margin: 0; }

.copy { font-size: 15px; color: var(--body); }
.hint { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; }
.hint strong { color: var(--ink); }
.mapPrompt {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--moss);
  color: var(--forest);
  font-size: 13.5px;
  font-weight: 700;
}
.warn {
  font-size: 13.5px; color: var(--oxide); font-weight: 700;
  background: #F5E4DE; border-radius: 10px; padding: 10px 12px; margin: 14px 0 0;
}
.status { font-size: 14px; font-weight: 700; margin-top: 10px; min-height: 20px; }
.status.ok { color: var(--forest); }
.status.bad { color: var(--oxide); }

/* --- form --- */

label {
  display: block; margin-top: 14px;
  font-weight: 800; font-size: 12px; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em;
}
label .sub { text-transform: none; letter-spacing: 0; font-weight: 600; color: #9A8C7A; }

input, select, textarea {
  width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--rule); border-radius: 10px;
  background: #fff; color: var(--ink);
  font: inherit; font-weight: 400; text-transform: none; letter-spacing: 0;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--forest); outline-offset: 1px; }
.count { display: block; text-align: right; font-size: 12px; color: #9A8C7A; font-weight: 600; }

button.primary {
  margin-top: 14px; width: 100%;
  border: none; border-radius: 999px;
  background: var(--forest); color: var(--parchment);
  font-weight: 900; font-size: 15px; padding: 13px 22px; cursor: pointer;
}
button.primary:disabled { opacity: .5; cursor: default; }
button.link {
  background: none; border: none; color: var(--saddle);
  font-weight: 800; cursor: pointer; font-size: 13.5px; padding: 4px;
}

/* --- points & uploads --- */

.points, .uploads, .list { list-style: none; padding: 0; margin: 12px 0 0; }
.points li, .uploads li {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 0; border-top: 1px solid var(--rule); font-size: 13.5px;
}
.points .coord {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.points .grow, .uploads .grow { flex: 1; min-width: 0; }
.points input[type="text"], .points select { margin-top: 0; }
.points select { width: auto; }
.uploads img { width: 42px; height: 42px; object-fit: cover; border-radius: 8px; border: 1px solid var(--rule); }

/* --- lists --- */

.entry { border-top: 1px solid var(--rule); padding: 14px 0; }
.entry:first-child { border-top: none; }
.entry h3 { margin: 0 0 4px; font-size: 16px; color: var(--ink); }
.entry .meta { font-size: 12.5px; color: var(--muted); }
.entry .reason { font-size: 13.5px; color: var(--oxide); margin-top: 6px; }
.entry .story { font-size: 13.5px; margin-top: 8px; white-space: pre-wrap; max-height: 200px; overflow: auto; }
.pill {
  display: inline-block; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 3px 8px; border-radius: 999px; margin-left: 6px;
}
.pill.submitted { background: var(--sand); color: var(--muted); }
.pill.approved { background: var(--moss); color: var(--forest); }
.pill.rejected { background: #F5E4DE; color: var(--oxide); }
.pill.held { background: #F3E7CE; color: var(--saddle); }

.decide { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.decide input { margin-top: 0; flex: 1; min-width: 200px; }
.decide button {
  margin-top: 0; padding: 9px 16px; font-size: 13.5px;
  border: none; border-radius: 999px; font-weight: 800; cursor: pointer;
}
.decide .approve { background: var(--forest); color: var(--parchment); }
.decide .reject { background: var(--oxide); color: var(--parchment); }
.decide .hold { background: var(--saddle); color: var(--parchment); }

.empty { color: var(--muted); font-size: 14px; padding: 10px 0; }

/* --- markers, matching the app --- */

.coinMarker {
  width: 34px; height: 34px; border-radius: 17px;
  border: 2px solid var(--coinBorder); background: var(--coinFill);
  overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.coinMarker.final { width: 42px; height: 42px; border-radius: 21px; border-color: var(--gold); }
.coinMarker img { width: 100%; height: 100%; display: block; }

.draftMarker {
  width: 26px; height: 26px; border-radius: 13px;
  background: rgba(255, 242, 205, .95); border: 3px solid var(--forest);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px; color: var(--forest);
  box-shadow: 0 3px 10px rgba(0,0,0,.45);
}
.draftMarker.final { border-color: var(--gold); background: var(--gold); color: #3A2C1F; }

/* --- the coin menu, as on the phone --- */

.coinMenu { position: fixed; right: 18px; bottom: 18px; z-index: 620; }
.coinButton {
  width: 62px; height: 62px; border-radius: 31px;
  border: none; padding: 0; cursor: pointer; background: transparent;
  filter: drop-shadow(0 12px 20px rgba(42, 22, 8, .55));
  transition: transform .18s ease;
}
.coinButton:hover { transform: scale(1.05); }
.coinButton img { width: 100%; height: 100%; display: block; }

.coinItems {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 8px; margin-bottom: 10px;
}
.coinItems[hidden] { display: none !important; }
.coinItem {
  border: 1px solid var(--rule);
  background: rgba(246, 239, 229, .96);
  color: var(--primary);
  font-weight: 800; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
  box-shadow: 0 8px 18px rgba(42, 22, 8, .35);
  white-space: nowrap;
}
.coinItem:hover { background: #fff; }
.coinItem.is-active { background: var(--forest); color: var(--parchment); border-color: var(--forest); }

/* --- narrow screens: sheets take the full width --- */

@media (max-width: 720px) {
  .sheet { width: 100%; top: 58px; padding: 10px 10px 130px; }
  .zoneLegend { max-width: calc(100% - 100px); font-size: 11px; }
}
