/* "date your opposite" chat quiz. Rebuilt from the blue glass-bubble design in output/playwright/. */
#quiz-dialog {
  --chat-ink: #12345f;
  --chat-glass: #0d3a6e9e;
  --chat-glass-hover: #0d3a6ecc;
  --chat-line: #ffffff40;
  --chat-soft: #ffffffc4;
  width: 460px;
  height: min(860px, calc(100svh - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  overflow: hidden;
  color: #fff;
  border: 1px solid #ffffff3d;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='3' height='3'%3E%3Cpath fill='%23fff' fill-opacity='.12' d='M0 0h1v1H0zM2 1h1v1H2z'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #5f8fe0d9 0%, #2f66b8e6 45%, #0f4a8cf2 100%),
    url('assets/washington-square.jpg') center/cover;
}
#quiz-dialog .close-dialog { position: static; background: transparent; color: #fff; font-size: 30px; width: 40px; height: 40px }
.chat-shell { display: flex; flex-direction: column; height: 100% }
.chat-header { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; padding: 18px 16px 6px }
#chat-back { background: transparent; color: #fff; font-size: 34px; line-height: 1; width: 40px; height: 40px }
.chat-wordmark { text-align: center; font-family: var(--display); font-size: 34px; line-height: 1; letter-spacing: -.5px }
.chat-wordmark span { display: block; font-family: Arial, Helvetica, sans-serif; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; margin-top: 6px; opacity: .85 }
#quiz-content { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; padding: 10px 20px 20px }

.chat-progress { display: flex; gap: 5px; margin-top: 6px }
.chat-progress span { flex: 1; height: 3px; border-radius: 3px; background: #ffffff3a; overflow: hidden }
.chat-progress i { display: block; height: 100%; background: #fff; transition: width .35s ease }
.chat-stage { display: flex; justify-content: space-between; gap: 12px; font-size: 9px; letter-spacing: 1.4px; margin: 9px 0 18px; color: var(--chat-soft) }
.chat-stage span:last-child { letter-spacing: .3px }

.chat-messages { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px }
.chat-sender { font-size: 12px; color: var(--chat-soft); margin-left: 12px }
.chat-sender span { color: #ff9fd0 }
.chat-bubble { max-width: 92%; background: #f2f6ffee; color: var(--chat-ink); border-radius: 26px; padding: 15px 20px; font-size: 19px; line-height: 1.3; box-shadow: 0 6px 20px #0a2a5a26 }
.chat-bubble:focus { outline: none }
.chat-bubble strong { font-weight: 700 }
.chat-preface { background: #ffffff2e; color: #fff; font-size: 15px; padding: 11px 17px; border-radius: 22px 22px 22px 6px; box-shadow: none; animation: chat-in .3s ease-out both }
.chat-messages h2.chat-bubble { animation: chat-in .3s .12s ease-out both }
.chat-note { font-size: 13px; line-height: 1.5; color: var(--chat-soft); margin: 0 12px 16px }
.chat-context { align-self: flex-end; display: inline-flex; gap: 14px; background: var(--chat-glass); border: 1px solid var(--chat-line); border-radius: 24px; padding: 12px 18px; font-size: 14px; margin-bottom: 14px }

.chat-options { display: flex; flex-direction: column; align-items: flex-end; gap: 9px }
.chat-option { position: relative; display: flex; align-items: center; gap: 6px; width: min(100%, 300px); min-height: 48px; text-align: left; padding: 12px 40px 12px 18px; border-radius: 26px; background: var(--chat-glass); border: 1px solid var(--chat-line); color: #fff; font-size: 15px; line-height: 1.3; backdrop-filter: blur(10px); transition: background .15s, color .15s, transform .15s }
.chat-option:hover { background: var(--chat-glass-hover) }
.chat-option:active { transform: scale(.98) }
.chat-option.selected { background: #fff; color: var(--chat-ink); border-color: #fff }
.choice-check { position: absolute; right: 16px; opacity: 0; transition: opacity .15s }
.chat-option.selected .choice-check { opacity: 1 }
.chat-custom { padding-right: 18px; outline-offset: 2px }
.chat-custom::placeholder { color: #ffffffa8 }

.chat-footer { margin-top: auto; padding-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 11px; color: var(--chat-soft) }
.chat-question { display: flex; flex-direction: column; flex: 1 }
.chat-next { flex: none; width: 72px; height: 48px; border-radius: 26px; background: #fff; color: var(--chat-ink); font-size: 26px; transition: opacity .2s, transform .2s }
.chat-next:hover:not(:disabled) { transform: translateX(3px) }
.chat-next:disabled { background: #ffffff40; color: #fff; cursor: not-allowed }

.chat-composer { display: flex; gap: 9px; margin-top: auto; padding-top: 24px }
.chat-composer input, .chat-field { flex: 1; min-width: 0; height: 50px; border-radius: 26px; border: 1px solid var(--chat-line); background: var(--chat-glass); color: #fff; padding: 0 20px; font-size: 16px }
.chat-field { flex: none }
.chat-composer input::placeholder, .chat-field::placeholder { color: #ffffffa0 }
.chat-error { font-size: 12px; color: #ffd2e6; min-height: 0; margin: 8px 12px 0 }
.chat-error:empty { display: none }

.chat-upload { display: flex; align-items: center; gap: 14px; padding: 22px; border: 1.5px dashed #ffffffa0; border-radius: 22px; background: var(--chat-glass); cursor: pointer; transition: background .15s }
.chat-upload:hover { background: var(--chat-glass-hover) }
.chat-upload:focus-within { outline: 3px solid var(--pink); outline-offset: 3px }
.chat-upload input { position: absolute; width: 1px; height: 1px; opacity: 0 }
.chat-upload-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #fff; color: var(--chat-ink); font-size: 20px; flex: none }
.chat-upload-text { font-size: 15px; overflow-wrap: anywhere }

.chat-intro { display: flex; flex-direction: column; gap: 10px; margin-top: 4px }
.chat-intro > label:first-child { font-size: 12px; letter-spacing: .5px; color: var(--chat-soft); margin-left: 12px }
.chat-start { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px; padding: 0 24px; border-radius: 30px; background: #fff; color: var(--chat-ink); font-weight: 700; font-size: 16px; margin-top: 8px }
.chat-start:hover { background: #ffe6f2 }
.chat-restart { background: transparent; color: #fff; font-size: 14px; padding: 14px; margin-top: 4px; text-decoration: underline; text-underline-offset: 4px }
.chat-fine { font-size: 10px; line-height: 1.6; color: #ffffffa8; text-align: center; margin-top: 14px }

.chat-result { display: flex; flex-direction: column }
.opposite-card { background: var(--chat-glass); border: 1px solid var(--chat-line); border-radius: 26px; padding: 24px; margin: 4px 0 18px; backdrop-filter: blur(12px) }
.opposite-kicker { font-size: 10px; letter-spacing: 1.6px }
.opposite-icon { display: block; color: #ff9fd0; font-size: 40px; margin: 14px 0 8px }
.opposite-card h3 { font-family: var(--display); font-size: 44px; line-height: 1.02; margin-bottom: 14px }
.opposite-card > p { font-size: 15px; line-height: 1.5 }
.opposite-detail { border-top: 1px solid var(--chat-line); margin-top: 18px; padding-top: 16px }
.opposite-detail span { font-size: 9px; letter-spacing: 1.5px; color: var(--chat-soft) }
.opposite-detail p { font-size: 14px; line-height: 1.5; margin-top: 7px }
.chat-result > .chat-note { margin: 0 4px 6px }

@keyframes chat-in { from { opacity: 0; transform: translateY(8px) } }
@media (prefers-reduced-motion: reduce) { .chat-preface, .chat-messages h2.chat-bubble { animation: none } .chat-progress i { transition: none } }
@media (max-width: 560px) {
  /* Sized to the visible area (modal-viewport.js), so the composer sits right above the iOS keyboard. */
  #quiz-dialog { inset: var(--vv-top, 0) 0 auto 0; width: 100vw; max-width: 100vw; height: var(--vv-height, 100dvh); max-height: none; border-radius: 0; border: 0; margin: 0 }
  #quiz-content { padding: 8px 16px 18px }
  .chat-wordmark { font-size: 30px }
  .chat-bubble { font-size: 18px }
}

/* Optional sharing, outside the question form so sharing never submits an answer. */
.chat-invite { flex: none; text-align: center; margin-top: 22px; padding: 14px 8px 0; border-top: 1px solid var(--chat-line); }
.chat-invite > p:first-child { color: var(--chat-soft); font-size: 13px; line-height: 1.5; margin: 0; }
.chat-invite .chat-restart { min-height: 44px; margin: 0; padding: 10px; }
.chat-invite .chat-fine:empty { display: none; }
#resend-code:disabled { opacity: .6; cursor: wait; text-decoration: none; }
