@font-face {
  font-family: Inter;
  src: url('/quiz-media/inter.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
}

:root {
  color-scheme: light;
  --ink: #111;
  --primary: #5037b4;
  --surface: #f5f6f8;
  --gutter: 24px;
}

* { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--ink); font: 400 16px/1.5 Inter, system-ui, sans-serif; }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
[hidden] { display: none !important; }
#app { width: min(100%, 450px); margin-inline: auto; }

.app-header { height: 52px; position: relative; display: grid; place-items: center; }
.app-header img { width: 24px; height: 24px; object-fit: contain; }
.back {
  position: absolute;
  left: var(--gutter);
  display: grid;
  place-items: center;
  width: 28px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
}
.back::before { content: ""; width: 11px; height: 11px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); }
.progress { height: 4px; background: #ececec; margin-inline: var(--gutter); border-radius: 999px; overflow: hidden; }
.progress-value { height: 100%; min-width: 4px; border-radius: inherit; background: var(--primary); }
main { padding-inline: var(--gutter); padding-bottom: 26px; margin-top: 16px; }
main:has(.action-dock) { padding-bottom: 115px; }
.element + .element { margin-top: 16px; }
.rich-text { margin: 0; text-align: center; font-size: 16px; line-height: 1.5; font-weight: 400; overflow-wrap: anywhere; }
h1.rich-text, h2.rich-text { font-size: 22px; font-weight: 600; line-height: 1.28; }
.intro-title { font-family: system-ui, -apple-system, sans-serif; }
.quiz-image { display: block; width: 100%; height: auto; margin-inline: auto; }
.info-visual { min-height: 165px; display: grid; place-items: center; border-radius: 28px; background: #f2eeff; color: #6b4bc2; }
.info-visual::before { content: '♡'; font: 100px/1 system-ui, sans-serif; }

.options { display: grid; grid-template-columns: repeat(var(--columns, 1), minmax(0, 1fr)); gap: var(--gap-y, 8px) var(--gap-x, 8px); }
.option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: var(--option-height, 70px);
  padding: 10px 16px;
  color: var(--ink);
  background: var(--option-bg, var(--surface));
  border: 2px solid var(--option-border, var(--surface));
  border-radius: var(--option-radius, 35px);
  font-weight: 500;
  text-align: left;
}
.option:hover { filter: brightness(.98); }
.option[aria-checked=true] { background: #f1ebff; border-color: var(--active-border, var(--primary)); }
.option.centered { justify-content: center; text-align: center; }
.options.scale .option { padding-inline: 0; }
.emoji { font-size: 22px; flex: none; }
.option-art { width: 36px; height: 36px; object-fit: contain; flex: none; }
.check { flex: none; width: 19px; height: 19px; border-radius: 5px; border: 1px solid #d1ced7; margin-left: auto; background: #fff; }
.option[aria-checked=true] .check { background: var(--primary); border-color: var(--primary); color: #fff; display: grid; place-items: center; }
.option[aria-checked=true] .check::after { content: "✓"; font-size: 12px; }
.option-tile { padding: 0; display: block; text-align: center; overflow: hidden; }
.tile-image { display: block; width: 100%; aspect-ratio: 1 / 1.035; object-fit: cover; }
.tile-label { display: block; padding: 12px 5px; font-weight: 500; }
.intro .option-tile { border-radius: 0; }
.intro .tile-image { object-fit: contain; }
.intro .tile-label { padding-top: 14px; }

.action-dock {
  position: fixed;
  z-index: 1;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 450px);
  padding: 12px var(--gutter) max(32px, env(safe-area-inset-bottom));
  background: #fff;
}
.continue {
  width: 100%;
  min-height: 56px;
  padding: 12px 18px;
  border: none;
  border-radius: 36px;
  color: #fff;
  background: var(--primary);
  font-weight: 650;
}
.field { width: 100%; min-height: 56px; border: 1px solid #d8d6e0; border-radius: 12px; padding: 12px 16px; }
.group { display: flex; flex-direction: column; }
.group.row { flex-direction: row; }
.group > .element { min-width: 0; }
.group > .element + .element { margin-top: 0; }
.group.row > .element { flex: 1; }
.load-ring {
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin-inline: auto;
  border-radius: 50%;
  background: conic-gradient(#8156e7 var(--percent), #f0edf9 0);
  font-size: 30px;
  font-weight: 600;
}
.load-ring span { display: grid; place-items: center; width: 126px; height: 126px; border-radius: 50%; background: white; }
dialog { width: min(calc(100% - 32px), 400px); padding: 20px 24px; border: 0; border-radius: 16px; color: var(--ink); text-align: center; }
dialog::backdrop { background: #1116; }
.recap { margin: 24px 0 0; padding: 0; display: grid; gap: 8px; }
.recap div, .message { padding: 14px 18px; border-radius: 12px; background: #f5f2ff; }
.recap dt { font-size: 12px; font-weight: 600; color: #66529d; }
.recap dd { margin: 3px 0 0; }
.message { margin-top: 16px; }
.result-copy { text-align: center; margin-top: 16px; color: #555; }
.result-link { display: block; margin-top: 12px; color: var(--primary); text-align: center; }

@media (max-width: 350px) {
  :root { --gutter: 18px; }
  .option { padding-inline: 12px; }
}
