:root {
  --app-yellow: #ffcb37;
  --app-yellow-soft: #ffe990;
  --app-blush: #ffb8c8;
  --app-cream: #fff8e6;
  --app-paper: rgba(255, 253, 244, .92);
  --app-ink: #1f1a12;
  --app-muted: #6d6044;
  --app-line: rgba(31, 26, 18, .14);
  --app-sage: #6d7f61;
  --app-shadow: rgba(91, 68, 0, .16);
}

body:is([data-page="participant"], [data-page="matchmaker"], [data-page="host"], [data-page="founder"]) {
  min-height: 100svh;
  background: #ffd84d;
  color: var(--app-ink);
}

#app-shell {
  position: relative;
  z-index: 0;
  isolation: isolate;
  min-height: 100svh;
  padding-bottom: 72px;
}

#app-shell::before,
#app-shell::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#app-shell::before {
  z-index: -2;
  background: url("/assets/yq-bumble-hero.webp") center top / cover no-repeat;
}

#app-shell::after {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 248, 230, .94) 0%, rgba(255, 248, 230, .8) 52%, rgba(255, 248, 230, .9) 100%),
    linear-gradient(0deg, rgba(255, 216, 77, .96), rgba(255, 248, 230, .78) 46%, rgba(255, 203, 55, .44));
}

#app-shell header {
  background: transparent;
  color: var(--app-ink);
  padding: 42px 18px 18px;
  box-shadow: none;
}

#app-shell header .wrap,
#app-shell main {
  width: min(100% - 36px, 860px);
  max-width: 860px;
  margin: auto;
}

#app-shell header .wrap::before {
  content: "Yq";
  display: inline-grid;
  place-items: center;
  min-width: 52px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 999px;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  font-style: italic;
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(91, 68, 0, .16);
}

#app-shell h1 {
  margin: 0;
  color: var(--app-ink);
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 34px;
  font-weight: 900;
  line-height: 1.12;
}

#app-shell h2,
#app-shell h3 {
  color: var(--app-ink);
}

#app-shell p {
  color: inherit;
}

#app-shell .sub {
  color: var(--app-muted);
  opacity: 1;
}

#app-shell main {
  padding: 12px 0 0;
}

#app-shell .toolbar,
#app-shell .card,
#app-shell .profile-summary,
#app-shell .participant-hero,
#app-shell .target-card,
#app-shell .participant-done,
#app-shell .host-next,
#app-shell .mm-hero,
#app-shell .mm-pair,
#app-shell .mm-done,
#app-shell .accuracy-phase,
#app-shell .insight-card,
#app-shell .report-shell {
  border: 1px solid var(--app-line);
  border-radius: 24px;
  background: var(--app-paper);
  box-shadow: 0 22px 58px var(--app-shadow);
  color: var(--app-ink);
  backdrop-filter: blur(14px);
}

#app-shell .toolbar {
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
}

#app-shell .pill,
#app-shell .target-badge,
#app-shell .waiting-person,
#app-shell .step-progress {
  border: 1px solid rgba(31, 26, 18, .14);
  background: #fff1b8;
  color: var(--app-ink);
}

#app-shell button {
  border: 0;
  border-radius: 15px;
  background: var(--app-yellow);
  box-shadow: 0 14px 30px rgba(166, 124, 0, .22);
  color: var(--app-ink);
}

#app-shell button.secondary {
  border: 1px solid rgba(31, 26, 18, .16);
  background: #fffdf4;
  color: var(--app-ink);
  box-shadow: none;
}

#app-shell button.danger,
#app-shell .danger {
  background: #a51f32 !important;
  color: #fff7ed !important;
}

#app-shell input,
#app-shell select {
  border: 1px solid rgba(31, 26, 18, .2);
  border-radius: 14px;
  background: #fffdf4;
  color: var(--app-ink);
}

.readonly-field {
  min-height: 42px;
  display: grid;
  align-items: center;
  border: 1px solid rgba(31, 26, 18, .14);
  border-radius: 14px;
  background: rgba(255, 253, 244, .62);
  padding: 0 13px;
  font-weight: 750;
}

#app-shell label,
#app-shell .field label,
#app-shell .setup-form label,
#app-shell .reward-form label {
  color: var(--app-ink);
}

#app-shell .muted,
#app-shell .small,
#app-shell .profile-details dt,
#app-shell .gender-pill,
#app-shell .target-sub,
#app-shell .score-guide,
#app-shell .evaluation-note,
#app-shell .footer {
  color: var(--app-muted);
}

#app-shell .profile-summary,
#app-shell .card,
#app-shell .target-card {
  margin: 16px 0;
  padding: 22px;
}

#app-shell .profile-summary h2 {
  margin: 0 0 18px;
  color: var(--app-ink);
  font-family: "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 28px;
}

#app-shell .profile-summary {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 18px;
  align-items: center;
}

