:root {
  --bg: #0f120f;
  --bg-soft: #171b16;
  --panel: rgba(26, 31, 24, 0.92);
  --panel-2: rgba(20, 24, 19, 0.92);
  --line: rgba(173, 181, 136, 0.22);
  --text: #ece7d6;
  --muted: #b4b09c;
  --accent: #c6a45b;
  --accent-2: #8a6e31;
  --danger: #e79a9a;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(120, 109, 64, 0.18), transparent 32%),
    linear-gradient(180deg, #151913 0%, #0e110e 100%);
  color: var(--text);
}

a { color: var(--accent); }
a:hover { color: #e8c983; }

.wrap {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.panel {
  position: relative;
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(198, 164, 91, 0.08), transparent 45%);
  pointer-events: none;
}

#login-screen {
  display: none;
  place-items: center;
  padding: 2rem;
  position: relative;
}

#login-screen.active { display: grid; }

.noise {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image:
    linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 4px 4px;
  pointer-events: none;
}

.login-card {
  width: min(520px, 100%);
  padding: 2rem;
  z-index: 1;
}

h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; letter-spacing: 0.02em; }
h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); margin: 0 0 0.75rem; }
h2 { font-size: clamp(1.8rem, 3vw, 2.8rem); margin: 0; }
h3 { font-size: 1.35rem; margin-bottom: 0.25rem; }
.eyebrow, .label, .day-date, .map-title, .map-subtitle {
  text-transform: uppercase;
  letter-spacing: 0.2em;
}
.eyebrow, .label, .day-date { font-size: 0.78rem; color: var(--accent); }
.lead { color: var(--muted); font-size: 1.05rem; line-height: 1.6; }

.login-form { display: grid; grid-template-columns: 1fr auto; gap: 0.75rem; margin-top: 1.5rem; }
input {
  background: rgba(9, 12, 9, 0.75);
  border: 1px solid rgba(198, 164, 91, 0.3);
  color: var(--text);
  padding: 0.95rem 1rem;
  border-radius: 12px;
  font-size: 1rem;
}
button, .button {
  border: 1px solid rgba(198, 164, 91, 0.45);
  background: linear-gradient(180deg, #b79751, #816731);
  color: #111;
  padding: 0.95rem 1.15rem;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover, .button:hover { filter: brightness(1.06); }
.button-secondary { background: transparent; color: var(--text); }
.button-ghost { background: rgba(255,255,255,0.04); color: var(--text); }
.error { min-height: 1.25rem; color: var(--danger); margin-top: 0.75rem; }
.hint { color: var(--muted); font-size: 0.92rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero {
  position: relative;
  min-height: 58vh;
  display: flex;
  align-items: end;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 30%, rgba(198, 164, 91, 0.15), transparent 22%),
    linear-gradient(rgba(11, 14, 11, 0.55), rgba(11, 14, 11, 0.82)),
    linear-gradient(135deg, #1d221a 0%, #111410 40%, #171c15 100%);
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 2px, transparent 2px, transparent 110px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.012), rgba(255,255,255,0.012) 2px, transparent 2px, transparent 110px);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  width: 100%;
  padding: 5rem 0 3rem;
}
.hero-actions {
  display: flex;
  gap: 0.75rem;
  align-items: end;
  flex-wrap: wrap;
}

.section-block { padding: 4.5rem 0 0; }
.section-title { margin-bottom: 1.5rem; }
.section-title.compact { margin-bottom: 1rem; }

.intro-grid,
.info-grid,
.food-grid,
.location-list {
  display: grid;
  gap: 1rem;
}

.intro-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: -1.5rem;
  position: relative;
  z-index: 2;
}

.stat-card, .location-card, .food-card { padding: 1.25rem; }
.stat-card h2 { font-size: 1.55rem; margin: 0.3rem 0; }
.location-card h3, .food-card h3 { margin-top: 0.15rem; }
.muted-card { opacity: 0.8; }

