/* Banna, GameHub's own colour-matching game. The table is 3-patti's
   (body.patti-mode): seats, the deck and the pile come from styles.css. These
   rules cover Banna's own cards, the seat count and tags, the colour to play,
   a hand that grows, the colour buttons for a wild card and the result.
   A card's colours are part of the game, so no theme repaints them. */
.banna-tile .game-tile-art{background:radial-gradient(ellipse at 32% 22%,#f1c96a4d,transparent 62%),linear-gradient(145deg,#3d3168,#1f4f5e 58%,#256b4c)}
.bn-tile-art{position:absolute;left:50%;top:50%;width:256px;height:160px;transform:translate(-50%,-50%)}
.bn-tile-card{position:absolute;display:block}
.bn-tile-art .playing-card{margin:0;width:88px;height:126px;box-shadow:0 8px 16px #00000033}
.bn-tile-card.one{left:20px;top:16px;transform:rotate(-14deg)}
.bn-tile-card.two{left:62px;top:6px;transform:rotate(-5deg)}
.bn-tile-card.three{left:104px;top:4px;transform:rotate(4deg)}
.bn-tile-card.four{left:148px;top:12px;transform:rotate(13deg)}
@media (max-width:580px){.bn-tile-art{transform:translate(-50%,-50%) scale(.9)}}
.bn-rules-card h2{font-size:1.5rem}
.bn-rule-pick{border:1px solid var(--line);border-radius:12px;padding:10px 12px 6px;margin:0;display:grid;gap:4px}
.bn-rule-pick legend{font-size:.78rem;font-weight:650;padding:0 4px}
.bn-rule-pick .option-row{display:flex;gap:10px;align-items:flex-start;padding:6px 2px;cursor:pointer}
.bn-rule-pick .option-row input{margin-top:4px}
.bn-rule-pick .option-row strong{display:block;font-size:.86rem}
.bn-rule-pick .option-row small{display:block;color:var(--muted);font-size:.74rem;line-height:1.45}

/* The cards: a solid colour, red, yellow, green or blue (owner request,
   2026-11-23), with the number or symbol at the top corner and the colour's
   shape under it. Yellow carries dark lettering, the others white. A wild
   card is paper with the four shapes. */
.bn-R,.bn-named-R{--bn-fill:#c8312b;--bn-on:#fff}
.bn-Y,.bn-named-Y{--bn-fill:#f2b90f;--bn-on:#33260a}
.bn-G,.bn-named-G{--bn-fill:#0e7d53;--bn-on:#fff}
.bn-B,.bn-named-B{--bn-fill:#2f55c4;--bn-on:#fff}
.playing-card.simple-card.bn-card{font-family:ui-rounded,"SF Pro Rounded","Arial Rounded MT Bold","Trebuchet MS",system-ui,sans-serif;color:var(--bn-on,#fff);background-color:var(--bn-fill);background-image:linear-gradient(160deg,#ffffff2b,#ffffff00 46%,#00000021);border-color:#ffffff73}
.playing-card.simple-card.bn-card.bn-W{color:#3a3340;background-color:#fffcf3;background-image:none;border-color:#d9d2bd}
/* A wild card on the pile carries a band in the colour that was named. */
.playing-card.simple-card.bn-card.bn-W.bn-named{background-image:linear-gradient(to top,var(--bn-fill) 26%,transparent 26%)}
.bn-card .card-value{font-weight:800;letter-spacing:-.04em}
.bn-shape,.bn-icon,.bn-pips{display:block;width:1em;height:1em;flex:0 0 auto}
.bn-shape{fill:currentColor}
.bn-card .card-suit .bn-shape{width:.78em;height:.78em;opacity:.94}
/* Skip, Reverse, the draw cards and the wild cards have their name written
   on them (owner request, 2026-11-23): across the foot of a card that shows
   whole, and down the edge of a card in the hand, where only a strip of it
   shows. Cards too small to read it (a result's leftovers, the cards under
   the top of the pile) keep the symbol alone. */
.bn-label{display:block;align-self:stretch;margin:auto 0 9%;text-align:center;font-family:system-ui,sans-serif;font-size:19cqw;font-weight:800;line-height:1;letter-spacing:.01em;white-space:nowrap}
.bn-card.bn-W.bn-named .bn-label{color:var(--bn-on)}
.stack-layer:not(:last-child) .bn-label,.bn-card.small-card .bn-label{display:none}

/* Seats: the card fan with the count, and a tag for what just happened. */
.bn-seats .seat-hand{display:flex;align-items:flex-end;justify-content:center;gap:5px}
.bn-count{font-size:.68rem;font-weight:800;line-height:1;padding:2px 5px;border-radius:8px;background:#003f5866;color:#fff4cf;font-variant-numeric:tabular-nums}
.bn-tag{position:absolute;left:50%;bottom:-6px;transform:translateX(-50%);z-index:3;padding:2px 7px;border-radius:9px;font-size:.6rem;font-weight:800;line-height:1.25;white-space:nowrap;pointer-events:none;box-shadow:0 2px 5px #0b221a40}
.bn-tag-skip{background:#ece7d6;color:#41443a}
.bn-tag-drew{background:#f6d6d2;color:#7a2320}
.audience-board .bn-tag{font-size:.78rem;padding:3px 9px}
.audience-board .bn-count{font-size:.85rem}

/* A player who gets down to one card: their face says Banna (owner request,
   2026-11-23). A speech bubble under the head, its tail pointing up at it,
   shown for about two seconds and then removed; the head's own bounce is the
   motion. */
.bn-say{position:relative;flex:0 0 auto;align-self:center;padding:2px 7px;border-radius:9px;background:#fffdf5;color:#23403b;font-size:.64rem;font-weight:800;line-height:1.25;white-space:nowrap;box-shadow:0 2px 5px #0b221a40}
.bn-say::before{content:"";position:absolute;left:7px;bottom:100%;border:5px solid transparent;border-top:0;border-bottom-color:#fffdf5}
.bn-seats .seat-hand.bn-say-start{justify-content:flex-start}
.bn-seats .seat-hand.bn-say-end{justify-content:flex-end}
.audience-board .bn-say{font-size:.85rem;padding:3px 10px}

/* The middle: the deck, the pile, which way play goes and the colour to play. */
.bn-deck{position:relative;width:var(--pile-width);height:calc(var(--pile-height) + 12px);padding-top:4px}
.bn-deck .playing-card{box-shadow:2px 2px 0 #fffdf2,3px 3px 0 #b5ba9f,5px 5px 0 #fffdf2,6px 6px 0 #b5ba9f,0 8px 15px #071e2259}
.bn-deck .pile-pickup.bn-quiet>.playing-card{outline:0;box-shadow:2px 2px 0 #fffdf2,3px 3px 0 #b5ba9f,5px 5px 0 #fffdf2,6px 6px 0 #b5ba9f,0 8px 15px #071e2259}
.table-orbit .physical-piles.bn-piles .pile-caption{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:4px;min-height:24px}
/* The colour to play is a pill in that colour with a paper ring, so it stands
   out on any felt. */
.bn-piles .pile-caption .bn-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 9px;border-radius:999px;background:var(--bn-fill,#fffdf5);color:var(--bn-on,#243d36);box-shadow:0 0 0 2px #fffdf5;font-size:.76rem;font-weight:800;line-height:1.2;white-space:nowrap}
.bn-piles .pile-caption .bn-chip .bn-shape{width:.95em;height:.95em}
.bn-piles .pile-caption .bn-chip.bn-direction{font-size:1rem;line-height:1;padding:2px 8px 3px}
.bn-piles .pile-caption .bn-chip.bn-owed{background:#ffe074;color:#3b2f10}
.audience-board .bn-piles .pile-caption .bn-chip{font-size:1rem;padding:5px 13px}
.audience-board .bn-piles .pile-caption .bn-chip.bn-direction{font-size:1.4rem}
.bn-round-note{position:absolute;left:14px;bottom:10px;margin:0;font-size:.7rem;color:#e7f6ee;opacity:.85;pointer-events:none}
.in-game .bn-round-note{left:10px;bottom:6px;font-size:.62rem}
.bn-rule-mark{display:inline-flex;align-items:center;gap:4px;padding:1px 8px;border-radius:999px;font-weight:800;background:var(--bn-fill);color:var(--bn-on);white-space:nowrap}
.bn-rule-mark .bn-shape{width:.9em;height:.9em}

/* A hand that grows: each button is the exposed strip of its card, narrower
   as the row fills, scrolling once even that no longer fits. On your turn
   the cards you can play are lifted and the others are dimmed. */
.bn-hand .hand-cards{container-type:inline-size;overflow-x:auto;overflow-y:visible;scrollbar-width:thin}
.bn-hand .hand-fan,body.patti-mode.in-game .bn-hand .hand-fan{width:max-content;min-width:100%;margin:0 auto;justify-content:safe center}
.bn-hand.hand-area .hand-fan{--step:max(calc(var(--hand-card-width) * .32),min(calc(var(--hand-card-width) * .62),calc((100cqw - var(--hand-card-width) - 24px) / max(1, var(--n) - 1))))}
.bn-hand.hand-area .hand-fan .card-button{--fan-angle:0deg;--fan-offset:0px;width:var(--step);min-width:var(--step);flex:0 0 var(--step)}
.bn-hand.hand-area .hand-fan .card-button:last-child{width:var(--hand-card-width);min-width:var(--hand-card-width);flex-basis:var(--hand-card-width)}
.bn-hand .hand-fan .simple-card .card-value{font-size:min(34cqw,calc(var(--step) * .8));margin-left:7%}
.bn-hand .hand-fan .simple-card .card-suit{font-size:min(30cqw,calc(var(--step) * .7));margin-left:7%}
/* A card with its name written on it: a smaller symbol and shape leave room
   for the name down the edge. */
.bn-hand .hand-fan .simple-card.bn-action .card-value{font-size:min(27cqw,calc(var(--step) * .7))}
.bn-hand .hand-fan .simple-card.bn-action .card-suit{font-size:min(22cqw,calc(var(--step) * .58))}
.bn-hand .hand-fan .bn-label{writing-mode:vertical-rl;align-self:flex-start;margin:5% 0 0 8%;text-align:left;font-size:16.5cqw}
.bn-hand .card-button.bn-playable{transform:translateY(-9px)}
.bn-hand .card-button.selected{transform:translateY(-22px)}
.bn-hand .hand-fan .selection-check{top:-13px}
.bn-hand .card-button.bn-unplayable .playing-card{filter:brightness(.86) saturate(.72)}
/* Cards just picked up keep a still paper and gold edge until you next play
   (paper inside, so it shows on a yellow card too). */
.bn-hand .card-button.bn-fresh .playing-card{box-shadow:inset 0 5px 0 #fffdf5,0 0 0 2px #fffdf5,0 0 0 4px #e0a62c}
.bn-hand .card-button.bn-arriving{visibility:hidden}
body.patti-mode.in-game .bn-hand .hand-cards{overflow-x:auto;overflow-y:hidden;padding-top:22px;margin-top:-22px}
/* A phone holds seven or more cards across, so Banna's cards are narrower
   than 3-patti's three; the table takes the height they leave. */
@media (max-width:580px) and (orientation:portrait){body.patti-mode.banna-mode.in-game{--patti-card:clamp(62px,calc(10.5dvh - 4px),80px)}}
@media (max-width:580px) and (orientation:portrait) and (max-height:620px){body.patti-mode.banna-mode.in-game{--patti-card:clamp(56px,calc(10dvh - 4px),70px)}}
/* A landscape phone's hand sits in a narrow column beside the table. */
@media (orientation:landscape) and (min-width:568px) and (max-height:650px){body.patti-mode.banna-mode.in-game .bn-hand .hand-cards{--hand-card-width:68px;--hand-card-height:calc(68px * 1.4)}}
@media (prefers-reduced-motion:reduce){.bn-hand .card-button.selected{transform:translateY(-12px)}.bn-hand .card-button.bn-playable{transform:translateY(-5px)}}

/* The action tray: one button, two, or the four colours for a wild card. */
.bn-controls .primary-moves.bn-single{grid-template-columns:minmax(0,1fr)}
.bn-colors{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
.bn-controls .primary-moves .btn.bn-color,.in-game .hand-area .bn-controls .btn.bn-color{display:grid;justify-items:center;align-content:center;gap:3px;min-width:0;padding:6px 2px;border:0;color:var(--bn-on);background:var(--bn-fill);font-size:.7rem;font-weight:800;line-height:1.1}
.bn-color .bn-shape{width:18px;height:18px}

/* Card flights and a played card waiting to land. */
.bn-flight{position:absolute;left:0;top:0;will-change:transform,opacity}
.bn-flight .playing-card{width:100%;height:100%;margin:0}
.bn-in-flight{visibility:hidden}

/* A round's result: each player's leftover cards with what they cost. */
.bn-result .revealed-cards.bn-leftover{display:flex;flex-wrap:wrap;gap:5px 0;padding:3px 2px 8px 18px;margin:6px 0 4px}
.bn-result .bn-leftover .playing-card,.patti-result.bn-result .result-hand .bn-leftover .small-card+.small-card{margin:0 0 0 -16px}
.bn-order{list-style:none;margin:0 0 14px;padding:0;display:grid;gap:6px}
.bn-order li{display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid #d7decf;border-radius:12px;background:#ffffff9a}
.bn-order li.bn-first{border:2px solid #e0b75a;background:#fdf6e3}
.bn-order-place{min-width:38px;font-weight:800;color:#8a6a2e}
.bn-order-face .gh-face{--face:34px}
.bn-order-name{font-weight:700;font-size:1rem}
.bn-order small{margin-left:auto;color:var(--muted);text-align:right}
.audience-board .bn-order-name{font-size:1.3rem}
.bn-round-list{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.bn-round-list li{display:grid;gap:2px;padding:8px 10px;border:1px solid var(--line);border-radius:10px}
.bn-round-list small{color:var(--muted)}
