/* The upright phone's table (phonetable.js). Everything here is under html.pt, which only an upright phone has, so the
   laptop and the tablet are never touched. */
.pt-only { display: none; }
html.pt .pt-only { display: revert; }

/* Step 1: the card in play, with its nearest lines; "Change the card" is a small link at the foot of it */
html.pt .panel-tabs, html.pt #panelChange, html.pt #panelHide { display: none; }
html.pt .panel .card-top { flex-wrap: nowrap; margin-bottom: 2px; }
html.pt .panel .card-title { margin: 0; font: 400 1.35rem/1.15 var(--g-font-display, inherit); color: var(--ink); }
html.pt .panel .panel-close { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent;
  font-size: 1.7rem; line-height: 1; color: var(--ink-soft); cursor: pointer; }
html.pt .panel .card-nearest { display: none; }
html.pt .panel #cardSub.pt-nearest > span { font-size: 0.95rem; color: var(--ink-soft); }
html.pt .panel .card-foot { text-align: center; margin: 8px 0 4px; }
html.pt .panel .card-swipe { margin: 4px 0 2px; font-size: 0.9rem; color: var(--ink-soft); }
html.pt .panel .card-change { font: inherit; font-size: 0.95rem; background: none; border: 0; padding: 8px 10px; min-height: 40px;
  color: #7a4d08; text-decoration: underline; cursor: pointer; }

/* Step 2: the card slides in from the right over the table and the band, and stops above the rack */
html.pt .panel-show { display: none !important; }
html.pt .app #panel, html.pt .app #panel[hidden] { display: block; position: fixed; top: 0; right: 0; bottom: var(--pt-rack-h, 190px); left: 14%;
  width: auto; max-height: none; z-index: 50; border-radius: 16px 0 0 0; padding: 12px 12px 8px; overflow-y: auto;
  background: #f8f1e0; box-shadow: -8px 0 18px rgba(0, 0, 0, 0.5); transform: translateX(45%); visibility: hidden;     /* it starts half in view: the card shows in the first frame and settles in 100 ms */
  transition: transform 0.1s ease-out, visibility 0s linear 0.1s; }
html.pt .app:not(.panel-hidden) #panel { transform: none; visibility: visible; transition: transform 0.1s ease-out, visibility 0s; }
html.pt .app #panel::before { display: none; }
html.pt .panel-dim { position: fixed; left: 0; right: 0; top: 0; bottom: var(--pt-rack-h, 190px); z-index: 49; background: rgba(0, 0, 0, 0.55);
  opacity: 0; pointer-events: none; transition: opacity 0.1s ease-out; }
html.pt .app:not(.panel-hidden) ~ .panel-dim, html.pt .app:not(.panel-hidden) .panel-dim { opacity: 1; pointer-events: auto; }
html.pt .card-tab { position: fixed; right: 0; top: var(--pt-tab-top, 55vh); z-index: 30; width: 30px; height: var(--pt-tab-h, 100px); padding: 0; border: 0;
  border-radius: 12px 0 0 12px; background: linear-gradient(90deg, #d68c12, #f6c443); color: #3a2606; cursor: pointer;
  writing-mode: vertical-rl; font: 400 17px var(--g-font-display, inherit); box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.4); }
