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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: radial-gradient(circle at top, #141b2a 0, #050915 55%, #020308 100%);
  color: #f9fafb;
}

body {
  display: flex;
  justify-content: center;
}

#app {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.app-header h1 {
  font-size: 1.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-logo {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(148, 163, 184, 0.6);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.7);
  background: radial-gradient(circle at 30% 20%, #f97316 0, #450a0a 40%, #020617 100%);
}

.app-title-block {
  display: flex;
  flex-direction: column;
}

.app-subtitle {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.app-main {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr);
  gap: 0.75rem;
}

.panel {
  background: linear-gradient(135deg, #0a0f1c, #050915);
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.75rem;
}

.output-panel {
  min-height: 260px;
}

.sidebar-panel h2 {
  font-size: 0.95rem;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.character-summary {
  font-size: 0.85rem;
  line-height: 1.4;
}

.character-summary.empty {
  opacity: 0.75;
  font-style: italic;
}

.hero-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.hero-icons img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  border-radius: 8px;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.6);
}

.choices-panel {
  min-height: 120px;
}

.choices-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.map-container {
  margin-top: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  text-align: center;
}

.map-caption {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #94a3b8;
  margin-bottom: 0.3rem;
}

.map-container img {
  width: 100%;
  max-height: 260px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.65);
}

button {
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 0.8rem;
  background: #111827;
  color: #e5e7eb;
}

button:hover {
  background: #1f2937;
}

.primary-button {
  background: linear-gradient(135deg, #1d4ed8, #0ea5e9);
  border-color: rgba(191, 219, 254, 0.6);
  color: #dbeafe;
}

.secondary-button {
  background: #020617;
}

.listen-button {
  background: radial-gradient(circle at 30% 20%, #2563eb 0, #111827 70%);
  border-color: rgba(147, 197, 253, 0.8);
  color: #e0f2fe;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  animation: listenPulse 2.4s ease-in-out infinite;
}

.listen-button:hover {
  background: radial-gradient(circle at 50% 30%, #38bdf8 0, #0f172a 70%);
}

@keyframes listenPulse {
  0% {
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 0 22px rgba(56, 189, 248, 0.55);
    transform: translateY(-1px);
  }
  100% {
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
    transform: translateY(0);
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.field-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.field-note {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.3rem;
}

input[type="text"],
select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #030712;
  color: #e5e7eb;
  font-size: 0.9rem;
}

.layout-two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
}

.section-title {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}

.section-subtitle {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  color: #9ca3af;
}

.description-block p {
  margin: 0.3rem 0;
}

.tagline {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}

.choices-panel h2 {
  font-size: 0.95rem;
  margin-top: 0;
  margin-bottom: 0.4rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}

.pill {
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

@media (max-width: 720px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

   .app-header-actions {
     width: 100%;
     justify-content: flex-start;
     flex-wrap: wrap;
   }
}
