:root {
  --bg: #1a1512;
  --panel: #2a221c;
  --text: #f3ebe3;
  --muted: #b9a99a;
  --accent: #c45c26;
  --accent-hover: #e07038;
  --line: #3d322a;
  --font: "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(ellipse at top, #3a2a20 0%, transparent 55%),
    linear-gradient(160deg, #1a1512 0%, #0f0c0a 100%);
  padding-bottom: 2.8rem;
}

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.25rem 1rem 1rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.header h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  letter-spacing: 0.02em;
}

.version-badge {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: #3d2a22;
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.28rem 0.6rem;
  white-space: nowrap;
}

.tagline {
  margin: 0 0 1.5rem;
  color: var(--muted);
  max-width: 40rem;
  line-height: 1.45;
}

.stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 700px) {
  .stage {
    grid-template-columns: 1fr;
  }

  .app {
    padding: 0.65rem 0.65rem 3.2rem;
  }

  .tagline {
    display: none;
  }

  .header h1 {
    font-size: 1.35rem;
  }

  .frame {
    max-height: 24vh;
    aspect-ratio: auto;
    height: 24vh;
  }

  .footer {
    font-size: 0.85rem;
  }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  overflow: hidden;
}

.panel h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 4px;
  overflow: hidden;
}

.frame video,
.frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.age-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.65rem;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
}

.age-field input {
  width: 6.2rem;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: #140f0c;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
}

.spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
}

.spinner::after {
  content: "";
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.is-hidden {
  display: none !important;
}

.controls {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.years {
  flex: 1 1 240px;
  min-width: min(100%, 220px);
}

.years input[type="range"] {
  width: 100%;
  accent-color: #6aa7ff;
}

.year-heading {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
}

.year-live {
  color: var(--text);
  font-weight: 700;
}

.year-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text);
}

.controls label.check {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

button {
  appearance: none;
  border: none;
  border-radius: 6px;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  width: 100%;
  margin: 0;
  min-height: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.status.error {
  color: #e88a7a;
}

.disclaimer {
  width: 100%;
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  margin: 0;
  max-width: none;
  text-align: center;
  padding: 0.4rem 0.75rem calc(0.4rem + env(safe-area-inset-bottom));
  background: rgba(15, 12, 10, 0.94);
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status.lock:empty {
  display: none;
}
