:root {
  --c-bg: #fff8f3;
  --c-card: #ffffff;
  --c-primary: #ff6b6b;
  --c-primary-dark: #e8533d;
  --c-accent: #ffd166;
  --c-text: #1f2a3a;
  --c-muted: #6b7280;
  --c-border: #f1e4d8;
  --c-success: #06d6a0;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(214, 100, 100, 0.12);
  --font-head: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--c-text);
  background: linear-gradient(180deg, #fff8f3 0%, #fff1f0 100%);
  min-height: 100vh;
}

.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header {
  text-align: center;
  padding: 36px 20px 18px;
}
.logo {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
}
.tagline {
  margin: 6px 0 0;
  color: var(--c-muted);
  font-size: 1.05rem;
}

main { padding: 16px 0 60px; }

.layout {
  display: grid;
  grid-template-columns: 1fr 620px;
  gap: 20px;
  align-items: start;
}

.layout-gifts {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.card {
  background: var(--c-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.question-block {
  padding: 26px 22px;
  margin: 14px 0;
  border: 2px solid var(--c-border);
  border-radius: 14px;
  background: #fffdfb;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.question-block:first-child { margin-top: 0; }

.question-block.active {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.10);
}
.question-block.answered {
  opacity: 0.72;
  background: #fbfbf9;
}
.question-block.answered:hover { opacity: 1; }

.q-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.q-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c-success);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.question-text {
  font-family: var(--font-head);
  font-size: 1.3rem;
  margin: 0;
}
.question-hint {
  color: var(--c-muted);
  font-size: 0.92rem;
  margin: 4px 0 16px;
}

.multi-continue-wrap {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}
.btn-sm {
  font-size: 0.9rem;
  padding: 9px 18px;
}

.options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border: 2px solid var(--c-border);
  border-radius: 12px;
  background: #fffdfb;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.option:hover {
  border-color: var(--c-primary);
  background: #fff7f5;
  transform: translateY(-1px);
}
.option.multi { cursor: pointer; }
.option.selected {
  border-color: var(--c-primary);
  background: #fff0ee;
  box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.12);
}
.option input {
  margin-top: 4px;
  accent-color: var(--c-primary);
  transform: scale(1.2);
}
.option .label { line-height: 1.35; font-weight: 600; }

.quiz-actions {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); }

.btn-primary {
  background: var(--c-primary);
  color: #fff;
}
.btn-primary:not(:disabled):hover { background: var(--c-primary-dark); }

.btn-secondary {
  background: transparent;
  color: var(--c-text);
  border: 2px solid var(--c-border);
}
.btn-secondary:hover { border-color: var(--c-primary); color: var(--c-primary); }

.btn-ghost {
  background: transparent;
  color: var(--c-muted);
}
.btn-ghost:hover { color: var(--c-primary); }

