:root {
  --bg-top: #f7fbff;
  --bg-bottom: #cbe7ff;
  --card: #ffffff;
  --primary: #0f6ca8;
  --primary-strong: #0a4f7c;
  --secondary: #fff6d9;
  --accent: #f18b2c;
  --danger: #c0392b;
  --ok: #207a30;
  --text: #163148;
  --muted: #4d6478;
  --radius: 18px;
  --shadow: 0 10px 26px rgba(22, 49, 72, 0.15);
  --font: "Nunito", "Trebuchet MS", "Verdana", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  min-height: 100vh;
}

.app-shell {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: 16px 14px 28px;
}

.app-header {
  text-align: center;
  margin-bottom: 14px;
}

.app-header h1 {
  margin: 10px 0 2px;
  font-size: clamp(2rem, 5.8vw, 2.8rem);
  line-height: 1.05;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 3.5vw, 1.3rem);
}

.demo-toggle-wrap {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.demo-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff7cd;
  border: 2px solid #f2d16b;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  color: #694e00;
}

.demo-toggle input {
  width: 20px;
  height: 20px;
}

.card-stack {
  display: grid;
  gap: 12px;
}

[hidden] {
  display: none !important;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin-top: 0;
}

.lead-text {
  font-size: 1.15rem;
  line-height: 1.4;
}

.muted {
  color: var(--muted);
}

.status-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #e7f3ff;
  color: #104c7a;
  font-weight: 700;
}

.module-image,
.final-image {
  width: 100%;
  height: auto;
  border-radius: 14px;
  display: block;
  margin-bottom: 10px;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 14px rgba(15, 60, 95, 0.2);
}

.module-grid {
  display: grid;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 14px;
  background: var(--primary);
  color: #fff;
  padding: 14px 18px;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  transition: transform 130ms ease, background 130ms ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--primary-strong);
  transform: translateY(-1px);
}

.btn.secondary {
  background: var(--secondary);
  color: #7a4f00;
}

.btn.secondary:hover,
.btn.secondary:focus-visible {
  background: #ffe8ad;
}

.btn.danger {
  background: var(--danger);
}

.btn-row {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.full {
  width: 100%;
}

.map {
  width: 100%;
  height: 290px;
  border-radius: 14px;
  border: 2px solid #d2e8fb;
}

.nav-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.nav-chip {
  border-radius: 12px;
  background: #f1f8ff;
  padding: 8px;
  text-align: center;
}

.nav-chip span {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
}

.nav-chip strong {
  font-size: 1.4rem;
}

.compass-wrap {
  margin: 10px 0;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.compass {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 40%, #ffffff 0%, #cde8ff 85%);
  border: 3px solid #8ec0eb;
  position: relative;
}

.compass-center {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.compass-arrow {
  width: 10px;
  height: 52px;
  background: linear-gradient(180deg, #e63f2f 0%, #fb8a45 100%);
  clip-path: polygon(50% 0, 100% 34%, 66% 34%, 66% 100%, 34% 100%, 34% 34%, 0 34%);
  transform-origin: 50% 90%;
  position: absolute;
  left: calc(50% - 5px);
  top: calc(50% - 48px);
  transition: transform 180ms linear;
}

.answer-form {
  display: grid;
  gap: 8px;
}

.answer-form input {
  border: 2px solid #c1d8eb;
  border-radius: 12px;
  padding: 12px;
  font-size: 1.1rem;
}

.feedback {
  min-height: 1.4em;
  font-weight: 700;
}

.feedback.ok {
  color: var(--ok);
}

.feedback.error {
  color: var(--danger);
}

@media (max-width: 420px) {
  .app-shell {
    padding: 12px 10px 24px;
  }

  .card {
    padding: 12px;
  }

  .map {
    height: 250px;
  }
}
