/* Playfair Display for the wordmark and buttons, Inter for everything that has to be read at
   length. Both self-hosted — see fonts.css. */

:root {
  --yellow: #ffd21e;
  --orange: #ff8a00;
  --ink: #16160f;
  --muted: #6b6b63;
  --line: #e4e4dd;
  --bg: #ffffff;
  --tint: #fff8ec;
  --radius: 12px;

  --display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Column layout so the footer sits at the bottom of the viewport on short pages instead of
   hanging directly under the content. */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Wide enough that a full poll link fits on one line next to its label, tag and Copy button. */
.page {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 48px 64px;
}

.footer {
  flex: 0 0 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 48px 32px;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  border-top: 1px solid var(--line);
  color: #a3a39a;
  font-size: 14px;
}

.footer-sep { color: var(--line); }

.footer-version { font-family: var(--mono); font-size: 13px; }

/* --- type ---------------------------------------------------------------- */

.brand {
  font-family: var(--display);
  font-style: italic;
  font-weight: 700;
  font-size: 84px;
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.brand-sm {
  font-size: 34px;
  line-height: 1.2;
}

.tagline {
  font-size: 24px;
  color: var(--muted);
  margin: 14px 0 40px;
  white-space: nowrap;
}

.poll-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 46px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 28px;
}

/* The title doubles as the heading and its own input: borderless until hovered or focused, so it
   reads as a heading but invites editing. */
.title-edit {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 28px;
}

.poll-title-input {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  padding: 6px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--ink);
}

.poll-title-input::placeholder { color: #bdbdb4; }

.poll-title-input:hover { border-color: var(--line); }

.poll-title-input:focus {
  outline: none;
  border-color: var(--orange);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.14);
}

.title-status {
  flex: 0 0 auto;
  font-size: 15px;
  color: var(--muted);
  white-space: nowrap;
}

.title-status.is-error { color: #c62828; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 16px;
}

.hint, .link-desc, .note, .empty, .field-hint {
  color: var(--muted);
  font-size: 15px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.note { margin: 16px 0 0; }
.note-top { margin: 0 0 18px; }
.empty { margin: 0; }

.hero {
  padding: 120px 0 0;
  text-align: center;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 36px;
}

.topbar-split { justify-content: space-between; }

/* --- buttons ------------------------------------------------------------- */

.btn {
  background: var(--yellow);
  color: var(--ink);
  border: none;
  border-radius: var(--radius);
  padding: 13px 26px;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease;
}

.btn:hover:not(:disabled),
.btn:focus-visible:not(:disabled) {
  background: var(--orange);
  color: #fff;
}

.btn:active:not(:disabled) {
  background: var(--orange);
  color: #fff;
  transform: translateY(1px);
}

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

a.btn { text-decoration: none; display: inline-block; }

.btn-lg { padding: 20px 56px; font-size: 26px; }

.btn-copy { padding: 11px 20px; font-size: 17px; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--text);
  font-size: 16px;
  font-weight: 600;
}

.btn-ghost:hover, .btn-ghost:focus-visible {
  background: transparent;
  border-color: var(--orange);
  color: var(--orange);
}

/* --- inputs -------------------------------------------------------------- */

.input {
  width: 100%;
  padding: 16px 18px;
  font-family: var(--text);
  font-size: 18px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.14);
}

.input-question { font-size: 22px; padding: 18px 20px; }

.input-comment {
  margin-top: 10px;
  font-size: 17px;
  color: var(--muted);
}

.input-comment:focus { color: var(--ink); }

.field {
  display: block;
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: 8px;
}

.field-hint { display: block; margin-top: 8px; }

.setup-form { margin: 0; }

/* --- share links --------------------------------------------------------- */

.links {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 44px;
}

/* Deliberately one line per link: the label, the tag, the URL and Copy stay side by side rather
   than wrapping. The URL field takes whatever width is left. */
.link-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
}

.link-row + .link-row { margin-top: 16px; }

.link-meta {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-width: 190px;
}

.link-label { font-weight: 700; font-size: 17px; white-space: nowrap; }
.link-desc { white-space: nowrap; }

.link-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--mono);
  color: var(--muted);
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-overflow: ellipsis;
}

.link-input:focus { outline: none; border-color: var(--orange); color: var(--ink); }

.tag {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}