html.pt body.no-card .card-tab, html.pt body:has(#ask.ask-over) .card-tab { display: none; }
@media (prefers-reduced-motion: reduce) { html.pt .app #panel, html.pt .panel-dim { transition: none; } }

/* Step 3: Keep on the table, and the "Going for" strip in the band */
html.pt .line .line-top { flex-wrap: wrap; }
html.pt .line-pin { display: inline-flex; align-items: center; margin-left: auto; font-size: 0.8rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #e9e2d0; color: #3a2e1a; cursor: pointer; white-space: nowrap; }
html.pt .line-pin::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 0; }
html.pt .line-pin.kept { background: #f6c443; color: #3a2606; }
html.pt .going { flex: 1 1 100%; order: 2; display: flex; flex-direction: column; justify-content: center; gap: 3px; min-height: 36px; padding: 4px 8px; border-radius: 14px; box-sizing: border-box;
  background: rgba(8, 36, 26, 0.78); border: 1px solid rgba(255, 233, 163, 0.45); color: #fff6e2; cursor: pointer; overflow: hidden; }
html.pt .going[hidden] { display: none; }
html.pt .going .going-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
html.pt .going b { font: 400 14px/1.05 var(--g-font-display, inherit); color: #ffe9a3; white-space: normal; overflow: hidden; min-width: 0; flex: 1 1 auto; max-height: 30px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
html.pt .going .going-away { font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(255, 233, 163, 0.18); white-space: nowrap; flex: none; }
/* the whole line in card order: 26 px tiles, scaled down to the strip's width when the line is long (fourteen tiles on a 390 px phone) */
html.pt .going .going-fit { flex: none; height: 36px; overflow: hidden; display: flex; align-items: center; }
html.pt .going .going-tiles { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; flex: none; width: max-content; transform: scale(var(--gs, 1)); transform-origin: 0 50%; }
html.pt .going .going-set { display: flex; gap: 1px; flex: none; }
html.pt .going .going-tiles .tile { --tile-base-w: 26px; --tile-base-h: 36px; --tile-scale: 1; --tile-size: 1; --fit: 1; --zoom: 1; flex: none; margin: 0; border-radius: 3px; box-shadow: 0 1px 0 var(--tile-shadow); }
html.pt .going .going-tiles .have-tile { opacity: 1; }
html.pt .going .going-tiles .need-tile { opacity: 0.4; }
html.pt body .table #mat #going button.going-change { margin-left: auto; flex: none; width: auto; height: auto; background: none; border: 0; box-shadow: none; padding: 0 2px; min-height: 30px; font: inherit; font-size: 13px; color: #ffe9a3; text-decoration: underline; }

/* Step 4: the square table. No top bar: Back and Menu are small round icons in the top corners and the tiles left is a
   small count on the felt. Each opponent is one row of standing tile backs on a thin wooden strip; the side players' rows are turned to run down the sides. Under the square one band, then the rack. */
html.pt { --pt-u: 1; }
html.pt .table { padding: 0; gap: 0; }
html.pt .table .rack { margin-left: 0; margin-right: 0; }
html.pt .game-bar { position: fixed; top: 0; left: 0; right: 0; height: 0; max-width: none; padding: 0; z-index: 46; pointer-events: none; }
html.pt .game-bar > * { pointer-events: auto; }
html.pt .game-bar .gb-card, html.pt .table .game-bar button.gb-aim { display: none !important; }
html.pt body .table .game-bar .gb-back { box-sizing: border-box; position: absolute; left: calc(8px + var(--inset-l, 0px)); top: 8px; width: 32px !important; height: 32px !important; min-width: 32px !important; min-height: 0; padding: 0 !important; margin: 0;
  display: flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; font-size: 1.3rem; line-height: 1; color: #fff6e2;
  background: linear-gradient(180deg, #3c6f57, #1d4a37 55%, #123528); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), 0 2px 0 #0a2018; }
html.pt header { top: 8px; right: calc(8px + var(--inset-r, 0px)); }
html.pt header #tableMenu > summary { width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: linear-gradient(180deg, #3c6f57, #1d4a37 55%, #123528); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.22), 0 2px 0 #0a2018; }
html.pt header #tableMenu > summary::before { font-size: 1rem; }
html.pt body .table .game-bar .gb-wall { position: absolute; left: calc(46px + var(--inset-l, 0px)); top: 10px; margin: 0; height: 28px; min-height: 0; width: auto; padding: 0 11px; z-index: 2; gap: 0;
  background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255, 246, 226, 0.2); font-size: 13px; }
html.pt .gb-wall .gb-tile-back { display: none; }
html.pt body .table .game-bar .gb-wall b { font: 400 13px/1 var(--g-font-display, system-ui); }
html.pt .gb-coins:not([hidden]) { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); margin: 0; }

html.pt .around { display: block; position: relative; flex: 1 1 0; min-height: 0; overflow: hidden; padding: 0; margin: 0; gap: 0; }
html.pt .around .seat { position: absolute; display: block; padding: 0; gap: 0; background: none; }
html.pt .slot-across, html.pt .slot-left, html.pt .slot-right { position: absolute; min-width: 0; padding: 0; margin: 0; overflow: visible; }
html.pt .slot-across { left: 50%; top: calc(40px * var(--pt-u)); width: calc(366px * var(--pt-u)); height: calc(32px * var(--pt-u)); transform: translateX(-50%); }
html.pt .slot-left { left: calc(10px * var(--pt-u)); top: var(--pt-side-top, 90px); width: calc(32px * var(--pt-u)); height: var(--pt-lw-side, 300px); }
html.pt .slot-right { right: calc(10px * var(--pt-u)); top: var(--pt-side-top, 90px); width: calc(32px * var(--pt-u)); height: var(--pt-lw-side, 300px); }
html.pt .around .seat-across, html.pt .around .seat-left, html.pt .around .seat-right { left: 0; top: 0; width: 100%; height: 100%; }

/* one rack, drawn lying across; the side players' are this turned a quarter way round */
html.pt .around .seat-person { position: absolute; left: 0; top: 0; width: calc(366px * var(--pt-u)); height: calc(32px * var(--pt-u)); max-width: none;
  display: flex; flex-direction: row; align-items: flex-end; gap: 0; transform-origin: 0 0; }
html.pt .around .seat-left .seat-person { width: var(--pt-lw-side, 300px); transform: translateY(var(--pt-lw-side, 300px)) rotate(-90deg); }
html.pt .around .seat-right .seat-person { width: var(--pt-lw-side, 300px); transform: translateX(calc(32px * var(--pt-u))) rotate(90deg); }
html.pt .around .seat-name { position: absolute; left: 50%; top: calc(14px * var(--pt-u)); z-index: 2; transform: translate(-50%, -50%); display: flex; align-items: center; width: auto; max-width: calc(250px * var(--pt-u)); height: calc(21px * var(--pt-u));
  min-height: 0; margin: 0; padding: 0 calc(8px * var(--pt-u)) 0 calc(4px * var(--pt-u)); box-sizing: border-box; border-radius: 999px; background: rgba(8, 26, 18, 0.9); gap: 0; color: inherit; white-space: nowrap; }
html.pt .around .seat.is-turn .seat-name { color: inherit; }
html.pt body .table .around .seat-name, html.pt body .table .around .seat-name.by { border: 2px solid var(--c, rgba(255, 236, 176, 0.55)); outline: 0; box-shadow: none; }
/* the name lies on the backs: across reads left to right; the left player's reads top to bottom and the right player's bottom to top, facing into the table */
html.pt .around .seat-left .seat-name, html.pt .around .seat-right .seat-name { transform: translate(-50%, -50%) rotate(180deg); }
html.pt .around .seat-who-btn { display: flex; flex-direction: row; align-items: center; gap: 4px; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0;
  background: none; box-shadow: none; text-align: left; color: inherit; }
html.pt .around .seat-face { display: none; }
html.pt .around .seat-face .avatar-wrap, html.pt .around .seat-face .avatar-wrap .avatar, html.pt .around .seat-face .avatar-wrap .avatar-art,
html.pt .around .seat-face img, html.pt .around .seat-face canvas { width: 100%; height: 100%; }
html.pt .around .seat-face .frame-art { display: none; }
html.pt .around .seat-text { display: flex; align-items: center; line-height: calc(13px * var(--pt-u)); min-width: 0; white-space: nowrap; overflow: hidden; }
html.pt .around .seat-name .seat-who { display: inline-block; vertical-align: middle; max-width: calc(110px * var(--pt-u)); overflow: hidden; text-overflow: ellipsis; font: 800 calc(11px * var(--pt-u))/calc(13px * var(--pt-u)) var(--g-font-body, system-ui); letter-spacing: 0.1px; color: #fff6e2; }
html.pt .around .seat-sub { display: inline-flex; align-items: center; margin: 0; font: 600 calc(10px * var(--pt-u))/calc(13px * var(--pt-u)) var(--g-font-body, system-ui); color: rgba(255, 246, 226, 0.8); }
html.pt .around .seat-sub .seat-where { display: none; }
html.pt .around .seat-sub .seat-count { display: inline; font: inherit; font-weight: 400; color: inherit; opacity: 1; }
html.pt .around .seat-sub .seat-count { margin-left: calc(4px * var(--pt-u)); gap: 0; padding: 0 calc(5px * var(--pt-u)); border-radius: 999px; background: rgba(0, 0, 0, 0.5); color: #fff;
  font: 800 calc(11.5px * var(--pt-u))/calc(13px * var(--pt-u)) var(--g-font-body, system-ui); vertical-align: top; }
html.pt .around .seat-sub .seat-count-back, html.pt .around .seat-sub .tag, html.pt .around .seat-sub .seat-trophies, html.pt .around .seat-sub .seat-title,
html.pt .around .seat-read { display: none; }
html.pt .around .seat-invite { display: none; }
html.pt body .table .around .seat-name .east-mark { display: none; }     /* the wind letter beside the name says it (E, S, W, N), East in red */
html.pt .pt-wind { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: calc(14px * var(--pt-u)); height: calc(14px * var(--pt-u)); margin-right: calc(3px * var(--pt-u));
  border-radius: 50%; vertical-align: middle; font: 800 calc(9.5px * var(--pt-u))/1 var(--g-font-body, system-ui); background: rgba(0, 0, 0, 0.55); color: #fff6e2; border: 1px solid rgba(255, 246, 226, 0.55); }
html.pt .pt-wind.east { width: calc(16px * var(--pt-u)); height: calc(16px * var(--pt-u)); font-size: calc(11px * var(--pt-u)); background: #c8321f; color: #fff; border-color: #ffd98a; box-shadow: 0 0 0 1.5px #f6c443; }

html.pt .around .seat-tiles { position: relative; flex: 1 1 auto; min-width: 0; height: calc(30px * var(--pt-u)); margin: 0; padding: 0 0 0 calc(50px * var(--pt-u));
  display: flex; flex-direction: row; flex-wrap: nowrap; justify-content: flex-start; align-items: flex-start; gap: calc(1px * var(--pt-u)); border-radius: 0; background: none; box-shadow: none; }
html.pt .around .seat-person::after { content: ""; position: absolute; left: 0; right: 0; top: calc(28px * var(--pt-u)); height: calc(3px * var(--pt-u)); border-radius: 1px;
  background: #8a5a33; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); pointer-events: none; }
html.pt .around .seat.pt-turn .seat-person::after { background: #ffd34d; height: calc(4px * var(--pt-u)); box-shadow: 0 0 10px 4px rgba(255, 211, 77, 0.95); }
html.pt .around .seat.pass-to .seat-tiles { filter: drop-shadow(0 0 4px #f6c443); }
/* whose turn: her name on gold, her row of tiles in a gold glow, the strip under them lit */
html.pt body .table .around .seat.pt-turn .seat-name { background: linear-gradient(180deg, #ffe9a3, #f6c443); border-radius: calc(8px * var(--pt-u)); box-shadow: 0 0 0 2px #fff3c4, 0 0 14px 5px rgba(255, 211, 77, 0.95); }
html.pt .around .seat.pt-turn .seat-name .seat-who, html.pt .around .seat.pt-turn .seat-name .seat-sub { color: #2a1a02; }
html.pt .around .seat.pt-turn .seat-name .seat-count { background: rgba(42, 26, 2, 0.85); color: #ffe9a3; }
html.pt .around .seat.pt-turn .seat-tiles::before { content: ""; position: absolute; inset: calc(-3px * var(--pt-u)) calc(-4px * var(--pt-u)); border-radius: 6px; background: rgba(255, 211, 77, 0.28); box-shadow: 0 0 10px 3px rgba(255, 211, 77, 0.85); z-index: -1; }
html.pt .around .seat-tiles .seat-back.none { display: none; }
html.pt .around .seat-tiles .seat-back { flex: none; display: block; width: calc(18px * var(--pt-u)); height: calc(27px * var(--pt-u)); margin: 0;
  border-radius: 3px 3px 1.5px 1.5px;
  background: linear-gradient(180deg, #fffaf0 0, #fffaf0 1px, #f3ecdc 1px, #f3ecdc 3.5px, #d9cdb2 3.5px, #d9cdb2 4.5px, transparent 4.5px),
    var(--tile-back-art, none) center / cover no-repeat, linear-gradient(160deg, var(--tile-back, #2f5fa8), var(--tile-back-deep, #1d3f7a));
  box-shadow: inset -2px 0 0 #e6dcc3, inset -1px 0 0 #d9cdb2, inset 1px 0 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(0, 0, 0, 0.28), 0 1px 1.5px rgba(0, 0, 0, 0.5), 1px 0 1.5px rgba(0, 0, 0, 0.28); }
html.pt .around .seat-tiles.face-up { height: auto; flex-wrap: wrap; justify-content: flex-start; padding-left: 0; }
/* at the end the whole hand lies face up: the name steps off the tiles to the rack's start */
html.pt .around .seat-person:has(.seat-tiles.face-up) .seat-name, html.pt .around .seat-left .seat-person:has(.seat-tiles.face-up) .seat-name, html.pt .around .seat-right .seat-person:has(.seat-tiles.face-up) .seat-name { position: relative; left: auto; top: auto; transform: none; flex: 0 0 auto; align-self: flex-start; margin-right: calc(4px * var(--pt-u)); }


/* the face-up sets: beside the rack, toward the middle */
html.pt .around .seat-sets { position: absolute; display: flex; flex-wrap: wrap; gap: 3px; align-items: flex-start; align-content: flex-start; justify-content: flex-start; padding: 0; background: none; }
html.pt .around .seat-across .seat-sets { left: 50%; transform: translateX(-50%); top: calc(80px * var(--pt-u)); width: calc(285px * var(--pt-u)); justify-content: flex-end; }
html.pt .around .seat-left .seat-sets { left: calc(50px * var(--pt-u)); top: 0; width: calc(58px * var(--pt-u)); flex-direction: row; }
html.pt .around .seat-right .seat-sets { right: calc(50px * var(--pt-u)); top: auto; bottom: 0; width: calc(58px * var(--pt-u)); flex-direction: row; justify-content: flex-end; }
html.pt .around .seat-sets .seat-set { padding: 1px; flex-direction: row; }
html.pt .around .seat-sets .seat-set .tile { --tile-scale: 0.2; transform: none; margin: 0; }

/* the middle: the thrown tiles, in the order thrown */
html.pt .slot-centre { position: absolute; align-self: stretch; justify-self: stretch; left: 62px; right: 62px; top: 120px; bottom: 6px; margin: 0; max-height: none; min-height: 0; padding: 0; overflow: hidden; }
html.pt .around .slot-centre, html.pt .around .slot-centre .centre, html.pt .around #centre { background: none !important; box-shadow: none !important; border: 0 !important; }
html.pt .slot-centre .centre { height: 100%; padding: 0; gap: 0; border: 0; border-radius: 0; background: none; box-shadow: none; min-height: 0; }
html.pt .centre .stage, html.pt .centre .now, html.pt .centre .centre-head, html.pt .centre .focus-line, html.pt .centre .pool-key, html.pt .centre .pool-zoom { display: none !important; }
html.pt #centre { height: 100%; cursor: default; }
html.pt #centre > .pool { display: grid; grid-template-columns: repeat(var(--pt-cols, 8), var(--pt-w, 26px)); gap: 3px; justify-content: center; align-content: start;
  height: 100%; padding: 0; overflow: hidden; max-height: none; }
html.pt #centre > .pool .tile { width: var(--pt-w, 26px); height: calc(var(--pt-w, 26px) * 1.4); border-radius: 3px; transform: none; margin: 0;
  box-shadow: 0 1px 0 rgba(60, 45, 25, 0.5); }
/* the thrower's color, a band round each thrown tile (style.css gives it to every table; this rule is as strong as the phone's own box-shadow above) */
html.pt #centre > .pool .tile.by { box-shadow: 0 0 0 2px var(--c), 0 1px 0 rgba(60, 45, 25, 0.5); }
html.pt #centre > .pool .tile.mine { box-shadow: 0 0 0 2px rgba(127, 209, 255, 0.85), 0 1px 0 rgba(60, 45, 25, 0.5); }
html.pt #centre > .pool .tile.last { outline: 2px solid #f6c443; outline-offset: 2px; z-index: 1; }

/* the Charleston: the tiles going, and the way they go */
html.pt .pt-arrow { position: absolute; display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: rgba(8, 36, 26, 0.7); pointer-events: none; }
html.pt .pt-arrow .pt-arrow-tiles { display: flex; gap: 2px; }
html.pt .pt-arrow .pt-arrow-tiles i { display: block; width: 14px; height: 20px; border-radius: 2.5px 2.5px 1px 1px;
  background: linear-gradient(180deg, #fffaf0 0, #fffaf0 0.6px, #f3ecdc 0.6px, #f3ecdc 2px, #d9cdb2 2px, #d9cdb2 3px, transparent 3px), linear-gradient(160deg, var(--tile-back, #2f5fa8), var(--tile-back-deep, #1d3f7a)); }
html.pt .pt-arrow b { font: 400 30px/1 var(--g-font-display, system-ui); color: #f6c443; text-shadow: 0 2px 4px #000; }
html.pt .pt-arrow-right { right: calc(70px * var(--pt-u)); top: 48%; }
html.pt .pt-arrow-right b::before { content: "\2192"; }
html.pt .pt-arrow-left { left: calc(70px * var(--pt-u)); top: 48%; flex-direction: row-reverse; }
html.pt .pt-arrow-left b::before { content: "\2190"; }
html.pt .pt-arrow-across { left: 50%; transform: translateX(-50%); top: 26%; }
html.pt .pt-arrow-across b::before { content: "\2191"; }

/* the band: a status line, the Going for strip, and the buttons for this moment */
html.pt #mat { position: relative; z-index: 3; flex: none; display: grid; grid-template-columns: calc(52px) minmax(0, 1fr) auto; grid-template-rows: minmax(38px, auto) auto 48px;
  gap: 8px 6px; align-content: center; height: auto; min-height: 166px; margin: 0; padding: 9px 40px 8px 10px; box-sizing: border-box; border: 0; border-top: 1px solid rgba(255, 233, 163, 0.28);
  background: linear-gradient(180deg, rgba(4, 24, 16, 0.82), rgba(6, 30, 21, 0.9)); }
html.pt #mat::after { display: none; }
html.pt #ask:not(.ask-over) { display: contents; }
html.pt body .table #mat #ask:not(.ask-over) .ask-card { grid-column: 1 / -1; grid-row: 1; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 38px; padding: 4px 14px; margin: 0;
  border-radius: 19px; background: rgba(8, 36, 26, 0.86); border: 1px solid rgba(255, 233, 163, 0.4); color: #fff6e2; box-shadow: none; max-width: none; width: auto; transform: none; position: static; }
html.pt #mat #ask .ask-card .ask-line { margin: 0; font: 700 14px/1.25 var(--g-font-body, system-ui); color: #fff6e2; text-align: center; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
html.pt #mat .ask-card .ask-line .pass-arrow { display: none; }
html.pt body .table #mat #ask:not(.ask-over) .ask-card .ask-body { display: none !important; }
html.pt body .table #mat #ask:not(.ask-over) .ask-card { display: flex !important; }
html.pt #mat .going { grid-column: 1 / -1; grid-row: 2; order: 0; flex: none; height: auto; min-height: 0; }
html.pt #mat .going[hidden] { display: block; visibility: hidden; height: 34px; min-height: 0; padding: 0; }      /* no strip: the row keeps its old 34 px, so the table does not jump */
html.pt body .table #mat #askGo { grid-column: 2; grid-row: 3; display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-start; gap: 8px; min-width: 0; margin: 0 !important; padding: 0; background: none; justify-self: stretch; width: auto; }
html.pt body .table #mat #actions { grid-column: 3; grid-row: 3; display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin: 0 !important; padding: 0; flex-wrap: nowrap; justify-self: stretch; width: auto; }
html.pt #mat #actions > *, html.pt #mat #askGo > * { flex: none; }
html.pt #mat #yourSets { position: absolute; left: 8px; right: 44px; bottom: calc(100% + 4px + 12px * var(--pt-u)); margin: 0; z-index: 2; }
html.pt #mat button.pt-hide { display: none !important; }
html.pt #mat #askGo > button, html.pt #mat #actions > button, html.pt #mat #actions .more-helpers summary { min-height: 46px; height: 46px; font-size: 17px; padding: 0 15px; margin: 0; white-space: nowrap; }
html.pt #mat button[data-pt-short] { font-size: 0 !important; }
html.pt #mat button[data-pt-short]::after { content: attr(data-pt-short); font-size: 17px; line-height: 1; }
html.pt #mat #askGo .ask-slots { flex: 0 1 auto; min-width: 0; height: 46px; display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0; padding: 0 6px;
  border: 2px dashed rgba(255, 233, 163, 0.6); border-radius: 12px; background: rgba(0, 0, 0, 0.18); }
html.pt #mat #askGo .ask-slot-col { display: flex; flex-direction: column; align-items: center; }
html.pt #mat #askGo .ask-slot-col > span { display: none; }
html.pt #mat #askGo .ask-slots .ask-slot { width: 22px; height: 31px; border-width: 1px; border-radius: 4px; }
html.pt #mat #askGo .ask-slots .tile { --tile-base-w: 22px; --tile-base-h: 31px; --tile-scale: 1; --fit: 1; --tile-size: 1; width: 22px; height: 31px; border-radius: 3px; }
html.pt .rack #rackSort { display: none; }
/* standing on the rack's top edge at the band's right end, never lower: it used to reach down over the last tile of the rack when the band's top was measured late (22 Nov, staging, 390 x 844) */
html.pt .card-tab { top: auto; bottom: calc(var(--pt-rack-h, 70px) + 6px); height: 100px; }

/* Kora's picture is the ask button, in the band's button row; her answer opens over the status line with the button for her move inside it */
html.pt .coach-dock, html.pt .coach-dock.docked { position: fixed !important; left: calc(10px + var(--inset-l, 0px)) !important; top: var(--pt-kora-top, 700px) !important;
  bottom: auto !important; right: auto !important; z-index: 47; width: 44px; height: 44px; transform: none; }
html.pt .coach-dock .coach-bubble { position: relative; width: 44px; height: 44px; padding: 0; }
html.pt .coach-dock .coach-face { width: 44px; height: 44px; box-shadow: 0 0 0 2px #f6c443, 0 3px 8px rgba(0, 0, 0, 0.45); }
html.pt .coach-dock .coach-word { display: none; }
html.pt .coach-dock .coach-dot { position: absolute; right: -4px; bottom: -4px; top: auto; width: 19px; height: 19px; border-radius: 50%; background: #f6c443; color: #3a2606;
  font: 400 13px/19px var(--g-font-display, system-ui); text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); }
html.pt .coach-dock .coach-dot::before { content: "?"; }
html.pt .coach-dock .coach-bubble[aria-expanded="true"] .coach-face { box-shadow: 0 0 0 3px rgba(246, 196, 67, 0.45), 0 0 12px 3px rgba(246, 196, 67, 0.7); }
html.pt #coachDock #coachBox.coach-box, html.pt .coach-dock.open-left #coachBox.coach-box, html.pt .coach-dock.open-up #coachBox.coach-box, html.pt #coachDock #coachBox.coach-box.hello { position: fixed; left: calc(10px + var(--inset-l, 0px)); right: 46px; top: auto;
  bottom: var(--pt-stat-bottom, 140px); width: auto; max-height: 38vh; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 14px; border: 0; border-radius: 19px;
  background: #fff6e2 !important; color: #2a2418 !important; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3); font: 700 14px/1.25 var(--g-font-body, system-ui); }
html.pt #coachBox .coach-words, html.pt #coachBox .coach-words * { color: #2a2418; }
html.pt #coachDock #coachBox.coach-box[hidden] { display: none; }
html.pt #coachDock #coachBox.coach-box[data-key="tableRead"], html.pt #coachDock #coachBox.coach-box.hello { bottom: var(--pt-above-band, 180px); max-height: 66px; padding: 6px 12px; font-size: 13px; line-height: 1.25; cursor: pointer; }
html.pt #coachBox[data-key="tableRead"] .coach-body, html.pt #coachBox.hello .coach-body { max-height: 54px; overflow: hidden; }
html.pt #coachBox .coach-head, html.pt #coachBox .coach-more, html.pt #coachBox .coach-foot { display: none; }
/* her dead-hand message keeps a small close at its right end, and a tap on the words closes it too (22 Nov) */
html.pt #coachBox[data-key^="dead"] .coach-head { display: flex; order: 2; margin: 0; flex: none; }
html.pt #coachBox[data-key^="dead"] .coach-head strong { display: none; }
html.pt #coachBox[data-key^="dead"] .coach-x { min-width: 36px; min-height: 36px; color: #2a2418; font-size: 1.5rem; }
html.pt #coachBox .coach-head .coach-why { color: #7a4a00; min-height: 36px; padding: 0 8px; font-size: 15px; margin-left: 0; }
html.pt #coachBox .coach-body { flex: 1 1 auto; min-width: 0; max-height: calc(38vh - 12px); overflow-y: auto; }
html.pt #coachBox .coach-words, html.pt #coachBox .coach-words p { margin: 0; color: #2a2418; }
html.pt #coachBox > .coach-go { flex: none; min-height: 28px; padding: 0 14px; font-size: 14px; }

/* the end of a game keeps the end screen as it was: no band */
html.pt body:has(#ask.ask-over) #mat { display: block; position: static; height: auto; padding: 0; background: none; border: 0; }
html.pt body:has(#ask.ask-over) .card-tab { display: none; }

/* Step 5: motion. A thrown tile on its own over the page has a face and a back; the back turns away as the face turns in */
html.pt .pt-fly { transform-origin: 50% 50%; will-change: transform; }
html.pt .pt-fly .pt-fly-face { position: absolute; inset: 0; width: 100% !important; height: 100% !important; margin: 0; transform: scaleX(0); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.45); }
html.pt .pt-fly .pt-fly-back, html.pt .tile-fly.pt-back::after { content: ""; position: absolute; inset: 0; border-radius: 3.5px 3.5px 1.5px 1.5px;
  background: linear-gradient(180deg, #fffaf0 0, #fffaf0 0.6px, #f3ecdc 0.6px, #f3ecdc 3px, #d9cdb2 3px, #d9cdb2 4px, transparent 4px),
    var(--tile-back-art, none) center / cover no-repeat, linear-gradient(160deg, var(--tile-back, #2f5fa8), var(--tile-back-deep, #1d3f7a));
  box-shadow: inset -2px 0 0 #e6dcc3, inset -1px 0 0 #d9cdb2, inset 0 -1px 0 rgba(0, 0, 0, 0.28), 0 3px 6px rgba(0, 0, 0, 0.45); }
html.pt .pt-fly.pt-draw .pt-fly-back { border-radius: 2.5px 2.5px 1px 1px; }
@media (prefers-reduced-motion: reduce) { html.pt .pt-fly { display: none; } }


/* ---- 22 Nov fixes after Jeff's play on staging ------------------------------------------------------------------------- */

/* your rack: one row of 14 places across the foot of the screen, every tile readable; a strip along its top says who you are
   (wind letter, name) and whether it is your turn. The room this saves goes to the table above. */
html.pt .table .rack { padding: calc(22px) 4px calc(8px + var(--inset-b, 0px)); margin: 0; border-radius: 12px 12px 0 0; }
html.pt .table .rack #hand { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 0 2px; max-width: none; }
html.pt .table .rack #hand .tile { width: 100%; height: auto; aspect-ratio: 100 / 140; }
html.pt .table .rack .rack-row, html.pt .table .rack #rackMe, html.pt .table .rack #rackEast { display: none; }
html.pt .around .pt-me { position: absolute; left: calc(8px * var(--pt-u)); z-index: 2; display: flex; align-items: center; gap: 4px; padding: 3px 9px 3px 4px; border-radius: 999px; background: rgba(0, 0, 0, 0.5);
  color: #fff6e2; font: 800 calc(13px * var(--pt-u))/1 var(--g-font-body, system-ui); pointer-events: none; }
html.pt .around .pt-me .pt-wind { margin: 0; }
html.pt .rack .pt-mine { position: absolute; left: 50%; transform: translateX(-50%); top: 3px; white-space: nowrap; height: 17px; display: flex; align-items: center; padding: 0 10px; border-radius: 999px; color: #fff6e2; font: 800 13px/1 var(--g-font-body, system-ui); }
html.pt .rack .pt-mine:empty { display: none; }
html.pt .rack.pt-turn { outline: 3px solid #ffd34d; outline-offset: -1px; box-shadow: inset 0 2px 0 rgba(255, 226, 180, 0.55), 0 0 20px 6px rgba(255, 211, 77, 0.85), 0 -6px 18px rgba(0, 0, 0, 0.35); }
html.pt .rack.pt-turn .pt-mine { background: #ffd34d; color: #2a1a02; }
/* the status line lights on your turn */
html.pt[data-pt-turn="you"] body .table #mat #ask:not(.ask-over) .ask-card { background: linear-gradient(180deg, #ffe9a3, #f6c443); color: #2a1a02; border-color: #fff3c4; box-shadow: 0 0 0 2px #ffd34d, 0 0 16px 4px rgba(255, 211, 77, 0.85); }
html.pt[data-pt-turn="you"] #mat #ask .ask-card .ask-line { color: #2a1a02; }

/* whose turn, on the felt */
html.pt .pt-turn-pill { position: absolute; left: 50%; top: var(--pt-pill-top, 122px); transform: translateX(-50%); z-index: 3; padding: 4px 14px; border-radius: 999px; white-space: nowrap; pointer-events: none;
  font: 800 15px/1.2 var(--g-font-body, system-ui); background: rgba(8, 36, 26, 0.88); color: #ffe9a3; border: 2px solid #ffd34d; box-shadow: 0 0 12px 2px rgba(255, 211, 77, 0.6); }
html.pt .pt-turn-pill.mine { background: linear-gradient(180deg, #ffe9a3, #f6c443); color: #2a1a02; border-color: #fff3c4; font-size: 17px; box-shadow: 0 0 18px 6px rgba(255, 211, 77, 0.95); }
html.pt .pt-turn-pill[hidden] { display: none; }

/* the thrown tiles: loose, not stretched to fill */
html.pt #centre > .pool { justify-content: center; }

/* Change: the lines she can still make, closest first */
html.pt .go-shade { position: fixed; inset: 0; bottom: var(--pt-rack-h, 70px); z-index: 60; background: rgba(0, 0, 0, 0.5); opacity: 0; pointer-events: none; transition: opacity 0.1s ease-out; }
html.pt .go-shade.open { opacity: 1; pointer-events: auto; }
html.pt .go-change { position: fixed; left: 0; right: 0; bottom: var(--pt-rack-h, 70px); max-height: 66vh; z-index: 61; display: flex; flex-direction: column; background: #f8f1e0; color: #2a2418;
  border-radius: 16px 16px 0 0; box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.5); transform: translateY(104%); visibility: hidden; transition: transform 0.1s ease-out, visibility 0s linear 0.1s; }
html.pt .go-change.open { transform: none; visibility: visible; transition: transform 0.1s ease-out, visibility 0s; }
html.pt .go-head { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px 16px; }
html.pt .go-head b { flex: 1; font: 400 1.2rem/1.15 var(--g-font-display, inherit); }
html.pt .go-close, html.pt .more-close { min-height: 44px; min-width: 76px; padding: 0 16px; border-radius: 999px; border: 2px solid #3a2e1a; background: #fff; color: #2a2418; font: 800 16px/1 var(--g-font-body, system-ui); cursor: pointer; }
html.pt .go-sub { margin: 0; padding: 0 16px 8px; font-size: 0.95rem; color: #5a5040; }
html.pt .go-list { overflow-y: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 6px; }
html.pt .go-line { box-sizing: border-box; display: flex; flex-direction: column; gap: 2px; height: auto; min-height: 0; flex: none; padding: 8px 12px; text-align: left; border-radius: 12px; border: 1px solid #d8cba9; background: #fff; color: #2a2418; font: inherit; cursor: pointer; }
html.pt .go-line .go-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
html.pt .go-line b { font-size: 1.05rem; }
html.pt .go-line .go-away { font-weight: 800; background: #f6e7b0; border-radius: 999px; padding: 2px 10px; justify-self: end; }
html.pt .go-line .go-pts { font-size: 0.85rem; color: #6a5d44; }
html.pt .go-line .go-mark { align-self: flex-end; font-style: normal; font-size: 0.8rem; font-weight: 800; color: #7a4d08; }
html.pt .go-line.now { border: 2px solid #d68c12; background: #fff7dc; }

/* More: a Close at its top, the whole sheet scrolls under it */
html.pt .more-list.more-sheet { max-height: 88vh; overflow-y: auto; padding-top: 0; }
html.pt .more-list.more-sheet > .more-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 60px; padding: 8px 4px; margin: 0 0 4px;
  background: #174632; border: 0; box-shadow: 0 2px 0 rgba(255, 233, 163, 0.25); }
html.pt .more-head b { font: 400 1.4rem/1 var(--g-font-display, inherit); color: #ffe9a3; }
html.pt .more-list.more-sheet > .more-head .more-close { width: auto; min-height: 44px; background: #fff6e2; }

/* the name block sits at the top of its place, so its second line (where she sits, and her count) clears the wooden strip */
html.pt .around .seat-name { align-items: flex-start; }
html.pt .around .seat-who-btn { align-items: flex-start; height: calc(27px * var(--pt-u)); }
html.pt .around .seat-text { line-height: calc(12.5px * var(--pt-u)); padding-top: calc(1px * var(--pt-u)); }
html.pt .around .seat-face { margin-top: calc(3px * var(--pt-u)); }
html.pt .around .seat-sub .seat-count { line-height: calc(12.5px * var(--pt-u)); }

/* the first Charleston's gold cue on the tiles to choose from holds still: a ring that pulsed on thirteen tiles repainted the
   rack sixty times a second (on a test phone it cost 200 ms a frame, and the card could not slide in while it ran) */
html.pt #hand.pick-cue .tile:not(.selected):not([data-code="J"]) { animation: none; box-shadow: 0 0 0 3px rgba(224, 178, 58, 0.9); }
html.pt .around .seat-name { z-index: 3; }
html.pt .around .seat-name .seat-who, html.pt .around .pt-wind { vertical-align: top; }
/* the table is its own layer, so a card sliding over it does not repaint every row under it (on a test phone the slide went from 1.4 s to 0.4 s) */
html.pt .around { will-change: transform; }

/* Change: each row shows its line's tiles, held ones solid and needed ones pale */
html.pt .go-line .go-tiles { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 4px; min-height: 28px; }
html.pt .go-line .go-tiles .tile { --tile-base-w: 20px; --tile-base-h: 28px; --tile-scale: 1; --fit: 1; --tile-size: 1; width: 20px; height: 28px; border-radius: 3px; flex: none; margin: 0; position: relative; }
html.pt .go-line .go-tiles .need-tile { opacity: 0.4; }
html.pt .go-line .go-tiles .have-tile { opacity: 1; }

/* the first pass: the sentence, then the count under it on a line of its own */
html.pt #mat .ask-card .ask-line .ask-picked-line { display: block; margin-top: 2px; font-size: 14px; color: inherit; }
html.pt #mat .ask-card .ask-body .ask-picked, html.pt #mat .ask-card .ask-body .ask-goes { display: none; }
