:root {
  color-scheme: light;
  --ink: #211f35;
  --muted: #68677a;
  --primary: #5b45e0;
  --primary-dark: #4831c7;
  --soft: #f3f1ff;
  --line: #e8e6f1;
  --paper: #ffffff;
  --danger: #b42318;
  --success: #168154;
  --survey-bg-image: none;
  --shadow: 0 18px 45px rgba(44, 34, 105, .11);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #f8f7fc; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh; min-height: 100dvh; margin: 0; color: var(--ink); overflow-x: hidden;
  overscroll-behavior-y: none;
  background:
    var(--survey-bg-overlay, none),
    var(--survey-bg-image),
    radial-gradient(circle at 10% 0%, rgba(126, 102, 244, .15), transparent 27rem),
    radial-gradient(circle at 100% 25%, rgba(255, 198, 92, .12), transparent 24rem),
    #f8f7fc;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
.with-survey-bg {
  --survey-bg-overlay: linear-gradient(120deg, rgba(248, 247, 252, 0.82), rgba(248, 247, 252, 0.9));
}
.header-media {
  width: 100%; aspect-ratio: 4 / 1; margin-bottom: 16px; overflow: hidden;
  border: 1px solid rgba(33,31,53,.1); border-radius: 16px;
  background: #eceaf7; box-shadow: var(--shadow);
}
.header-image {
  width: 100%; height: 100%; display: block;
  object-fit: cover;
  object-position: center;
}
button, input, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.page-shell {
  width: min(100%, 760px); min-height: 100dvh; margin: 0 auto;
  padding-top: max(24px, env(safe-area-inset-top));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: max(40px, env(safe-area-inset-bottom));
  padding-left: max(16px, env(safe-area-inset-left));
}
.close-button {
  position: fixed; z-index: 30;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: 1px solid rgba(33,31,53,.12); border-radius: 50%;
  color: var(--ink); background: rgba(255,255,255,.92); box-shadow: 0 8px 24px rgba(44,34,105,.15);
  font-size: 30px; font-weight: 400; line-height: 1; cursor: pointer;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.close-button:focus-visible { outline: 3px solid rgba(91,69,224,.28); outline-offset: 2px; }
.close-button:active { transform: scale(.96); }
.hero { display: flex; align-items: center; gap: 12px; margin: 4px 4px 22px; padding-right: 48px; }
.hero h1 { font-size: clamp(1.45rem, 6vw, 2rem); line-height: 1.1; margin: 2px 0 0; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--primary); font-size: .7rem; font-weight: 800; letter-spacing: .16em; }
.brand-mark {
  display: grid; grid-template-columns: repeat(2, 10px); gap: 3px; place-content: center;
  width: 45px; height: 45px; border-radius: 14px; background: var(--primary);
  box-shadow: 0 8px 22px rgba(91, 69, 224, .28);
}
.brand-mark span { width: 10px; height: 10px; border-radius: 4px; background: white; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(3) { opacity: .65; }
.language-button {
  margin-left: auto; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255,255,255,.8); color: var(--primary); font-weight: 700; cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  max-width: 100px;
  text-align: center;
  text-align-last: center;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  overflow: hidden;
}
.game-id-card { margin-bottom: 14px; }
.input-label { display: block; margin-bottom: 8px; font-size: .9rem; font-weight: 700; color: var(--ink); }
.text-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: #fcfcff;
  font-size: 16px;
}
.text-input:focus { outline: 3px solid rgba(91,69,224,.13); border-color: var(--primary); }
.text-input:read-only { color: var(--muted); background: #f4f3f8; }
.card {
  background: var(--paper); border: 1px solid rgba(224, 221, 237, .9); border-radius: 20px;
  box-shadow: var(--shadow); padding: 20px;
}
.intro { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 14px; border-top: 4px solid var(--primary); }
.intro-copy { min-width: 0; flex: 1; }
.intro p { color: var(--muted); line-height: 1.55; margin: 0; }
.context-note { margin-top: 10px !important; padding-top: 10px; border-top: 1px solid var(--line); font-size: .82rem; }
.time-chip { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; color: var(--primary); background: var(--soft); font-size: .75rem; font-weight: 800; }
.questions { display: grid; gap: 14px; }
.question-card { position: relative; }
.question-number { display: block; color: var(--primary); font-size: .75rem; font-weight: 800; letter-spacing: .08em; margin-bottom: 8px; }
.question-label { display: block; font-size: 1.02rem; line-height: 1.4; font-weight: 750; }
.required { color: var(--danger); margin-left: 4px; }
.help { color: var(--muted); font-size: .82rem; line-height: 1.45; margin: 6px 0 0; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice label {
  display: flex; align-items: center; justify-content: center; min-height: 48px;
  border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; background: #fff;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.choice input:checked + label {
  color: var(--primary); border-color: var(--primary); background: var(--soft);
  box-shadow: 0 0 0 3px rgba(91,69,224,.1); font-weight: 800;
}
.choice input:focus-visible + label { outline: 3px solid rgba(91,69,224,.25); outline-offset: 2px; }
.choice label:active { transform: scale(.98); }
.scale-labels { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--muted); font-size: .72rem; }
.option-list { display: grid; gap: 9px; margin-top: 16px; }
.option-list .choice label { justify-content: flex-start; gap: 11px; padding: 11px 13px; min-height: 46px; }
.image-options .choice label { height: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.option-image, .option-image-placeholder { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); }
.option-image-placeholder { background: linear-gradient(135deg, #f4f2fb, #ece9f8); }
.option-caption { display: flex; align-items: center; gap: 11px; min-height: 52px; padding: 11px 13px; }
.option-text { min-width: 0; overflow-wrap: anywhere; }
.option-control {
  width: 20px; height: 20px; border: 1.5px solid #bbb7ca; border-radius: 50%; background: white; flex: 0 0 auto;
}
.multiple .option-control { border-radius: 6px; }
.choice input:checked + label .option-control { border: 6px solid var(--primary); }
.multiple input:checked + label .option-control { border: 2px solid var(--primary); background: var(--primary); box-shadow: inset 0 0 0 3px white; }
textarea {
  width: 100%; min-height: 124px; margin-top: 14px; padding: 13px 14px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 14px; color: var(--ink); background: #fcfcff;
  font-size: 16px; scroll-margin-top: max(72px, env(safe-area-inset-top));
}
textarea:focus { outline: 3px solid rgba(91,69,224,.13); border-color: var(--primary); }
.counter { display: block; color: var(--muted); font-size: .75rem; text-align: right; margin-top: 6px; }
.privacy-card { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; background: #f9fffC; box-shadow: none; }
.privacy-icon, .success-icon {
  display: grid; place-items: center; flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  color: white; background: var(--success); font-weight: 900;
}
.privacy-card strong { font-size: .9rem; }
.privacy-card p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.banner { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: .86rem; }
.error-banner { color: var(--danger); background: #fff2f0; border: 1px solid #fecdca; }
.submit-button {
  width: 100%; min-height: 56px; margin-top: 14px; padding: 13px 18px; border: 0; border-radius: 16px;
  display: flex; align-items: center; justify-content: center; gap: 12px; color: white; background: var(--primary);
  font-weight: 800; cursor: pointer; box-shadow: 0 12px 28px rgba(91,69,224,.27);
}
.submit-button:hover { background: var(--primary-dark); }
.submit-button:disabled { cursor: not-allowed; opacity: .55; box-shadow: none; }
.button-arrow { font-size: 1.25rem; }
.success-card { text-align: center; padding: 38px 22px; }
.success-card .success-icon { width: 52px; height: 52px; margin: 0 auto 15px; font-size: 1.3rem; }
.success-card h2 { margin: 0 0 8px; font-size: 1.6rem; }
.success-card p { margin: 0; color: var(--muted); line-height: 1.5; }
.response-id { margin-top: 14px !important; font-family: ui-monospace, monospace; font-size: .72rem; }
footer { display: flex; justify-content: center; gap: 7px; margin-top: 24px; color: #8a8899; font-size: .72rem; }
.skeleton div { height: 13px; border-radius: 999px; background: linear-gradient(90deg,#f0eef7,#f8f7fb,#f0eef7); margin: 10px 0; animation: pulse 1.2s infinite; }
.skeleton div:nth-child(2) { width: 70%; }
.skeleton div:nth-child(3) { height: 48px; margin-top: 20px; }
[hidden] { display: none !important; }
@keyframes pulse { 50% { opacity: .55; } }
@media (min-width: 640px) {
  .page-shell { padding-top: 42px; }
  .card { padding: 24px; }
  .option-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 420px) {
  .page-shell {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(12px, env(safe-area-inset-right));
    padding-left: max(12px, env(safe-area-inset-left));
  }
  .hero { gap: 9px; margin-bottom: 16px; padding-right: 46px; }
  .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
  .hero h1 { font-size: clamp(1.25rem, 6vw, 1.65rem); }
  .language-button { padding: 7px 9px; }
  .card { padding: 17px; border-radius: 17px; }
  .intro { gap: 10px; }
  .time-chip { padding: 6px 8px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .page-shell { padding-top: max(12px, env(safe-area-inset-top)); }
  .hero { margin-bottom: 12px; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
