/* tq-result.v1.css: TQResult's end-of-game modal (tq-result.v1.js), on top of pv-widgets.v1.css's PVModal. */
.tqr-modal .pv-modal-body { gap: 16px; padding: 18px 20px 20px; }
.tqr { display: flex; flex-direction: column; gap: 16px; }
.tqr-main, .tqr-side { display: contents; }   /* one column: the halves (tq-result.v1.js open) are only for a wide frame */

.tqr-hero { text-align: center; padding: 6px 0 2px; }
.tqr-kicker { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--pv-text-2); }
.tqr-title { font-family: var(--pv-font-display, var(--pv-font)); font-size: 1.5rem; font-weight: 600; margin-top: 4px; color: var(--pv-text); }
.tqr-win .tqr-title { color: var(--pv-success); }
.tqr-loss .tqr-title { color: var(--pv-error); }
.tqr-score { display: flex; align-items: baseline; justify-content: center; gap: 6px; margin-top: 10px; font-variant-numeric: tabular-nums; }
.tqr-n { font-family: var(--pv-font-display, var(--pv-font)); font-size: 3.6rem; line-height: 1; font-weight: 600; color: var(--pv-text); }
.tqr-score small { font-size: 1.1rem; color: var(--pv-text-3); font-weight: 500; }
.tqr-score-label { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pv-text-3); margin-top: 4px; }

.tqr-line { margin: 0; text-align: center; color: var(--pv-text-2); line-height: 1.45; text-wrap: pretty; }

