* {
  box-sizing: border-box;
}

body {
  font-family: Inter, sans-serif;
  line-height: 1.5;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.65), transparent 35%),
    linear-gradient(180deg, #f8f3ed 0%, #efe4d6 100%);
  text-align: center;
  padding: 40px 20px;
  margin: 0;
  min-height: 100vh;
  color: #4d3a2f;
}

.app {
  max-width: 380px;
  margin: 0 auto;
}

h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(2.4rem, 6vw, 3.2rem);
  font-weight: 600;
  margin: 0 0 16px;
  color: #4d3a2f;
  letter-spacing: 0.3px;

  text-shadow: 0 2px 8px rgba(80, 55, 35, 0.12);
}

.tagline {
  margin: 0 0 24px;
  color: #6a5546;
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.65);
  border: 2px solid rgba(109, 72, 49, 0.08);
  box-shadow: 0 12px 30px rgba(80, 55, 35, 0.08);
  display: grid;
  place-items: center;
}

#preview,
#camera {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

#camera {
  background: #000;
}

#captureButton {
  display: none;
}

#placeholderText {
  position: absolute;
  inset: 0;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #6a5546;
  font-size: 1rem;
  text-align: center;
  line-height: 1.5;
  animation: oracleFadeIn 2s ease;
}

@keyframes oracleFadeIn {
  from {
    opacity: 0;
    transform: translateY(0px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}



.loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 24px;
  background: rgba(248, 243, 237, 0.84);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #4d3a2f;
}

.loading-overlay.is-visible {
  display: grid;
}

.loading-overlay p {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: 1.05rem;
}

.oracle-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(77, 58, 47, 0.18);
  border-top-color: #4d3a2f;
  border-radius: 50%;
  animation: oracleSpin 0.9s linear infinite;
}

@keyframes oracleSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .oracle-spinner {
    animation-duration: 1.8s;
  }
}

.result {
  display: none;
  min-height: 0;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(109, 72, 49, 0.12);
  color: #4d3a2f;
  line-height: 1.5;
  box-shadow: 0 6px 18px rgba(80, 55, 35, 0.06);
}

.button-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.icon-button,
.primary-button {
  font-family: 'Inter', sans-serif;
  border: none;
  border-radius: 24px;
  background: #ffffff;
  color: #4d3a2f;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 6px 18px rgba(80, 55, 35, 0.08);
}

.icon-button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(80, 55, 35, 0.12);
}

.icon-button:disabled,
.primary-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(80, 55, 35, 0.05);
}

.icon-button {
  width: 58px;
  aspect-ratio: 1 / 1;
  flex: 0 0 58px;
  display: grid;
  place-items: center;
  padding: 0;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.8;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button {
  font-family: 'Inter', sans-serif;
  flex: 1;
  min-width: 0;
  padding: 0 20px;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.button-row .primary-button {
  min-height: 58px;
}

@media (max-width: 480px) {
  body {
    padding: 24px 16px 32px;
  }

  .button-row {
    gap: 10px;
  }

  .icon-button {
    width: 54px;
    flex-basis: 54px;
  }

  .button-row .primary-button {
    min-height: 54px;
    padding: 0 16px;
    font-size: 0.95rem;
  }


}