/* Ten Steps — green felt, cream cards with serif ranks (Fraunces), gold buttons, Nunito body.
   Layout from cb-arcade.css; everything here is scoped to .ts-page. */
.ts-page [hidden] { display: none !important; }
.ts-page, .ts-dlg {
  --felt: radial-gradient(110% 70% at 50% 30%, #1f6b47, #124a31 60%, #0b2e1f);
  --ink: #f4f1e6; --muted: #cfe6d6; --soft: #e3efe6;
  --gold: #ffd88a; --ok: #7fd99a; --opp: #f28ab0; --bad: #ffb4a8;
  --card: #fffdf6; --card-edge: #c9bfa6; --red: #c0283a; --black: #1d2433;
  --gold-btn: linear-gradient(180deg, #ffe7a6, #ffd060 40%, #e6a91e);
}
.ts-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- who to play ---------- */
.ts-tabs { display: flex; gap: 6px; margin: 0 0 10px; padding: 4px; border-radius: 16px; background: linear-gradient(180deg, #124a31, #0b2e1f); }
.ts-tabs button { flex: 1; min-height: 44px; border: 0; background: transparent; padding: 10px 8px; border-radius: 12px; font: 900 15px var(--cbx-body); color: rgba(244, 241, 230, .7); cursor: pointer; }
.ts-tabs button[aria-selected="true"] { background: var(--gold-btn); color: #3b2500; box-shadow: 0 2px 0 #9a6b0d; }

/* ---------- the game card: felt ---------- */
.cbx-card.ts-card { padding: 0; background: #0b2e1f; color: var(--ink); overflow: hidden; }
.ts-card p { color: inherit; }
.ts-card .cb-rv-slot { color: initial; }
.ts-banner, .cbx-card .ts-banner { margin: 0; padding: 11px 14px; color: #fff4dc; font: 800 14px/1.4 var(--cbx-body); background: rgba(255, 216, 138, .16); border-bottom: 1px solid rgba(255, 216, 138, .35); }
.ts-banner b { color: var(--gold); }
.ts-felt { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px 18px; background: var(--felt); font-family: var(--cbx-body); }
.ts-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.ts-brand { font: 900 22px var(--cbx-display); }
.ts-round { font: 800 13px var(--cbx-body); color: var(--muted); text-align: right; }
.ts-link { min-height: 44px; border: 0; background: none; padding: 0 2px; font: 800 14px var(--cbx-body); color: var(--muted); cursor: pointer; }
.ts-link:hover { color: #fff; }

/* the step ladder as a bar: done gold, current white with a gold ring */
.ts-bar { display: flex; gap: 4px; width: 100%; padding: 6px 0; border: 0; background: none; cursor: pointer; }
.ts-bar span { flex: 1; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .18); }
.ts-bar span.done { background: var(--gold); }
.ts-bar span.now { background: #fff; box-shadow: 0 0 0 2px var(--gold); }
.ts-goal { display: grid; gap: 4px; text-align: left; width: 100%; padding: 12px 14px; border-radius: 14px; background: rgba(0, 0, 0, .25); border: 1.5px solid rgba(255, 216, 138, .5); color: var(--ink); cursor: pointer; font-family: var(--cbx-body); }
.ts-goal .k { font: 900 12px var(--cbx-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.ts-goal .t { font: 900 22px/1.2 var(--cbx-display); }
.ts-goal .ok { font: 900 13px var(--cbx-body); color: var(--ok); }
.ts-opp { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.ts-opp .nm { font-weight: 900; }
.ts-opp .st { margin-left: auto; font: 800 13px var(--cbx-body); color: var(--muted); }
.ts-opp .turn { font: 900 12px var(--cbx-body); color: #3b2500; background: var(--gold-btn); padding: 3px 10px; border-radius: 999px; animation: ts-pulse 1.6s ease-in-out infinite; }
@keyframes ts-pulse { 50% { opacity: .6; } }

/* ---------- cards ---------- */
.ts-c { --w: 52px; position: relative; box-sizing: border-box; flex: none; display: flex; flex-direction: column; justify-content: space-between; width: var(--w); aspect-ratio: 52 / 74; height: auto;
  padding: 5px 6px; margin: 0; border: 0; border-radius: 8px; background: var(--card); color: var(--black); text-align: left; cursor: pointer;
  font: 900 19px/1 var(--cbx-display); font-variant-numeric: lining-nums; box-shadow: 0 2px 0 var(--card-edge), 0 6px 12px rgba(0, 0, 0, .35);
  transition: transform .15s cubic-bezier(.3, 1.3, .5, 1), box-shadow .15s; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
.ts-c b { font: inherit; letter-spacing: -.03em; }
.ts-c i { font-style: normal; align-self: flex-end; font-size: 1.16em; line-height: 1; }
.ts-c.r { color: var(--red); }
.ts-c.w { background: linear-gradient(160deg, #ffe58a, #f2b52a); color: #5a3a00; justify-content: center; align-items: center; font: 900 11px var(--cbx-body); letter-spacing: .08em; }
.ts-c:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ts-back { display: block; width: 62px; aspect-ratio: 62 / 88; border-radius: 9px; background: repeating-linear-gradient(45deg, #8b1e2e 0 6px, #a3283a 6px 12px); box-shadow: 0 0 0 3px var(--card), 0 6px 14px rgba(0, 0, 0, .4); }
.ts-empty { display: block; width: 62px; aspect-ratio: 62 / 88; border-radius: 9px; box-shadow: inset 0 0 0 2px rgba(255, 216, 138, .45); }

/* ---------- the table: groups laid down ---------- */
.ts-cap, .cbx-card .ts-cap { margin: 0; font: 900 12px var(--cbx-body); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.ts-tablegroups { display: grid; gap: 8px; }
.ts-groups { display: flex; flex-wrap: wrap; gap: 8px; }
.ts-group { display: grid; gap: 6px; min-height: 44px; padding: 8px 10px 10px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .14); background: rgba(0, 0, 0, .2); color: var(--ink); text-align: left; cursor: pointer; font-family: var(--cbx-body); max-width: 100%; }
.ts-group.mine { border-color: rgba(255, 216, 138, .35); }
.ts-group .gl { font: 800 12.5px var(--cbx-body); color: var(--soft); }
.ts-group .gl b { color: var(--gold); margin-right: 2px; }
.ts-group:not(.mine) .gl b { color: var(--opp); }
.ts-group .gc { display: flex; flex-wrap: wrap; row-gap: 4px; }
.ts-group .ts-c { --w: 30px; justify-content: flex-start; align-items: flex-start; gap: 1px; padding: 3px 0 0 3px; border-radius: 5px; font-size: 12px; box-shadow: 0 1px 0 var(--card-edge), -1px 0 3px rgba(0, 0, 0, .28); cursor: inherit; }
.ts-group .ts-c i { align-self: flex-start; font-size: 11px; }
.ts-group .ts-c + .ts-c { margin-left: -12px; }
.ts-group .ts-c.w { justify-content: center; padding: 0; writing-mode: vertical-rl; font-size: 7px; letter-spacing: .06em; }
.ts-group.fits { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(255, 216, 138, .45); animation: ts-glow 1.4s ease-in-out infinite; }
@keyframes ts-glow { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 6px rgba(255, 216, 138, .2); } }
.ts-group:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- the deck and the discard pile ---------- */
.ts-mid { display: flex; justify-content: center; align-items: flex-start; gap: 22px; margin: 2px 0; }
.ts-pilebox { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ts-pile { position: relative; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 9px; -webkit-tap-highlight-color: transparent; }
.ts-pile:disabled { cursor: default; }
.ts-pile .ts-c { --w: 62px; font-size: 22px; cursor: inherit; }
.ts-pile .hint { animation: ts-hint 1.3s ease-in-out infinite; }
@keyframes ts-hint { 50% { box-shadow: 0 0 0 3px var(--card), 0 0 0 6px var(--gold), 0 0 22px 4px rgba(255, 216, 138, .65); } }
.ts-pile .ts-c.hint { animation-name: ts-hint-face; }
@keyframes ts-hint-face { 50% { box-shadow: 0 2px 0 var(--card-edge), 0 0 0 3px var(--gold), 0 0 22px 4px rgba(255, 216, 138, .65); } }
.ts-pile:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.ts-count { position: absolute; right: -10px; bottom: -6px; min-width: 24px; padding: 2px 6px; border-radius: 999px; background: var(--gold-btn); color: #3b2500; font: 900 12px/1.2 var(--cbx-body); box-shadow: 0 2px 0 #9a6b0d; }
.ts-mid .ts-cap { font-size: 12px; }

.ts-note, .cbx-card .ts-note { margin: 0; min-height: 18px; text-align: center; font: 700 13.5px/1.4 var(--cbx-body); color: var(--muted); }
.ts-status, .cbx-card .ts-status { margin: 0; min-height: 22px; text-align: center; font: 800 15px/1.35 var(--cbx-body); color: var(--ink); }
.cbx-card .ts-status.good { color: var(--gold); }
.cbx-card .ts-status.bad { color: var(--bad); }

/* ---------- my hand ---------- */
.ts-handhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ts-sort { min-height: 32px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: var(--ink); font: 900 12.5px var(--cbx-body); padding: 4px 11px; border-radius: 999px; cursor: pointer; }
.ts-hand { display: grid; grid-template-columns: repeat(var(--cols, 6), minmax(0, 1fr)); gap: 10px 6px; justify-items: center; padding-top: 12px; }
.ts-hand .ts-c { --w: min(100%, 64px); width: min(100%, 64px); }
.ts-hand .ts-c.lift { transform: translateY(-7px); box-shadow: 0 0 0 2px rgba(255, 216, 138, .75), 0 8px 14px rgba(0, 0, 0, .4); }
.ts-hand .ts-c.fit::before { content: ''; position: absolute; top: -9px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.ts-hand .ts-c.sel { transform: translateY(-12px); box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--gold), 0 10px 18px rgba(0, 0, 0, .45); z-index: 1; }
.ts-hand.locked .ts-c { cursor: default; }
@media (hover: hover) { .ts-hand:not(.locked) .ts-c:not(.sel):hover { transform: translateY(-5px); } }

/* ---------- buttons ---------- */
.ts-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 10px 18px; border-radius: 14px; cursor: pointer;
  font: 900 16px var(--cbx-body); color: var(--ink); border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .08); box-shadow: 0 3px 0 rgba(0, 0, 0, .35); }
.ts-btn.gold { border: 0; background: var(--gold-btn); color: #3b2500; font-size: 17px; min-height: 54px; box-shadow: 0 4px 0 #9a6b0d; }
.ts-btn.block { display: flex; width: 100%; }
.ts-btn.small { min-height: 44px; padding: 8px 14px; font-size: 14.5px; }
.ts-btn:not(:disabled):active { transform: translateY(2px); }
.ts-btn:disabled { opacity: .45; cursor: default; }
.ts-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ts-play { display: flex; gap: 8px; flex-wrap: wrap; }
.ts-play .ts-btn { flex: 1 1 160px; }
.ts-play:not(:has(> :not([hidden]))) { display: none; }
.ts-foot, .cbx-card .ts-foot { margin: 0; text-align: center; font: 800 13px/1.4 var(--cbx-body); color: var(--muted); }
.ts-foot:empty { display: none; }
.ts-send { padding: 0 14px 14px; background: #0b2e1f; display: grid; gap: 8px; }
.ts-send .ts-btn { animation: ts-send 2.4s ease-in-out infinite; }
@keyframes ts-send { 50% { box-shadow: 0 4px 0 #9a6b0d, 0 0 26px rgba(255, 216, 138, .55); } }
.ts-opts { display: flex; justify-content: center; padding: 12px 14px 0; background: #0b2e1f; }
.ts-seg { display: inline-flex; gap: 3px; background: rgba(0, 0, 0, .35); border-radius: 999px; padding: 3px; }
.ts-seg button { border: 0; min-height: 36px; padding: 7px 14px; border-radius: 999px; background: transparent; font: 900 13.5px var(--cbx-body); color: rgba(244, 241, 230, .7); cursor: pointer; }
.ts-seg button[aria-pressed="true"] { background: var(--gold-btn); color: #3b2500; }
.ts-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; padding: 12px 14px 16px; background: #0b2e1f; }

/* ---------- laying down ---------- */
.ts-h, .cbx-card .ts-h { margin: 0; font: 900 24px var(--cbx-display); color: var(--ink); }
.ts-slots { display: grid; gap: 10px; }
.ts-slot { padding: 10px 12px 12px; border-radius: 14px; background: rgba(0, 0, 0, .22); border: 2px dashed rgba(255, 216, 138, .55); }
.ts-slot.ok { border: 2px solid var(--ok); }
.ts-slot.bad { border: 2px solid var(--bad); }
.ts-slot.active:not(.ok) { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255, 216, 138, .25); }
.ts-slot .sh { display: flex; width: 100%; justify-content: space-between; align-items: center; min-height: 32px; padding: 0; border: 0; background: none; color: var(--ink); font: 900 16px var(--cbx-body); cursor: pointer; text-align: left; }
.ts-slot .sh em { font-style: normal; font-size: 14px; color: var(--gold); }
.ts-slot.ok .sh em { color: var(--ok); }
.ts-slot.bad .sh em { color: var(--bad); }
.ts-slot .sc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ts-slot .sc .ts-c { --w: 48px; font-size: 18px; }
.ts-slot .sc .ts-c.w { font-size: 11px; }
.ts-gap { background: transparent !important; box-shadow: none !important; border: 2px dashed rgba(255, 216, 138, .7) !important; color: var(--gold) !important; justify-content: center; align-items: center; font: 900 18px var(--cbx-body) !important; }
.ts-slot .sw, .cbx-card .ts-slot .sw { margin: 8px 0 0; font: 800 13px/1.4 var(--cbx-body); color: var(--muted); }
.cbx-card .ts-slot .sw.bad { color: var(--bad); }
.ts-layhand { padding-top: 4px; }
.ts-row { display: flex; gap: 8px; }
.ts-row .ts-btn { flex: 1; }
.ts-tip, .cbx-card .ts-tip { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); font: 800 14px/1.4 var(--cbx-body); color: var(--soft); }

/* ---------- a round over ---------- */
.ts-end { gap: 14px; padding: 22px 16px 20px; }
.ts-kick, .cbx-card .ts-kick { margin: 8px 0 0; text-align: center; font: 900 13px var(--cbx-body); letter-spacing: .16em; text-transform: uppercase; color: var(--gold); }
.ts-eh, .cbx-card .ts-eh { margin: 0; text-align: center; font: 900 32px/1.1 var(--cbx-display); color: var(--ink); }
.ts-er { padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, .07); }
.ts-er.me { background: rgba(255, 216, 138, .12); border: 2px solid var(--gold); }
.ts-er .h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ts-er .h span { font: 900 20px var(--cbx-display); }
.ts-er .h em { font-style: normal; font-weight: 900; }
.ts-er .h em.ok { color: var(--ok); }
.ts-er .h em.miss { color: var(--opp); }
.ts-er p, .cbx-card .ts-er p { margin: 6px 0 0; font: 800 15px/1.4 var(--cbx-body); color: var(--soft); }
.ts-er p b { color: #fff; }
.ts-er p.pts, .cbx-card .ts-er p.pts { font-size: 14px; color: var(--muted); }
.ts-lead, .cbx-card .ts-lead { margin: 0; text-align: center; font: 900 13.5px var(--cbx-body); color: var(--muted); }
.ts-final { display: grid; gap: 8px; padding: 16px; border-radius: 16px; border: 2px solid var(--gold); background: rgba(0, 0, 0, .22); text-align: center; }
.ts-final p, .cbx-card .ts-final p { margin: 0; font: 800 15px/1.45 var(--cbx-body); color: var(--soft); }
.ts-final p.big, .cbx-card .ts-final p.big { font: 900 28px/1.15 var(--cbx-display); color: var(--gold); }

/* ---------- dialogs: the ladder and the friend form ---------- */
.ts-dlg { border: 0; padding: 0; border-radius: 22px; width: min(420px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--ink); background: var(--felt); box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.ts-dlg::backdrop { background: rgba(4, 18, 11, .62); }
.ts-dlg-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 14px 18px; font-family: var(--cbx-body); }
.ts-dlg-top { display: flex; align-items: center; justify-content: space-between; }
.ts-dlg h2 { margin: 0; font: 900 24px var(--cbx-display); color: var(--ink); }
.ts-dlg p { margin: 0; font: 700 15px/1.45 var(--cbx-body); color: var(--soft); }
.ts-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ts-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); }
.ts-steps li > b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font: 900 14px var(--cbx-display); background: rgba(255, 255, 255, .14); }
.ts-steps li > span { flex: 1; font: 800 15px var(--cbx-body); }
.ts-steps li > i { font-style: normal; font: 900 12px var(--cbx-body); padding: 3px 8px; border-radius: 99px; }
.ts-steps li > i.me { background: var(--gold); color: #3b2500; }
.ts-steps li > i.opp { background: var(--opp); color: #3a0718; }
.ts-steps li.done > b { background: var(--gold); color: #3b2500; }
.ts-steps li.done > span { color: var(--muted); }
.ts-steps li.now { background: rgba(255, 216, 138, .14); box-shadow: inset 0 0 0 2px var(--gold); }
.ts-rules { margin-top: 6px !important; padding: 12px 14px; border-radius: 12px; background: rgba(0, 0, 0, .22); font: 800 13px/1.45 var(--cbx-body) !important; color: var(--soft); }
.ts-field { display: grid; gap: 4px; font: 800 13px var(--cbx-body); color: var(--muted); }
.ts-field input { font: 800 17px var(--cbx-body); padding: 11px 12px; border-radius: 12px; color: var(--ink); background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 216, 138, .4); }
.ts-field input::placeholder { color: rgba(244, 241, 230, .4); }
.ts-field input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 216, 138, .3); }
.ts-dlg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.ts-mine { margin-top: 10px; border-top: 1px solid rgba(255, 216, 138, .25); padding-top: 10px; }
.ts-mine h3 { margin: 0 0 6px; font: 900 14px var(--cbx-display); color: var(--gold); }
.ts-mine ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ts-mine a { display: block; padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, .06); font: 800 14px var(--cbx-body); color: var(--ink); text-decoration: none; }
.ts-list li { line-height: 1.5; }

@media (min-width: 600px) {
  .ts-felt { padding: 20px 22px 22px; }
  .ts-mid { gap: 34px; }
  .ts-pile .ts-c, .ts-back, .ts-empty { --w: 72px; width: 72px; }
  .ts-group .ts-c { --w: 34px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .ts-c, .ts-hand .ts-c { transition: none; }
  .ts-pile .hint, .ts-group.fits, .ts-opp .turn, .ts-send .ts-btn { animation: none !important; }
}

/* the step bar opens the ladder: give it a taller tap area without moving anything */
.ts-bar { padding: 12px 0; margin: -6px 0; }
/* short phones: tighter table so the hand fits on screen with the draw and discard piles */
@media (max-width: 599px) and (max-height: 760px) {
  .ts-felt { gap: 8px; padding: 12px 12px 14px; }
  .ts-top { min-height: 24px; }
  .ts-brand { font-size: 19px; }
  .ts-goal { padding: 8px 12px; gap: 2px; }
  .ts-goal .k { font-size: 11px; }
  .ts-goal .t { font-size: 19px; }
  .ts-opp { padding: 7px 10px; }
  .ts-pile .ts-c, .ts-back, .ts-empty { --w: 52px; width: 52px; }
  .ts-pile .ts-c { font-size: 19px; }
  .ts-mid { gap: 18px; }
  .ts-hand { padding-top: 8px; gap: 8px 6px; }
}
@media (max-width: 599px) and (max-height: 620px) {
  .ts-brand { display: none; }
  .ts-top { justify-content: flex-end; min-height: 0; }
  .ts-goal .t { font-size: 17px; }
  .ts-pile .ts-c, .ts-back, .ts-empty { --w: 44px; width: 44px; }
  .ts-pile .ts-c { font-size: 17px; }
  .ts-note { min-height: 0; }
}