.profile-avatar {
  width: 92px;
  aspect-ratio: 1;
  border-radius: 26px;
  object-fit: cover;
  border: 1px solid rgba(31, 26, 18, .14);
  background: #fffdf4;
  box-shadow: 0 16px 38px rgba(91, 68, 0, .16);
}

.profile-avatar.fallback {
  display: grid;
  place-items: center;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-size: 30px;
  font-weight: 900;
}

#app-shell .profile-details {
  gap: 16px 22px;
}

#app-shell .profile-details dd {
  color: var(--app-ink);
  font-size: 16px;
}

#app-shell .item,
#app-shell .accuracy-row,
#app-shell .roster-person {
  border-color: rgba(31, 26, 18, .12);
}

#app-shell .participant-hero::after,
#app-shell .host-stage::after {
  display: none;
}

#app-shell .participant-hero,
#app-shell .host-stage,
#app-shell .dashboard-head {
  background: linear-gradient(135deg, rgba(255, 253, 244, .94), rgba(255, 241, 184, .92));
}

#app-shell .participant-kicker,
#app-shell .host-label,
#app-shell .eyebrow,
#app-shell .report-section-title {
  color: #7a5c00;
}

#app-shell .participant-state,
#app-shell .host-person,
#app-shell .target-name,
#app-shell .mm-hero .person,
#app-shell .mm-pair-people,
#app-shell .accuracy-number,
#app-shell .insight-card strong,
#app-shell .host-next strong {
  color: var(--app-ink);
}

#app-shell .next-up,
#app-shell .notice,
#app-shell .score-guide,
#app-shell .evaluation-note,
#app-shell .participant-empty,
#app-shell .exception-card,
#app-shell .reward-card,
#app-shell .roster-summary > div,
#app-shell .accuracy-compare > div {
  border: 1px solid rgba(31, 26, 18, .12);
  background: #fff1b8;
  color: var(--app-ink);
}

#app-shell .target-avatar,
#app-shell .roster-avatar,
#app-shell .participant-done .check {
  background: var(--app-ink);
  color: var(--app-yellow);
  box-shadow: 0 12px 28px rgba(91, 68, 0, .2);
}

#app-shell img.roster-avatar {
  object-fit: cover;
}

.identity-line {
  margin-top: 4px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

#app-shell .choice {
  border: 1px solid rgba(31, 26, 18, .16);
  background: #fffdf4;
  color: var(--app-ink);
}

#app-shell .choice.active,
#app-shell .evaluation .choice.active {
  border-color: transparent;
  background: var(--app-ink);
  color: var(--app-yellow);
}

#app-shell .choice.active .score-number,
#app-shell .choice.active .score-desc {
  color: var(--app-yellow);
}

#app-shell .score-number,
#app-shell .score-desc {
  color: var(--app-ink);
}

.signup-link {
  display: grid;
  gap: 8px;
  margin: 10px 0 14px;
  padding: 14px;
  border: 1px solid rgba(31, 26, 18, .14);
  border-radius: 16px;
  background: rgba(255, 253, 244, .78);
}

.signup-link label {
  font-size: 13px;
  color: var(--app-muted);
  font-weight: 800;
}

.signup-link > div {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}

.signup-link input {
  width: 100%;
}

.signup-link a {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 14px;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-weight: 850;
  text-decoration: none;
}

.participant-signup-card {
  border-color: rgba(31, 26, 18, .16);
  background: linear-gradient(135deg, #fffdf4, #fff1b8);
}

.participant-signup-card h2 {
  margin-top: 10px;
}

.participant-status-card {
  background: linear-gradient(135deg, #fffdf4, #fff1b8);
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 10px;
}

.report-metrics > div {
  border: 1px solid rgba(31, 26, 18, .12);
  border-radius: 16px;
  padding: 13px 10px;
  background: #fffdf4;
  text-align: center;
}

.report-metrics strong {
  display: block;
  color: var(--app-ink);
  font-size: 25px;
  line-height: 1;
}

.report-metrics span {
  display: block;
  margin-top: 7px;
  color: var(--app-muted);
  font-size: 12px;
  font-weight: 750;
}

.report-privacy {
  margin: 0 0 14px;
  color: var(--app-muted);
  text-align: center;
  font-size: 12px;
}

#app-shell .report-cover {
  background: linear-gradient(150deg, #1f1a12, #5c4700 58%, #ffcb37);
}

.participant-profile-plus {
  margin-top: 22px;
}

.participant-profile-plus details {
  display: grid;
  gap: 18px;
}

.participant-profile-plus summary {
  display: flex;
  align-items: center;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.participant-profile-plus summary::-webkit-details-marker {
  display: none;
}

.participant-profile-plus .big-plus {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 24px;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-size: 56px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 16px 34px rgba(91, 68, 0, .2);
}

.participant-profile-plus summary b {
  display: block;
  color: var(--app-ink);
  font-size: 22px;
}

.participant-profile-plus summary small {
  display: block;
  margin-top: 5px;
  color: var(--app-muted);
}

.participant-extra-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.mbti-builder {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(31, 26, 18, .14);
  border-radius: 20px;
  background: rgba(255, 253, 244, .72);
}

.mbti-builder legend,
.tag-picker > label {
  padding: 0 4px;
  color: var(--app-ink);
  font-weight: 850;
}

.mbti-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.mbti-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
}

.mbti-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-weight: 850;
}

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

.mbti-choice,
.tag-option {
  position: relative;
  cursor: pointer;
}

.mbti-choice input,
.tag-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
}

