/* ============================================================
   Sequence — game-specific styles, layered over tabletop.css.
   The board is one world object (a CSS grid of 100 inert cells);
   chips are divs inside cells, so they never need coordinate math.
   ============================================================ */

:root {
  --seq-card-face: #f6f1e7;
  --seq-card-ink: #1c1c1e;
  --seq-card-red: #c0392b;
  --seq-cell-w: 70px;
  --seq-cell-h: 96px;
  --seq-gold: #f5c542;
}

/* ---------- Board ---------- */

.seq-board {
  position: relative; /* the celebration fx layer anchors to it */
  display: grid;
  grid-template-columns: repeat(10, var(--seq-cell-w));
  grid-template-rows: repeat(10, var(--seq-cell-h));
  gap: 6px;
  padding: 18px;
  background: #14281d;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: var(--tt-shadow);
}

.seq-cell {
  position: relative;
  background: var(--seq-card-face);
  color: var(--seq-card-ink);
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  user-select: none;
}
.seq-cell.seq-red { color: var(--seq-card-red); }

.seq-rank {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  white-space: pre-line;
}
.seq-rank-br {
  top: auto;
  left: auto;
  bottom: 4px;
  right: 6px;
  transform: rotate(180deg);
}
.seq-pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  opacity: 0.92;
}
.seq-pip-num { display: none; }

/* ---------- Large print cards (Settings toggle) ----------
   The suit fills the card with the rank knocked out in white on top of
   it (corners keep the normal small indices for card-players' eyes). */
body.seq-bigcards .seq-cell .seq-pip { font-size: 66px; opacity: 1; }
body.seq-bigcards .seq-hcard .seq-pip { font-size: 56px; opacity: 1; }
body.seq-bigcards .seq-pip-num {
  display: block;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  color: #fff;
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
body.seq-bigcards .seq-hcard .seq-pip-num { font-size: 22px; }
/* the big glyph must not fight the chip: fade the pip under a chip */
body.seq-bigcards .seq-cell.seq-has-chip .seq-pip { opacity: 0.35; }

.seq-cell.seq-corner {
  background:
    radial-gradient(circle at 50% 42%, rgba(245, 197, 66, 0.28), transparent 62%),
    repeating-linear-gradient(45deg, #2b4d8f 0 7px, #24406f 7px 14px);
  color: #f2e9d4;
  border: 3px solid var(--seq-card-face);
  box-sizing: border-box;
}
.seq-corner-star {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 34px;
  color: var(--seq-gold);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.seq-corner-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 7px;
  text-align: center;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

/* ---------- Chips ---------- */

.seq-chip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.55), transparent 42%),
    var(--chip, #888);
  border: 3px solid rgba(0, 0, 0, 0.38);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), inset 0 0 0 5px rgba(255, 255, 255, 0.22);
  transform: scale(0);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
  z-index: 2;
}
.seq-cell.seq-has-chip .seq-chip { transform: scale(1); }

/* chip (or corner) locked into a completed sequence */
.seq-cell.seq-locked .seq-chip {
  border-color: var(--seq-gold);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.45), 0 0 12px 2px rgba(245, 197, 66, 0.65),
    inset 0 0 0 5px rgba(255, 255, 255, 0.22);
}
.seq-cell.seq-corner.seq-locked { border-color: var(--seq-gold); }

/* ---------- Targeting ---------- */

/* Passive reach: cells any non-jack card in your hand could claim right
   now — an unmistakable but calm glow, no dimming, slow pulse. Replaced by
   the intense targeting mode below the moment a card is selected. */
.seq-cell.seq-playable {
  background: #e4f1ff;
  outline: 3px solid rgba(77, 163, 255, 0.85);
  outline-offset: -1px;
  animation: seq-reach 2.2s ease-in-out infinite;
  cursor: pointer;
}
.seq-cell.seq-playable:hover {
  outline-width: 4px;
  filter: brightness(1.06);
}
@keyframes seq-reach {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(77, 163, 255, 0.45); }
  50% { box-shadow: 0 0 20px 7px rgba(77, 163, 255, 0.75); }
}