/* The tags sit inside the label column rather than the row: "Keep secret, save for later!" is wide
   enough that, on the row, it took the width the URL field needs to show a full link. */
.link-meta .tag {
  align-self: flex-start;
  margin-top: 6px;
}

.tag-secret { background: #fdecec; color: #b3261e; }
.tag-share { background: #eaf5ec; color: #1e7b34; }

.warn {
  margin: 18px 0 0;
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.6;
  color: #6d3b00;
  background: var(--tint);
  border: 1px solid #ffd9a8;
  border-radius: var(--radius);
}

.warn strong { color: #b3261e; }

/* --- composer ------------------------------------------------------------ */

.composer { margin-bottom: 52px; }

.kind-toggle {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.kind {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 17px;
  white-space: nowrap;
  cursor: pointer;
}

.kind:has(input:checked) {
  border-color: var(--orange);
  background: var(--tint);
  font-weight: 600;
}

.kind input { accent-color: var(--orange); margin: 0; width: 18px; height: 18px; }

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.option-row .input { padding: 13px 16px; font-size: 17px; }

.remove-option {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 8px;
}

.remove-option:hover { color: var(--orange); }

.composer-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 20px;
}

.error {
  color: #c62828;
  font-size: 16px;
  margin: 14px 0 0;
}

/* --- question list ------------------------------------------------------- */

.question-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.question-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  background: #fff;
}

.question-item.dragging { opacity: 0.4; }
.question-item.drop-target { border-color: var(--orange); }

.drag-handle {
  flex: 0 0 auto;
  cursor: grab;
  color: #b8b8ae;
  font-size: 20px;
  line-height: 1.3;
  user-select: none;
}

.drag-handle:active { cursor: grabbing; }

.question-body { flex: 1 1 auto; min-width: 0; }

.question-text { font-weight: 600; font-size: 20px; }

/* The creator's note on a question, in both the editor list and the answer form. Set apart with a
   rule rather than italics so it does not compete with the question itself. */
.question-comment,
.answer-question-comment {
  margin: 8px 0 0;
  padding-left: 12px;
  border-left: 3px solid var(--yellow);
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.answer-question-comment { margin: 10px 0 0; font-size: 17px; }

.badge {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--muted);
  background: #f4f4ef;
  border-radius: 999px;
  padding: 4px 11px;
  margin: 8px 0 4px;
  white-space: nowrap;
}

.option-list {
  list-style: disc;
  margin: 8px 0 0;
  padding-left: 24px;
  color: var(--muted);
  font-size: 17px;
}

.question-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.edit-question,
.delete-question {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.edit-question:hover,
.delete-question:hover { color: var(--orange); }

.question-item.is-editing {
  border-color: var(--orange);
  background: #fffdf8;
}

.question-item.is-editing .input-question { font-size: 20px; }

/* --- answering ----------------------------------------------------------- */

.answer-question {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 18px;
}

.answer-question-text {
  font-weight: 600;
  font-size: 22px;
  padding: 0 6px;
}

.answer-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.answer-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  font-size: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.answer-option:hover { border-color: var(--orange); }

.answer-option:has(input:checked) {
  border-color: var(--orange);
  background: var(--tint);
}

.answer-option input {
  accent-color: var(--orange);
  margin: 0;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

/* --- results ------------------------------------------------------------- */

.response {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
}

.response-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 14px;
}

.response-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
}

.response-time {
  color: var(--muted);
  font-size: 14px;
  font-family: var(--mono);
  white-space: nowrap;
}

.response-answers { margin: 0; }

.response-answers dt {
  color: var(--muted);
  font-size: 16px;
  margin-top: 12px;
}

.response-answers dt:first-child { margin-top: 0; }

.response-answers dd {
  margin: 3px 0 0;
  font-weight: 600;
  font-size: 19px;
}

/* --- narrow screens ------------------------------------------------------ */

/* Laptop widths: claw back horizontal padding and label width so the full poll link still fits on
   its single line instead of scrolling inside the field. */
@media (max-width: 1400px) {
  .page { padding: 40px 28px 64px; }
  .footer { padding: 22px 28px 32px; }
  .link-meta { min-width: 170px; }
  .links { padding: 20px; }
}

/* The no-wrap link rows only hold up while there is width for them. Below this they stack, which
   beats a URL field squeezed to nothing. */
@media (max-width: 780px) {
  html, body { font-size: 17px; }
  .page { padding: 28px 20px 48px; }
  .footer { padding: 20px 20px 28px; }
  .brand { font-size: 56px; white-space: normal; }
  .brand-sm { font-size: 28px; }
  .tagline { font-size: 20px; white-space: normal; }
  .poll-title { font-size: 34px; }
  .btn-lg { padding: 16px 36px; font-size: 22px; }
  .hero { padding: 64px 0 0; }
  .link-row { flex-wrap: wrap; }
  .link-meta { min-width: 0; }
  .link-input { flex: 1 1 100%; }
}

/* --- footer link + prose pages ------------------------------------------- */

.footer-link {
  color: #a3a39a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:hover { color: var(--orange); }

.prose {
  max-width: 760px;
  font-size: 18px;
  line-height: 1.65;
}

.prose .lede {
  font-size: 21px;
  line-height: 1.5;
  padding: 16px 18px;
  background: var(--tint);
  border: 1px solid #ffd9a8;
  border-radius: var(--radius);
  color: #6d3b00;
  margin: 0 0 28px;
}

.prose h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 26px;
  margin: 32px 0 10px;
}

.prose p { margin: 0 0 14px; }

.prose ul { margin: 0 0 14px; padding-left: 24px; }

.prose li { margin-bottom: 8px; }

/* --- landing page --------------------------------------------------------
   The front page has to sell the thing, so it gets a narrower measure than the app pages: a full
   1320px line of body copy is unreadable however well it suits a poll editor. */

.hero-sell { padding: 96px 0 0; }

.hero-question {
  font-family: var(--display);
  font-weight: 700;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.015em;
  max-width: 900px;
  margin: 20px auto 0;
}

.hero-lede {
  font-size: 21px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 700px;
  margin: 20px auto 36px;
}

.hero-note {
  font-size: 16px;
  color: var(--muted);
  margin: 22px 0 0;
}

.hero-note a { color: var(--muted); }
.hero-note a:hover, .hero-note a:focus-visible { color: var(--orange); }

.pitch { margin-top: 104px; }

.pitch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.pitch-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  font-size: 17px;
  line-height: 1.6;
  /* Column, so the closing line can be pushed to the bottom and the three of them line up across
     cards of unequal length. Otherwise the shortest ends halfway up and looks unfinished. */
  display: flex;
  flex-direction: column;
}

.pitch-card p { margin: 0 0 14px; }
.pitch-card p:last-child { margin-bottom: 0; }

.pitch-question {
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.2;
  margin: 0 0 16px;
}

/* The one line in each card worth carrying away from it. Specific enough to beat `.pitch-card p`
   above, which zeroes margin-top and would leave the auto margin doing nothing. */
.pitch-card .pitch-punch {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-weight: 600;
}

.steps { margin-top: 104px; }

.step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step-list li { display: flex; gap: 18px; align-items: flex-start; }

.step-num {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--yellow);
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-name {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  margin: 6px 0 8px;
}

.step-list p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.cta-band {
  margin-top: 104px;
  padding: 56px 40px;
  border-radius: var(--radius);
  background: var(--tint);
  border: 1px solid #ffd9a8;
  text-align: center;
}

.cta-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: 34px;
  line-height: 1.2;
  letter-spacing: -0.015em;
  max-width: 760px;
  margin: 0 auto 16px;
}

