:root {
  --bg: #090b12;
  --bg-accent: #151926;
  --surface: rgba(18, 22, 34, 0.82);
  --surface-strong: #171c2b;
  --text: #edf0ff;
  --muted: #9ea7c5;
  --line: rgba(204, 214, 255, 0.08);
  --primary: #6f7cff;
  --primary-dark: #4454d1;
  --warm: #ff9d5c;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable Text", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(111, 124, 255, 0.28), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 157, 92, 0.18), transparent 24%),
    radial-gradient(circle at bottom center, rgba(74, 89, 198, 0.2), transparent 32%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-accent) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 999px;
  filter: blur(10px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: 240px;
  height: 240px;
  background: rgba(111, 124, 255, 0.18);
  top: -50px;
  right: -60px;
}

body::after {
  width: 200px;
  height: 200px;
  background: rgba(255, 157, 92, 0.14);
  bottom: 20px;
  left: -50px;
}

.app {
  position: relative;
  z-index: 1;
  width: min(100%, 980px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.hero,
.panel,
.facts-section {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(174, 188, 255, 0.12);
  box-shadow: var(--shadow);
}

.hero {
  padding: 28px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
}

.eyebrow,
.status-label,
.location-label,
.facts-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1,
.location-card h2 {
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  font-weight: 800;
  max-width: 10ch;
}

.subtitle,
#placeMeta,
.facts-hint,
.fact-card p,
.status-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}

.status-card,
.location-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-indicator {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #c2c9c4;
  box-shadow: 0 0 0 8px rgba(194, 201, 196, 0.25);
  flex-shrink: 0;
}

.status-indicator.loading {
  background: var(--warm);
  box-shadow: 0 0 0 8px rgba(240, 138, 36, 0.18);
}

.status-indicator.success {
  background: var(--primary);
  box-shadow: 0 0 0 8px rgba(15, 118, 110, 0.18);
}

.status-indicator.error {
  background: #c65146;
  box-shadow: 0 0 0 8px rgba(198, 81, 70, 0.18);
}

.location-card h2 {
  font-size: clamp(1.35rem, 3vw, 2rem);
  margin-bottom: 10px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.button {
  border: 0;
  border-radius: 999px;
  min-height: 52px;
  padding: 0 18px;
  font: inherit;
  font-weight: 700;
  background: rgba(237, 240, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  background: rgba(237, 240, 255, 0.12);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #f8f9ff;
}

.button-primary:hover {
  background: linear-gradient(135deg, #8390ff 0%, #5565eb 100%);
}

.button-share {
  background: linear-gradient(135deg, #ffbb82 0%, #ff9d5c 100%);
  color: #251407;
}

.button-share:hover {
  background: linear-gradient(135deg, #f4bf72 0%, #e17b14 100%);
}

.facts-section {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.facts-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 14px;
}

.facts-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.fact-card {
  min-height: 220px;
  padding: 22px;
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(33, 39, 58, 0.88), rgba(21, 25, 38, 0.96)),
    var(--surface-strong);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 12px;
}

.fact-card strong {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.92rem;
  color: #aeb8ff;
}

.fact-card h3 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  line-height: 1.15;
}

.fact-card p {
  font-size: 1rem;
}

.fact-card-meta {
  font-size: 0.92rem;
  color: var(--muted);
}

.fact-card-placeholder {
  grid-column: 1 / -1;
  min-height: 140px;
  justify-content: center;
}

.audio-section[hidden] {
  display: none;
}

.audio-card {
  background:
    linear-gradient(180deg, rgba(33, 39, 58, 0.88), rgba(21, 25, 38, 0.96)),
    var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
}

.audio-card audio {
  display: none;
}

.audio-shell {
  display: flex;
  align-items: center;
  gap: 16px;
}

.audio-toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  flex-shrink: 0;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #8b96ff 0%, #5565eb 100%);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(85, 101, 235, 0.28);
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}

.audio-toggle:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 18px 36px rgba(85, 101, 235, 0.34);
}

.audio-toggle:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.audio-toggle-icon {
  display: inline-block;
  font-size: 1.35rem;
  line-height: 1;
  transform: translateX(1px);
}

.audio-main {
  min-width: 0;
  flex: 1;
}

.audio-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}

.audio-title,
.audio-time {
  margin: 0;
}

.audio-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.audio-time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.audio-progress-wrap {
  position: relative;
}

.audio-progress {
  width: 100%;
  height: 8px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--warm) 0%, var(--warm) var(--progress, 0%), rgba(237, 240, 255, 0.12) var(--progress, 0%), rgba(237, 240, 255, 0.12) 100%);
  outline: none;
}

.audio-progress::-webkit-slider-runnable-track {
  height: 8px;
  background: transparent;
}

.audio-progress::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff3e5;
  box-shadow: 0 4px 12px rgba(255, 157, 92, 0.28);
  cursor: pointer;
}

.audio-progress::-moz-range-track {
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.audio-progress::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: #fff3e5;
  box-shadow: 0 4px 12px rgba(255, 157, 92, 0.28);
  cursor: pointer;
}

.audio-progress:disabled {
  opacity: 0.45;
}

.audio-progress:disabled::-webkit-slider-thumb,
.audio-progress:disabled::-moz-range-thumb {
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .audio-shell {
    align-items: stretch;
    flex-direction: column;
  }

  .audio-toggle {
    width: 100%;
    height: 56px;
    border-radius: 18px;
  }

  .audio-toggle-icon {
    transform: none;
  }

  .audio-meta {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 10px;
  }
}

@media (max-width: 760px) {
  .app {
    padding: 14px 14px 28px;
  }

  .hero,
  .panel,
  .facts-section {
    border-radius: 24px;
  }

  .actions,
  .facts-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
