/* rushcraft.co — the home page quiz: layout only.
   The rules that choose which question and which result are shown are written into the
   page with the quiz itself (shared/render-home-quiz.mjs), because they are built from
   the questions. Tokens come from tokens.css, loaded before this file. */

/* Brought back into view by quiz.js after handing in, clear of the sticky nav */
.quiz { margin-top: 40px; scroll-margin-top: 80px; }
.quiz fieldset { border: 0; min-width: 0; }

/* One question: prompt, the six seats, the two cards, three answers */
.q {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
  padding: 20px 22px 22px; margin-top: 16px;
}
.q:first-of-type { margin-top: 0; }
/* Floated, the legend is an ordinary child of the box instead of sitting on its border */
.q-head { display: block; float: left; width: 100%; padding: 0; margin-bottom: 28px; }
.q-body { clear: both; }
.q-no { display: block; font-family: var(--font-mono); color: var(--accent); font-size: 0.8125rem; letter-spacing: 0.08em; }
.q-prompt { display: block; margin-top: 6px; font-weight: 600; font-size: 1.0625rem; line-height: 1.5; }

/* The table, drawn as the product draws its quiz table (poker_table_widget.cc, a
   520 x 300 widget): the felt and the seat positions are fractions of the box, the seat
   boxes, cards, chips and dealer button keep their pixel size, so the labels stay
   legible on a phone. Slot 0 is the Hero at the bottom centre; the next seat to act is
   bottom-left, then clockwise. The colours are the product's, not the site's palette. */
