:root {
  --bg: #07090f;
  --panel: #0a0d15;
  --raised: #12161f;
  --paper: #eceae3;
  --muted: rgba(236, 234, 227, 0.55);
  --gold: #8f6d18;
  --gold-line: rgba(143, 109, 24, 0.35);
  --amber: #e0a106;
  --amber-soft: rgba(224, 161, 6, 0.22);
  --ok: #3dba7a;
  --ok-soft: rgba(61, 186, 122, 0.22);
  --danger: #e07060;
  --bar-h: 44px;
  --offset: 56px;
  --radius: 14px;
  --font: Syne, ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "DM Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: var(--offset);
}

a { color: var(--gold); }

/* —— Brand bar —— */
#axe-brand-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 2147483647 !important;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: #07090f;
  border-bottom: 1px solid var(--gold-line);
  font-family: var(--font);
  pointer-events: auto;
}
#axe-brand-bar a.axe-logo {
  font-family: Wallpoet, cursive, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: #eceae3;
  text-decoration: none;
}
#axe-brand-bar a.axe-logo:hover { color: var(--gold); }
#axe-brand-bar .axe-tag {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  /* mixed case — do NOT uppercase via text-transform */
  text-transform: none;
  color: rgba(236, 234, 227, 0.55);
  font-family: var(--mono);
}

#axe-help-btn {
  position: fixed;
  top: 8px;
  right: 4.5rem;
  z-index: 2147483647 !important;
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(143, 109, 24, 0.55);
  background: rgba(7, 9, 15, 0.92);
  color: #eceae3;
  font: 600 0.68rem Syne, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  pointer-events: auto;
}
#axe-help-btn:hover { border-color: var(--gold); color: var(--gold); }

/* —— Intro —— */
#axe-demo-intro {
  position: fixed;
  inset: 0;
  z-index: 2147483646 !important;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-top: var(--offset);
  background: rgba(7, 9, 15, 0.72);
  backdrop-filter: blur(8px);
  font-family: var(--font);
  pointer-events: auto;
}
#axe-demo-intro[hidden] { display: none !important; }
.axe-intro-card {
  width: min(440px, 100%);
  max-height: min(78vh, 560px);
  overflow: auto;
  background: var(--panel);
  border: 1px solid rgba(143, 109, 24, 0.4);
  border-radius: 16px;
  padding: 1.35rem 1.25rem 1.2rem;
  color: #eceae3;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}
.axe-intro-card .axe-kicker {
  font: 500 0.62rem/1 var(--mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.55rem;
}
.axe-intro-card h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 0.55rem;
}
.axe-intro-card .axe-lead {
  font: 400 0.84rem/1.55 Syne, sans-serif;
  color: rgba(236, 234, 227, 0.72);
  margin: 0 0 1rem;
}
.axe-intro-card ol {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: rgba(236, 234, 227, 0.85);
  font-size: 0.84rem;
  line-height: 1.55;
}
.axe-intro-card ol li { margin: 0.35rem 0; }
.axe-intro-card .axe-note {
  font: 400 0.72rem/1.55 var(--mono);
  color: rgba(236, 234, 227, 0.48);
  border-top: 1px solid rgba(236, 234, 227, 0.08);
  padding-top: 0.85rem;
  margin: 0 0 1rem;
}
.axe-intro-actions { display: flex; flex-wrap: wrap; gap: 0.55rem; }
.axe-intro-actions button, .axe-intro-actions a,
.btn {
  font: 700 0.78rem Syne, sans-serif;
  letter-spacing: 0.03em;
  text-decoration: none;
  padding: 0.7rem 1.05rem;
  border-radius: 8px;
  border: 0;
  cursor: pointer;
  display: inline-block;
}
.axe-btn-go, .btn-primary { background: #eceae3; color: #07090f; }
.axe-btn-go:hover, .btn-primary:hover { background: var(--gold); }
.axe-btn-soft, .btn-soft {
  background: transparent;
  border: 1px solid rgba(236, 234, 227, 0.18) !important;
  color: #eceae3;
}
.axe-btn-soft:hover, .btn-soft:hover { border-color: var(--gold) !important; color: var(--gold); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

@media (min-width: 720px) {
  #axe-demo-intro { align-items: center; }
}

/* —— App shell —— */
.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.place-card {
  background: linear-gradient(165deg, var(--panel), var(--raised));
  border: 1px solid rgba(236, 234, 227, 0.08);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  margin-bottom: 1rem;
}
.place-card .eyebrow {
  font: 500 0.62rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.45rem;
}
.place-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.place-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1rem 0;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(236, 234, 227, 0.08);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
}
.panel[hidden] { display: none !important; }

.sample-list { list-style: none; margin: 0; padding: 0; }
.sample-list li { margin: 0 0 0.5rem; }
.sample-list button {
  width: 100%;
  text-align: left;
  background: var(--raised);
  border: 1px solid rgba(236, 234, 227, 0.1);
  color: var(--paper);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  font: 600 0.86rem/1.35 var(--font);
  cursor: pointer;
}
.sample-list button:hover {
  border-color: var(--gold);
  color: var(--gold);
}
.sample-list .sub {
  display: block;
  margin-top: 0.25rem;
  font: 400 0.72rem/1.4 var(--mono);
  color: var(--muted);
}

.stage {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #12100e;
  border: 1px solid rgba(236, 234, 227, 0.08);
  aspect-ratio: 16 / 9;
}
.stage img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.overlay-box {
  position: absolute;
  border: 2px solid var(--amber);
  background: var(--amber-soft);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35);
}
.overlay-box.corrected {
  border-color: var(--ok);
  background: var(--ok-soft);
  cursor: default;
}
.overlay-box .hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 6px);
  background: rgba(7, 9, 15, 0.92);
  border: 1px solid rgba(224, 161, 6, 0.45);
  color: var(--amber);
  font: 600 0.72rem/1.35 var(--font);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  pointer-events: none;
  white-space: nowrap;
}
.overlay-box.corrected .hint {
  border-color: rgba(61, 186, 122, 0.45);
  color: var(--ok);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.85rem;
  font: 500 0.78rem/1.4 var(--mono);
  color: var(--muted);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--raised);
  border: 1px solid rgba(236, 234, 227, 0.08);
}
.chip.warn { color: var(--amber); border-color: rgba(224, 161, 6, 0.35); }
.chip.ok { color: var(--ok); border-color: rgba(61, 186, 122, 0.35); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  z-index: 2147483645;
  background: rgba(10, 13, 21, 0.95);
  border: 1px solid rgba(61, 186, 122, 0.45);
  color: var(--ok);
  font: 700 0.82rem Syne, sans-serif;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.toast.show { opacity: 1; }

.history {
  list-style: none;
  margin: 0;
  padding: 0;
}
.history li {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(236, 234, 227, 0.08);
  font-size: 0.86rem;
  line-height: 1.45;
}
.history li:last-child { border-bottom: 0; }
.history .when {
  display: block;
  font: 400 0.7rem/1.4 var(--mono);
  color: var(--muted);
  margin-top: 0.25rem;
}
.empty {
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-note {
  margin-top: 1.5rem;
  font: 400 0.72rem/1.55 var(--mono);
  color: rgba(236, 234, 227, 0.4);
  text-align: center;
}