.cta-note {
  font-size: 17px;
  line-height: 1.6;
  color: #6d3b00;
  max-width: 680px;
  margin: 0 auto 30px;
}

.cta-note a { color: #6d3b00; }

@media (max-width: 1100px) {
  .pitch-grid, .step-list { grid-template-columns: 1fr; }
  .pitch, .steps, .cta-band { margin-top: 72px; }
}

@media (max-width: 780px) {
  .hero-sell { padding: 56px 0 0; }
  .hero-question { font-size: 30px; }
  .hero-lede { font-size: 19px; }
  .pitch-question { font-size: 24px; }
  .cta-title { font-size: 27px; }
  .cta-band { padding: 40px 24px; }
}


/* ===========================================================================
   Hungry Hamster. Everything above is the shared base the other Brightness
   apps use. Played on a tablet lying flat, so every control is at least 44px,
   nothing depends on hover, and the table fits the shorter side of the screen.
   =========================================================================== */

.table-top {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

/* The board is the point, so the panel is sized to what its content needs and everything left over
   goes to the table. On a landscape tablet that is the difference between a 556px board with a
   hundred pixels of unused height under it and a 640px one that fills the screen. */
.deck {
  display: grid;
  /* The panel takes a share of the screen rather than a fixed slab. On a small landscape tablet that
     hands the difference to the board, which is the part worth having; on a big screen it stops
     growing at 19rem, past which it is just a wide column of short lines. */
  grid-template-columns: minmax(0, 1fr) clamp(16rem, 26vw, 19rem);
  gap: 14px;
  padding: 10px max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom))
           max(12px, env(safe-area-inset-left));
  align-items: start;
}