/* Dead-card spaces: the whole card face goes GREY with a pulsing grey
   halo — "your card maps here, but it's occupied". The chip keeps its
   color: an enemy chip here is your one-eyed-jack combo target. */
.seq-cell.seq-deadspot {
  background: #d9dde3;
  outline: 4px dashed rgba(150, 160, 175, 0.95);
  outline-offset: -1px;
  animation: seq-deadreach 2.2s ease-in-out infinite;
}
.seq-cell.seq-deadspot .seq-rank,
.seq-cell.seq-deadspot .seq-pip {
  filter: grayscale(1) opacity(0.55);
}
@keyframes seq-deadreach {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(160, 170, 185, 0.55); }
  50% { box-shadow: 0 0 22px 8px rgba(175, 185, 200, 0.9); }
}

/* While a card is selected, everything that is NOT a target fades back so
   the playable spaces are unmissable. */
.seq-board.seq-targeting .seq-cell:not(.seq-legal):not(.seq-removable) {
  filter: brightness(0.5) saturate(0.6);
}

.seq-cell.seq-legal {
  cursor: pointer;
  background: #cfe6ff;
  outline: 4px solid var(--tt-accent);
  outline-offset: -1px;
  z-index: 1;
  transform: scale(1.06);
  animation: seq-breathe-blue 0.9s ease-in-out infinite;
}
.seq-cell.seq-legal:hover {
  transform: scale(1.12);
  background: #e2f0ff;
  animation: none;
  box-shadow: 0 0 26px 9px rgba(77, 163, 255, 0.95);
}

.seq-cell.seq-removable {
  cursor: pointer;
  background: #ffd9d9;
  outline: 4px solid var(--tt-danger);
  outline-offset: -1px;
  z-index: 1;
  transform: scale(1.06);
  animation: seq-breathe-red 0.9s ease-in-out infinite;
}
.seq-cell.seq-removable:hover {
  transform: scale(1.12);
  background: #ffe7e7;
  animation: none;
  box-shadow: 0 0 26px 9px rgba(255, 107, 107, 0.95);
}

@keyframes seq-breathe-blue {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(77, 163, 255, 0.55); }
  50% { box-shadow: 0 0 26px 9px rgba(77, 163, 255, 0.95); }
}
@keyframes seq-breathe-red {
  0%, 100% { box-shadow: 0 0 10px 3px rgba(255, 107, 107, 0.55); }
  50% { box-shadow: 0 0 26px 9px rgba(255, 107, 107, 0.95); }
}

.seq-cell.seq-flash { animation: seq-flash 1.4s ease-out; }
@keyframes seq-flash {
  0%, 20%, 40% { filter: brightness(1.9) saturate(1.4); }
  10%, 30%, 100% { filter: none; }
}

/* ---------- Threat radar (guides) ---------- */

.seq-cell.seq-threat {
  outline: 3px solid #ff9838;
  outline-offset: -1px;
  animation: seq-threat 0.8s ease-in-out infinite;
}
/* a threat cell you can also play = the block is in your hand: flash the
   two identities alternately — clearly blue, then clearly orange */
.seq-cell.seq-playable.seq-threat {
  animation: seq-block-flash 1.3s ease-in-out infinite;
}
@keyframes seq-block-flash {
  0%, 38% {
    outline-color: var(--tt-accent);
    background: #cfe6ff;
    box-shadow: 0 0 18px 6px rgba(77, 163, 255, 0.85);
  }
  50%, 88% {
    outline-color: #ff9838;
    background: #ffe3c4;
    box-shadow: 0 0 18px 6px rgba(255, 120, 40, 0.85);
  }
  100% {
    outline-color: var(--tt-accent);
    background: #cfe6ff;
    box-shadow: 0 0 18px 6px rgba(77, 163, 255, 0.85);
  }
}
@keyframes seq-threat {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(255, 152, 56, 0.45); }
  50% { box-shadow: 0 0 18px 6px rgba(255, 120, 40, 0.8); }
}

/* ---------- Last-move trail ---------- */

