:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #314238;
  background: #f8edf1;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(145deg, rgba(216, 142, 165, 0.32), transparent 42%),
    linear-gradient(315deg, rgba(151, 169, 139, 0.28), transparent 48%),
    #f8edf1;
}

button {
  font: inherit;
}

.page {
  width: min(680px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: max(22px, env(safe-area-inset-top)) 0 max(28px, env(safe-area-inset-bottom));
}

.hero {
  padding: 22px 0 20px;
  text-align: center;
}

.kicker {
  margin: 0 0 12px;
  color: #6f8267;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #7b3d50;
  font-size: clamp(2.15rem, 12vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.intro {
  max-width: 34rem;
  margin: 18px auto 0;
  color: #4f6558;
  font-size: 1.05rem;
  line-height: 1.55;
}

.camera-card {
  border: 1px solid rgba(111, 130, 103, 0.28);
  border-radius: 8px;
  background: rgba(255, 252, 253, 0.88);
  box-shadow: 0 18px 46px rgba(123, 61, 80, 0.14);
  padding: 14px;
}

.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  background: #dfe8db;
}

video,
img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

video {
  transform: scaleX(-1);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #586d5d;
  text-align: center;
  line-height: 1.45;
}

.controls {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.button,
.text-button {
  min-height: 48px;
  border-radius: 8px;
  border: 0;
  font-weight: 750;
  cursor: pointer;
}

.button {
  background: #d88ea5;
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(123, 61, 80, 0.16);
}

.button.secondary {
  background: #97a98b;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.text-button {
  background: transparent;
  color: #7b3d50;
}

.status {
  min-height: 1.4em;
  margin: 12px 4px 0;
  color: #4f6558;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: center;
}

.gallery-section {
  margin-top: 22px;
  padding-bottom: 16px;
}

.gallery-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gallery-heading h2 {
  margin: 0;
  color: #7b3d50;
  font-size: 1.25rem;
  letter-spacing: 0;
}

.text-button.compact {
  min-height: 36px;
  padding: 0 6px;
  font-size: 0.95rem;
}

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

.gallery-item {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(111, 130, 103, 0.28);
  border-radius: 8px;
  background: #dfe8db;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 16px;
  border: 1px dashed rgba(111, 130, 103, 0.45);
  border-radius: 8px;
  color: #4f6558;
  text-align: center;
  background: rgba(255, 252, 253, 0.72);
}

@media (min-width: 700px) {
  .page {
    display: grid;
    align-content: center;
    padding-top: 34px;
    padding-bottom: 34px;
  }

  .controls {
    grid-template-columns: 1fr 1fr;
  }

  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  #saveButton,
  #retakeButton {
    grid-column: span 2;
  }
}
