:root {
  --cream: #ede6d6;
  --bone: #f6f1e6;
  --tan: #c8a97e;
  --ochre: #c98a3b;
  --terracotta: #a0522d;
  --brown: #6b4423;
  --darkbrown: #2b2118;
  --sage: #8a8b5c;
  --ink: #2b2118;
  --shadow: 0 10px 30px rgba(43, 33, 24, 0.18);
  --radius: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Fredoka", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #e7c9a0 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, #d9b98f 0%, transparent 40%),
    radial-gradient(circle at 50% 110%, #a0522d 0%, transparent 55%),
    linear-gradient(160deg, #f3e8d6 0%, #e3c9a6 55%, #cda06e 100%);
  background-attachment: fixed;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, env(safe-area-inset-bottom));
}

.app {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* HERO */
.hero { text-align: center; padding: 6px 4px 0; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 11vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -1px;
  color: var(--darkbrown);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.4);
  line-height: 1;
}
.hero h1 .or {
  display: inline-block;
  font-size: 0.42em;
  font-weight: 600;
  color: #fff;
  background: var(--terracotta);
  padding: 0.18em 0.5em;
  border-radius: 999px;
  transform: rotate(-6deg);
  margin: 0 0.12em;
  vertical-align: middle;
  box-shadow: var(--shadow);
}
.tagline {
  margin: 12px auto 0;
  max-width: 24em;
  font-size: 1rem;
  font-weight: 400;
  color: var(--brown);
  line-height: 1.4;
}
.tagline em { font-style: italic; font-weight: 500; }

/* CARD / STAGES */
.card {
  background: var(--bone);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  border: 2px solid rgba(255, 255, 255, 0.55);
}
.stage { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.hidden { display: none !important; }

/* UPLOAD */
.drop {
  width: 100%;
  border: 3px dashed var(--tan);
  border-radius: 18px;
  background: #fff;
  padding: 34px 18px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.2s, background 0.2s;
  display: block;
}
.drop:active { transform: scale(0.98); }
.drop.dragover { border-color: var(--ochre); background: #fff8ee; }
.drop-icon { font-size: 2.8rem; }
.drop-title { font-size: 1.25rem; font-weight: 600; margin-top: 8px; color: var(--darkbrown); }
.drop-sub { font-size: 0.92rem; color: var(--brown); margin-top: 4px; }
.privacy { font-size: 0.82rem; color: var(--brown); text-align: center; margin: 4px 0 0; opacity: 0.85; }

/* THUMB */
.thumb {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 6px 16px rgba(43, 33, 24, 0.22);
}

/* ANALYSING */
.spinner {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 5px solid rgba(160, 82, 45, 0.2);
  border-top-color: var(--terracotta);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.analysing-text { font-size: 1.05rem; font-weight: 500; color: var(--brown); text-align: center; margin: 0; min-height: 1.4em; }

/* RESULT */
.verdict { text-align: center; }
.score-ring {
  --val: 0;
  width: 140px; height: 140px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  color: var(--darkbrown);
  background:
    radial-gradient(closest-side, var(--bone) 70%, transparent 71% 100%),
    conic-gradient(var(--terracotta) calc(var(--val) * 1%), rgba(160, 82, 45, 0.16) 0);
  box-shadow: var(--shadow);
}
#score-number { font-size: 3rem; line-height: 1; }
.score-ring .pct { font-size: 1.3rem; margin-top: 0.4em; }
#verdict-title { font-size: 1.5rem; margin: 6px 0 6px; color: var(--terracotta); }
#verdict-blurb { margin: 0 auto; max-width: 26em; font-size: 1rem; font-weight: 400; color: var(--brown); line-height: 1.45; }

/* BREAKDOWN */
.breakdown { width: 100%; display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.bar-row { display: flex; flex-direction: column; gap: 5px; }
.bar-label { font-size: 0.9rem; font-weight: 500; color: var(--darkbrown); }
.bar { height: 12px; background: rgba(160, 82, 45, 0.14); border-radius: 999px; overflow: hidden; }
.bar-fill {
  height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ochre), var(--terracotta));
  transition: width 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* BUTTON */
.btn {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
  background: var(--terracotta);
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease, background 0.2s;
  width: 100%;
}
.btn:active { transform: scale(0.97); background: var(--brown); }

.disclaimer { text-align: center; font-size: 0.8rem; color: var(--brown); margin: 2px 0 0; line-height: 1.3; }
.disclaimer span { opacity: 0.7; font-size: 0.92em; }

/* FOOT */
.foot { text-align: center; font-size: 0.78rem; color: var(--brown); opacity: 0.75; padding: 4px 0 2px; }

@media (max-width: 360px) {
  .card { padding: 18px; }
  .score-ring { width: 120px; height: 120px; }
  #score-number { font-size: 2.5rem; }
}