.seq-mark {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--mark, #fff);
  border: 2px solid #0d1620;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
  display: none;
  z-index: 4;
  pointer-events: none;
  text-shadow: 0 0 2px #000;
}
.seq-cell.seq-marked .seq-mark { display: block; }
.seq-cell.seq-mark-latest .seq-mark {
  animation: seq-mark-pulse 1s ease-in-out infinite;
}
@keyframes seq-mark-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 4px 1px rgba(255, 255, 255, 0.5); }
  50% { transform: scale(1.25); box-shadow: 0 0 10px 3px rgba(255, 255, 255, 0.8); }
}
/* ghost ring where a chip was just removed */
.seq-cell.seq-ghost::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 3px dashed var(--ghost, #999);
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- Sequence celebration ---------- */

.seq-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
  overflow: visible;
}
.seq-fx-line {
  stroke: var(--seq-gold);
  stroke-width: 7;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(245, 197, 66, 0.9));
  transition: stroke-dashoffset 0.9s ease-out, opacity 0.6s;
  opacity: 0.95;
}
.seq-cell.seq-ignite { animation: seq-ignite 0.55s ease; }
@keyframes seq-ignite {
  0% { filter: none; }
  40% { filter: brightness(1.8) saturate(1.5); transform: scale(1.12); }
  100% { filter: none; transform: none; }
}

.seq-confetti-wrap {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  overflow: hidden;
}
.seq-confetti {
  position: absolute;
  top: -22px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: seq-fall linear forwards;
}
@keyframes seq-fall {
  to { transform: translateY(108vh) rotate(560deg); }
}

/* ---------- Roster & stats ---------- */

.seq-roster {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid var(--tt-panel-border);
  padding-top: 7px;
}
.seq-roster-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 2px 5px;
  border-radius: 6px;
  font-size: 12px;
  color: var(--tt-text-dim);
}
.seq-roster-row.seq-roster-active {
  background: rgba(77, 163, 255, 0.14);
  color: var(--tt-text);
  outline: 1px solid rgba(77, 163, 255, 0.4);
}
.seq-dot-sm { width: 11px; height: 11px; flex: none; display: inline-block; }
.seq-roster-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.seq-roster-cards {
  flex: none;
  min-width: 14px;
  padding: 0 4px;
  border: 1px solid var(--tt-panel-border);
  border-radius: 3px;
  background: rgba(246, 241, 231, 0.12);
  font-size: 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.seq-roster-last { flex: none; min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }
.seq-roster-thinking .seq-roster-last { animation: seq-think 1s ease-in-out infinite; }
@keyframes seq-think {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.seq-stats-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}
.seq-stats-table th,
.seq-stats-table td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--tt-panel-border);
  text-align: center;
  white-space: nowrap;
}
.seq-stats-table td:first-child { text-align: left; color: var(--tt-text-dim); }
.seq-stats-table th { color: var(--tt-text); font-size: 12px; }
.seq-stats-table th .seq-dot-sm { vertical-align: -1px; margin-right: 3px; }
.seq-stats-modal .tt-modal {
  max-width: min(720px, 94vw);
  max-height: 92vh;
  overflow-y: auto;
  box-sizing: border-box;
}
/* six-team tables get wide: scroll the table inside the modal instead of
   letting it push the dialog off screen */
.seq-stats-modal .seq-stats-table {
  display: block;
  overflow-x: auto;
  max-width: 100%;
}

/* ---------- Hand tray ---------- */

.seq-hand {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 14px 22px 12px;
  background: rgba(20, 24, 30, 0.78);
  border: 1px solid var(--tt-panel-border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.seq-hand[hidden] { display: none; }

.seq-hcard {
  position: relative;
  touch-action: pan-x; /* quick swipes scroll the tray; hold-to-lift reorders */
  width: 62px;
  height: 88px;
  background: var(--seq-card-face);
  color: var(--seq-card-ink);
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition: transform 0.13s, outline-color 0.13s;
  outline: 2px solid transparent;
  user-select: none;
}
.seq-hcard.seq-red { color: var(--seq-card-red); }
.seq-hcard:hover { transform: translateY(-10px); }
.seq-hcard.seq-sel {
  transform: translateY(-16px);
  outline-color: var(--tt-accent);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5), 0 0 12px rgba(77, 163, 255, 0.45);
}

.seq-jack-tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  text-align: center;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.8px;
  opacity: 0.75;
}