.tqr-rows { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.tqr-rows > div { background: var(--pv-surface); border: 1px solid var(--pv-stroke); border-radius: var(--pv-radius); padding: 8px 10px; }
.tqr-rows dt { font-size: 0.72rem; color: var(--pv-text-2); }
.tqr-rows dd { margin: 2px 0 0; font-weight: 600; font-size: 1rem; font-variant-numeric: tabular-nums; color: var(--pv-text); }

.tqr-slot:not(:has(> :not([hidden]))) { display: none; }   /* nothing in it yet (a board still loading) */

.tqr-share { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--pv-stroke); padding-top: 14px; }
.tqr-share-pic { width: 100%; height: auto; aspect-ratio: 1200 / 630; border-radius: var(--pv-radius); border: 1px solid var(--pv-stroke); display: block; }
.tqr-share-text { margin: 0; padding: 14px 16px; background: #f8f7f1; border: 1px solid rgba(26, 62, 58, .1); border-radius: 10px;
  font-family: var(--pv-font-display, var(--pv-font)); font-size: 15px; line-height: 1.5; letter-spacing: -.15px; overflow-wrap: anywhere;
  color: #1a3a39; }
.tqr-share-link { display: block; margin-top: 6px; color: #1c7a6a; font-weight: 500; }   /* the link Copy text adds after the text */
/* Share, Save image, Copy text: one even row of Turquoise Play pills (play-landing's .pill and Share dialog's Copy) */
.tqr-share-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tqr-sbtn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: max-content; height: 44px;
  padding: 0 18px; border: 1.1px solid rgba(26, 62, 58, .1); border-radius: 9999px; background: #fff;
  font-family: var(--pv-font-display, var(--pv-font)); font-weight: 500; font-size: 16px; line-height: 1.4; letter-spacing: -.24px;
  color: #1a3e3a; cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.tqr-sbtn:hover { background: #f8f7f1; }
.tqr-sbtn:focus-visible { outline: 2px solid #2fb37a; outline-offset: 2px; }
.tqr-sbtn [data-icon], .tqr-sbtn svg { width: 18px; height: 18px; font-size: 18px; }
.tqr-sbtn--primary { border: 1.5px solid #183a36; background: linear-gradient(180deg, #1c4045, #18323a 29.167%); color: #fff; }
.tqr-sbtn--primary:hover { background: linear-gradient(180deg, #31636a, #18323a 29.167%); }
@media (prefers-reduced-motion: reduce) { .tqr-sbtn { transition: none; } }

/* the sign-up form: the share block's look (its 10px boxes, display type, pill button, Play greens) */
.tqr-form { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--pv-stroke); padding-top: 16px; text-align: left; }
.tqr-form[hidden] { display: none; }   /* the switch is off */
.tqr-form h3 { margin: 0; font-family: var(--pv-font-display, var(--pv-font)); font-size: 17px; font-weight: 600; line-height: 1.35;
  letter-spacing: -.2px; color: #1a3e3a; text-wrap: balance; }
.tqr-form > p { margin: -6px 0 0; font-size: 14px; line-height: 1.45; color: var(--pv-text-2); }
.tqr-form-fields { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.tqr-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tqr-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tqr-field label { font-size: 13px; font-weight: 500; color: var(--pv-text-2); }
.tqr-field input { box-sizing: border-box; width: 100%; height: 44px; padding: 0 14px; background: #fff;
  border: 1.1px solid rgba(26, 62, 58, .16); border-radius: 10px; box-shadow: none;
  font-family: var(--pv-font-display, var(--pv-font)); font-size: 16px; letter-spacing: -.15px; color: #1a3e3a;
  transition: border-color .15s ease, box-shadow .15s ease; }   /* 16px: iOS zooms into a smaller field */
.tqr-field input:hover { border-color: rgba(26, 62, 58, .3); }
.tqr-field input:focus-visible { border-color: #2fb37a; box-shadow: 0 0 0 3px rgba(47, 179, 122, .18); outline: 2px solid transparent; }
.tqr-field input[aria-invalid="true"] { border-color: var(--pv-error); }
.tqr-form-send { flex: none; width: 100%; height: 44px; margin-top: 2px; font-size: 16px; }   /* .tqr-sbtn's flex basis is for a row */
.tqr-form-send:disabled { opacity: .6; cursor: progress; }
.tqr-form-note { margin: 0; font-size: 12px; line-height: 1.5; color: #5b6f6c; }
.tqr-form-note a { color: #1c7a6a; font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.tqr-form-note a:focus-visible { outline: 2px solid #2fb37a; outline-offset: 2px; border-radius: 2px; }
.tqr-form-msg { margin: 0; font-size: 13px; line-height: 1.45; color: #b3300f; }   /* --pv-error, dark enough for small text */
.tqr-form-msg[hidden] { display: none; }
.tqr-form-done { margin: 0; padding: 14px 16px; background: #f8f7f1; border: 1px solid rgba(26, 62, 58, .1); border-radius: 10px;
  font-family: var(--pv-font-display, var(--pv-font)); font-size: 15px; color: #1a3a39; }
@media (prefers-reduced-motion: reduce) { .tqr-field input { transition: none; } }

/* compact (formBlock opts.compact, and every modal): the title and a Subscribe button on one row, the fields under it
   once that is clicked, so a result fits its frame */
.tqr-form-cta { display: flex; align-items: center; gap: 8px; }
.tqr-form-cta h3 { flex: 1 1 0; min-width: 0; font-size: 15px; }
/* the same width and right edge as Copy text above it (.tqr-share-acts: two buttons, 8px apart) */
.tqr-form-cta .tqr-form-open { flex: 0 0 calc(50% - 4px); min-width: 0; }
.tqr-form--compact.is-open .tqr-form-open, .tqr-form-cta.is-done .tqr-form-open { display: none; }
.tqr-form-fields[hidden] { display: none; }
.tqr-form-sheet-head { display: none; }
/* sheet (opts.sheet, on a phone): the fields slide up over the bottom of the screen, over a scrim (both moved to <body>
   while open, so they read without .tqr-form around them) */
.tqr-form-scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(18, 19, 19, .36); }
.tqr-form-scrim[hidden] { display: none; }
.tqr-form-fields.is-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-width: 640px; margin-inline: auto; max-height: calc(100dvh - 24px);
  overflow-y: auto; box-sizing: border-box; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--pv-card, #fff);
  border-radius: 16px 16px 0 0; box-shadow: 0 -12px 32px rgba(18, 19, 19, .18); animation: tqr-sheet-up .22s ease-out; }
.tqr-form-fields.is-sheet .tqr-form-sheet-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 6px; }
.tqr-form-sheet-head b { flex: 1; font-family: var(--pv-font-display, var(--pv-font)); font-size: 16px; font-weight: 600; line-height: 1.35; color: #1a3e3a; }
.tqr-form-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -6px 0 0; padding: 0; border: 0; border-radius: 9999px;
  background: none; color: #1a3e3a; cursor: pointer; }
.tqr-form-x:hover { background: #f8f7f1; }
.tqr-form-x:focus-visible { outline: 2px solid #2fb37a; outline-offset: 2px; }
.tqr-form-x svg, .tqr-form-x [data-icon] { width: 20px; height: 20px; }
/* modal (opts.sheet 'always', wider than a phone): the same fields, centered on the screen */
.tqr-form-fields.is-sheet.is-modal { top: 50%; bottom: auto; left: 50%; right: auto; width: min(440px, calc(100vw - 32px)); margin: 0;
  max-height: calc(100dvh - 48px); padding: 20px; border-radius: 16px; transform: translate(-50%, -50%);
  box-shadow: 0 24px 48px rgba(18, 19, 19, .22); animation: tqr-modal-in .18s ease-out; }
@keyframes tqr-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes tqr-modal-in { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@media (prefers-reduced-motion: reduce) { .tqr-form-fields.is-sheet { animation: none; } }

/* the modal fits the game's frame: it scrolls inside itself instead of running past the frame's bottom edge */
.pv-modal-scrim:has(> .tqr-modal) { padding: 16px; align-items: center; }
.tqr-modal { max-height: 100%; min-height: 0; }
.tqr-modal .pv-modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* A wide frame: the result on the left, sharing it (the card, the buttons, the sign-up) on the right, so the modal fits a
   laptop's game frame without scrolling. */
@media (min-width: 820px) {
  .pv-modal.tqr-modal:has(.tqr-side > *) { width: min(880px, 100%); }
  .tqr:has(.tqr-side > *) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; align-items: center; }
  .tqr:has(.tqr-side > *) > :is(.tqr-main, .tqr-side) { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
  .tqr-side > .tqr-share:first-child { border-top: 0; padding-top: 0; }
  .tqr-main .tqr-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* a phone, upright: the rows two to a line, and the card picture gives way (Save image still saves it) */
@media (max-width: 520px) {
  .tqr { gap: 12px; }
  .tqr-modal .pv-modal-body { padding: 14px 16px 16px; }
  .tqr-title { font-size: 1.25rem; }
  .tqr-score { margin-top: 6px; }
  .tqr-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tqr-rows > div { padding: 6px 10px; }
  .tqr-share { padding-top: 12px; }
  .tqr-share-pic { display: none; }
}
/* a phone on its side: one tight band of type, no picture */
@media (max-height: 500px) {
  .tqr-modal .pv-modal-head { padding: 8px 14px; }
  .tqr-modal .pv-modal-body { padding: 10px 14px 12px; }
  .tqr-modal .pv-modal-foot { padding: 8px 14px; }
  .tqr-share-pic { display: none; }
  .tqr-hero { padding: 0; }
  .tqr-title { font-size: 1.1rem; margin-top: 2px; }
  .tqr-score { margin-top: 4px; }
  .tqr .tqr-n { font-size: 2.2rem; }
  .tqr-line { font-size: 0.82rem; }
  .tqr-rows > div { padding: 5px 10px; }
  .tqr:has(.tqr-side > *) > :is(.tqr-main, .tqr-side) { gap: 8px; }
  .tqr-form { padding-top: 10px; }
}
/* On a phone, Play floats its menu button over the frame's top left corner (play-landing play.css .stage__burger: 34px,
   8px in, the query is assets/game.js PHONE), so the modal's title starts clear of it. */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .tqr-modal .pv-modal-head { padding-left: 48px; }
}
/* a short frame: the score card picture and the post's text give up their height first */
@media (max-height: 760px) {
  .tqr-share-pic { width: auto; max-width: 100%; max-height: 24vh; margin: 0 auto; }
  .tqr-n { font-size: 3rem; }
}
@media (max-height: 640px) { .tqr-share-text { display: none; } }

@media (max-width: 520px) {
  .tqr-form-row { grid-template-columns: 1fr; }
  .tqr-n { font-size: 2.8rem; }
  .tqr-modal .pv-modal-foot { flex-wrap: wrap; }
  .tqr-modal .pv-modal-foot .pv-btn { flex: 1 1 auto; }
  .tqr-form-cta h3 { font-size: 14px; line-height: 1.3; }   /* half the row now: three short lines, not four */
}