.deck-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 6px max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
}

.deck-where { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.deck-title { font-family: var(--display); font-weight: 700; font-size: 20px; }
.deck-left { color: var(--muted); font-size: 15px; }
.deck-rules { color: var(--muted); font-size: 15px; min-height: 44px; display: flex;
              align-items: center; }
.deck-rules:hover, .deck-rules:focus-visible { color: var(--orange); }


/* ==========================================================================
   Texas
   ==========================================================================
   Two screens with different jobs. The felt is a shared screen in the middle of the table, read
   from a metre away by everybody at once, so everything on it is large and nothing on it is
   secret. A seat page is held in one hand, a foot from the face, and is the only place a hand of
   cards is ever drawn.
   ========================================================================== */

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 40px; }
.wrap-narrow { max-width: 640px; }

.page-title { font-family: var(--display); font-size: clamp(28px, 5vw, 44px); margin: 8px 0 4px; }
.lede { font-size: clamp(16px, 2vw, 20px); color: var(--muted); margin: 0 0 22px; max-width: 60ch; }

.two-up { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: #fff;
}
.card-head {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted);
}

.stack { display: flex; flex-direction: column; gap: 6px; }
.stack .btn { margin-top: 10px; }
.row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row-two span { display: flex; flex-direction: column; gap: 6px; }

.input-code {
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: 0.22em;
  text-align: center;
  text-transform: uppercase;
}