.mbti-choice span,
.tag-option span {
  display: block;
  border: 1px solid rgba(31, 26, 18, .14);
  border-radius: 999px;
  background: #fffdf4;
  color: var(--app-ink);
  font-weight: 800;
  transition: transform .15s ease, border-color .15s ease, background .15s ease;
}

.mbti-choice span {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
}

.mbti-choice small {
  color: var(--app-muted);
  font-weight: 850;
}

.mbti-choice input:checked + span,
.tag-option input:checked + span {
  border-color: transparent;
  background: var(--app-ink) !important;
  color: var(--app-yellow) !important;
}

.mbti-choice input:checked + span small {
  color: var(--app-yellow) !important;
}

.mbti-choice input:focus-visible + span,
.tag-option input:focus-visible + span {
  outline: 3px solid rgba(255, 203, 55, .75);
  outline-offset: 2px;
}

.mbti-generated {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(31, 26, 18, .18);
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 750;
}

.mbti-result {
  color: var(--app-ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.mbti-result.empty {
  color: var(--app-muted);
  font-size: 13px;
  font-weight: 700;
}

.tag-picker {
  display: grid;
  gap: 10px;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-option span {
  padding: 8px 12px;
  font-size: 13px;
}

.participant-extra-form input[name="personality_tags"] {
  width: 100%;
}

.participant-extra-form input[type="file"] {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
}

.tag-cloud,
.participant-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud span {
  border: 1px solid rgba(31, 26, 18, .14);
  border-radius: 999px;
  background: #fff1b8;
  color: var(--app-ink);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
}

.participant-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

.photo-frame,
.participant-photo-grid img,
.photo-add-tile {
  aspect-ratio: 1;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(31, 26, 18, .14);
  object-fit: cover;
  background: #fffdf4;
}

.photo-frame {
  position: relative;
  overflow: hidden;
}

.photo-frame img {
  display: block;
  border: 0;
  border-radius: inherit;
}

.photo-frame span,
.photo-frame button {
  position: absolute;
  left: 8px;
  top: 8px;
  border-radius: 999px;
  padding: 4px 8px;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-size: 11px;
  font-weight: 850;
}

.photo-frame button {
  border: 0;
  cursor: pointer;
  box-shadow: none;
}

.photo-frame button[data-photo-action="delete"] {
  top: auto;
  bottom: 8px;
  background: rgba(31, 26, 18, .86);
}

.photo-add-tile {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  color: var(--app-ink);
  cursor: pointer;
}

.photo-add-tile span {
  font-size: 42px;
  font-weight: 850;
  line-height: 1;
}

.photo-add-tile small {
  color: var(--app-muted);
  font-weight: 700;
}

.ranking-item {
  border-top: 1px solid rgba(31, 26, 18, .1);
  padding: 12px 0;
}

.ranking-item summary {
  display: grid;
  grid-template-columns: 54px minmax(140px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}

.rank-no {
  width: 44px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--app-ink);
  color: var(--app-yellow);
  font-weight: 900;
}

.ranking-detail {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 12px 0 4px 54px;
}

#toast {
  border: 1px solid rgba(31, 26, 18, .16);
  background: #fffdf4;
  color: var(--app-ink);
  box-shadow: 0 18px 42px rgba(91, 68, 0, .16);
}

@media (max-width: 620px) {
  #app-shell {
    padding-bottom: 48px;
  }

  #app-shell::before {
    background-size: auto 120%;
    background-position: center top;
  }

  #app-shell header {
    padding-top: 28px;
  }

  #app-shell header .wrap,
  #app-shell main {
    width: calc(100% - 28px);
  }

  #app-shell h1 {
    font-size: 28px;
  }

  #app-shell .toolbar,
  #app-shell .profile-summary,
  #app-shell .card,
  #app-shell .target-card {
    border-radius: 20px;
    padding: 18px;
  }

  #app-shell .profile-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #app-shell .profile-summary {
    grid-template-columns: 72px 1fr;
    gap: 13px;
  }

  .profile-avatar {
    width: 72px;
    border-radius: 22px;
  }

  .report-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-item summary {
    grid-template-columns: 48px 1fr;
  }

  .ranking-item summary span:not(.rank-no) {
    grid-column: 2;
  }

  .ranking-detail {
    grid-template-columns: 1fr;
    padding-left: 0;
  }

  .signup-link > div {
    grid-template-columns: 1fr;
  }

  .signup-link a,
  .signup-link button {
    width: 100%;
  }

  .participant-profile-plus .big-plus {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    font-size: 46px;
  }

  .participant-profile-plus summary b {
    font-size: 19px;
  }
}
