/* Gin Rummy: a juniper-green card table under the site's night sky. The cards are absolutely placed elements that
   glide between the stock, the discard pile and the hands (game.js lays them out); the HUD, the action bar, the
   end-of-hand sheet and the panels are HTML over the table. */
.gr { display: flex; flex-direction: column; color: #e4f1ee; --gr-hud: 54px; --gr-barh: 64px; --gr-accent: #55d6ff; --gr-gold: #ffd166; --gr-mint: #7cf2c8;
  --gr-line: #1c3a4a; --gr-glass: rgba(6,20,28,0.84); --cw: 60px; --ch: 84px; --mw: 34px; }
.gr-stage { position: relative; width: 100%; height: min(86vh, 800px); min-height: 520px; overflow: hidden; background: #041318; outline: none;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 600px) { .gr-stage { height: auto; aspect-ratio: 3 / 5; max-height: 88vh; min-height: 0; } }
.gr-felt { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(1.4px 1.4px at 12% 18%, rgba(255,255,255,.55), transparent 60%), radial-gradient(1px 1px at 82% 12%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.2px 1.2px at 64% 6%, rgba(255,255,255,.4), transparent 60%), radial-gradient(1px 1px at 28% 4%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 93% 34%, rgba(255,255,255,.3), transparent 60%), radial-gradient(1.1px 1.1px at 5% 46%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(rgba(255,255,255,0.03) 0.8px, transparent 1px) 0 0 / 5px 5px,
    radial-gradient(ellipse 85% 60% at 50% 52%, #17585a 0%, #0d3b42 45%, #072029 78%, #041318 100%); }
.gr-felt::after { content: ""; position: absolute; left: 4%; right: 4%; top: calc(var(--gr-hud) + 4px); bottom: calc(var(--gr-barh) + 2px); border-radius: 28px;
  box-shadow: inset 0 0 0 1px rgba(255,209,102,0.10), inset 0 0 60px rgba(0,0,0,0.25); }

/* HUD */
.gr-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--gr-hud); display: flex; align-items: center; gap: 10px; padding: 0 8px 0 10px; z-index: 30; pointer-events: none; }
.gr-hud > * { pointer-events: auto; }
.gr-pz { flex: 0 1 auto; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; position: relative; min-width: 92px; max-width: 42vw; height: 44px; padding: 2px 26px 2px 10px; border-radius: 12px;
  border: 1px solid var(--gr-line); background: var(--gr-glass); color: #fff; cursor: pointer; font: inherit; line-height: 1.05; touch-action: manipulation; text-align: left; transition: border-color .15s; }
.gr-pz-lv { font-size: 10px; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; color: #8fb8b4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gr-pz-n { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.gr-pz-dd { position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px; fill: none; stroke: #8fb8b4; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.gr-score { display: flex; gap: 12px; align-items: center; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--gr-line); background: var(--gr-glass); color: #fff; font: inherit; cursor: pointer; touch-action: manipulation; transition: border-color .15s; }
.gr-sc { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.gr-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8fb8b4; }
.gr-sc b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; transition: transform .2s cubic-bezier(.3,1.6,.5,1), color .2s; display: inline-block; transform-origin: left center; }
.gr-sc b.pop { transform: scale(1.25); color: var(--gr-gold); }
.gr-sc-cpu b { color: #ffc0cf; }
.gr-sp { flex: 1 1 auto; }
.gr-tool { position: relative; display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid var(--gr-line); background: var(--gr-glass);
  color: #c9e6e1; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s; }
.gr-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gr-tool .spk { fill: currentColor; stroke: none; }
@media (hover: hover) { .gr-tool:hover, .gr-pz:hover, .gr-score:hover { border-color: var(--gr-accent); color: #fff; } }
.gr-tool:focus-visible, .gr-pz:focus-visible, .gr-score:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; }
#gr-sound .off { display: none; } #gr-sound[aria-pressed="true"] { color: #5d7c80; } #gr-sound[aria-pressed="true"] .on { display: none; } #gr-sound[aria-pressed="true"] .off { display: inline; }
.gr-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--gr-gold); box-shadow: 0 0 8px var(--gr-gold); }
.gr-dot[hidden] { display: none; }

/* the table: everything here is placed by game.js in stage pixels */
.gr-table { position: absolute; inset: 0; z-index: 10; pointer-events: none; }
.gr-table > * { pointer-events: auto; }
.gr-cards, .gr-bars, .gr-fx { position: absolute; inset: 0; pointer-events: none; }
.gr-cards { z-index: 5; }
.gr-fx { z-index: 40; }
.gr-slot { position: absolute; width: var(--cw); height: var(--ch); border-radius: calc(var(--cw) * 0.09); box-shadow: inset 0 0 0 1.5px rgba(200,255,240,0.18); background: rgba(0,0,0,0.14); pointer-events: none; transform-origin: 0 0; }
.gr-hit { position: absolute; width: var(--cw); height: var(--ch); border: 0; padding: 0; margin: 0; background: transparent; border-radius: calc(var(--cw) * 0.09); cursor: default; z-index: 7; touch-action: manipulation; transform-origin: 0 0; }
.gr-hit.can { cursor: pointer; animation: gr-ring 1.6s ease-in-out infinite; }
.gr-hit:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 4px; }
@keyframes gr-ring { 0%, 100% { box-shadow: 0 0 0 2px rgba(255,209,102,0.55), 0 0 14px rgba(255,209,102,0.25); } 50% { box-shadow: 0 0 0 3px rgba(255,209,102,0.95), 0 0 26px rgba(255,209,102,0.5); } }
.gr-hit.hint { animation: gr-hintring 0.9s ease-in-out infinite; }
@keyframes gr-hintring { 0%, 100% { box-shadow: 0 0 0 3px rgba(85,214,255,0.6), 0 0 18px rgba(85,214,255,0.35); } 50% { box-shadow: 0 0 0 4px rgba(85,214,255,1), 0 0 30px rgba(85,214,255,0.7); } }
.gr-lab { position: absolute; transform: translateX(-50%); font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #8fb8b4; white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.gr-lab b { color: #e4f1ee; }
.gr-cnt { position: absolute; z-index: 8; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 99px; background: #06141c; color: #fff; border: 1px solid #2a5263; font-size: 12.5px; font-weight: 800; line-height: 22px; text-align: center; font-variant-numeric: tabular-nums; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 2px 6px rgba(0,0,0,0.4); }
.gr-cnt.low { color: #ffd166; border-color: rgba(255,209,102,0.6); }
.gr-rule { position: absolute; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; transform: translate(-100%, -50%); padding: 5px 10px; border-radius: 10px; background: rgba(4,18,24,0.6); border: 1px solid rgba(124,242,200,0.18); pointer-events: none; white-space: nowrap; text-align: right; }
.gr-rule b { font-size: 18px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; line-height: 1.05; }
.gr-rule small { font-size: 11px; font-weight: 700; color: #a7cbc6; }
.gr-rule.okla { border-color: rgba(255,209,102,0.45); } .gr-rule.okla b { color: #ffe3a3; } .gr-rule.okla small.dbl { color: var(--gr-gold); }
.gr-prompt { position: absolute; left: 50%; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 6px 14px; border-radius: 999px; background: rgba(4,18,24,0.72); border: 1px solid rgba(124,242,200,0.22);
  font-size: 13.5px; font-weight: 700; color: #e9fbf6; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; transition: border-color .2s, color .2s; }
.gr-prompt.go { border-color: rgba(255,209,102,0.6); color: #fff3cf; box-shadow: 0 0 18px rgba(255,209,102,0.16); }
.gr-prompt.wait { color: #a7cbc6; }
.gr-prompt:empty { display: none; }
.gr-prompt.under { visibility: hidden; }
.gr-dw { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; transform: translateY(-50%); padding: 5px 10px; border-radius: 10px; background: rgba(4,18,24,0.6); border: 1px solid rgba(124,242,200,0.18); pointer-events: none; white-space: nowrap; }
.gr-dw b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; color: #fff; line-height: 1.05; transition: color .2s; }
.gr-dw b.ok { color: var(--gr-gold); text-shadow: 0 0 10px rgba(255,209,102,0.5); }
.gr-dw b.gin { color: var(--gr-mint); text-shadow: 0 0 12px rgba(124,242,200,0.6); }
.gr-dw small { font-size: 11px; font-weight: 700; color: #a7cbc6; }
.gr-dw small:empty { display: none; }
.gr-dw[hidden] { display: none; }
.gr-opp { position: absolute; display: flex; align-items: center; gap: 8px; transform: translateX(-50%); max-width: calc(100% - 16px); pointer-events: none; }
.gr-av { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255,160,190,0.14); border: 1px solid rgba(255,160,190,0.4); color: #ffc0cf; }
.gr-av svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gr-opp.think .gr-av { animation: gr-think 1s ease-in-out infinite; }
@keyframes gr-think { 50% { box-shadow: 0 0 0 4px rgba(255,160,190,0.18); } }
.gr-opp-t { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.gr-opp-t b { font-size: 13px; font-weight: 800; color: #ffd9e2; white-space: nowrap; }
.gr-bub { font-size: 12.5px; font-weight: 600; color: #cfe8e4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gr-bub b { color: #fff; font-weight: 800; }
.gr-bub .red { color: #ff8fa3; } .gr-bub .blk { color: #fff; }

/* the cards */
.gr-c { position: absolute; left: 0; top: 0; width: var(--cw); height: var(--ch); transform-origin: 50% 50%; will-change: transform; pointer-events: auto; touch-action: none; perspective: 900px;
  transition: transform .42s cubic-bezier(.2,.8,.25,1); }
.gr-c.hide { visibility: hidden; }
.gr-c.drag, .gr-c.snap { transition: none; }
.gr-ci { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .34s cubic-bezier(.3,.7,.3,1); }
.gr-c.up .gr-ci { transform: rotateY(180deg); }
.gr-f, .gr-bk { position: absolute; inset: 0; border-radius: 9% / 6.4%; backface-visibility: hidden; -webkit-backface-visibility: hidden; background-size: 100% 100%; background-repeat: no-repeat;
  box-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 3px 8px rgba(0,0,0,0.18); transition: box-shadow .2s, filter .2s; }
.gr-f { transform: rotateY(180deg); }
.gr-bk { background-image: var(--gr-back); }
.gr-c.mine { cursor: pointer; }
.gr-c.sel .gr-f { box-shadow: 0 0 0 2.5px var(--gr-gold), 0 0 18px rgba(255,209,102,0.55), 0 8px 18px rgba(0,0,0,0.35); }
.gr-c.cur .gr-f { box-shadow: 0 0 0 2px var(--gr-accent), 0 0 12px rgba(85,214,255,0.45), 0 3px 8px rgba(0,0,0,0.25); }
.gr-c.cur.sel .gr-f { box-shadow: 0 0 0 2.5px var(--gr-gold), 0 0 0 5px rgba(85,214,255,0.7), 0 0 18px rgba(255,209,102,0.55); }
.gr-c.fresh .gr-f { animation: gr-fresh 1.8s ease-out 1; }
@keyframes gr-fresh { 0%, 40% { box-shadow: 0 0 0 2.5px var(--gr-mint), 0 0 20px rgba(124,242,200,0.7); } 100% { box-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 3px 8px rgba(0,0,0,0.18); } }
.gr-c.hint .gr-f { animation: gr-hintc 0.9s ease-in-out infinite; }
@keyframes gr-hintc { 0%, 100% { box-shadow: 0 0 0 2.5px rgba(85,214,255,0.7), 0 0 14px rgba(85,214,255,0.4); } 50% { box-shadow: 0 0 0 3.5px #55d6ff, 0 0 26px rgba(85,214,255,0.8); } }
.gr-c.known .gr-f { box-shadow: 0 0 0 2px rgba(255,160,190,0.85), 0 0 10px rgba(255,160,190,0.4); }
.gr-c.nodisc .gr-f::after { content: ""; position: absolute; left: 6%; right: 6%; bottom: 4%; height: 3px; border-radius: 2px; background: rgba(255,120,140,0.75); }
.gr-c.dead .gr-f { filter: brightness(0.86) saturate(0.9); }
.gr-knock.hinted, .gr-main.ready.hinted { animation: gr-knockhint 0.9s ease-in-out infinite; }
@keyframes gr-knockhint { 50% { box-shadow: 0 0 0 4px rgba(85,214,255,0.9), 0 0 26px rgba(85,214,255,0.7); } }
.gr-c.drop .gr-f { box-shadow: 0 0 0 3px var(--gr-gold), 0 0 26px rgba(255,209,102,0.7); }
@media (hover: hover) { .gr-c.mine:not(.drag):hover .gr-f { box-shadow: 0 0 0 1.5px rgba(85,214,255,0.65), 0 6px 14px rgba(0,0,0,0.3); } }

/* meld brackets under your hand */
.gr-mb { position: absolute; height: 4px; border-radius: 3px; background: var(--mc); box-shadow: 0 0 10px color-mix(in srgb, var(--mc) 55%, transparent); transition: left .35s, width .35s, top .35s, opacity .2s; }
.gr-mb span { position: absolute; left: 50%; top: 7px; transform: translateX(-50%); font-size: 9.5px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mc); white-space: nowrap; }
.gr-mb.dw { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.28) 0 5px, transparent 5px 9px); box-shadow: none; }
.gr-mb.dw span { color: #8fb8b4; }

/* the action bar */
.gr-bar { position: absolute; left: 50%; transform: translateX(-50%); bottom: 8px; height: calc(var(--gr-barh) - 12px); z-index: 30; display: flex; gap: 6px; padding: 0 6px; width: min(calc(100% - 12px), 560px); }
.gr-bar[hidden] { display: none; }
.gr-btn { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 14px; border: 1px solid var(--gr-line);
  background: rgba(6,20,28,0.88); color: #d2ebe7; font: inherit; font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em; cursor: pointer; touch-action: manipulation; padding: 0 2px;
  transition: border-color .15s, color .15s, opacity .15s, background .15s, transform .08s; }
.gr-btn[hidden] { display: none; }
.gr-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gr-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (hover: hover) { .gr-btn:hover:not(:disabled) { border-color: var(--gr-accent); color: #fff; } }
.gr-btn:active:not(:disabled) { transform: translateY(1px); }
.gr-btn:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; }
.gr-btn:disabled { opacity: 0.36; cursor: default; }
.gr-hint { color: #ffe3a3; }
.gr-main.ready { background: #ffd166; color: #1a1200; border-color: #ffd166; }
@media (hover: hover) { .gr-main.ready:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; color: #1a1200; } }
.gr-knock { flex: 1.25 1 0; background: linear-gradient(135deg, #ffe08a, #ffb84d); color: #2a1600; border-color: transparent; font-size: 12.5px; font-weight: 900; box-shadow: 0 6px 22px rgba(255,184,77,0.35); animation: gr-knockin .35s cubic-bezier(.2,1.4,.4,1); }
.gr-knock.gin { background: linear-gradient(135deg, #a8ffe0, #55d6ff 60%, #b48bff); color: #04161c; box-shadow: 0 6px 24px rgba(85,214,255,0.45); }
@media (hover: hover) { .gr-knock:hover:not(:disabled) { border-color: transparent; color: #2a1600; filter: brightness(1.07); } .gr-knock.gin:hover { color: #04161c; } }
@keyframes gr-knockin { from { transform: scale(0.6); opacity: 0; } }

/* the coach line: hints and first-time tips */
.gr-coach[hidden] { display: none; }
.gr-coach { position: absolute; left: 50%; transform: translateX(-50%); z-index: 35; top: calc(var(--gr-hud) + 4px); width: min(calc(100% - 20px), 520px); padding: 8px 34px 8px 12px; border-radius: 12px;
  background: rgba(5,18,26,0.94); border: 1px solid rgba(85,214,255,0.5); box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 18px rgba(85,214,255,.14); font-size: 13.5px; line-height: 1.4; color: #e4f1ee; animation: gr-drop .22s ease-out; }
@keyframes gr-drop { from { opacity: 0; transform: translate(-50%, -6px); } }
.gr-coach b { color: var(--gr-accent); font-weight: 800; margin-right: 6px; }
.gr-coach.tip { border-color: rgba(255,209,102,0.55); } .gr-coach.tip b { color: var(--gr-gold); }
.gr-coach-close { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: #8fb8b4; font-size: 19px; line-height: 1; cursor: pointer; }
@media (hover: hover) { .gr-coach-close:hover { color: #fff; background: rgba(255,255,255,.08); } }

/* the end of a hand: both hands laid out, the layoffs and the score */
.gr-end[hidden] { display: none; }
.gr-end { position: absolute; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; padding: calc(var(--gr-hud) + 6px) 8px 8px; background: linear-gradient(to bottom, rgba(3,12,16,0.35), rgba(3,12,16,0.82)); animation: gr-fade .25s ease-out; overflow: auto; }
.gr-endp { position: relative; width: min(100%, 620px); max-height: 100%; overflow: auto; overscroll-behavior: contain; margin: auto auto 0; padding: 16px 16px 14px; border-radius: 18px; outline: none;
  background: rgba(6,18,26,0.96); border: 1px solid rgba(124,242,200,0.25); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 40px rgba(85,214,255,0.08); animation: gr-up .35s cubic-bezier(.2,.9,.25,1.1); }
@keyframes gr-up { from { opacity: 0; transform: translateY(24px); } }
@keyframes gr-fade { from { opacity: 0; } }
.gr-endp > .gr-actions { position: sticky; bottom: -14px; z-index: 2; margin: 12px -16px -14px; padding: 12px 16px 14px; background: linear-gradient(to bottom, rgba(6,18,26,0), rgba(6,18,26,0.97) 22%); }
.gr-endp h2 { margin: 0; font-size: 22px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.15; }
.gr-endp h2 em { font-style: normal; color: var(--gr-gold); text-shadow: 0 0 18px rgba(255,209,102,0.45); }
.gr-endp h2 em.bad { color: #ff9fb4; text-shadow: none; }
.gr-endp .gr-sub { margin: 3px 0 0; font-size: 13px; color: #a7cbc6; line-height: 1.45; }
.gr-hrow { margin-top: 12px; padding: 10px 10px 8px; border-radius: 14px; background: rgba(0,0,0,0.22); border: 1px solid rgba(124,242,200,0.12); }
.gr-hrow-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.gr-hrow-h b { font-size: 13.5px; color: #fff; } .gr-hrow-h b i { font-style: normal; font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--gr-gold); margin-left: 6px; }
.gr-hrow-h span { font-size: 12.5px; color: #a7cbc6; font-variant-numeric: tabular-nums; white-space: nowrap; } .gr-hrow-h span b { font-size: 15px; }
.gr-groups { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.gr-mg { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.gr-mg-c { display: flex; }
.gr-mg-c .gr-m + .gr-m { margin-left: calc(var(--mw) * -0.48); }
.gr-mg small { font-size: 9.5px; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--mc, #8fb8b4); padding-left: 2px; }
.gr-m { position: relative; width: var(--mw); height: calc(var(--mw) * 1.4); border-radius: 9% / 6.4%; background-size: 100% 100%; box-shadow: 0 1px 2px rgba(0,0,0,0.4); flex: none; }
.gr-m.lo { box-shadow: 0 0 0 2px var(--gr-accent), 0 0 10px rgba(85,214,255,0.5); }
.gr-m.dd { filter: brightness(0.93); }
.gr-m.dd::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1.5px rgba(255,120,140,0.55); }
.gr-sum { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 3px; }
.gr-sum li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: #cfe8e4; padding: 3px 2px; border-bottom: 1px dashed rgba(124,242,200,0.12); }
.gr-sum li b { font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; }
.gr-sum li.tot { border-bottom: 0; font-size: 15px; font-weight: 800; color: #fff; } .gr-sum li.tot b { color: var(--gr-gold); } .gr-sum li.tot.cpu b { color: #ff9fb4; }
.gr-meter { margin-top: 12px; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.gr-meter span { color: #a7cbc6; font-weight: 700; } .gr-meter b { font-variant-numeric: tabular-nums; color: #fff; text-align: right; min-width: 2.5em; }
.gr-meter i { position: relative; height: 8px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; }
.gr-meter i::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--p); border-radius: 99px; background: linear-gradient(90deg, #55d6ff, #7cf2c8); transition: width .6s cubic-bezier(.2,.8,.3,1); }
.gr-meter i.cpu::after { background: linear-gradient(90deg, #ff8fa3, #ffc0cf); }
.gr-endp .gr-laid { margin-top: 6px; }
.gr-foot { margin-top: 12px; }
.gr-foot .gr-sum { margin: 0; }
.gr-foot .gr-mt { margin-top: 10px; }
.gr-foot .gr-meter { margin-top: 0; }
.gr-foot .gr-fine { margin-top: 6px !important; }
/* a wide panel puts the score lines and the match meter side by side, and the buttons in one row */
.gr-wide .gr-foot:not(.solo) { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.gr-wide .gr-foot:not(.solo) .gr-mt { margin-top: 0; padding: 9px 11px 8px; border-radius: 12px; background: rgba(0,0,0,0.2); border: 1px solid rgba(124,242,200,0.1); }
.gr-endp > .gr-endact { flex-direction: row; }
.gr-endact .gr-b-primary { flex: 2 1 0; min-width: 0; }
.gr-endact .gr-b-board { flex: 1 1 0; min-width: 0; min-height: 46px; }
/* a short table (phone landscape): a wider panel, both hands side by side, and the panel up over the HUD */
.gr-short .gr-end { padding-top: 8px; }
.gr-short .gr-endp { width: min(100%, 780px); padding: 12px 14px 12px; }
.gr-short .gr-endp > .gr-actions { margin: 10px -14px -12px; padding: 8px 14px 12px; bottom: -12px; }
.gr-short .gr-endp h2 { font-size: 19px; }
.gr-short .gr-hrow { margin-top: 8px; padding: 8px 9px 7px; }
.gr-two .gr-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; align-items: stretch; }

/* panels */
.gr-overlay[hidden] { display: none; }
.gr-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; z-index: 60; overflow: auto;
  background: radial-gradient(ellipse at center, rgba(3,14,18,0.5), rgba(2,8,12,0.86)); animation: gr-fade .18s ease-out; }
.gr-panel { position: relative; width: min(100%, 440px); margin: auto; padding: 20px 18px 18px; border: 1px solid var(--gr-line); border-radius: 18px; text-align: left; outline: none;
  background: rgba(6,18,26,0.96); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(124,242,200,0.05) inset; animation: gr-in .26s cubic-bezier(.2,.9,.25,1.1); }
.gr-panel.wide { width: min(100%, 580px); }
.gr-panel.compact h3 { margin: 12px 0 6px; }
.gr-panel.compact .gr-set { padding: 8px 0; }
.gr-panel.compact .gr-actions { margin-top: 12px; }
@keyframes gr-in { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.gr-panel h2 { margin: 0 38px 12px 0; font-size: 20px; font-weight: 900; color: #fff; letter-spacing: 0.01em; text-transform: none; line-height: 1.25; }
.gr-panel h3 { margin: 16px 0 8px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: #8fb8b4; }
.gr-panel p, .gr-panel li { font-size: 13.5px; line-height: 1.55; color: #bcd8d4; }
.gr-panel p { margin: 0 0 9px; }
.gr-panel ul, .gr-panel ol { margin: 0 0 9px; padding-left: 18px; }
.gr-panel li { margin-bottom: 3px; }
.gr-panel b { color: #fff; }
.gr-panel kbd { display: inline-block; min-width: 1.4em; padding: 0 5px; border-radius: 5px; border: 1px solid #2a4b58; background: #071a22; color: #fff; font: 700 12px/1.6 system-ui, sans-serif; text-align: center; }
.gr-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; border: 0; background: rgba(255,255,255,.07); color: #d2ebe7; cursor: pointer; padding: 0; z-index: 2; }
.gr-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) { .gr-x:hover { background: rgba(255,255,255,.14); color: #fff; } }
.gr-x:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 2px; }
.gr-fine { font-size: 12px !important; color: #6f9590 !important; margin: 8px 0 0 !important; }
.gr-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.gr-row { display: flex; gap: 8px; } .gr-row > * { flex: 1 1 0; }
.gr-b { font: inherit; font-weight: 700; font-size: 14.5px; padding: 10px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation; text-decoration: none;
  border: 1px solid var(--gr-line); background: #0a1d26; color: #e4f1ee; transition: background .15s, border-color .15s, transform .1s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .gr-b:hover:not(:disabled) { border-color: var(--gr-accent); } }
.gr-b:active { transform: translateY(1px); }
.gr-b:disabled { opacity: .45; cursor: default; }
.gr-b:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.gr-b svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gr-b span { white-space: nowrap; }
.gr-b-primary { background: #ffd166; color: #1a1200; border-color: #ffd166; font-size: 16px; font-weight: 800; box-shadow: 0 6px 22px rgba(255,209,102,0.25); }
@media (hover: hover) { .gr-b-primary:hover:not(:disabled) { background: #ffe08a; border-color: #ffe08a; } }
.gr-b-sm { min-height: 40px; padding: 6px 10px; font-size: 13px; }
.gr-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; vertical-align: middle; margin-left: 6px;
  color: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: gr-shine 1.6s linear infinite; box-shadow: 0 0 18px rgba(255,209,102,0.5); }
@keyframes gr-shine { to { background-position: -200% 0; } }
.gr-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.gr-stats.three { grid-template-columns: repeat(3, 1fr); }
.gr-stats div { padding: 8px 4px; border-radius: 10px; background: #061620; border: 1px solid #143040; text-align: center; min-width: 0; }
.gr-stats span { display: block; font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #6f9590; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gr-stats b { display: block; margin-top: 2px; font-size: 17px; color: #e4f1ee; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gr-stats .gold b { color: var(--gr-gold); } .gr-stats .ok b { color: var(--gr-mint); } .gr-stats .hot b { color: #ffc0cf; }
.gr-table2 { width: 100%; border-collapse: collapse; font-size: 13px; }
.gr-table2 th, .gr-table2 td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #143040; font-variant-numeric: tabular-nums; }
.gr-table2 th:first-child, .gr-table2 td:first-child { text-align: left; }
.gr-table2 thead th { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #6f9590; }
.gr-table2 tbody th { color: #fff; font-weight: 700; }
.gr-table2 td { color: #d2ebe7; }
.gr-table2 td.w { color: var(--gr-gold); font-weight: 800; }
.gr-table2 td.l { color: #6f9590; }
.gr-table2 tfoot td, .gr-table2 tfoot th { color: #fff; font-weight: 800; border-bottom: 0; }
.gr-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #061620; border: 1px solid var(--gr-line); margin: 0 0 12px; }
.gr-tab { font: inherit; font-size: 13.5px; font-weight: 700; color: #8fb8b4; background: transparent; border: 0; border-radius: 9px; min-height: 38px; cursor: pointer; }
.gr-tab[aria-selected="true"] { background: #10303c; color: #fff; box-shadow: inset 0 0 0 1px rgba(124,242,200,0.4); }
.gr-tab:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 1px; }
.gr-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #061620; border: 1px solid var(--gr-line); }
.gr-seg button { flex: 1 1 0; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: #8fb8b4; font: 700 13.5px system-ui, sans-serif; cursor: pointer; padding: 4px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.gr-seg button small { font-size: 10.5px; font-weight: 600; color: #6f9590; }
.gr-seg button[aria-pressed="true"] { background: #10303c; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,209,102,0.6); }
.gr-seg button[aria-pressed="true"] small { color: #c9e6e1; }
.gr-seg button:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 1px; }
.gr-set { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #143040; cursor: pointer; }
.gr-set span { display: flex; flex-direction: column; gap: 2px; } .gr-set b { font-size: 14px; color: #fff; } .gr-set small { font-size: 12px; color: #8fb8b4; }
.gr-set input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gr-sw { position: relative; width: 46px; height: 27px; flex: none; border-radius: 14px; border: 1px solid #23485a; background: #071a22; transition: background .15s, border-color .15s; }
.gr-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #5d7c80; transition: transform .15s, background .15s; }
.gr-set input:checked + .gr-sw { background: #3b2f0b; border-color: var(--gr-gold); }
.gr-set input:checked + .gr-sw::after { transform: translateX(19px); background: var(--gr-gold); box-shadow: 0 0 10px rgba(255,209,102,.7); }
.gr-set input:focus-visible + .gr-sw { outline: 2px solid var(--gr-accent); outline-offset: 2px; }
.gr-backs { display: flex; gap: 10px; }
.gr-backs button { width: 52px; height: 72px; border-radius: 7px; border: 0; padding: 0; background-size: 100% 100%; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.gr-backs button[aria-pressed="true"] { box-shadow: 0 0 0 2.5px var(--gr-gold), 0 0 14px rgba(255,209,102,0.5); }
.gr-backs button:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 3px; }
.gr-hub { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gr-hubc { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 92px; padding: 12px 12px 10px; border-radius: 15px; border: 1px solid var(--gr-line);
  background: radial-gradient(120% 120% at 100% 0%, color-mix(in srgb, var(--hc) 20%, transparent), transparent 60%), #061620; color: #e4f1ee; font: inherit; text-align: left; cursor: pointer; touch-action: manipulation; transition: border-color .15s, transform .1s; overflow: hidden; }
.gr-hubc.big { grid-column: 1 / -1; min-height: 88px; }
.gr-hubc svg { width: 26px; height: 26px; fill: none; stroke: var(--hc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 2px; }
.gr-hubc b { font-size: 15.5px; color: #fff; }
.gr-hubc small { font-size: 12px; color: #8fb8b4; line-height: 1.35; }
.gr-hubc em { position: absolute; top: 10px; right: 12px; font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--hc); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .gr-hubc:hover { border-color: var(--hc); } }
.gr-hubc:active { transform: translateY(1px); }
.gr-hubc:focus-visible { outline: 2px solid var(--hc); outline-offset: 2px; }
.gr-cal-head { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; }
.gr-cal-head b { flex: 1 1 auto; text-align: center; color: #fff; font-size: 15px; }
.gr-step { width: 42px; height: 42px; flex: none; display: grid; place-items: center; padding: 0; border-radius: 10px; border: 1px solid #23485a; background: #0a1d26; color: #e4f1ee; cursor: pointer; }
.gr-step svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gr-step:disabled { opacity: .35; cursor: default; }
.gr-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.gr-cal-w { text-align: center; font-size: 10.5px; font-weight: 800; color: #6f9590; padding: 2px 0; }
.gr-cal-d { position: relative; aspect-ratio: 1; display: grid; place-items: center; border-radius: 9px; border: 1px solid #143040; background: #061620; color: #d2ebe7; font: 700 13px system-ui, sans-serif; cursor: pointer; padding: 0; }
.gr-cal-d.off { opacity: .28; cursor: default; }
.gr-cal-d.won { background: rgba(124,242,200,0.12); border-color: rgba(124,242,200,0.55); color: var(--gr-mint); }
.gr-cal-d.lost { background: rgba(255,143,163,0.08); border-color: rgba(255,143,163,0.4); color: #ffb3c1; }
.gr-cal-d.drawn { background: rgba(255,255,255,0.05); border-color: rgba(200,230,225,0.4); color: #c9e6e1; }
.gr-cal-d.today { box-shadow: 0 0 0 2px var(--gr-gold), 0 0 14px rgba(255,209,102,.4); }
.gr-cal-pad { aspect-ratio: 1; }
@media (hover: hover) { .gr-cal-d:not(.off):hover { border-color: var(--gr-accent); } }
.gr-cal-d:focus-visible { outline: 2px solid var(--gr-accent); outline-offset: 1px; }
.gr-howto { display: grid; grid-template-columns: 76px 1fr; gap: 10px 12px; align-items: center; margin: 4px 0 8px; }
.gr-howto .gr-mini { display: flex; }
.gr-howto .gr-m { --mw: 26px; width: 26px; height: 36.4px; }
.gr-howto .gr-m + .gr-m { margin-left: -12px; }
.gr-howto p { margin: 0 !important; }

.gr-toast[hidden] { display: none; }
.gr-toast { position: absolute; left: 50%; bottom: calc(var(--gr-barh) + 12px); transform: translateX(-50%); z-index: 70; padding: 8px 14px; border-radius: 999px; background: #eafaf6; color: #04161c; font-size: 13px; font-weight: 800; animation: gr-rise .2s ease-out; pointer-events: none; white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 24px rgba(0,0,0,0.4); }
.gr-toast.warn { background: #ffd166; color: #1a1200; }
@keyframes gr-rise { from { opacity: 0; transform: translate(-50%, 6px); } }

/* bursts: gin sparkles and score pops */
.gr-spark { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--sc, #ffd166); box-shadow: 0 0 10px var(--sc, #ffd166); animation: gr-spark var(--d, .9s) cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes gr-spark { to { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }
.gr-pop { position: absolute; transform: translate(-50%, -50%); font-size: 30px; font-weight: 900; color: #fff; text-shadow: 0 0 24px rgba(255,209,102,0.9), 0 2px 0 rgba(0,0,0,0.4); white-space: nowrap; animation: gr-popa 1.4s cubic-bezier(.2,.8,.3,1) forwards; letter-spacing: 0.02em; }
.gr-pop.cpu { text-shadow: 0 0 24px rgba(255,143,163,0.9), 0 2px 0 rgba(0,0,0,0.4); }
@keyframes gr-popa { 0% { opacity: 0; transform: translate(-50%, -30%) scale(0.6); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 70% { opacity: 1; transform: translate(-50%, -60%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -80%) scale(1); } }

.gr-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.gr-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.gr-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .gr-help .hint-kb { display: none; } .gr-help .hint-touch { display: inline; } }
.stage .gr-help { padding: 10px 14px 12px; }

@media (max-width: 520px) {
  .gr-hud { gap: 7px; padding-left: 8px; padding-right: 6px; }
  .gr-pz { padding-right: 22px; padding-left: 8px; min-width: 0; }
  .gr-pz-n { font-size: 15px; }
  .gr-score { gap: 9px; padding: 0 9px; }
  .gr-sc b { font-size: 17px; }
  .gr-tool { width: 36px; height: 36px; border-radius: 11px; }
  .gr-btn { font-size: 10.5px; border-radius: 12px; }
  .gr-knock { font-size: 11.5px; }
  .gr-panel { padding: 18px 14px 14px; }
  .gr-endp { padding: 14px 12px 12px; }
  .gr-end { padding-top: 8px; }   /* the panel may use the HUD's strip: its score line shows the totals */
  .gr-endp > .gr-actions { margin: 10px -12px -12px; padding: 10px 12px 12px; bottom: -12px; }
  .gr-endact .gr-b-board { flex: 0 0 52px; padding: 0; }
  .gr-endact .gr-b-board span { display: none; }
  .gr-endact .gr-b-board svg { width: 20px; height: 20px; }
  .gr-endp h2 { font-size: 19px; }
  .gr-hrow { margin-top: 10px; padding: 8px 8px 7px; }
  .gr-groups { gap: 8px 9px; }
  .gr-mg-c .gr-m + .gr-m { margin-left: calc(var(--mw) * -0.5); }
  .gr-mg small { letter-spacing: 0.07em; }
  .gr-inblue { display: none; }
  /* the match meter in one line (the HUD shows the scores too), and its note only when the match is over */
  .gr-meter { grid-template-columns: auto 1fr auto auto 1fr auto; gap: 6px 8px; }
  .gr-meter b { min-width: 0; }
  .gr-meter b:first-of-type { margin-right: 6px; }
  .gr-mt:not(.over) .gr-fine { display: none; }
  .gr-stats b { font-size: 15px; }
  .gr-prompt { font-size: 12.5px; padding: 5px 12px; }
}
@media (max-width: 400px) { .gr-sc-cpu .gr-k { font-size: 0; } .gr-sc-cpu .gr-k::after { content: "CPU"; font-size: 10px; } .gr-lab { letter-spacing: 0.1em; } }
@media (max-width: 420px) { .gr-stats span { font-size: 9px; letter-spacing: 0.04em; } .gr-sum li { font-size: 13px; padding: 2px 2px; } }
@media (max-width: 380px) { .gr-stats span { font-size: 8.5px; letter-spacing: 0.02em; } .gr-endp h2 { font-size: 17px; } .gr-endp .gr-sub { font-size: 12.5px; } }
@media (hover: none) and (pointer: coarse) { .gr-kbline { display: none; } }
@media (max-width: 600px) { .gr-cal-d { aspect-ratio: auto; height: 38px; } .gr-cal-pad { aspect-ratio: auto; height: 38px; } }
@media (max-width: 370px) { #gr-sound { display: none; } }

/* full screen: the table takes the whole screen */
.stage.is-immersive .stage-body > .gr { min-height: 0; flex: 1 1 auto; }
.stage.is-immersive .gr-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .gr-help { display: none; }
@media (prefers-reduced-motion: reduce) {
  .gr-c, .gr-ci { transition-duration: .12s; }
  .gr-panel, .gr-toast, .gr-overlay, .gr-end, .gr-endp, .gr-knock { animation: none; }
  .gr-hit.can, .gr-hit.hint, .gr-c.hint .gr-f, .gr-c.fresh .gr-f, .gr-tag, .gr-opp.think .gr-av, .gr-knock.hinted, .gr-main.ready.hinted { animation: none; }
  /* still marked, just without the pulse */
  .gr-hit.can { box-shadow: 0 0 0 2.5px rgba(255,209,102,0.8), 0 0 16px rgba(255,209,102,0.35); }
  .gr-hit.hint, .gr-knock.hinted, .gr-main.ready.hinted { box-shadow: 0 0 0 3px rgba(85,214,255,0.95), 0 0 24px rgba(85,214,255,0.6); }
  .gr-c.hint .gr-f { box-shadow: 0 0 0 3px #55d6ff, 0 0 22px rgba(85,214,255,0.75); }
}
.gr-calm .gr-c, .gr-calm .gr-ci { transition-duration: .12s; }
.gr-calm .gr-panel, .gr-calm .gr-toast, .gr-calm .gr-overlay, .gr-calm .gr-end, .gr-calm .gr-endp, .gr-calm .gr-knock { animation: none; }
.gr-calm .gr-hit.can, .gr-calm .gr-tag, .gr-calm .gr-opp.think .gr-av, .gr-calm .gr-c.fresh .gr-f { animation: none; }
.gr-calm .gr-hit.can { box-shadow: 0 0 0 2.5px rgba(255,209,102,0.8), 0 0 16px rgba(255,209,102,0.35); }
.gr-calm .gr-hit.hint, .gr-calm .gr-c.hint .gr-f, .gr-calm .gr-knock.hinted, .gr-calm .gr-main.ready.hinted { animation: none; }
.gr-calm .gr-hit.hint, .gr-calm .gr-knock.hinted, .gr-calm .gr-main.ready.hinted { box-shadow: 0 0 0 3px rgba(85,214,255,0.95), 0 0 24px rgba(85,214,255,0.6); }
.gr-calm .gr-c.hint .gr-f { box-shadow: 0 0 0 3px #55d6ff, 0 0 22px rgba(85,214,255,0.75); }