.skip-wrap {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--c-border);
  text-align: center;
}
.btn-link {
  background: none;
  border: none;
  color: var(--c-muted);
  font-family: var(--font-body);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-link:hover { color: var(--c-primary); }
.q-status-skip {
  background: var(--c-muted);
}

.loading {
  text-align: center;
  padding: 28px;
  color: var(--c-muted);
  font-size: 1.1rem;
}

.results-title {
  font-family: var(--font-head);
  font-size: 1.8rem;
  text-align: center;
  margin: 0 0 6px;
}
.results-sub {
  text-align: center;
  color: var(--c-muted);
  margin: 0 0 14px;
}
.results-actions { text-align: center; margin: 0 0 20px; }

.gift-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.gift {
  background: var(--c-card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gift h3 {
  font-family: var(--font-head);
  margin: 0;
  font-size: 1.15rem;
  color: var(--c-text);
}
.gift p {
  margin: 0;
  color: var(--c-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}
.gift .match {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-primary-dark);
  background: #ffe9e6;
  padding: 3px 9px;
  border-radius: 999px;
  width: max-content;
}
.match-great { background: #d3f9d8 !important; color: #2b8a3e !important; }
.match-good  { background: #d0ebff !important; color: #1971c2 !important; }
.match-fair  { background: #fff3bf !important; color: #b08900 !important; }
.match-possible { background: #ffe9e6 !important; color: var(--c-primary-dark) !important; }
.gift .buy {
  text-decoration: none;
  background: var(--c-primary);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 18px;
  justify-self: start;
}
.gift .buy:hover { background: var(--c-primary-dark); color: #fff; }

.gift-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #f5f0ec;
  flex-shrink: 0;
}
.gift-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Sidebar gifts panel */
.gifts-title {
  font-family: var(--font-head);
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.gifts-sub {
  color: var(--c-muted);
  font-size: 0.88rem;
  margin: 0 0 16px;
}

.gift-mini {
  padding: 0;
  box-shadow: none;
  border: 1px solid var(--c-border);
  background: #fffdfb;
  border-radius: 10px;
  overflow: hidden;
}
.gift-mini .gift-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.gift-mini .gift-link:hover h3 { color: var(--c-primary); }
.gift-mini .gift-img-wrap {
  width: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
}
.gift-mini .gift-body { padding: 6px 8px 8px; }
.gift-mini h3 {
  font-size: 0.78rem;
  margin: 2px 0 2px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.gift-mini p { display: none; }
.gift-mini .match {
  font-size: 0.62rem;
  padding: 1px 5px;
}

#gift-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

@media (max-width: 1200px) {
  #gift-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 820px) {
  #gift-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 540px) {
  #gift-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Full results grid: 3 columns by default, 2 then 1 as width narrows */
#gift-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

@media (max-width: 900px) {
  #gift-grid-full {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  #gift-grid-full {
    grid-template-columns: 1fr;
  }
}

.site-footer {
  padding: 24px 20px 36px;
  text-align: center;
  color: var(--c-muted);
  font-size: 0.85rem;
}

.hidden { display: none !important; }

@media (max-width: 820px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .layout-gifts {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 540px) {
  .card { padding: 22px; }
  .question-text { font-size: 1.3rem; }
  .options-hero { grid-template-columns: 1fr; }
}

/* Hero question: large colorful horizontal text boxes (boy / girl) */
.options-hero {
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.option.hero {
  text-align: center;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 48px 24px;
  border-width: 3px;
  min-height: 180px;
}
.option.hero .label {
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.option.hero { cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.25s ease, filter 0.25s ease; }

/* When one hero option is selected, dim the other */
.options-hero:has(.option.selected) .option.hero:not(.selected) {
  opacity: 0.4;
  filter: saturate(0.5);
}
.options-hero:has(.option.selected) .option.hero:not(.selected):hover {
  opacity: 0.7;
  filter: saturate(0.8);
}

.option.hero-0 {
  background: linear-gradient(135deg, #4dabf7 0%, #74c0fc 100%) !important;
  border-color: #4dabf7 !important;
  color: #fff;
}
.option.hero-0 .label { color: #fff; }
.option.hero-0:hover {
  background: linear-gradient(135deg, #3b9ae4 0%, #5bb0f8 100%) !important;
  border-color: #3b9ae4 !important;
  box-shadow: 0 10px 28px rgba(77, 171, 247, 0.35);
}
.option.hero-0.selected {
  background: linear-gradient(135deg, #1971c2 0%, #4dabf7 100%) !important;
  border-color: #1971c2 !important;
  box-shadow: 0 0 0 6px rgba(77, 171, 247, 0.35), 0 8px 32px rgba(77, 171, 247, 0.4);
  transform: scale(1.03);
}

.option.hero-1 {
  background: linear-gradient(135deg, #ff6b9d 0%, #ffa8c5 100%) !important;
  border-color: #ff6b9d !important;
  color: #fff;
}
.option.hero-1 .label { color: #fff; }
.option.hero-1:hover {
  background: linear-gradient(135deg, #f06595 0%, #ff8ab5 100%) !important;
  border-color: #f06595 !important;
  box-shadow: 0 10px 28px rgba(255, 107, 157, 0.35);
}
.option.hero-1.selected {
  background: linear-gradient(135deg, #d6336c 0%, #ff6b9d 100%) !important;
  border-color: #d6336c !important;
  box-shadow: 0 0 0 6px rgba(255, 107, 157, 0.35), 0 8px 32px rgba(255, 107, 157, 0.4);
  transform: scale(1.03);
}