/* Pass the Time. Sizes use em so the header text-size buttons scale the games. */
.ptt-page { max-width: 72rem; min-width: 0; }
.ptt-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  gap: 1.25rem 2rem;
  align-items: start;
  margin: 0 0 1.25rem;
}
.ptt-intro { max-width: 40rem; margin: 0; }
.ptt-chair {
  border: 2px solid var(--primary, #2E5E4E);
  border-radius: 0.6rem;
  padding: 1rem 1.1rem 1.15rem;
  background: #fff;
}
.ptt-chair h3 { margin: 0 0 0.4rem; }
.ptt-chair p { margin: 0 0 0.9rem; }
@media (max-width: 700px) {
  .ptt-top { grid-template-columns: 1fr; }
}
.ptt-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
  max-width: 100%;
}
.ptt-pick {
  min-height: 48px;
  min-width: 48px;
  flex: 1 1 12rem;
  max-width: 100%;
  white-space: normal;
  hyphens: none;
  word-break: normal;
  overflow-wrap: normal;
  text-align: center;
  line-height: 1.25;
  background: #d9d9d9;
  color: #2b2b2b;
}
.ptt-pick.is-on,
.ptt-pick[aria-pressed="true"] {
  background: var(--accent, #C9A227);
  color: #2b2b2b;
}
.ptt-stage, #ptt-board, .ptt-invites { max-width: 100%; min-width: 0; }
.ptt-stage { margin-top: 0.5rem; }
.ptt-status, .ptt-help, .ptt-note, .ptt-label, .ptt-pegs, .ptt-count {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.ptt-stage-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.ptt-stage-bar h3 { margin-right: auto; }
.ptt-help { max-width: 40rem; margin: 0 0 1rem; }
.ptt-status { font-weight: bold; min-height: 1.5em; margin-top: 0.75rem; }
.ptt-slide { font-size: 0.95em; margin: 0.5rem 0 0; }

.ptt-sol-top,
.ptt-tableau,
.ptt-homes,
.ptt-waste {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45em;
  align-items: flex-start;
}
.ptt-tableau {
  margin-top: 0.8em;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 0.4em;
}
.ptt-col { display: flex; flex-direction: column; align-items: center; min-width: 76px; }
.ptt-card,
.ptt-slot {
  box-sizing: border-box;
  width: 5.2em;
  min-width: 88px;
  height: 6.5em;
  min-height: 108px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.06em;
  flex-shrink: 0;
  border: 2px solid #2b2b2b;
  border-radius: 0.45em;
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  font-size: 1em;
  font-weight: bold;
  line-height: 1;
  padding: 0.28em 0.18em 0.16em;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
}
.ptt-rank,
.ptt-suit,
.ptt-slot-label {
  display: block;
  max-width: 100%;
  line-height: 1.05;
}
.ptt-rank { font-size: 1.2em; white-space: nowrap; }
.ptt-suit { font-size: 1.35em; line-height: 1; }
.ptt-slot {
  justify-content: center;
  background: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}
.ptt-slot-label {
  font-size: 0.82em;
  font-weight: 700;
  white-space: normal;
}
.ptt-col .ptt-card,
.ptt-col .ptt-slot { margin-top: -4.35em; }
.ptt-col .ptt-card:first-child,
.ptt-col .ptt-slot:first-child { margin-top: 0; }
.ptt-card.is-red { color: #8d1d1d; }
.ptt-card.is-down {
  background: var(--primary, #2E5E4E);
  color: transparent;
  cursor: default;
}
.ptt-card.is-selected { outline: 4px solid var(--accent, #C9A227); outline-offset: 2px; }
.ptt-slot.is-quiet { cursor: default; }
.ptt-cheer {
  margin: 0.85rem 0 0;
  padding: 0.85rem 1rem;
  max-width: 40rem;
  border: 3px solid var(--accent, #C9A227);
  border-radius: 0.5rem;
  background: #fff8e4;
  font-weight: bold;
}

.ptt-blocks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-start;
  min-width: 0;
  max-width: 100%;
}
/* Cell size is set from the viewport (--ptt-fit-cell). The fallback keeps the
   first paint inside a short laptop window: cap 1.6em, floor 18px. */
.ptt-block-grid {
  --ptt-cell: var(--ptt-fit-cell, min(1.6em, max(18px, calc((100dvh - 16em) / 20))));
  display: grid;
  grid-template-columns: repeat(10, var(--ptt-cell));
  grid-template-rows: repeat(20, var(--ptt-cell));
  gap: 2px;
  width: max-content;
  max-width: 100%;
  background: #1d332c;
  padding: 0.4em;
  border-radius: 0.4em;
}
.ptt-stage:has(.ptt-blocks) {
  scroll-margin-top: 8px;
  scroll-margin-bottom: 8px;
}
.ptt-stage:has(.ptt-blocks) .ptt-stage-bar { margin-bottom: 0.4rem; }
.ptt-stage:has(.ptt-blocks) .ptt-help { margin-bottom: 0.4rem; }
.ptt-stage:has(.ptt-blocks) .ptt-status { margin-top: 0.35rem; }
.ptt-cell { background: rgba(255, 255, 255, 0.08); border-radius: 2px; }
.ptt-cell.is-bar { background: #1f6f5b; }
.ptt-cell.is-box { background: #c4a15a; }
.ptt-cell.is-tee { background: #8d5a3c; }
.ptt-cell.is-ell { background: #3e6d8c; }
.ptt-cell.is-jay { background: #5c6b4a; }
.ptt-cell.is-ess { background: #a15c4a; }
.ptt-cell.is-zee { background: #4a6670; }
.ptt-block-controls {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  max-width: 22rem;
  min-width: min(100%, 16rem);
}
.ptt-block-btn { min-width: 5.5rem; min-height: 48px; background: #d9d9d9; color: #2b2b2b; }
.ptt-next { flex-basis: 100%; margin: 0.25rem 0 0; }

.ptt-memory {
  display: grid;
  grid-template-columns: repeat(4, minmax(48px, 5.5em));
  gap: 0.6em;
  width: max-content;
  max-width: 100%;
}
.ptt-memory-card {
  min-width: 48px;
  min-height: 64px;
  aspect-ratio: 1;
  border: 2px solid #2b2b2b;
  border-radius: 0.45em;
  background: var(--primary, #2E5E4E);
  color: #fff;
  font: inherit;
  font-size: 1.4em;
  font-weight: bold;
  cursor: pointer;
}
.ptt-memory-card.is-up {
  background: #fff;
  color: #1a1a1a;
}
.ptt-memory-card.is-found { outline: 4px solid var(--accent, #C9A227); }
.ptt-memory-card svg { width: 70%; height: 70%; display: block; margin: 0 auto; }

.ptt-puzzle-bar,
.ptt-pad {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.8rem;
}
.ptt-mini,
.ptt-num,
.ptt-check { min-height: 48px; min-width: 48px; }
.ptt-mini[data-crossword][aria-pressed="true"] {
  background: var(--accent, #C9A227);
  color: #2b2b2b;
}
.ptt-num { background: #d9d9d9; color: #2b2b2b; font-size: 1.2em; }
.ptt-sudoku {
  display: grid;
  grid-template-columns: repeat(9, minmax(36px, 2.6em));
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border: 3px solid #2b2b2b;
}
.ptt-sudo {
  min-width: 36px;
  min-height: 44px;
  border: 1px solid #888;
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  font-size: 1.15em;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}
.ptt-sudo.is-given { background: #efe6d2; }
.ptt-sudo.is-focus { outline: 3px solid var(--primary, #2E5E4E); outline-offset: -3px; }
.ptt-sudo.is-wrong { background: #f3c7c0; }
.ptt-sudo.is-box-r { border-right: 3px solid #2b2b2b; }
.ptt-sudo.is-box-b { border-bottom: 3px solid #2b2b2b; }

.ptt-xword-layout {
  display: grid;
  gap: 1rem 1.5rem;
  align-items: start;
  margin-bottom: 1rem;
}
.ptt-current-clue {
  margin: 0 0 0.75rem;
  min-height: 2.6em;
  font-weight: 700;
  line-height: 1.35;
}
.ptt-xword {
  display: grid;
  gap: 1px;
  width: min(100%, calc(34rem * var(--font-scale, 1)));
  margin: 0 auto;
  background: #2b2b2b;
  border: 2px solid #2b2b2b;
  justify-self: center;
}
.ptt-xcell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  background: #fff;
  container-type: size;
}
.ptt-xcell.is-black { background: #2b2b2b; }
.ptt-xcell.is-word { background: #e4f0e8; }
.ptt-xcell.is-focus { background: #f6e7a8; }
.ptt-xnum {
  position: absolute;
  top: 4cqmin;
  left: 6cqmin;
  font-size: 32cqmin;
  line-height: 1;
  font-weight: 700;
  pointer-events: none;
}
.ptt-xcell input {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent;
  text-align: center;
  font: inherit;
  font-size: 52cqmin;
  font-weight: 700;
  text-transform: uppercase;
  padding: 18cqmin 0 0;
  border-radius: 0;
}
.ptt-xcell input.is-wrong,
.ptt-xcell.is-word input.is-wrong,
.ptt-xcell.is-focus input.is-wrong { background: #f3c7c0; }
.ptt-clues {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 0;
}
.ptt-clue.is-on {
  background: rgba(46, 94, 78, 0.14);
  font-weight: 700;
}
@media (min-width: 960px) {
  .ptt-xword-layout { grid-template-columns: minmax(0, 36rem) minmax(16rem, 1fr); }
  .ptt-xword { margin: 0; }
}
@media (max-width: 640px) {
  .ptt-xword {
    width: calc(100% + 1.5rem);
    max-width: none;
    margin-left: -0.75rem;
    margin-right: -0.75rem;
  }
}
.ptt-clue-list { list-style: none; padding: 0; margin: 0; }
.ptt-clue {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  font: inherit;
  font-size: 1em;
  padding: 0.55em 0.2em;
  min-height: 48px;
  cursor: pointer;
  color: inherit;
}

body.high-contrast .ptt-pick,
body.high-contrast .ptt-block-btn,
body.high-contrast .ptt-num {
  background: #fff;
  color: #000;
  border: 2px solid #000;
}
body.high-contrast .ptt-pick.is-on,
body.high-contrast .ptt-pick[aria-pressed="true"],
body.high-contrast .ptt-mini[data-crossword][aria-pressed="true"] {
  background: #000;
  color: #fff;
}
body.high-contrast .ptt-card,
body.high-contrast .ptt-slot,
body.high-contrast .ptt-sudo,
body.high-contrast .ptt-xcell,
body.high-contrast .ptt-memory-card.is-up {
  background: #fff;
  color: #000;
  border-color: #000;
}
body.high-contrast .ptt-card.is-red { color: #000; text-decoration: underline; }
body.high-contrast .ptt-cheer { background: #fff; color: #000; border: 3px solid #000; }
body.high-contrast .ptt-card.is-down,
body.high-contrast .ptt-memory-card,
body.high-contrast .ptt-xcell.is-black,
body.high-contrast .ptt-block-grid { background: #000; color: #fff; }
body.high-contrast .ptt-cell { background: #222; }
body.high-contrast .ptt-cell.is-bar,
body.high-contrast .ptt-cell.is-box,
body.high-contrast .ptt-cell.is-tee,
body.high-contrast .ptt-cell.is-ell,
body.high-contrast .ptt-cell.is-jay,
body.high-contrast .ptt-cell.is-ess,
body.high-contrast .ptt-cell.is-zee { background: #fff; }
body.high-contrast .ptt-sudo.is-given { background: #ddd; color: #000; }
body.high-contrast .ptt-sudo.is-wrong,
body.high-contrast .ptt-xcell input.is-wrong { background: #000; color: #fff; }
body.high-contrast .ptt-clue { color: #000; }
body.high-contrast .ptt-xcell.is-word { background: #ddd; }
body.high-contrast .ptt-xcell.is-focus { background: #fff; outline: 3px solid #000; outline-offset: -3px; }
body.high-contrast .ptt-clue.is-on { background: #000; color: #fff; }
body.high-contrast .ptt-current-clue { color: #000; }

.ptt-mini {
  white-space: normal;
  hyphens: none;
  word-break: normal;
  line-height: 1.2;
  max-width: 100%;
}
.ptt-action, .ptt-die, .ptt-crib-card, .ptt-score-row {
  background: #d9d9d9;
  color: #1a1a1a;
  border: 2px solid #2b2b2b;
  border-radius: 0.45rem;
  font: inherit;
  font-weight: 700;
}
.ptt-action {
  min-height: 48px;
  min-width: 48px;
  padding: 0.65rem 1rem;
  white-space: normal;
  hyphens: none;
  word-break: normal;
  line-height: 1.25;
  text-align: center;
  max-width: 100%;
}
.ptt-action.is-ready,
.ptt-crib-card.is-selected,
.ptt-die.is-held,
.ptt-search-cell.is-on,
.ptt-mini[aria-pressed="true"] {
  background: var(--accent, #C9A227);
  color: #2b2b2b;
}
.ptt-action:active, .ptt-die:active, .ptt-crib-card:active, .ptt-score-row:active, .ptt-search-cell:active {
  background: var(--accent, #C9A227);
  animation: ptt-press 0.35s ease;
}
@keyframes ptt-press {
  0% { transform: scale(1); }
  40% { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .ptt-action:active, .ptt-die:active, .ptt-crib-card:active, .ptt-score-row:active, .ptt-search-cell:active { animation: none; }
}
.ptt-hand, .ptt-series, .ptt-dice, .ptt-invite-row, .ptt-puzzle-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-width: 100%;
  align-items: center;
}
.ptt-crib-card {
  position: relative;
  width: 4.2rem;
  flex: 0 0 auto;
  max-width: 4.6rem;
  min-width: 3.6rem;
  min-height: 5.6rem;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.28rem 0.32rem;
  line-height: 1;
  background: linear-gradient(#fffefb, #f3efe6);
  border-radius: 0.45rem;
  box-shadow: 0 1px 0 #d9d0c0, 0 8px 12px rgba(0, 0, 0, 0.18);
}
.ptt-corner { display: flex; flex-direction: column; align-items: center; line-height: 0.9; }
.ptt-pip {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translate(-50%, -50%);
  font-size: 1.7rem;
  line-height: 1;
}
.ptt-crib-card.is-down {
  background:
    radial-gradient(circle at 30% 25%, #4e9a78, #1a4636 62%);
  color: transparent;
  box-shadow: inset 0 0 0 3px #e2c57a, 0 6px 10px rgba(0, 0, 0, 0.25);
}
.card-back {
  position: absolute;
  inset: 0.35rem;
  border: 2px solid rgba(226, 197, 122, 0.8);
  border-radius: 0.25rem;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 4px, rgba(255, 255, 255, 0.08) 4px, rgba(255, 255, 255, 0.08) 8px);
}
.ptt-crib-card.is-red { color: #9c2b2b; }
.ptt-crib-card.is-over { opacity: 0.45; filter: grayscale(0.35); }
.ptt-crib-card.is-selected { box-shadow: 0 0 0 3px #f0d78c, 0 10px 14px rgba(0, 0, 0, 0.2); }
.your-hand .ptt-crib-card:hover { transform: translateY(-0.35rem); }
.ptt-crib-card .ptt-rank { font-size: 1.15rem; }
.ptt-crib-card .ptt-suit { font-size: 0.95rem; }
.ptt-pegs { font-size: 1.35rem; font-weight: 700; margin: 0.35rem 0; }
.ptt-count { font-size: 1.5rem; font-weight: 700; margin: 0.35rem 0; }
.ptt-label { margin: 0.6rem 0 0.25rem; font-size: 1.05rem; }
.ptt-note { margin: 0.35rem 0; }
.ptt-parts p { margin: 0.15rem 0; }
.ptt-turn-banner {
  margin: 0.4rem 0 0.7rem;
  padding: 0.7rem 0.85rem;
  background: #f4e4b8;
  border: 3px solid #2b2b2b;
  border-radius: 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
}
.ptt-yahtzee-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.3rem 0 0.6rem;
}
.ptt-die.is-waiting { cursor: default; }
.ptt-scorecard.is-active { box-shadow: 0 0 0 3px #2E5E4E; }
.ptt-die {
  width: 4.4rem;
  height: 4.4rem;
  min-width: 48px;
  min-height: 48px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
}
.ptt-die-face { font-size: 1.8rem; line-height: 1; }
.ptt-die-held { font-size: 0.8rem; line-height: 1.1; }
.ptt-scorecard {
  max-width: 100%;
  margin: 0.6rem 0 1rem;
  padding: 0.65rem 0.7rem 0.75rem;
  background: #fffaf2;
  border: 3px solid #2b2b2b;
  border-radius: 0.6rem;
}
.ptt-scorecard > .ptt-label { margin-top: 0; }
.ptt-score-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0.75rem;
  align-items: start;
}
.ptt-score-section { min-width: 0; }
.ptt-score-section:last-child {
  border-left: 2px solid #2b2b2b;
  padding-left: 0.65rem;
}
.ptt-score-head {
  margin: 0 0 0.4rem;
  padding: 0.28rem 0.45rem;
  background: #2E5E4E;
  color: #fffaf2;
  border-radius: 0.3rem;
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.25;
}
.ptt-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  min-height: 48px;
  margin: 0 0 0.2rem;
  padding: 0.35rem 0.5rem;
  text-align: left;
  white-space: normal;
  word-break: normal;
  hyphens: none;
}
.ptt-score-row span:first-child { flex: 1 1 auto; min-width: 0; }
.ptt-score-row.is-filled { background: #fff; }
.ptt-score-row.is-sum {
  min-height: 2.5rem;
  background: transparent;
  border-color: transparent;
  border-bottom: 2px solid #2b2b2b;
  border-radius: 0;
  cursor: default;
}
.ptt-score-row.is-section-total { background: #f4efe4; }
.ptt-score-row.is-grand {
  min-height: 48px;
  background: #f4e4b8;
  border: 2px solid #2b2b2b;
  border-radius: 0.35rem;
  font-size: 1.05rem;
}
.ptt-search {
  --ptt-search-cell: 16px;
  display: grid;
  width: max-content;
  max-width: 100%;
  gap: 1px;
  margin: 0 auto 0.5rem;
}
.ptt-search-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--ptt-search-cell);
  height: var(--ptt-search-cell);
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #2b2b2b;
  background: #fff;
  color: #1a1a1a;
  font-family: inherit;
  font-weight: 700;
  font-size: calc(var(--ptt-search-cell) * 0.58);
  line-height: 1;
}
.ptt-search-cell.is-found { background: #e4d48a; }
.ptt-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 100%;
}
.ptt-words li {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border: 2px solid #2b2b2b;
  border-radius: 0.4rem;
  background: #fff;
  white-space: nowrap;
}
.ptt-words li.is-found { background: #e4d48a; text-decoration: line-through; }
.ptt-photo, .ptt-spot-card { position: relative; width: min(100%, 36rem); max-width: 100%; }
.ptt-photo svg, .ptt-spot-card svg { width: 100%; height: auto; display: block; }
.ptt-spot-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
  max-width: 100%;
}
.ptt-toast {
  margin: 0.4rem 0 0.8rem;
  padding: 0.75rem 1rem;
  max-width: 100%;
  background: #2E5E4E;
  color: #fffaf2;
  border: 3px solid #1a1a1a;
  border-radius: 0.5rem;
  font-weight: 700;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.ptt-invite-slot, .ptt-invites { margin: 0.5rem 0 0.75rem; max-width: 100%; }
.ptt-invite-name {
  flex: 1 1 8rem;
  min-width: 0;
  margin: 0;
  overflow-wrap: break-word;
  word-break: normal;
}
.ptt-member-list {
  max-width: 100%;
  overflow-x: hidden;
}
@media (min-width: 800px) {
  .ptt-spot-pair { grid-template-columns: 1fr 1fr; }
}
body.high-contrast .ptt-action,
body.high-contrast .ptt-die,
body.high-contrast .ptt-crib-card,
body.high-contrast .ptt-score-row,
body.high-contrast .ptt-search-cell,
body.high-contrast .ptt-words li {
  background: #fff;
  color: #000;
  border-color: #000;
}
body.high-contrast .ptt-action.is-ready,
body.high-contrast .ptt-crib-card.is-selected,
body.high-contrast .ptt-die.is-held,
body.high-contrast .ptt-search-cell.is-on,
body.high-contrast .ptt-search-cell.is-found,
body.high-contrast .ptt-words li.is-found,
body.high-contrast .ptt-mini[aria-pressed="true"] {
  background: #000;
  color: #fff;
}
body.high-contrast .ptt-crib-card.is-down { background: #000; }
body.high-contrast .ptt-crib-card.is-red { color: #000; text-decoration: underline; }
body.high-contrast .ptt-toast { background: #000; color: #fff; border-color: #fff; }
body.high-contrast .ptt-turn-banner,
body.high-contrast .ptt-scorecard.is-active { background: #fff; color: #000; border-color: #000; box-shadow: none; }
body.high-contrast .ptt-scorecard { background: #fff; border-color: #000; }
body.high-contrast .ptt-score-head { background: #000; color: #fff; }
body.high-contrast .ptt-score-section:last-child { border-left-color: #000; }
body.high-contrast .ptt-score-row.is-sum { color: #000; border-bottom-color: #000; background: #fff; }
body.high-contrast .ptt-score-row.is-section-total { background: #fff; }
body.high-contrast .ptt-score-row.is-grand { background: #000; color: #fff; }
body.high-contrast .crib-board {
  background: #fff;
  background-image: none;
  border-color: #000;
  box-shadow: none;
}
body.high-contrast .felt-table {
  background: #fff;
  color: #000;
  box-shadow: inset 0 0 0 4px #000;
}
body.high-contrast .felt-table .ptt-label,
body.high-contrast .felt-table .ptt-note,
body.high-contrast .seat-plaque,
body.high-contrast .crib-who,
body.high-contrast .seat-score { color: #000; }
body.high-contrast .seat-plaque,
body.high-contrast .count-dial,
body.high-contrast .score-pill { background: #fff; color: #000; border-color: #000; }
body.high-contrast .seat-plaque.is-turn { box-shadow: 0 0 0 3px #000; }
body.high-contrast .crib-board-photo { filter: none; }
body.high-contrast .peg-head { outline: 2px solid #000; }
body.high-contrast .crib-track-name { background: #fff; color: #000; border-color: #000; }
body.high-contrast .crib-track.is-turn .crib-track-name,
body.high-contrast .crib-name-row .crib-track-name.is-turn { background: #000; color: #fff; }
body.high-contrast .crib-group { background: transparent; box-shadow: inset 0 0 0 1px #000; }
body.high-contrast .spot-mark.is-found { border-color: #000; }
body.high-contrast .spot-miss { border-color: #000; }

.crib-board, .crib-table-row, .spot-play, .spot-pair, .ptt-search {
  max-width: 100%;
  min-width: 0;
}
.crib-board {
  width: 100%;
  max-width: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
.crib-photo-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
}
.crib-board-photo {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.crib-peg {
  position: absolute;
  width: max(13px, 2.7%);
  height: max(30px, 6.8%);
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -78%);
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.45));
}
.peg-stem {
  position: absolute;
  left: 36%;
  right: 36%;
  bottom: 0;
  height: 58%;
  border-radius: 1px 1px 0 0;
  background: linear-gradient(90deg, #6f675c, #f7f3ea 46%, #4e4942);
}
.peg-head {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 50%;
  border-radius: 46% 46% 40% 40%;
  background:
    radial-gradient(circle at 32% 26%, #fff 0 10%, transparent 12%),
    radial-gradient(circle at 42% 38%, rgba(255, 255, 255, 0.55), var(--peg, #9c2b2b) 46%, #140c0c 100%);
  box-shadow: inset 0 -3px 4px rgba(0, 0, 0, 0.35);
}
.crib-peg.is-glow .peg-head {
  box-shadow: 0 0 8px 3px #f0d78c, inset 0 -3px 4px rgba(0, 0, 0, 0.35);
}
.crib-peg.is-hop { animation: peg-hop 0.56s ease; }
@keyframes peg-hop {
  0% { transform: translate(-50%, -78%); }
  42% { transform: translate(-50%, -118%); }
  100% { transform: translate(-50%, -78%); }
}
.peg-call {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  padding: 0.05rem 0.4rem;
  background: #f0d78c;
  color: #3a2a08;
  font-weight: 800;
  font-size: 0.85rem;
  border-radius: 999px;
  pointer-events: none;
  animation: peg-float 3.4s ease forwards;
}
@keyframes peg-float {
  0% { opacity: 0; }
  8% { opacity: 1; }
  72% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .crib-peg.is-hop, .peg-call { animation: none; }
}
.crib-legend {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  line-height: 1.35;
}
.crib-29-key {
  display: inline-block;
  font-weight: 800;
  color: #6e2b16;
  background: #f6e6c4;
  border: 2px solid #6e2b16;
  border-radius: 0.25rem;
  padding: 0 0.28rem;
  line-height: 1.3;
}
.crib-track { margin: 0 0 0.55rem; max-width: 100%; }
.crib-track:last-child { margin-bottom: 0; }
.crib-track.is-turn .crib-track-name { background: #2E5E4E; color: #fffaf2; }
.crib-track-name, .crib-scoreflash, .crib-end, .spot-count, .spot-day {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.crib-track-name {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.2rem;
  padding: 0.35rem 0.55rem;
  font-weight: 700;
  background: #efe8dc;
  border: 2px solid #2b2b2b;
  border-left: 8px solid var(--peg, #9c2b2b);
  border-radius: 0.4rem;
}
.crib-swatch {
  width: 0.95rem;
  height: 0.95rem;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid #2b2b2b;
}
.crib-who { min-width: 0; }
.crib-turn { font-weight: 700; }
.crib-score {
  margin-left: auto;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.crib-name-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.35rem;
}
.crib-name-row .crib-track-name {
  margin: 0;
  overflow-wrap: normal;
  word-break: normal;
}
.crib-name-row .crib-who { white-space: nowrap; }
.crib-name-row .crib-track-name.is-turn { background: #2E5E4E; color: #fffaf2; }
.crib-lane {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: transparent;
  overflow: hidden;
}
.crib-end {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #2b2b2b;
  line-height: 1;
}
.crib-scoreflash {
  margin: 0.4rem 0;
  padding: 0.45rem 0.7rem;
  background: #fffaf2;
  border: 2px solid #2E5E4E;
  border-radius: 0.4rem;
  font-weight: 700;
}
.crib-table-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
}
.crib-pile { flex: 0 0 auto; min-width: 4.8rem; max-width: 100%; }
.crib-pile .ptt-crib-card { width: 4.2rem; min-width: 4.2rem; max-width: 4.2rem; flex-shrink: 0; }
.spot-hud, .spot-pair { max-width: 100%; }
.spot-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0 0.6rem;
}
.spot-count { margin: 0; font-weight: 700; font-size: 1.15rem; }
.spot-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
.spot-card, .spot-frame { max-width: 100%; min-width: 0; }
.spot-frame { position: relative; width: 100%; cursor: pointer; touch-action: manipulation; }
.spot-frame:focus { outline: none; }
.spot-frame:focus-visible {
  outline: 3px solid #2E5E4E;
  outline-offset: 4px;
}
.spot-svg svg { width: 100%; height: auto; display: block; }
.spot-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.spot-mark, .spot-miss {
  position: absolute;
  box-sizing: border-box;
  border-radius: 50%;
}
.spot-mark.is-found {
  border: 4px solid #e6b445;
  box-shadow: 0 0 0 3px #fffaf2, 0 0 18px 6px rgba(230, 180, 69, 0.95);
  background: rgba(246, 217, 138, 0.34);
  animation: spot-glow 1.3s ease-in-out infinite;
}
.spot-mark.is-hint {
  border: 3px dashed #1d4e89;
  background: rgba(29, 78, 137, 0.16);
}
.spot-miss {
  width: 2.4rem;
  height: 2.4rem;
  margin-left: -1.2rem;
  margin-top: -1.2rem;
  border: 3px solid #9c2b2b;
  background: transparent;
}
.spot-frame.is-shake { animation: spot-shake 0.42s ease; }
.spot-celebrate { animation: spot-cheer 0.7s ease; }
.ptt-mini.is-today { box-shadow: inset 0 -4px 0 #2E5E4E; }
.spot-time { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
@keyframes spot-glow {
  0%, 100% { box-shadow: 0 0 0 3px #fffaf2, 0 0 10px 2px rgba(230, 180, 69, 0.75); }
  50% { box-shadow: 0 0 0 4px #fffaf2, 0 0 22px 8px rgba(230, 180, 69, 1); }
}
@keyframes spot-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  45% { transform: translateX(6px); }
  70% { transform: translateX(-3px); }
}
@keyframes spot-cheer {
  0% { transform: scale(0.98); }
  45% { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@media (max-width: 420px) {
  main.ptt-page:has(.spot-pair) {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}
.ptt-stage:has(.spot-pair),
#ptt-board:has(.spot-pair) { overflow-x: hidden; }
body.simple-mode .spot-count,
body.simple-mode .spot-time,
body.simple-mode .spot-card .ptt-label,
body.simple-mode .ptt-note { color: #000; }
body.simple-mode .spot-mark.is-found {
  border-color: #000;
  box-shadow: 0 0 0 4px #000, 0 0 0 8px #ffd000;
}
body.high-contrast .spot-mark.is-found {
  border-color: #000;
  background: transparent;
  box-shadow: 0 0 0 3px #000;
  animation: none;
}
body.high-contrast .spot-frame:focus-visible { outline-color: #000; }
@media (prefers-reduced-motion: reduce) {
  .spot-mark.is-found,
  .spot-frame.is-shake,
  .spot-celebrate { animation: none; }
  .crib-peg.is-moving { transition: none; }
}
@media (min-width: 800px) {
  .spot-pair { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .crib-board {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .ptt-score-split { column-gap: 0.4rem; }
  .ptt-score-section:last-child { padding-left: 0.4rem; }
  .ptt-score-row { padding: 0.3rem 0.35rem; }
}
@media (max-width: 360px) {
  .ptt-search {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }
  .crib-lane, .spot-frame, .spot-pair { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .crib-board-photo,
  .crib-peg { transition: none; animation: none; }
}

/* Last Card. Original suits: wheat, teal, plum, spruce. Shapes carry the suit. */
.ptt-pick-name { display: block; }
.ptt-pick-note {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}
#ptt-title .ptt-title-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  max-width: 22rem;
}
.last-play, .last-rules, .last-others, .last-pile, .last-hand, .last-actions, .last-colours, .last-seats {
  max-width: 100%;
  min-width: 0;
}
.last-rules {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem 0.9rem 1.15rem;
  border: 3px solid var(--primary, #2E5E4E);
  border-radius: 0.5rem;
  background: #fff;
}
.last-rules-title { margin: 0 0 0.35rem; font-size: 1.15rem; }
.last-rules-list { margin: 0; padding-left: 1.2rem; }
.last-rules-list li { margin: 0.15rem 0; }
.last-ask, .last-caption, .last-called, .last-hand-title {
  margin: 0.35rem 0;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.last-others, .last-pile, .last-actions, .last-colours, .last-seats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.last-others, .last-pile { margin-bottom: 0.75rem; }
.last-who {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  align-items: center;
  margin: 0;
  min-height: 48px;
  padding: 0.4rem 0.75rem;
  border: 2px solid #2b2b2b;
  border-radius: 0.45rem;
  background: #fff;
  font-weight: 700;
}
.last-who.is-turn { background: #2E5E4E; color: #fffaf2; }
.last-who-call {
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  background: var(--accent, #C9A227);
  color: #2b2b2b;
}
.last-stock-count { margin: 0; font-weight: 700; }
.last-banner {
  margin: 0.4rem 0 0.7rem;
  padding: 0.75rem 1rem;
  border: 3px solid var(--accent, #C9A227);
  border-radius: 0.5rem;
  background: #fff8e4;
  font-weight: 700;
}
.last-seats .ptt-action, .last-actions .ptt-action, .last-colour {
  min-height: 48px;
}
.last-call { font-size: 1.25rem; min-height: 56px; flex: 1 1 12rem; }
.last-seats .ptt-action { flex: 1 1 14rem; }
.last-colour {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-width: 7rem;
}
.last-mini { display: inline-flex; width: 1.35rem; height: 1.35rem; }
.last-mini svg { width: 100%; height: 100%; display: block; }
.last-hand {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.last-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 7.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.4rem 0.3rem;
  border: 3px solid #1a1a1a;
  border-radius: 0.55rem;
  background: #fff;
  color: #1a1a1a;
  font: inherit;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  cursor: pointer;
}
div.last-card { cursor: default; }
.last-pile .last-card { width: 7.4rem; max-width: 46%; flex: 0 0 auto; }
.last-mark { display: block; width: 1.7rem; height: 1.7rem; }
.last-mark svg { width: 100%; height: 100%; display: block; }
.last-rank, .last-name {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}
.last-rank { font-size: 2rem; }
.last-card.is-word .last-rank { font-size: 1.15rem; line-height: 1.15; }
.last-name { font-size: 0.95rem; }
.last-card.is-live { box-shadow: inset 0 0 0 3px #1a1a1a; }
.last-card.is-selected { outline: 4px solid var(--accent, #C9A227); outline-offset: 2px; }
.last-card:focus-visible, .last-colour:focus-visible, .last-call:focus-visible {
  outline: 3px solid var(--accent, #C9A227);
  outline-offset: 2px;
}
.last-card.last-wheat { background: #F6E4B4; border-color: #6B3E00; }
.last-card.last-wheat .last-mark { color: #6B3E00; }
.last-card.last-teal { background: #C9E7EA; border-color: #042E36; }
.last-card.last-teal .last-mark { color: #042E36; }
.last-card.last-plum { background: #F8D0E6; border-color: #8E2F6E; }
.last-card.last-plum .last-mark { color: #8E2F6E; }
.last-card.last-spruce { background: #E3EBE6; border-color: #3E4E46; }
.last-card.last-spruce .last-mark { color: #3E4E46; }
.last-card.last-wild { background: #F3E6C8; border-color: #5C4A32; }
.last-card.last-wild .last-mark { color: #2B2416; }
.last-colour.last-wheat { background: #F6E4B4; border-color: #6B3E00; color: #1a1a1a; }
.last-colour.last-wheat .last-mini { color: #6B3E00; }
.last-colour.last-teal { background: #C9E7EA; border-color: #042E36; color: #1a1a1a; }
.last-colour.last-teal .last-mini { color: #042E36; }
.last-colour.last-plum { background: #F8D0E6; border-color: #8E2F6E; color: #1a1a1a; }
.last-colour.last-plum .last-mini { color: #8E2F6E; }
.last-colour.last-spruce { background: #E3EBE6; border-color: #3E4E46; color: #1a1a1a; }
.last-colour.last-spruce .last-mini { color: #3E4E46; }
body.high-contrast .last-card,
body.high-contrast .last-colour,
body.high-contrast .last-who,
body.high-contrast .last-rules,
body.high-contrast .last-banner,
body.high-contrast .ptt-pick-note,
body.high-contrast .ptt-title-note {
  background: #fff;
  color: #000;
  border-color: #000;
}
body.high-contrast .last-mark,
body.high-contrast .last-mini { color: #000; }
body.high-contrast .last-who.is-turn,
body.high-contrast .last-card.is-live,
body.high-contrast .last-call.is-ready {
  background: #000;
  color: #fff;
}
body.high-contrast .last-who.is-turn .last-who-call { background: #fff; color: #000; }

.felt-table {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin: 0.4rem 0 0.6rem;
  padding: 0.75rem 0.7rem 0.9rem;
  border-radius: 1.35rem;
  color: #f7f3ea;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(255, 255, 255, 0.16), transparent 46%),
    radial-gradient(ellipse at 50% 48%, #218a52 0%, #0d5c36 55%, #073d24 100%);
  box-shadow:
    inset 0 0 0 8px #6a3818,
    inset 0 0 0 12px #c4894a,
    inset 0 0 0 16px #3d2010,
    0 14px 28px rgba(0, 0, 0, 0.28);
}
.felt-table .ptt-label,
.felt-table .ptt-note,
.felt-table .crib-who,
.felt-table .seat-score { color: #f7f3ea; }
.felt-seats, .felt-actions, .felt-piles, .score-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  max-width: 100%;
}
.felt-center { max-width: 100%; min-width: 0; }
.crib-photo-wrap { width: min(100%, 34rem); margin: 0.2rem auto 0.35rem; }
.crib-board-photo { filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.38)); }
.felt-seat, .felt-you, .felt-show, .felt-zone { min-width: 0; max-width: 100%; }
.seat-plaque {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  margin: 0;
  padding: 0.25rem 0.75rem;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}
.seat-plaque.is-turn { box-shadow: 0 0 0 3px #f0d78c; }
.seat-plaque.is-you { border-color: #f0d78c; }
.seat-peg {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 2px solid #f7f3ea;
  flex: 0 0 auto;
}
.dealer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  background: #f4f4f4;
  color: #1c1c1c;
  font-weight: 800;
}
.seat-score { margin-left: auto; font-weight: 800; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.seat-call, .score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: #f0d78c;
  color: #2b2108;
  font-weight: 800;
}
.seat-fan { display: flex; justify-content: center; align-items: flex-end; min-height: 3.6rem; padding-top: 0.35rem; }
.seat-fan .ptt-crib-card {
  width: 2.45rem;
  min-width: 2.2rem;
  max-width: 2.6rem;
  min-height: 3.4rem;
  margin-left: -0.8rem;
  transform: rotate(calc((var(--i, 0) - (var(--n, 1) - 1) / 2) * 8deg));
}
.seat-fan .ptt-crib-card:first-child { margin-left: 0; }
.count-dial {
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-width: 8.5rem;
  min-height: 48px;
  margin: 0;
  padding: 0.2rem 0.8rem;
  border-radius: 999px;
  border: 3px dashed #6b4218;
  background: radial-gradient(circle at 38% 32%, #fff, #d5dbe6 42%, #8b95a4);
  color: #1a1a1a;
  font-weight: 800;
}
.felt-you { margin-top: 0.45rem; }
.felt-choose-note {
  width: 100%;
  margin: 0.35rem 0 0.15rem;
  text-align: center;
  font-weight: 700;
}
.ptt-board > .ptt-invite-slot {
  margin: 0.75rem 0 0;
  max-width: 100%;
}
.ptt-board > .ptt-invite-slot .ptt-note { color: inherit; }
.your-hand { justify-content: center; }
.felt-table .ptt-cheer {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0.45rem 0;
  color: #3a2a08;
  background: #f0d78c;
  text-align: center;
}
@media (max-width: 420px) {
  .crib-photo-wrap { width: 100%; }
  .felt-table { padding: 0.55rem 0.4rem 0.7rem; border-radius: 1rem; }
  .your-hand .ptt-crib-card { min-width: 3.2rem; width: 3.4rem; min-height: 4.6rem; }
}