.day { padding: 1.4rem; margin-bottom: 1rem; }
.day-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1rem;
}
.location-line { color: var(--muted); margin: 0.2rem 0 0; }
.timeline {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
}
.timeline-row {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
.timeline-row span:last-child { color: var(--muted); text-align: right; }

.map-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.95fr;
  gap: 1rem;
}
.map-panel { padding: 1rem; }
.tactical-map { width: 100%; height: auto; display: block; }
.map-title { fill: var(--text); font-size: 20px; font-family: Georgia, serif; }
.map-subtitle { fill: var(--muted); font-size: 11px; }
.marker circle { fill: var(--accent); stroke: #f7e8b2; stroke-width: 2; }
.marker text { fill: var(--text); font-size: 14px; font-family: Inter, sans-serif; }
.marker-food circle { fill: #8db380; stroke: #d8f1d0; }
.marker-forging circle { fill: #d58b63; stroke: #ffd1bd; }
.marker-tank circle { fill: #9fb5d6; stroke: #e4eefb; }

.info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.clean-list { margin: 0; padding-left: 1.15rem; color: var(--muted); line-height: 1.7; }
.clean-list li + li { margin-top: 0.45rem; }
.numbered { padding-left: 1.35rem; }

.food-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.site-footer {
  padding: 3rem 0 4rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1000px) {
  .intro-grid,
  .food-grid,
  .info-grid,
  .map-layout {
    grid-template-columns: 1fr;
  }

  .hero-inner,
  .day-heading {
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .login-form,
  .timeline-row {
    grid-template-columns: 1fr;
  }

  .timeline-row span:last-child { text-align: left; }

  .hero {
    min-height: 48vh;
  }

  .hero-actions {
    align-items: start;
  }

  .intro-grid { margin-top: 1.5rem; }
}

/* ===== v5 exact selector fixes ===== */

/* Smaller top header, same feel */
.hero {
  min-height: 40vh;
}

.hero-inner.wrap {
  padding-top: 2.25rem;
  padding-bottom: 1.75rem;
  padding-left: 1rem;
  padding-right: 1rem;
  align-items: end;
}

/* Remove top-heavy spacing inside all panels */
.panel {
  padding: 1.25rem;
}

.day.panel {
  padding: 1.25rem;
}

.stat-card,
.location-card,
.food-card,
.map-panel {
  padding: 1.25rem;
}

/* Keep section title spacing tidy inside cards */
.panel .section-title.compact {
  margin-bottom: 1rem;
}

.panel .section-title.compact h2,
.panel .section-title.compact p {
  margin-top: 0;
}

/* Extra padding for the accommodation orders and field discipline cards */
.info-grid > .panel {
  padding: 1.5rem;
}

/* Real map layout */
.map-layout.single-map {
  grid-template-columns: 1fr;
}

#leaflet-map {
  width: 100%;
  height: 500px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.leaflet-container {
  font: inherit;
  background: #161a15;
}

.leaflet-popup-content {
  line-height: 1.5;
}

/* Smaller hero on mobile too */
@media (max-width: 720px) {
  .hero {
    min-height: 32vh;
  }

  .hero-inner.wrap {
    padding-top: 1.5rem;
    padding-bottom: 1.25rem;
  }
}


/* ===== v6 tighter header ===== */
.hero {
  min-height: 22vh;
}

.hero-inner.wrap {
  padding-top: 1rem;
  padding-bottom: 2rem;
}

/* ensure headings don't add extra height */
.hero h1 {
  margin-bottom: 0.25rem;
}

.hero p {
  margin-bottom: 0;
}

/* ===== push map links to bottom of cards ===== */
.location-card,
.food-card,
.stat-card {
  display: flex;
  flex-direction: column;
}

.location-card a,
.food-card a {
  margin-top: auto;
}


/* ===== v7 custom map icons ===== */
.custom-map-icon {
  background: transparent;
  border: 0;
}

.map-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  background: #20261d;
  border: 1px solid rgba(196, 170, 90, 0.65);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
}

.map-icon-accommodation {
  background: #1f2b1e;
}

.map-icon-forging {
  background: #2b231b;
}

.map-icon-tank {
  background: #2a2118;
}
