@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800;900&family=Space+Grotesk:wght@600;700&display=swap');

:root {
  color-scheme: dark;
  --bg: #060609;
  --surface: #101015;
  --text: #f8f8fb;
  --muted: #a9a9b5;
  --accent: #65f6b4;
  --accent-rgb: 101, 246, 180;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -10%, rgba(var(--accent-rgb), 0.14), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-type="roast"] {
  --accent: #ef4444;
  --accent-rgb: 239, 68, 68;
}

body[data-type="find"] {
  --accent: #8b5cf6;
  --accent-rgb: 139, 92, 246;
}

body[data-type="battle"] {
  --accent: #a855f7;
  --accent-rgb: 168, 85, 247;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .045;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.orb {
  position: fixed;
  z-index: -2;
  width: 34rem;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .12;
  background: var(--accent);
  animation: drift 12s ease-in-out infinite alternate;
}

.orb-one { left: -14rem; top: 12%; }
.orb-two { right: -18rem; bottom: -10rem; animation-delay: -5s; }

@keyframes drift {
  to { transform: translate3d(4rem, -2rem, 0) scale(1.1); }
}

nav {
  width: min(1180px, calc(100% - 40px));
  height: 88px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  text-decoration: none;
  font: 900 18px/1 "Space Grotesk", sans-serif;
  letter-spacing: 2.4px;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(var(--accent-rgb), .44);
}

.shared-badge {
  padding: 8px 12px;
  border: 1px solid rgba(var(--accent-rgb), .32);
  border-radius: 999px;
  background: rgba(var(--accent-rgb), .08);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.8px;
}

main {
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 88px);
  margin: auto;
  display: grid;
  place-items: center;
  padding: 44px 0 80px;
}

.share-shell {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(320px, 480px) minmax(320px, 1fr);
  gap: clamp(48px, 9vw, 118px);
  align-items: center;
}

.result-card {
  position: relative;
  min-height: 590px;
  overflow: hidden;
  border: 1px solid rgba(var(--accent-rgb), .36);
  border-radius: 34px;
  padding: 34px;
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), .18), transparent 38%),
    linear-gradient(145deg, rgba(255,255,255,.055), rgba(255,255,255,.01)),
    #0a0a0f;
  box-shadow:
    0 45px 100px rgba(0,0,0,.48),
    0 0 80px rgba(var(--accent-rgb), .08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  animation: card-in .65s cubic-bezier(.2,.8,.2,1) both;
}

.saved-share-card {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #08080c;
  border-radius: 24px;
}

.saved-share-card[hidden] { display: none; }

.result-card.has-saved-image {
  min-height: 0;
  padding: 0;
  aspect-ratio: var(--saved-card-ratio, 4 / 5);
  background: #08080c;
}

.result-card.has-saved-image > :not(.saved-share-card) {
  display: none;
}

.result-card::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -140px;
  top: -130px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(var(--accent-rgb), .035), 0 0 0 92px rgba(var(--accent-rgb), .025);
}

.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  top: 0;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px var(--accent);
  opacity: .38;
  animation: scan 4.5s ease-in-out infinite;
}

@keyframes scan {
  0%, 12% { transform: translateY(0); opacity: 0; }
  25% { opacity: .42; }
  78% { opacity: .2; }
  100% { transform: translateY(590px); opacity: 0; }
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(22px) rotate(-1deg); }
  to { opacity: 1; transform: none; }
}

.card-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2.4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.kicker, .eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 3px;
}

.rate-result, .find-result, .tryon-result, .battle-result { position: relative; z-index: 1; }

.score-lockup {
  display: flex;
  align-items: baseline;
  margin: 8px 0 4px;
}

.score-lockup strong {
  color: var(--accent);
  font: 700 clamp(110px, 17vw, 168px)/.9 "Space Grotesk", sans-serif;
  letter-spacing: -10px;
  text-shadow: 0 0 38px rgba(var(--accent-rgb), .2);
}

.score-lockup span {
  color: rgba(255,255,255,.58);
  font: 700 28px/1 "Space Grotesk", sans-serif;
}

.result-card h1 {
  max-width: 390px;
  margin: 18px 0 0;
  font: 700 31px/1.12 "Space Grotesk", sans-serif;
  letter-spacing: -1.1px;
}

.occasion {
  min-height: 21px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-transform: capitalize;
}

.find-result h1 {
  margin: 18px 0 34px;
  font-size: clamp(38px, 5vw, 60px);
}

.find-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: var(--muted);
  font-weight: 700;
}

.find-meta strong {
  color: var(--text);
  font-size: 28px;
}

.match-pill {
  display: inline-flex;
  margin-top: 24px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), .13);
  border: 1px solid rgba(var(--accent-rgb), .32);
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.6px;
}

.tryon-result h1 {
  margin: 14px 0 16px;
  color: var(--accent);
  font-size: clamp(32px, 5vw, 48px);
}

.tryon-photo-container {
  margin: 14px 0 18px;
  width: 100%;
  max-height: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,.45);
  border-radius: 20px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0,0,0,.5);
}

.tryon-photo {
  width: 100%;
  height: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.tryon-item {
  max-width: 380px;
  color: var(--muted);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.battle-result h1 {
  margin: 18px 0 30px;
  color: var(--accent);
  font-size: clamp(42px, 5vw, 62px);
  text-transform: uppercase;
}

.battle-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
}

.battle-scores > div {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  text-align: center;
}

.battle-scores span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}

.battle-scores strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font: 700 42px/1 "Space Grotesk", sans-serif;
}

.battle-vs {
  color: var(--accent) !important;
  font-size: 14px !important;
}

.battle-verdict {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.result-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 22px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.result-card footer span:last-child {
  color: var(--muted);
  text-align: right;
}

.copy { max-width: 530px; }

.copy h2 {
  margin: 18px 0;
  font: 700 clamp(42px, 5vw, 68px)/.98 "Space Grotesk", sans-serif;
  letter-spacing: -3.2px;
}

.copy > p:not(.eyebrow):not(.fine-print) {
  max-width: 510px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.shared-verdict {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid rgba(var(--accent-rgb), .3);
  border-radius: 18px;
  background: rgba(var(--accent-rgb), .08);
  text-align: left;
}

.shared-verdict[hidden] { display: none; }

.shared-verdict span {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}

.shared-verdict p {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.actions a {
  min-height: 54px;
  padding: 0 22px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 900;
  transition: transform .2s ease, border-color .2s ease;
}

.actions a:hover { transform: translateY(-2px); }

.primary {
  background: var(--accent);
  color: #07070a;
  box-shadow: 0 16px 42px rgba(var(--accent-rgb), .18);
}

.secondary {
  color: var(--text);
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.045);
}

.fine-print {
  color: #696976;
  font-size: 11px;
  margin-top: 16px;
}

@media (max-width: 820px) {
  nav { height: 72px; }
  main { padding-top: 24px; }
  .share-shell {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .result-card {
    width: min(100%, 480px);
    min-height: 540px;
    margin: auto;
  }
  .result-card.has-saved-image { min-height: 0; }
  .copy { text-align: center; margin: auto; }
  .copy h2 { letter-spacing: -2px; }
  .actions { justify-content: center; }
}

@media (max-width: 480px) {
  nav, main { width: min(100% - 28px, 1180px); }
  .shared-badge { display: none; }
  .result-card { min-height: 500px; padding: 26px; border-radius: 28px; }
  .result-card.has-saved-image { min-height: 0; padding: 0; }
  .score-lockup strong { font-size: 118px; }
  .copy h2 { font-size: 42px; }
  .actions { flex-direction: column; }
  .actions a { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
}