.q-table {
  --felt-light: #23893A; --felt-dark: #0F6A24; --wood: #4A2F1B; --felt-text: #D9F2E1;
  --seat: #2B2F35; --seat-fold: #3A3D42; --seat-line: #555A60; --seat-text: #E0E0E0;
  --hero-line: #3B82F6; --hero-text: #93C5FD; --raise-line: #F59E0B;
  --chip-raise: #D9534F; --chip-blind: #E3B341; --chip-text: #FFF4C2;
  position: relative; list-style: none;
  width: 100%; max-width: 520px; aspect-ratio: 520 / 300;
  margin: 0 auto;
  font-family: var(--font-body); font-weight: 700; line-height: 1;
}
.q-table > li { position: absolute; }
.felt {
  inset: 8.67% 7.69% 11.33%;
  background: var(--wood); border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
}
.felt::before {
  content: ""; position: absolute; inset: 9px; border-radius: 999px;
  background: linear-gradient(to bottom right, var(--felt-light), var(--felt-dark));
}
.pot { position: relative; color: var(--felt-text); font-size: 13px; }
.seat {
  width: 68px; height: 40px; margin: -20px 0 0 -34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--seat); color: var(--seat-text);
  border: 1px solid var(--seat-line); border-radius: 10px;
  font-size: 12px;
}
.seat-fold { background: var(--seat-fold); opacity: 0.55; }
.seat-hero { border: 2.5px solid var(--hero-line); color: var(--hero-text); font-size: 15px; }
.seat-raise { border: 2.5px solid var(--raise-line); }
.s0 { left: 50%; top: 86%; }
.s1 { left: 14%; top: 66%; }
.s2 { left: 14%; top: 24%; }
.s3 { left: 50%; top: 8%; }
.s4 { left: 86%; top: 24%; }
.s5 { left: 86%; top: 66%; }
/* The dealer button sits on the BTN box's top-left corner */
.dealer {
  width: 18px; height: 18px; margin: -29px 0 0 -43px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #16181B; border-radius: 50%; font-size: 11px;
}
/* A chip a third of the way from its seat to the middle, the amount beside it */
.chip {
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  background: var(--chip-blind); border: 1.5px solid #8E7029; border-radius: 50%;
  color: var(--chip-text); font-size: 12px; line-height: 13px;
  white-space: nowrap; text-indent: 19px;
}
.chip-raise { background: var(--chip-raise); border-color: #883431; }
.chip.s0 { left: 50%; top: 73.3%; }
.chip.s1 { left: 26.2%; top: 60.1%; }
.chip.s2 { left: 26.2%; top: 32.4%; }
.chip.s3 { left: 50%; top: 21.8%; }
.chip.s4 { left: 73.8%; top: 32.4%; }
.chip.s5 { left: 73.8%; top: 60.1%; }
/* The Hero's cards on the box's top-right corner, drawn over every neighbour */
.q-hand { position: absolute; left: 48px; top: -24px; display: flex; gap: 4px; z-index: 1; }
.q-card {
  width: 30px; height: 42px; padding-top: 3px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-around;
  background: #fff; border: 1px solid #CED4DA; border-radius: 4px;
  font-family: var(--font-body); font-size: 15px; font-weight: 700;
}
.q-card i { font-style: normal; }
.q-s { color: #2C3E50; }
.q-h { color: #E74C3C; }
.q-d { color: #3498DB; }
.q-c { color: #2ECC71; }
/* A phone has no room for the widget's proportions: the box turns square and the cards
   stand above the Hero instead of beside the bottom-right seat. */
@media (max-width: 480px) {
  .q { padding: 16px 14px 18px; }
  .q-table { aspect-ratio: 1 / 1; }
  .q-hand { left: 0; top: -46px; }
  /* The right-hand seats are close enough that an amount to their chip's right would
     run into the box: it goes on the chip's other side */
  .chip.s4, .chip.s5 { direction: rtl; }
}

/* A desktop has the room for the table and the answers side by side, under the prompt */
@media (min-width: 900px) {
  .q-body { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); column-gap: 48px; align-items: center; }
  .q-table { margin: 0; }
  .q-body .q-opts { margin-top: 0; }
}

/* Answers as full-width rows the whole of which is the target */
.q-opts { margin-top: 16px; display: grid; gap: 8px; }
.q-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 6px;
  cursor: pointer; font-size: 0.9375rem;
}
.q-opt:hover { border-color: var(--text-dim); }
.q-opt:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.q-opt input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; flex: none; }

/* One question on screen. The page radios are for assistive technology and the keyboard
   (arrow keys turn the page); the dots above the question mark the answered ones and the
   current one; the row below turns the page. Which dot is which, and which of the
   previous and next labels show, is written with the quiz itself. */
.q-dots { list-style: none; display: flex; justify-content: center; gap: 10px; margin: 0 0 14px; }
@media (min-width: 900px) { .q-dots { justify-content: flex-start; } }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--text-dim); }
.q-step { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-top: 20px; }
.q-prev { cursor: pointer; }
.q-nexts { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.q-next, .q-submit label { cursor: pointer; font-size: 1rem; padding: 10px 24px; }

/* Hand in: a checkbox wearing the primary button. It only appears once every question
   has an answer. */
.q-submit { display: none; }
.q-done { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.q-done:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The result: verdict, title, scoreboard, summary line and one row per miss; then the
   site's words and the download, below on a phone and beside on a desktop. The summary
   line is written after the rows (its counts are theirs) and ordered up. */
.q-result { display: none; grid-template-columns: minmax(0, 1fr); row-gap: 28px; margin-top: 32px; }
.q-r-main, .q-r-side { display: flex; flex-direction: column; min-width: 0; }
.q-r-side { gap: 28px; }
.q-r-side .q-copy, .q-r-side .q-cta, .q-r-side .q-shot, .q-r-side .q-redo { margin-top: 0; }
@media (min-width: 900px) {
  .q-result { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: start; }
}
.q-verdict, .q-title, .r-novice, .r-s1, .r-s2, .r-s3, .r-s4, .r-passed, .r-perfect { display: none; }
.q-verdict { order: 0; margin: 0; font-family: var(--font-mono); color: var(--accent); font-size: 0.875rem; letter-spacing: 0.1em; }
.q-title { order: 1; margin-top: 6px; font-size: 1.5rem; }
/* One mark per question, filled when right; the rules that hollow a missed one are
   written with the quiz */
.q-score { order: 2; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.sc {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); border: 1.5px solid var(--accent); color: #1A1400;
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: 600;
}
.q-count { order: 3; margin-top: 14px; color: var(--text-dim); }
.q-misses { order: 4; margin-top: 12px; display: grid; gap: 8px; }
.q-copy { order: 5; margin-top: 28px; }
.q-copy p { color: var(--text-dim); margin-top: 10px; }
.q-copy p:first-child { margin-top: 0; color: var(--text); }
.q-limp { display: none; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.q-cta { order: 6; margin-top: 28px; }
.q-under { margin: 10px 0 0; color: var(--text-dim); font-size: 0.875rem; }
.q-under + .q-under { margin-top: 2px; }
.q-redo { order: 8; margin-top: 24px; }
.q-redo button { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; }

/* Each row shown steps the two counts the summary line prints: one more missed, one
   fewer right. A hidden row generates no box and steps nothing; a closed one does. */
.q-miss {
  display: none;
  counter-increment: miss 1 right -1;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: 6px;
}
.q-miss[open] { border-color: var(--text-dim); }
.q-miss-head {
  position: relative; list-style: none; cursor: pointer;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  padding: 11px 40px 11px 14px;
  font-weight: 600; font-size: 0.9375rem;
}
.q-miss-head::-webkit-details-marker { display: none; }
.q-miss-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
/* The chevron: down when closed, up when open */
.q-miss-head::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 7px; height: 7px;
  border-right: 1.5px solid var(--text-dim); border-bottom: 1.5px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg);
}
.q-miss[open] > .q-miss-head::after { transform: translateY(-30%) rotate(225deg); }
.q-tag { font-family: var(--font-mono); font-weight: 400; font-size: 0.8125rem; color: var(--accent); letter-spacing: 0.06em; }
.q-badge {
  display: none;
  font-size: 0.75rem; font-weight: 600; color: #1A1400;
  background: var(--accent); border-radius: 4px; padding: 1px 8px;
}
.q-did { flex-basis: 100%; }
.q-answer { display: none; flex-basis: 100%; font-weight: 400; }
.q-explain { margin: 0; padding: 0 16px 14px 14px; color: var(--text-dim); font-size: 0.9375rem; }

/* Read by assistive technology only */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