.flash { border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; font-weight: 600; }
.flash-bad { background: #fdecec; color: #b3261e; }
.flash-warn { background: #fff6e5; color: #8a5a00; }

.pill {
  display: inline-block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px;
  background: var(--tint); color: var(--muted);
}
.pill-button { background: var(--ink); color: #fff; }
.pill-allin { background: #fdecec; color: #b3261e; }

.drawer { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 24px; }
.drawer summary { cursor: pointer; min-height: 44px; display: flex; align-items: center;
                  font-weight: 600; }
.drawer-quiet summary { color: var(--muted); font-weight: 400; }
.log { margin: 0; padding-left: 20px; font-size: 14px; color: var(--muted);
       display: flex; flex-direction: column; gap: 5px; }

.foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 18px max(16px, env(safe-area-inset-left)) max(20px, env(safe-area-inset-bottom));
  font-size: 13px; color: var(--muted); border-top: 1px solid var(--line);
}
.foot a { color: var(--muted); }
.foot-version { margin-left: auto; font-family: var(--mono); }

/* --- a playing card -------------------------------------------------------
 *
 * Drawn from type rather than from images. The suit glyphs are in every font we serve, they scale
 * with the card, and img-src is 'self' so a sprite sheet from anywhere else would not load.
 */
.card-rank, .card-suit { display: block; line-height: 1; }

.card:where(.is-red, .card-back, :not(.card-head)) { }

span.card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 46px;
  height: 66px;
  padding: 4px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid #cfc9bd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
  vertical-align: middle;
}
span.card .card-rank { font-size: 21px; }
span.card .card-suit { font-size: 19px; }
span.card.is-red { color: #b3261e; }

span.card.big { width: 68px; height: 98px; border-radius: 8px; }
span.card.big .card-rank { font-size: 31px; }
span.card.big .card-suit { font-size: 28px; }

span.card.huge { width: 104px; height: 150px; border-radius: 10px; }
span.card.huge .card-rank { font-size: 48px; }
span.card.huge .card-suit { font-size: 44px; }

/* span.card sets a white face, so the back has to match that specificity or it stays white. */
span.card.card-back {
  background: repeating-linear-gradient(45deg, #7d3b3b 0 6px, #944a4a 6px 12px);
  border-color: #5e2c2c;
  box-shadow: inset 0 0 0 3px #fff, 0 1px 3px rgba(0, 0, 0, .18);
}

/* --- the shared screen ---------------------------------------------------- */

.felt { background: var(--bg); }

.felt-wrap { padding: 10px max(12px, env(safe-area-inset-left)) 0; display: flex;
             justify-content: center; }

.felt-table {
  position: relative;
  width: min(100%, 1000px);
  aspect-ratio: 16 / 9;
  border-radius: 999px / 40%;
  background: radial-gradient(ellipse at 50% 45%, #2f6b4a 0%, #245439 70%, #1d452f 100%);
  border: 10px solid #5b3a24;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  container-type: inline-size;
}

.middle {
  position: absolute;
  left: 50%; top: 47%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  text-align: center;
  width: 70%;
}

.board-cards { display: flex; gap: 1.1cqw; justify-content: center; flex-wrap: nowrap; }
.pot { margin: 0; color: #e8f2ea; font-size: clamp(15px, 2.4cqw, 26px); }
.pot strong { font-family: var(--mono); }
.stage { margin: 0; color: #b9d3c3; font-size: clamp(12px, 1.6cqw, 18px);
         letter-spacing: 0.1em; text-transform: uppercase; }

/* The join card sits where the board will be, so the first thing anybody sees is how to get in. */
.join-card {
  background: #fff; border-radius: var(--radius); padding: 3cqw 4cqw;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.join-lead { margin: 0; font-size: clamp(12px, 1.5cqw, 16px); letter-spacing: 0.12em;
             text-transform: uppercase; color: var(--muted); }
.join-code {
  margin: 0; font-family: var(--mono); font-weight: 700;
  font-size: clamp(28px, 6cqw, 64px); letter-spacing: 0.14em;
}
.join-qr { width: clamp(96px, 16cqw, 180px); height: auto; image-rendering: pixelated; }
.join-where { margin: 0; font-size: clamp(11px, 1.4cqw, 15px); color: var(--muted); }

/* Seats around the rim. Nine positions, laid out by hand: a ring of absolutely placed boxes reads
   as people sitting round a table in a way a flex row never does. */
.seats { list-style: none; margin: 0; padding: 0; }
.seat {
  position: absolute;
  min-width: 15cqw;
  padding: 1cqw 1.6cqw;
  background: rgba(255, 255, 255, .94);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  transform: translate(-50%, -50%);
}
.seat-name { font-weight: 700; font-size: clamp(11px, 1.7cqw, 19px); white-space: nowrap; }
.seat-chips { font-family: var(--mono); font-size: clamp(10px, 1.5cqw, 17px); color: var(--muted); }
.seat-bet {
  position: absolute; top: calc(100% + 0.4cqw); left: 50%; transform: translateX(-50%);
  font-family: var(--mono); font-size: clamp(9px, 1.3cqw, 15px);
  background: var(--yellow); color: var(--ink);
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.seat.is-turn { outline: 3px solid var(--yellow); box-shadow: 0 0 0 6px rgba(255, 210, 30, .3); }
.seat.is-folded { opacity: .45; }

/* Seat positions, one set per table size. Generated by tools/seat_positions.py:
   a seat's place depends on how many are playing, and a style attribute would be
   dropped under style-src 'self'. Seat nought sits at the bottom, nearest the shared
   screen, and the rest go round clockwise. */
.p2-0 { left: 50.0%; top: 94.0%; }
.p2-1 { left: 50.0%; top: 6.0%; }
.p3-0 { left: 50.0%; top: 94.0%; }
.p3-1 { left: 89.8%; top: 28.0%; }
.p3-2 { left: 10.2%; top: 28.0%; }
.p4-0 { left: 50.0%; top: 94.0%; }
.p4-1 { left: 96.0%; top: 50.0%; }
.p4-2 { left: 50.0%; top: 6.0%; }
.p4-3 { left: 4.0%; top: 50.0%; }
.p5-0 { left: 50.0%; top: 94.0%; }
.p5-1 { left: 93.7%; top: 63.6%; }
.p5-2 { left: 77.0%; top: 14.4%; }
.p5-3 { left: 23.0%; top: 14.4%; }
.p5-4 { left: 6.3%; top: 63.6%; }
.p6-0 { left: 50.0%; top: 94.0%; }
.p6-1 { left: 89.8%; top: 72.0%; }
.p6-2 { left: 89.8%; top: 28.0%; }
.p6-3 { left: 50.0%; top: 6.0%; }
.p6-4 { left: 10.2%; top: 28.0%; }
.p6-5 { left: 10.2%; top: 72.0%; }
.p7-0 { left: 50.0%; top: 94.0%; }
.p7-1 { left: 86.0%; top: 77.4%; }
.p7-2 { left: 94.8%; top: 40.2%; }
.p7-3 { left: 70.0%; top: 10.4%; }
.p7-4 { left: 30.0%; top: 10.4%; }
.p7-5 { left: 5.2%; top: 40.2%; }
.p7-6 { left: 14.0%; top: 77.4%; }
.p8-0 { left: 50.0%; top: 94.0%; }
.p8-1 { left: 82.5%; top: 81.1%; }
.p8-2 { left: 96.0%; top: 50.0%; }
.p8-3 { left: 82.5%; top: 18.9%; }
.p8-4 { left: 50.0%; top: 6.0%; }
.p8-5 { left: 17.5%; top: 18.9%; }
.p8-6 { left: 4.0%; top: 50.0%; }
.p8-7 { left: 17.5%; top: 81.1%; }
.p9-0 { left: 50.0%; top: 94.0%; }
.p9-1 { left: 79.6%; top: 83.7%; }
.p9-2 { left: 95.3%; top: 57.6%; }
.p9-3 { left: 89.8%; top: 28.0%; }
.p9-4 { left: 65.7%; top: 8.7%; }
.p9-5 { left: 34.3%; top: 8.7%; }
.p9-6 { left: 10.2%; top: 28.0%; }
.p9-7 { left: 4.7%; top: 57.6%; }
.p9-8 { left: 20.4%; top: 83.7%; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 24px 0 8px; }
.controls form { margin: 0; }

.showdown { margin: 20px 0; }
.showdown-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
                 gap: 10px; }
.showdown-row { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center;
                gap: 12px; }
.showdown-name { font-weight: 700; }
.showdown-cards { display: flex; gap: 4px; }
.showdown-hand { color: var(--muted); font-size: 14px; }
.showdown-won { font-family: var(--mono); font-weight: 700; }
.showdown-row.is-winner .showdown-won { color: #1e7b34; }

/* --- a player's own screen ------------------------------------------------ */

.hand { background: var(--bg); }

.my-hand {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px 22px; background: #fff; margin-bottom: 18px;
}
.my-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; font-size: 13px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--muted);
}
.my-chips { font-family: var(--mono); color: var(--ink); font-size: 16px; letter-spacing: 0; }
.hand-cards { display: flex; gap: 14px; justify-content: center; }

.board-strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 18px;
  background: var(--tint); border-radius: var(--radius);
}
.board-label, .board-pot { font-size: 13px; color: var(--muted); }
.board-pot { margin-left: auto; font-family: var(--mono); }
.board-strip .board-cards { gap: 6px; }

.act { border: 2px solid var(--orange); border-radius: var(--radius); padding: 16px 18px 20px;
       background: #fffdf7; margin-bottom: 18px; }
.act-buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.act-buttons form { margin: 0; }
.act-buttons .btn { min-height: 56px; }
.raise-form { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; }

.waiting { color: var(--muted); font-size: 17px; margin: 0 0 18px; }

.others { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.other-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column;
              gap: 8px; }
.other { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center;
         font-size: 15px; }
.other-chips { font-family: var(--mono); }
.other-bet { font-family: var(--mono); font-size: 13px; color: var(--muted); min-width: 6em;
             text-align: right; }
.other.is-turn .other-name { font-weight: 700; }
.other.is-folded { opacity: .5; }

@media (max-width: 640px) {
  .felt-table { aspect-ratio: 3 / 4; border-radius: 40% / 999px; }
  .seat { min-width: 26cqw; }
}

/* --- the blind clock ------------------------------------------------------ */

.clock {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; margin: 20px 0 4px; background: var(--tint);
}
.clock.is-paused { background: #fff6e5; border-color: #f0dcae; }
.clock-face { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.clock-label { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
               color: var(--muted); }
.clock-time { font-family: var(--mono); font-weight: 700; font-size: clamp(26px, 4vw, 40px);
              line-height: 1; font-variant-numeric: tabular-nums; }
.clock-next { font-size: 14px; color: var(--muted); font-family: var(--mono); }
