/* The Right Pair — Clarity Lenses
   Phone-first portrait. Optical-shop navy / charcoal / gold. */

:root {
  --navy: #07111f;
  --navy-2: #0c1a2e;
  --panel: #121a27;
  --panel-2: #182233;
  --charcoal: #1b2433;
  --gold: #c6a35d;
  --gold-2: #e0c37a;
  --gold-dim: #8d7340;
  --ivory: #f3eee3;
  --muted: #9aa4b5;
  --line: rgba(198, 163, 93, 0.28);
  --miss: #d36a52;
  --miss-dim: #3a1d18;
  --ok-dim: #1a2618;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --target: 52px;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--navy);
  color: var(--ivory);
  font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  color-scheme: dark;
}

body {
  min-height: 100dvh;
  overflow: hidden;
}

button {
  font: inherit;
  color: inherit;
  appearance: none;
  border: 0;
  background: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

.app {
  min-height: 100dvh;
  min-height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  background:
    radial-gradient(120% 70% at 50% -10%, rgba(198, 163, 93, 0.14), transparent 50%),
    linear-gradient(180deg, var(--navy-2), var(--navy) 40%);
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding:
    calc(18px + var(--safe-top))
    18px
    calc(18px + var(--safe-bot));
}

.screen[hidden] {
  display: none;
}

/* ——— Splash ——— */
.splash {
  justify-content: space-between;
  text-align: center;
}

.brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
}

.brand-logo-plate {
  width: min(280px, 82%);
  background: #fff;
  border-radius: 16px;
  padding: 12px 16px 10px;
  box-shadow: var(--shadow);
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
}

.play-logo {
  height: 40px;
  width: auto;
  display: block;
  flex: 0 0 auto;
}

.splash-mid {
  padding: 8px 6px 24px;
}

.splash h1 {
  margin: 0 0 14px;
  font-family: Fraunces, "Iowan Old Style", Palatino, Georgia, serif;
  font-weight: 560;
  font-size: clamp(42px, 12vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.03em;
}

.splash-sub {
  margin: 0 auto;
  max-width: 16rem;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.4;
}

.splash-foot {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.btn-start,
.btn-again,
.btn-continue,
.btn-share {
  min-height: 56px;
  width: 100%;
  border-radius: 8px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow);
}

.btn-share {
  background: transparent;
  color: var(--gold-2);
  border: 1px solid var(--gold);
  box-shadow: none;
  margin-bottom: 8px;
}

.btn-start:active,
.btn-again:active,
.btn-continue:active,
.btn-share:active {
  transform: translateY(1px);
}

.house {
  margin: 0;
  color: var(--gold-dim);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ——— Play ——— */
.play-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.play-progress {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 13px;
}

.timer {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 16px;
}

.timer-fill {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  will-change: transform;
}

.card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.avatar {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--gold-2);
  border: 1px solid var(--gold);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.08), transparent 42%),
    var(--charcoal);
}

.avatar[data-id="1"] { background-color: #1a2740; }
.avatar[data-id="2"] { background-color: #1c2a24; }
.avatar[data-id="3"] { background-color: #241f38; }
.avatar[data-id="4"] { background-color: #2a2430; }
.avatar[data-id="5"] { background-color: #232018; }
.avatar[data-id="6"] { background-color: #1d2c33; }
.avatar[data-id="7"] { background-color: #2c1f2a; }
.avatar[data-id="8"] { background-color: #1a2433; }
.avatar[data-id="9"] { background-color: #1f261c; }
.avatar[data-id="10"] { background-color: #2c2218; }

.who {
  min-width: 0;
}

.who h2 {
  margin: 0;
  font-family: Fraunces, Palatino, Georgia, serif;
  font-size: 26px;
  font-weight: 560;
  letter-spacing: -0.02em;
}

.who .meta {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.rx {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--gold-2);
}

.brief {
  margin: 0 0 16px;
  color: var(--ivory);
  font-size: 16px;
  line-height: 1.35;
}

.tray {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.row-label {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.opts {
  display: grid;
  gap: 8px;
}

.opts-index {
  grid-template-columns: repeat(4, 1fr);
}

.opts-coating {
  grid-template-columns: 1fr 1fr;
}

.opts-type {
  grid-template-columns: repeat(3, 1fr);
}

.opt {
  min-height: var(--target);
  padding: 8px 6px;
  border-radius: 8px;
  border: 1px solid rgba(243, 238, 227, 0.14);
  background: var(--panel-2);
  color: var(--ivory);
  font-weight: 650;
  font-size: 13px;
  line-height: 1.15;
}

.opt.is-on {
  background: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.opt:disabled {
  opacity: 0.72;
}

/* ——— Feedback overlay ——— */
.feedback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  padding:
    calc(18px + var(--safe-top))
    18px
    calc(18px + var(--safe-bot));
  background: rgba(7, 17, 31, 0.55);
}

.feedback[hidden] {
  display: none;
}

.feedback-inner {
  width: 100%;
  border-radius: 16px;
  padding: 22px 18px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: center;
}

.feedback.is-gold .feedback-inner {
  background: linear-gradient(180deg, #1b2416, var(--panel));
}

.feedback.is-miss .feedback-inner {
  background: linear-gradient(180deg, #2a1815, var(--panel));
  text-align: left;
}

.tick {
  color: var(--gold);
  margin: 4px auto 8px;
}

.fb-brand {
  margin: 0;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--gold);
}

.fb-line,
.fb-shrug,
.fb-roast {
  margin: 12px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.fb-line-gold {
  font-family: Fraunces, Palatino, Georgia, serif;
  font-size: 20px;
}

.shrug-mark {
  font-size: 28px;
  color: var(--gold-dim);
  line-height: 1;
}

.fb-shrug {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 700;
}

.fb-roast {
  font-family: Fraunces, Palatino, Georgia, serif;
  font-size: 22px;
}

.fb-right {
  margin-top: 16px;
  padding: 12px 12px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(198, 163, 93, 0.06);
}

.fb-right-label {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.fb-right-pair {
  margin: 0;
  font-weight: 700;
  font-size: 16px;
}

.fb-right-why {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 450;
}

.btn-continue {
  margin-top: 16px;
}

/* ——— Results ——— */
.results {
  justify-content: space-between;
  text-align: center;
}

.results-score {
  margin: 28px 0 8px;
  font-family: Fraunces, Palatino, Georgia, serif;
  font-size: clamp(28px, 8vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.share-line {
  margin: 0 auto 10px;
  max-width: 22rem;
  font-size: 16px;
  font-weight: 650;
  color: var(--gold-2);
  line-height: 1.35;
}

.results-note {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.35;
}

.results-miss {
  text-align: left;
  margin: 8px 0 20px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel);
}

.results-miss[hidden] {
  display: none;
}

.results-miss-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-dim);
}

.results-miss-name {
  margin: 0 0 6px;
  font-family: Fraunces, Palatino, Georgia, serif;
  font-size: 22px;
}

.results-miss-line {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.35;
}

.results-miss-pair {
  margin: 0 0 6px;
  color: var(--gold-2);
  font-weight: 650;
}

.results-miss-why {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
}

.closer {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

@media (min-height: 740px) {
  .splash h1 { font-size: 60px; }
  .card { padding: 22px 18px 18px; }
}

@media (max-height: 640px) {
  .avatar { width: 48px; height: 48px; flex-basis: 48px; }
  .who h2 { font-size: 22px; }
  .opt { min-height: 48px; font-size: 13px; }
  .brief { margin-bottom: 10px; }
}