.seq-hand-tools {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-right: 6px;
}
.seq-sort-btn {
  padding: 6px 9px;
  font-size: 12px;
  white-space: nowrap;
}

.seq-hcard.seq-reordering {
  opacity: 0.85;
  transform: translateY(-8px) scale(1.06);
  transition: none;
  cursor: grabbing;
  z-index: 30;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.55);
}

.seq-dead-ribbon {
  position: absolute;
  left: -4px;
  top: 10px;
  padding: 1px 6px;
  background: var(--tt-danger);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 1px;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transform: rotate(-12deg);
}

/* ---------- Action bar (contextual: exchange / pass) ---------- */

.seq-actionbar {
  position: fixed;
  left: 50%;
  bottom: 128px;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  background: rgba(20, 24, 30, 0.9);
  border: 1px solid var(--tt-panel-border);
  border-radius: 12px;
  font-size: 13px;
  color: var(--tt-text-dim);
  box-shadow: var(--tt-shadow);
}
.seq-actionbar[hidden] { display: none; }

/* ---------- HUD ---------- */

.seq-hud {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 210px;
  padding: 12px 14px;
  background: rgba(20, 24, 30, 0.8);
  border: 1px solid var(--tt-panel-border);
  border-radius: 12px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
}

.seq-turn {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}
.seq-hud-toggle {
  margin-left: auto;
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--tt-text-dim);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.seq-hud-toggle:hover { background: rgba(255, 255, 255, 0.14); color: var(--tt-text); }
/* collapsed: just the turn line + buttons; scores/roster/piles hide */
.seq-hud.seq-hud-collapsed .seq-scores,
.seq-hud.seq-hud-collapsed .seq-roster,
.seq-hud.seq-hud-collapsed .seq-piles { display: none; }
.seq-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.4);
  background: var(--chip, #888);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
  flex: none;
}

.seq-scores { display: flex; flex-direction: column; gap: 4px; }
.seq-score-row { display: flex; align-items: center; gap: 7px; color: var(--tt-text); }
.seq-score-row .seq-count { margin-left: auto; color: var(--tt-text-dim); font-variant-numeric: tabular-nums; }
.seq-place {
  min-width: 15px;
  text-align: right;
  font-size: 11px;
  color: var(--tt-text-dim);
  font-variant-numeric: tabular-nums;
}
.seq-score-row.seq-score-lead { color: var(--seq-gold); }
.seq-score-row.seq-score-lead .seq-count { color: var(--seq-gold); }

.seq-piles {
  display: flex;
  gap: 12px;
  color: var(--tt-text-dim);
  font-size: 12px;
  border-top: 1px solid var(--tt-panel-border);
  padding-top: 8px;
}
.seq-piles b { color: var(--tt-text); font-variant-numeric: tabular-nums; }
.seq-piles.seq-jacks { border-top: none; padding-top: 0; cursor: help; }

.seq-hud-buttons { display: flex; gap: 6px; }
.seq-hud-buttons .tt-modal-btn { padding: 5px 10px; font-size: 12px; }

/* ---------- Pass-the-device cover (hot-seat privacy) ---------- */

.seq-passcover {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  cursor: pointer;
}
.seq-passcover[hidden] { display: none; }
.seq-passcover-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 30px 44px;
  background: var(--tt-panel);
  border: 1px solid var(--tt-panel-border);
  border-radius: 16px;
  box-shadow: var(--tt-shadow);
  font-size: 15px;
  text-align: center;
}
.seq-passcover-card .seq-dot { width: 26px; height: 26px; }
.seq-passcover-card small { color: var(--tt-text-dim); }

/* ---------- Main menu ---------- */

.seq-mainmenu {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  background: rgba(8, 10, 14, 0.68);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.seq-mainmenu[hidden] { display: none; }

.seq-mainmenu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 46px 70px 40px;
  background: var(--tt-panel);
  border: 1px solid var(--tt-panel-border);
  border-radius: 20px;
  box-shadow: var(--tt-shadow);
}

