/* The end of a game (3 Dec 2026; gameover.js; Jeff's mock-ups of 3 Dec). One centered column over the table's middle: the result and the
   hand's tiles (or the falling wall), the coins with the shop icon, her league place or the guest's sign-up, Kora's line and the report
   card button, the thumbs, Deal again. The X leaves a small Deal again bar over the finished table. Loaded after the table's own sheets,
   so the rules for #ask.ask-over (style.css, bigtable.css, phonetable.css) that placed and filled the old end box give way here to
   #ask.go2, which the table sets only for a game that ends on this panel. */

/* ---- the box the panel stands in: the table's own area, nothing else drawn in it ---- */
html body #ask.ask-over.go2, html.bt body #ask.ask-over.go2, html.pt body #ask.ask-over.go2 {
  position: fixed; left: var(--go-l, 0); top: var(--go-t, 0); width: var(--go-w, 100vw); height: var(--go-h, 100vh); max-width: none; max-height: none;
  margin: 0; padding: 0; transform: none; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  background: none; border: 0; box-shadow: none; border-radius: 0; overflow: visible; pointer-events: none; z-index: 60; gap: 0;
  grid-template-columns: none; text-align: center;
}
html body #ask.ask-over.go2 > .ask-line, html body #ask.ask-over.go2 > .ask-go, html body #ask.ask-over.go2 .ask-go:empty { display: none !important; }
html body #ask.ask-over.go2 > .ask-body { display: flex; justify-content: center; align-items: center; width: 100%; max-height: 100%; min-width: 0; margin: 0; padding: 0; }
html body #ask.ask-over.go2 > .ask-body > .go { pointer-events: none; display: flex; justify-content: center; align-items: center; width: 100%; max-height: 100%; }
html body #ask.ask-over.go2.ask-hold { visibility: hidden; }
html body:has(#ask.ask-over.go2) .rack, html body:has(#ask.ask-over.go2) #rackRow { visibility: hidden; }
/* the X: the panel goes, the finished table and the rack show, a small Deal again bar stays */
html body:has(#ask.ask-over.go2.go-shut) .rack, html body:has(#ask.ask-over.go2.go-shut) #rackRow { visibility: visible; }

/* ---- the panel ---- */
.go { color: var(--g-cream, #fff6e2); font-family: var(--g-font-body, "Atkinson Hyperlegible", system-ui, sans-serif); line-height: 1.35; text-align: center; }
.go *, .go *::before, .go *::after { box-sizing: border-box; }
.go-panel { --tile-size: 1; --fit: 1; position: relative; pointer-events: auto; width: min(100%, 500px); max-height: 100%; overflow-y: auto; overflow-x: hidden;
  padding: 30px 28px 26px; display: flex; flex-direction: column; align-items: center; gap: 14px;
  background: linear-gradient(180deg, #123a28 0%, #0b2619 100%); border: 2px solid rgba(246, 196, 67, 0.9); border-radius: 20px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 22px 56px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 233, 163, 0.18); }
.go-win .go-panel { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 22px 56px rgba(0, 0, 0, 0.6), 0 0 44px rgba(246, 196, 67, 0.28), inset 0 1px 0 rgba(255, 233, 163, 0.25); }
.go.go-closed .go-panel { display: none; }
.go-bar { display: none; position: fixed; left: calc(var(--go-l, 0px) + var(--go-w, 100vw) / 2); top: var(--go-bar-top, auto); bottom: auto; transform: translateX(-50%); z-index: 70; pointer-events: auto; }
.go.go-closed .go-bar { display: block; }
.go-bar .g-btn { font-size: 1.1rem; padding: 0.6em 1.6em; min-height: 48px; }

.go-ibtn { position: absolute; top: 10px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgba(255, 246, 226, 0.08); border: 1px solid var(--g-line, rgba(255, 233, 163, 0.35)); color: var(--g-cream, #fff6e2); }
.go-ibtn:hover { filter: brightness(1.2); }
.go-ibtn svg { width: 24px; height: 24px; }
.go-home { left: 10px; } .go-x { right: 10px; }

.go-head { margin: 0; padding: 0 34px; font-family: var(--g-font-display, "Lilita One", system-ui, sans-serif); font-weight: 400; font-size: 40px; line-height: 1.08;
  color: var(--g-gold-1, #ffe9a3); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.go-wall .go-head { font-size: 32px; }
.go-sub { margin: -8px 0 0; font-size: 17px; color: rgba(255, 246, 226, 0.88); }

/* the tiles, in the card line's own order and grouping, one row */
.go-hand { display: flex; justify-content: center; max-width: 100%; padding: 8px 10px 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.24); }
.go-hand .over-hand { display: flex; flex-wrap: nowrap; justify-content: center; align-items: flex-end; gap: 0 9px; margin: 0; }
.go-hand .over-set { display: flex; gap: 1px; padding: 0; background: none; border-radius: 0; }
.go-hand .over-set .tile { --tile-scale: 0.44; flex: none; }
.go-hand.go-small .over-set .tile { --tile-scale: 0.36; }
.go-win .go-hand .over-set .tile { box-shadow: 0 0 0 1.5px #ffd34d, 0 2px 0 #d4c7a8; }
.go-hand .over-set .tile.winning { box-shadow: 0 0 0 2px #ffd34d, 0 0 12px 2px rgba(255, 211, 77, 0.7); transform: translateY(-3px); }

/* the wall of our own tile backs, toppling into a pile once */
.go-pile { position: relative; width: 360px; max-width: 100%; height: 118px; border-radius: 12px; background: rgba(0, 0, 0, 0.24); overflow: hidden; }
.go-wt { --tile-scale: 0.5; --tile-size: 1; --fit: 1; position: absolute; left: 0; bottom: 0; transform-origin: 50% 100%; display: block;
  transform: translate(var(--x0), calc(var(--y0) * -1)) rotate(0deg); }
.go-pile .go-wt.tile { background: var(--tile-back-art, none) center / cover no-repeat, linear-gradient(160deg, var(--tile-back, #2f5fa8), var(--tile-back-deep, #1d3f7a));
  border: 1px solid rgba(0, 0, 0, 0.45); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.22); }
.go-pile.fallen .go-wt { transform: translate(var(--x1), calc(var(--y1) * -1)) rotate(var(--a1)); transition: transform 0.9s cubic-bezier(0.5, 0, 0.9, 0.6) var(--d); }
.go-pile.still .go-wt { transition: none; }

/* the coins */
.go-coins { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.go-gain { display: inline-flex; align-items: center; gap: 8px; font-family: var(--g-font-display, "Lilita One", system-ui, sans-serif); font-size: 30px; line-height: 1; color: var(--g-gold-1, #ffe9a3); }
.go-gain b { font-weight: 400; }
.go-gain-w.go-none { font-size: 22px; }
.go-coin, .go-fly { display: inline-block; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1b0, #f6c443 50%, #c27d0c 100%);
  box-shadow: inset 0 0 0 3px rgba(154, 95, 7, 0.55), 0 2px 3px rgba(0, 0, 0, 0.45); }
.go-coin { width: 30px; height: 30px; }
.go-fly { position: fixed; z-index: 2000; width: 22px; height: 22px; pointer-events: none; }
.go-shopbtn { margin-left: 6px; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; text-decoration: none;
  background: linear-gradient(180deg, var(--g-green-1, #2f7a52), var(--g-green-3, #1f5a3b)); border: 1px solid var(--g-line, rgba(255, 233, 163, 0.35)); color: var(--g-gold-1, #ffe9a3);
  box-shadow: 0 3px 0 var(--g-green-ledge, #0f3d27); }
.go-shopbtn svg { width: 20px; height: 20px; }
.go-shopbtn.glow { box-shadow: 0 3px 0 var(--g-green-ledge, #0f3d27), 0 0 0 2px var(--g-gold-2, #f6c443), 0 0 14px rgba(246, 196, 67, 0.6); }
.go-buy { margin: 0; font-size: 16px; color: var(--g-cream, #fff6e2); }
.go-buy[hidden] { display: none; }
.go-buy b { color: var(--g-gold-1, #ffe9a3); }

/* league place, or the guest's sign-up */
.go-league { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 8px 16px; border-radius: 999px; font-size: 18px; font-weight: 700; text-decoration: none;
  color: var(--g-cream, #fff6e2); background: rgba(0, 0, 0, 0.25); border: 1px solid rgba(255, 233, 163, 0.2); }
.go-league u { color: var(--g-gold-1, #ffe9a3); text-underline-offset: 3px; }
.go-guest { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.go-guest p { margin: 0; font-size: 18px; font-weight: 700; }

/* Kora */
.go-kora { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding: 12px 14px; border-radius: 16px; text-align: center;
  background: rgba(0, 0, 0, 0.26); border: 1px solid rgba(255, 233, 163, 0.18); }
.go-face { width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden; border: 2px solid var(--g-gold-2, #f6c443); background: #1d4a37; }
.go-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; display: block; }
.go-who { font-family: var(--g-font-display, "Lilita One", system-ui, sans-serif); font-size: 15px; color: var(--g-gold-2, #f6c443); letter-spacing: 0.04em; text-transform: uppercase; }
.go-kline { margin: 0; font-size: 17px; line-height: 1.35; }
.go-kline[hidden] { display: none; }

/* buttons: the theme's glossy gold (g-btn) and green (g-btn-green), sized here */
.go .g-btn-green.go-report { font-size: 1rem; min-height: 44px; margin-top: 2px; }
.go .go-sm { font-size: 1rem; padding: 0.65em 1.2em; min-height: 44px; }
.go .go-deal { font-size: 1.35rem; padding: 0.7em 2em; min-height: 56px; }
.go-dealrow { margin-top: 2px; }
.go-practice { margin: 4px 0; font-size: 18px; }

/* "How was that game?": the question and two thumbs on one line */
.go-rate { min-height: 0; }
.go-rate .game-feedback { background: none; border: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 10px; margin: 0; }
.go-rate .fb-q { margin: 0; font-size: 17px; color: rgba(255, 246, 226, 0.88); }
.go-rate .fb-thumbs { display: flex; gap: 10px; }
.go-rate .fb-thumb { width: 48px; height: 48px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: rgba(255, 246, 226, 0.08); border: 1px solid var(--g-line, rgba(255, 233, 163, 0.35)); color: var(--g-cream, #fff6e2); }
.go-rate .fb-thumb[aria-pressed="true"] { background: rgba(246, 196, 67, 0.28); border-color: #f6c443; }
.go-rate .fb-thumb svg { width: 24px; height: 24px; }
.go-rate .fb-line { display: flex; gap: 8px; width: 100%; }
.go-rate .fb-line[hidden], .go-rate .fb-thanks[hidden] { display: none; }
.go-rate .fb-line input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--g-line, rgba(255, 233, 163, 0.35)); background: rgba(0, 0, 0, 0.3); color: inherit; font: inherit; }
.go-rate .fb-send { min-height: 44px; padding: 0 16px; border-radius: 10px; cursor: pointer; }
.go-rate .fb-thanks { flex-basis: 100%; margin: 0; font-size: 15px; color: rgba(255, 246, 226, 0.88); }
.go-extra .over-first { margin-top: 8px; font-size: 15px; color: rgba(255, 246, 226, 0.88); }
.go-extra .over-first a { color: var(--g-gold-1, #ffe9a3); min-height: 44px; display: inline-flex; align-items: center; padding: 0 8px; }

/* a phone (under 700 px wide) */
@media (max-width: 700px) {
  .go-panel { padding: 26px 16px 18px; gap: 12px; width: 100%; }
  .go-head { font-size: 32px; padding: 0 30px; }
  .go-wall .go-head { font-size: 26px; }
  .go-gain { font-size: 26px; }
  .go-hand { padding: 6px 6px 8px; }
  .go-hand .over-hand { gap: 0 6px; }
  .go-hand .over-set .tile { --tile-scale: 0.3; }
  .go-hand.go-small .over-set .tile { --tile-scale: 0.27; }
  .go-pile { zoom: 0.88; }
}
/* a laptop (under 800 px high): a little tighter so the whole column stands in the table's area */
@media (max-height: 800px) and (min-width: 701px) {
  .go-panel { padding: 22px 24px 18px; gap: 10px; }
  .go-head { font-size: 34px; }
  .go-wall .go-head { font-size: 28px; }
}
@media (max-height: 800px) and (min-width: 701px) {
  .go-panel { padding: 16px 24px 14px; gap: 7px; }
  .go-head { font-size: 30px; }
  .go-wall .go-head { font-size: 25px; }
  .go-sub { margin-top: -4px; font-size: 15px; }
  .go-kora { padding: 8px 12px; gap: 3px; }
  .go-face { width: 44px; height: 44px; }
  .go-kline { font-size: 15px; line-height: 1.3; }
  .go-gain { font-size: 26px; }
  .go-guest { gap: 6px; }
  .go-guest p { font-size: 16px; }
  .go-pile { zoom: 0.78; }
  #ask .go .g-btn.go-deal { min-height: 46px; }
  #ask .go .go-ibtn { top: 8px; }
}
@media (prefers-reduced-motion: reduce) { .go-pile.fallen .go-wt { transition: none; } }

/* the table's own rule `.table button:not(...)` paints every button green; the id wins it back for the panel's own buttons */
#ask .go .g-btn { color: var(--g-gold-ink); border: 0; border-radius: 16px; min-height: 0;
  background: linear-gradient(180deg, var(--g-gold-1) 0%, var(--g-gold-2) 48%, var(--g-gold-3) 100%);
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(120, 70, 0, 0.3), 0 5px 0 var(--g-gold-ledge), 0 10px 18px rgba(0, 0, 0, 0.35); }
#ask .go .g-btn.go-sm, #ask .go .g-btn-green.go-report { min-height: 44px; }
#ask .go .g-btn.go-deal { min-height: 56px; } #ask .go .go-bar .g-btn { min-height: 48px; }
#ask .go .go-ibtn, #ask .go .fb-thumb { background: rgba(255, 246, 226, 0.08); border: 1px solid var(--g-line, rgba(255, 233, 163, 0.35)); color: var(--g-cream, #fff6e2); box-shadow: none; }
#ask .go .go-ibtn { padding: 0; min-height: 44px; }
#ask .go .fb-thumb[aria-pressed="true"] { background: rgba(246, 196, 67, 0.28); border-color: #f6c443; }

/* nothing in the panel squeezes; a tall panel scrolls instead, and a long head keeps clear of the home and X buttons */
.go-panel > * { flex-shrink: 0; }
.go-panel .go-head { padding-inline: 52px; }
.go-panel .ask-first, .go-panel .first-game { width: 100%; box-sizing: border-box; }
/* the heading keeps clear of the home and X buttons (44 px wide, 10 px in) whatever else sets padding on an h2 */
#ask .go .go-panel .go-head { box-sizing: border-box; width: 100%; max-width: 100%; padding-inline: 56px; margin-inline: 0; }
#ask .go .go-panel .go-head, #ask .go .go-panel .go-sub { display: block; text-align: center; }
#ask .go .go-panel .go-sub { color: rgba(255, 246, 226, 0.88); opacity: 1; }

/* the card's printed line over the tiles, and a joker drawn as the tile it stands for (30 Nov, #217) */
.go-handwrap { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; }
.go-printed { justify-content: center; flex-wrap: nowrap; gap: 0 12px; font-size: 1.15rem; color: #fff6e2; text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.go-printed.large { font-size: 1.3rem; }
.go-small .go-printed { font-size: 1rem; }
.go-hand .over-set .tile.joker-as { box-shadow: 0 0 0 2px #b072d0, 0 2px 0 #d4c7a8; }
.go-hand .over-set .tile.joker-as.winning { box-shadow: 0 0 0 2px #ffd34d, 0 0 12px 2px rgba(255, 211, 77, 0.7); }
.tile.joker-as::after { content: ""; position: absolute; inset: 0; background: rgba(122, 61, 143, 0.16); pointer-events: none; }
.joker-badge { position: absolute; right: -1px; bottom: -1px; z-index: 2; min-width: 15px; height: 15px; padding: 0 3px; box-sizing: border-box; border-radius: 8px 0 4px 0;
  background: #7a3d8f; color: #fff; font: 800 11px/15px system-ui, sans-serif; text-align: center; letter-spacing: 0; }
