:root {
  color-scheme: light;
  --ink: #20222b;
  --muted: #686c78;
  --paper: #ffffff;
  --canvas: #f5f6f8;
  --line: #e1e3e8;
  --line-strong: #d3d6dd;
  --accent: #6845d6;
  --accent-dark: #4d2fae;
  --accent-soft: #f0ebff;
  --cyan: #00a9ba;
  --pink: #e83292;
  --orange: #ff7a18;
  --yellow: #ffcc22;
  --green: #267a55;
  --green-soft: #eef8f2;
  --red: #b33b4a;
  --red-soft: #fff1f2;
  --amber: #a76012;
  --amber-soft: #fff7e8;
  --shadow: 0 18px 54px rgba(40, 31, 92, 0.1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 2%, rgba(0, 169, 186, 0.11), transparent 24rem),
    radial-gradient(circle at 92% 9%, rgba(232, 50, 146, 0.09), transparent 23rem),
    var(--canvas);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: min(100%, 660px);
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.screen {
  display: none;
}

.screen.active.start-screen,
.screen.active.result-screen {
  display: grid;
  place-items: center;
}

.screen.active.quiz-screen {
  display: block;
}

.start-card,
.quiz-card,
.result-card {
  width: 100%;
  border: 1px solid #e1def0;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.start-card,
.result-card {
  padding: 20px;
}

.logo-stage {
  display: grid;
  min-height: 252px;
  place-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.98), rgba(245, 242, 255, 0.88)),
    #fff;
}

.main-logo {
  display: block;
  width: min(100%, 330px);
  height: auto;
  mix-blend-mode: multiply;
}

.start-copy {
  max-width: 520px;
  margin: 0 auto;
  padding: 30px 10px 8px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
p {
  overflow-wrap: anywhere;
}

.start-copy h1,
.result-copy h1 {
  margin: 0;
  font-size: clamp(30px, 7.4vw, 43px);
  font-weight: 720;
  line-height: 1.08;
  letter-spacing: -0.038em;
}

.lead {
  margin: 15px auto 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.62;
}

.rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.rule-card {
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fcfbff;
}

.rule-card:nth-child(1) { border-top: 3px solid var(--cyan); }
.rule-card:nth-child(2) { border-top: 3px solid var(--yellow); }
.rule-card:nth-child(3) { border-top: 3px solid var(--orange); }
.rule-card:nth-child(4) { border-top: 3px solid var(--pink); }

.rule-card strong {
  display: block;
  margin-bottom: 5px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.rule-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.3;
}

.primary-button {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.025em;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.primary-button:hover {
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent-dark), #c8237a);
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button:focus-visible,
.answer-button:focus-visible {
  outline: 3px solid rgba(0, 169, 186, 0.26);
  outline-offset: 3px;
}

.quiz-card {
  min-height: calc(100svh - 48px);
  padding: 24px;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wordmark {
  color: var(--ink);
  font-size: 19px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.wordmark::before {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin-right: 9px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--accent));
  color: #fff;
  content: "G";
  font-size: 15px;
  font-weight: 750;
  vertical-align: middle;
}

.timer {
  --timer-color: var(--accent);
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--timer-color) var(--timer-progress), #e8e9ed 0);
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: color 0.15s ease;
}

.timer::after {
  position: absolute;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fff;
  content: "";
}

.timer span {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 700;
}

.timer-warning {
  --timer-color: var(--amber);
  color: var(--amber);
}

.timer-danger {
  --timer-color: var(--red);
  color: var(--red);
}

.progress-row {
  display: flex;
  justify-content: space-between;
  margin-top: 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.progress-track {
  height: 5px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 99px;
  background: #ebecef;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--accent), var(--pink));
  transition: width 0.25s ease;
}

.question-panel {
  margin-top: 24px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 204, 34, 0.12), transparent 12rem),
    #fff;
}

.question-kicker {
  margin: 0 0 10px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.question-panel h1 {
  margin: 0;
  font-size: clamp(22px, 5.8vw, 30px);
  font-weight: 680;
  line-height: 1.22;
  letter-spacing: -0.028em;
}

.answer-list {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.answer-button {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: start;
  width: 100%;
  min-height: 64px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  line-height: 1.45;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.answer-button:hover:not(:disabled) {
  border-color: #b7ace6;
  background: #fcfbff;
}

.answer-button:disabled {
  cursor: default;
}

.answer-letter {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
}

.answer-button > span:last-child {
  padding-top: 6px;
  font-size: 14px;
  font-weight: 520;
}

.answer-button.correct {
  border-color: #a9d2bb;
  background: var(--green-soft);
}

.answer-button.correct .answer-letter {
  background: var(--green);
  color: #fff;
}

.answer-button.wrong {
  border-color: #e1adb5;
  background: var(--red-soft);
}

.answer-button.wrong .answer-letter {
  background: var(--red);
  color: #fff;
}

.feedback {
  position: sticky;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 2;
  min-height: 48px;
  margin-top: 13px;
  padding: 14px 16px;
  border: 1px solid #25283a;
  border-radius: 12px;
  background: #25283a;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.17s ease, transform 0.17s ease;
}

.feedback-visible {
  opacity: 1;
  transform: translateY(0);
}

.result-image-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.result-image {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.result-copy {
  max-width: 520px;
  margin: 0 auto;
  padding: 30px 10px 24px;
  text-align: center;
}

.result-detail {
  margin: 22px 0 0;
  padding: 15px 16px;
  border-top: 1px solid #d9d2f1;
  border-bottom: 1px solid #d9d2f1;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.share-section {
  margin: 0 0 18px;
  padding-top: 2px;
}

.share-label {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
}

.share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.share-button {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.share-button:hover {
  border-color: #9c9fa9;
  background: #fafafa;
}

.share-button:focus-visible {
  outline: 3px solid rgba(79, 70, 184, 0.25);
  outline-offset: 3px;
}

.share-icon {
  position: relative;
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
}

.facebook-icon {
  border-radius: 50%;
  background: #1877f2;
  color: #fff;
  font-family: Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}

.instagram-icon {
  border: 2px solid #c13584;
  border-radius: 7px;
}

.instagram-icon::before {
  width: 7px;
  height: 7px;
  border: 2px solid #c13584;
  border-radius: 50%;
  content: "";
}

.instagram-icon::after {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #c13584;
  content: "";
}

.share-status {
  min-height: 18px;
  margin: 8px 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.result-card.no-result {
  max-width: 520px;
  padding: 42px 28px 24px;
}

.result-card.no-result .result-copy {
  padding: 0 10px 30px;
}

@media (min-width: 700px) {
  .app-shell {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .quiz-card {
    min-height: calc(100svh - 60px);
    padding: 28px;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .start-card,
  .result-card {
    padding: 12px;
    border-radius: 16px;
  }

  .quiz-card {
    padding: 18px 14px;
    border-radius: 16px;
  }

  .logo-stage {
    min-height: 225px;
  }

  .start-copy,
  .result-copy {
    padding-right: 6px;
    padding-left: 6px;
  }

  .question-panel {
    padding: 20px 16px;
  }

  .answer-button {
    grid-template-columns: 33px 1fr;
    padding: 12px;
  }

  .answer-letter {
    width: 32px;
    height: 32px;
  }
}

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