.seq-title {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 10px;
  margin-right: -10px; /* visually re-center the letter-spaced text */
  color: var(--tt-text);
}
.seq-title-suits {
  display: flex;
  gap: 14px;
  font-size: 20px;
  margin-bottom: 22px;
  color: var(--tt-text);
}
.seq-title-suits .seq-red-suit { color: #ff6b6b; }

.seq-menu-btn {
  width: 250px;
  padding: 13px 0;
  border: 1px solid var(--tt-panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tt-text);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.seq-menu-btn:hover { background: rgba(255, 255, 255, 0.12); }
.seq-menu-btn.seq-menu-primary {
  background: var(--tt-accent);
  border-color: var(--tt-accent);
  color: #0d1620;
}
.seq-menu-btn.seq-menu-primary:hover { filter: brightness(1.1); }
.seq-menu-btn[hidden] { display: none; }

.seq-menu-btn span { display: block; }
.seq-menu-btn small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.72;
}

/* setup screens share the menu card; smaller wordmark-style headings */
.seq-panel-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 6px;
  margin-right: -6px;
  color: var(--tt-text);
}
.seq-panel-sub {
  max-width: 300px;
  margin: -2px 0 16px;
  font-size: 13px;
  color: var(--tt-text-dim);
  text-align: center;
}

.seq-menu-back {
  margin-top: 12px;
  padding: 4px 10px;
  border: none;
  background: none;
  color: var(--tt-text-dim);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.seq-menu-back:hover { color: var(--tt-text); }

/* the config body inside the menu card */
.seq-cfg {
  display: flex;
  flex-direction: column;
  gap: 13px;
  width: 300px;
  margin-bottom: 10px;
}
.seq-cfg .tt-field > span:first-child {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--tt-text-dim);
}
.seq-cfg .tt-field { align-items: center; }
.seq-cfg .seq-seg { justify-content: center; }

.seq-setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.seq-setting-row input { width: 17px; height: 17px; accent-color: var(--tt-accent); }

.seq-swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.seq-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.4);
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.55), transparent 42%),
    var(--chip, #888);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 0 0 3px rgba(255, 255, 255, 0.22);
  transition: transform 0.12s;
}
.seq-swatch:hover { transform: scale(1.15); }
.seq-swatch.seq-swatch-on {
  outline: 3px solid var(--tt-accent);
  outline-offset: 2px;
  transform: scale(1.1);
}
.seq-swatch-custom {
  display: grid;
  place-items: center;
  font-size: 15px;
  padding: 0;
}
.seq-swatch-custom:not([style]) {
  background: conic-gradient(#ef4444, #f97316, #eab308, #22c55e, #14b8a6, #3b82f6, #a855f7, #ec4899, #ef4444);
}
/* inline draggable color picker */
.seq-cpicker {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 270px;
}
.seq-cpicker[hidden] { display: none; }
.seq-cpicker-sv {
  position: relative;
  height: 132px;
  border-radius: 10px;
  border: 1px solid var(--tt-panel-border);
  cursor: crosshair;
  touch-action: none;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, hsl(var(--hue, 270) 100% 50%));
}
.seq-cpicker-hue {
  position: relative;
  height: 18px;
  border-radius: 999px;
  border: 1px solid var(--tt-panel-border);
  cursor: pointer;
  touch-action: none;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.seq-cpicker-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.65);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.seq-cpicker-row { display: flex; align-items: center; gap: 10px; }
.seq-cpicker-preview { width: 38px; height: 38px; cursor: default; }
.seq-cpicker-preview:hover { transform: none; }
.seq-cpicker-hex {
  font-size: 12px;
  color: var(--tt-text-dim);
  font-variant-numeric: tabular-nums;
}

