/* Ultimate Teenpatti. The table is the 3-patti table (body.patti-mode) and
   reuses Poker's chip, bet, seat status and places styles (poker.css); these
   rules add the pot, the Seen badge, the bet amount choice and the result. */
.teenpatti-tile .game-tile-art{background:radial-gradient(ellipse at 45% 22%,#47c8c0a8,transparent 64%),linear-gradient(145deg,#1a9b9d,#167481 62%,#3b4f6e)}
.tp-tile-art{position:absolute;left:50%;top:50%;width:250px;height:160px;transform:translate(-50%,-50%)}
.tp-tile-art .playing-card{position:absolute;margin:0;width:92px;height:132px;box-shadow:0 8px 16px #00000026}
.tp-tile-card.one{left:42px;top:10px;transform:rotate(-12deg)}
.tp-tile-card.two{left:80px;top:2px;transform:rotate(-1deg)}
.tp-tile-card.three{left:118px;top:8px;transform:rotate(11deg)}
.tp-tile-chips{position:absolute;right:2px;bottom:4px;display:flex;flex-direction:column-reverse}
.tp-tile-chips i{display:block;width:44px;height:12px;margin-top:-6px;border-radius:50%;background:#d0493b;border:2px dashed #fff3d6;box-shadow:0 2px 0 #7c241c}
.tp-tile-chips i:nth-child(even){background:#e3b341;box-shadow:0 2px 0 #8a6416}
@media (max-width:580px){.tp-tile-art{transform:translate(-50%,-50%) scale(.9)}}

/* Table options: two short selects side by side. */
.tp-field-pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.tp-options .field{margin-top:10px}

/* The deck alone when no joker sits under it. */
.tp-no-joker .draw-joker-stack,.table-orbit .physical-piles.tp-no-joker .draw-joker-stack,.in-game .table-orbit .physical-piles.tp-no-joker .draw-joker-stack{width:calc(var(--pile-width) + 10px)}
.tp-no-joker .draw-layer{left:0}

/* The pot sits where 3-patti has its playing stack, the size of a pile card. */
.tp-pot{position:relative;display:grid;place-items:center;align-content:center;gap:4px;width:calc(var(--pile-width) + 8px);height:var(--pile-height);border-radius:12px;border:1.5px dashed #d2ebd57a;background:#c5f0db15;color:#fff4cf}
.tp-pot-stack{display:flex;flex-direction:column-reverse;align-items:center}
.tp-pot-stack i{display:block;width:calc(var(--pile-width) * .5);height:calc(var(--pile-width) * .13);margin-top:calc(var(--pile-width) * -.065);border-radius:50%;background:#d0493b;border:2px dashed #fff3d6;box-shadow:0 2px 0 #7c241c;box-sizing:border-box}
.tp-pot-stack i:nth-child(3n+2){background:#e3b341;box-shadow:0 2px 0 #8a6416}
.tp-pot-stack i:nth-child(3n){background:#2f6f78;box-shadow:0 2px 0 #18434a}
.tp-pot-amount{font-size:calc(var(--pile-width) * .2);font-weight:800;font-variant-numeric:tabular-nums;line-height:1;text-shadow:0 1px 3px #002c26}
.tp-limit{display:block}
.audience-board .tp-pot-amount{font-size:calc(var(--pile-width) * .18)}

/* Seats: the 3-patti seat, with chips; Seen is stamped across the mini
   card fan so it never widens the seat or covers the name. */
.tp-fan{position:relative;display:inline-flex}
.tp-seen-badge{position:absolute;left:50%;bottom:-4px;transform:translateX(-50%);z-index:4;padding:0 4px;border-radius:7px;background:#ffe788;color:#214644;font-size:.52rem;font-weight:850;letter-spacing:.04em;text-transform:uppercase;line-height:1.4;box-shadow:0 1px 3px #00283055;pointer-events:none}
.tp-bet-blind,.tp-bet-boot{background:#d9e4cf}
.tp-bet-chaal{background:#f3cf7b}
.tp-bet-sideshow,.tp-bet-force,.tp-bet-show{background:#c9e2f2}
.tp-bet-all-in{background:#e9b85d}

/* Your cards. The title row keeps one height whether or not See cards, Hide
   all or Sideshow shows beside it, so the cards never move when those come
   and go (one height per layout, matching that layout's button). */
body.teenpatti-mode.in-game .tp-hand .hand-title{min-height:40px}
@media (max-width:580px){body.patti-mode.teenpatti-mode.in-game .tp-hand .hand-title{min-height:35px}}
@media (orientation:landscape) and (min-width:568px) and (max-height:650px){body.patti-mode.teenpatti-mode.in-game .tp-hand .hand-title{min-height:44px}}
.tp-controls .move-prompt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* On a wide screen the buttons sit under the hand, and your turn's gold
   outline made the bar taller, so the page jumped after every bet. The bar
   keeps the outline's size all the time; only its colour changes. */
@media (min-width:581px) and (min-height:651px){
  body.teenpatti-mode.in-game .game-container .tp-controls{padding:13px;border:2px solid transparent;border-radius:15px}
  body.teenpatti-mode.in-game.turn-pulse .game-container .tp-controls.my-move{border-color:#d9b856}
}
.tp-hand .card-button.tp-card{pointer-events:none}
.tp-hand .card-button.tp-packed-card .playing-card,.tp-hand .card-button.tp-unused .playing-card{filter:saturate(.45) brightness(.92)}
.tp-hand .hand-fan .face-down-hand.tp-waiting{cursor:default}
.tp-hand .hand-fan .face-down-hand.tp-waiting:hover{transform:translateY(var(--fan-offset)) rotate(var(--fan-angle))}

/* The button row: Pack, then Show or Sideshow when open, the 2× toggle, and the bet. */
.primary-moves.tp-moves.has-double{grid-template-columns:minmax(64px,.6fr) 56px minmax(0,1.4fr)}
.primary-moves.tp-moves.has-extra{grid-template-columns:minmax(64px,.6fr) minmax(76px,.8fr) minmax(0,1.3fr)}
.primary-moves.tp-moves.has-extra.has-double{grid-template-columns:minmax(58px,.55fr) minmax(72px,.75fr) 50px minmax(0,1.3fr)}
.tp-moves .btn{white-space:nowrap}
/* Choosing whom to ask for a sideshow: one row that scrolls sideways. */
.primary-moves.tp-pick{display:flex;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
.tp-pick .btn{flex:0 0 auto;white-space:nowrap;min-width:72px}
.tp-moves .tp-double{padding-left:4px;padding-right:4px;font-weight:800}
.tp-moves .tp-double.selected,.tp-moves .tp-double.selected:hover:not(:disabled){background:#234436;color:#fff8e6;border-color:#234436}
@media (max-width:580px){
  .primary-moves.tp-moves:is(.has-extra,.has-double){gap:6px}
  .primary-moves.tp-moves:is(.has-extra,.has-double) .btn{padding-left:7px;padding-right:7px;font-size:.86rem}
}

/* The hand result, laid out as a 3-patti Show result. */
.tp-result .result-card-scores .tp-hand-name{font-size:.86rem!important;line-height:1.25;overflow-wrap:anywhere}
.tp-result .round-points.tp-up{color:#1d6b3c}
.tp-result .round-points.tp-down{color:#a3392f}
.tp-result .tp-own .playing-card{opacity:.72}
.tp-result .revealed-cards .playing-card.tp-unused{filter:saturate(.45) brightness(.92)}
.tp-result .pk-order{margin:6px 0 4px}
.tp-result .show-label+.show-label{margin-left:6px}

/* On a portrait phone the 3-patti layout sizes the table around a fixed
   bottom bar; this bar can carry the bet choice as well, so use its measured
   height (--move-bar, set by app.js) when it is taller. */
@media (max-width:580px) and (orientation:portrait) {
  body.patti-mode.teenpatti-mode.in-game{--patti-bar:max(96px,var(--move-bar,96px))}
}
@media (max-width:580px) and (orientation:portrait) and (max-height:620px) {
  body.patti-mode.teenpatti-mode.in-game{--patti-bar:max(90px,var(--move-bar,90px))}
}

/* A sideshow you took part in: the other player's cards at a readable size,
   over the middle of the table (in front of the deck and pot) until closed. */
.tp-peek-panel{--peek-w:clamp(60px,17vw,96px);position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:6;display:grid;justify-items:center;gap:6px;padding:10px 14px 12px;max-width:calc(100% - 16px);border-radius:16px;background:#fffdf2f5;border:1px solid #e3d59e;box-shadow:0 12px 30px #00283066;color:#214644}
.tp-peek-title{margin:0 26px 0;font-size:.7rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:#52614e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.tp-peek-cards{display:flex;justify-content:center}
.tp-peek-cards .playing-card{width:var(--peek-w);height:calc(var(--peek-w) * 1.43);margin:0;border-radius:calc(var(--peek-w) * .13);box-shadow:0 4px 12px #0b221a38}
.tp-peek-cards .playing-card+.playing-card{margin-left:calc(var(--peek-w) * -.1)}
.tp-peek-name{margin:0;font-size:.86rem;line-height:1.3;text-align:center}
.tp-peek-close{position:absolute;top:2px;right:2px;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:12px;background:none;color:#52614e;font-size:1.35rem;line-height:1}
.tp-peek-close:hover{background:#ece9d6}
.tp-peek-open{margin-right:4px}
.audience-board .tp-peek-panel{display:none}
@media (orientation:landscape) and (max-height:500px){.tp-peek-panel{--peek-w:clamp(54px,11vh,80px);padding:6px 12px 8px;gap:4px}}
.motion-reveal-label.tp-reveal-outcome{background:#214644;color:#fff8e6}

/* The turn pill stays centred and clear of the Hand ranks toggle; a long
   name ends in an ellipsis rather than running under it. */
.tp-surface .turn-indicator{max-width:calc(100% - 196px);min-width:0}
.tp-turn-text{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* Hand ranks: the toggle and panel styles are shared, in styles.css. */
.audience-board .tp-rank-cards{--mini-w:28px}