/* segmented pick-one rows in the game config screen */
.seq-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seq-seg button {
  padding: 7px 13px;
  border: 1px solid var(--tt-panel-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tt-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.seq-seg button:hover { background: rgba(255, 255, 255, 0.12); }
.seq-seg button.seq-seg-on {
  background: var(--tt-accent);
  border-color: var(--tt-accent);
  color: #0d1620;
  font-weight: 600;
}

.seq-cfg-summary {
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--tt-panel-border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--tt-text-dim);
  text-align: center;
}
.seq-setting-danger {
  margin-top: 8px;
  align-self: flex-start;
  color: var(--tt-danger);
}

/* ---------- Online lobby ---------- */

.seq-code-display {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: 14px;
  margin: 2px 0 2px 14px; /* offset the trailing letter-spacing */
  color: var(--seq-gold);
  text-shadow: 0 0 18px rgba(245, 197, 66, 0.45);
  user-select: text; /* let people copy it */
  -webkit-user-select: text;
}
.seq-lobby-roster {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 220px;
  margin: 6px 0 10px;
}
.seq-lobby-seat {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--tt-panel-border);
  border-radius: 9px;
  font-size: 14px;
}
.seq-code-input {
  text-transform: uppercase;
  letter-spacing: 8px;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
}
.seq-cfg .tt-input { width: 100%; box-sizing: border-box; }

/* ---------- Setup modal ---------- */

.seq-setup .tt-modal-footer { flex-wrap: wrap; justify-content: center; }

/* inspector previews of cells need explicit sizing */
.tt-inspector-content .seq-cell {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
}

/* ---------- Small screens (iPhone / narrow iPad) ---------- */

body {
  overscroll-behavior: none; /* no iOS rubber-banding under the table */
  -webkit-tap-highlight-color: transparent;
}
button { touch-action: manipulation; } /* no double-tap zoom delay */

@media (max-width: 760px), (max-height: 520px) {
  .seq-hud {
    top: max(6px, env(safe-area-inset-top, 6px));
    left: 6px;
    min-width: 0;
    max-width: 52vw;
    padding: 8px 10px;
    gap: 6px;
    font-size: 12px;
  }
  .seq-turn { font-size: 12px; }
  .seq-scores { gap: 2px; }
  .seq-score-row { font-size: 11px; }
  .seq-roster-row { font-size: 10px; padding: 1px 4px; gap: 5px; }
  .seq-piles { font-size: 10px; gap: 8px; padding-top: 5px; }
  .seq-hud-buttons .tt-modal-btn { padding: 4px 8px; font-size: 11px; }

  .tt-hint { display: none; } /* rules live in the setup screens on phones */

  .seq-hand {
    /* full-bleed tray: the centering transform fights max-width, so pin it */
    left: 0;
    transform: none;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    justify-content: flex-start;
    border-radius: 12px 12px 0 0;
    padding: 8px 10px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    overflow-x: auto;
  }
  .seq-hcard { width: 48px; height: 68px; flex: none; border-radius: 7px; }
  .seq-hcard .seq-rank { font-size: 10px; top: 3px; left: 4px; }
  .seq-hcard .seq-rank-br { top: auto; left: auto; bottom: 3px; right: 4px; }
  .seq-hcard .seq-pip { font-size: 20px; }
  body.seq-bigcards .seq-hcard .seq-pip { font-size: 40px; }
  body.seq-bigcards .seq-hcard .seq-pip-num { font-size: 16px; }
  .seq-jack-tag { font-size: 7px; bottom: 4px; }
  .seq-dead-ribbon { font-size: 7px; top: 7px; }
  .seq-sort-btn { padding: 5px 7px; font-size: 11px; }
  .seq-hand-tools { margin-right: 3px; }

  .seq-actionbar { bottom: 104px; max-width: 94vw; text-align: center; }

  .tt-modal {
    min-width: 0;
    width: 94vw;
    max-width: 94vw;
    box-sizing: border-box;
    padding: 12px 12px 10px;
  }
  .tt-modal-footer { flex-wrap: wrap; }

  .seq-mainmenu-card {
    width: 90vw;
    max-width: 380px;
    box-sizing: border-box;
    padding: 30px 22px 24px;
    max-height: 88vh;
    overflow-y: auto;
  }
  .seq-title { font-size: 34px; letter-spacing: 7px; margin-right: -7px; }
  .seq-menu-btn { width: 100%; }
  .seq-cfg { width: 100%; }
  .seq-panel-sub { max-width: none; }

  .seq-passcover-card { padding: 22px 26px; font-size: 14px; margin: 0 14px; }
  .seq-stats-table { font-size: 11px; }
  .seq-stats-table th, .seq-stats-table td { padding: 3px 5px; white-space: normal; }
}
