/* NVIDIAddict — Gin Rummy (Arena game "gin", 2026-10-03). Everything is scoped under .ag-gin. */
.ag-gin { --gn-m0: var(--accent); --gn-m1: var(--s2); --gn-m2: var(--gold); --gn-m3: var(--s4); }
.ag-gin .gn { display: block; }
/* styles.css has an older .pcard rule with padding; it shrinks the shared card's container box and
   makes the face simplify at ~89px instead of 58px. Cancel it here. */
.ag-gin .pcard { padding: 0; }
.ag-gin .gn[data-side="1"] { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.ag-gin .gn-main { min-width: 0; }
.ag-gin .gn-play { position: relative; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; max-width: 100%; }

/* bars: the computer above, you below the table */
.ag-gin .gn-bar { display: flex; align-items: center; gap: 6px; min-height: 46px; min-width: 0; }
.ag-gin .gn-opp { height: var(--opph, 46px); }
.ag-gin .gn-who { display: flex; flex-direction: column; justify-content: center; flex: 0 0 auto; max-width: 30%; min-width: 0; line-height: 1.15; padding-left: 8px; border-left: 3px solid transparent; transition: border-color .2s; }
.ag-gin .gn-opp.gn-turn .gn-who { border-left-color: var(--accent); }
.ag-gin .gn-who b { font: 700 15px/1.15 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-gin .gn-ort { font: 500 11.5px var(--mono); color: var(--muted); }
.ag-gin .gn-dots { display: none; gap: 3px; align-items: center; height: 10px; }
.ag-gin .gn-thinking .gn-dots { display: inline-flex; }
.ag-gin .gn-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: gndot 1.1s infinite ease-in-out; }
.ag-gin .gn-dots i:nth-child(2) { animation-delay: .15s; } .ag-gin .gn-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes gndot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ag-gin .gn-ofan { position: relative; flex: 1 1 auto; min-width: 0; height: calc(var(--fcw, 30px) * 1.4); }
.ag-gin .gn-ofan .pcard { --cw: var(--fcw, 30px); position: absolute; left: 0; top: 0; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.ag-gin .gn-ofan .pcard.gn-known { box-shadow: 0 0 0 2px var(--gold), 0 1px 2px rgba(0, 0, 0, .3); }
.ag-gin .gn-sc { display: grid; justify-items: center; align-content: center; min-width: 50px; height: 44px; padding: 0 8px; border-radius: 11px; background: var(--raised); border: 1px solid var(--line); flex: 0 0 auto; }
.ag-gin .gn-sc small { font: 600 9.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ag-gin .gn-sc b { font: 800 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.ag-gin .gn-turn .gn-sc { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }

/* the table: stock, discard pile, what just happened, what to do */
.ag-gin .gn-table { height: var(--tabh, 96px); display: flex; align-items: center; gap: 12px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line);
  background: radial-gradient(130% 120% at 22% 50%, color-mix(in srgb, var(--accent) 10%, var(--surface)) 0, var(--surface) 75%); }
.ag-gin .gn-piles { display: flex; gap: 12px; flex: 0 0 auto; touch-action: none; }
.ag-gin .gn-stock, .ag-gin .gn-disc { position: relative; width: var(--pcw, 60px); height: calc(var(--pcw, 60px) * 1.4); padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; border-radius: calc(var(--pcw, 60px) * .09); -webkit-tap-highlight-color: transparent; touch-action: none; }
.ag-gin .gn-piles .pcard { --cw: var(--pcw, 60px); position: absolute; left: 0; top: 0; pointer-events: none; }
.ag-gin .gn-stack .pcard:nth-child(1) { transform: translate(-4px, 4px); }
.ag-gin .gn-stack .pcard:nth-child(2) { transform: translate(-2px, 2px); }
.ag-gin .gn-stack[data-n="2"] .pcard:nth-child(1), .ag-gin .gn-stack[data-n="1"] .pcard:nth-child(-n+2) { display: none; }
.ag-gin .gn-stack[data-n="0"] { display: none; }
.ag-gin .gn-cnt { position: absolute; right: -7px; bottom: -7px; z-index: 5; font: 700 11.5px/1 var(--mono); font-style: normal; padding: 4px 7px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.ag-gin .gn-disc .gn-under { transform: rotate(-7deg) translate(-3px, 2px); filter: brightness(.9); }
.ag-gin .gn-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); border-radius: inherit; font: 600 10.5px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.ag-gin .gn-go::after, .ag-gin .gn-drop::after { content: ""; position: absolute; inset: -5px; border-radius: calc(var(--pcw, 60px) * .14); pointer-events: none; z-index: 6; }
.ag-gin .gn-go::after { box-shadow: 0 0 0 3px var(--accent); animation: gnpulse 1.6s ease-in-out infinite; }
.ag-gin .gn-drop::after { border: 2px dashed color-mix(in srgb, var(--accent) 75%, transparent); }
.ag-gin .gn-hot::after { border: 0; box-shadow: 0 0 0 4px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 55%, transparent); animation: none; }
.ag-gin .gn-off { opacity: .5; }
@keyframes gnpulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.ag-gin .gn-msg { flex: 1 1 auto; min-width: 0; display: grid; gap: 4px; align-content: center; }
.ag-gin .gn-last { font-size: 13px; line-height: 1.3; color: var(--muted); }
.ag-gin .gn-last:empty { display: none; }
.ag-gin .gn-say { font-size: 15px; line-height: 1.3; font-weight: 600; text-wrap: balance; }
.ag-gin .gn-say.gn-flash { color: var(--warn); }
.ag-gin .gn[data-lay="wide"] .gn-say { font-size: 17px; }
.ag-gin .gn[data-lay="wide"] .gn-last { font-size: 14px; }

/* your bar: menu, deadwood, sort, the one action that matters now, your score */
.ag-gin .gn-me { justify-content: space-between; }
.ag-gin .gn-ib { width: 44px; height: 44px; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--line); border-radius: 11px; background: var(--raised); color: var(--ink); cursor: pointer; }
.ag-gin .gn-ib svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.ag-gin .gn-dw { display: grid; justify-items: center; align-content: center; min-width: 66px; height: 44px; padding: 0 6px; border-radius: 11px; background: var(--raised); border: 1px solid var(--line); flex: 0 0 auto; }
.ag-gin .gn-dw small { font: 600 9.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.ag-gin .gn-dw b { font: 800 20px/1 var(--display); font-variant-numeric: tabular-nums; }
.ag-gin .gn-dw.gn-low b { color: var(--good); }
.ag-gin .gn-sortb { height: 44px; padding: 0 14px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px; background: var(--raised); color: var(--ink); font: 600 13.5px var(--sans); cursor: pointer; }
.ag-gin .gn-sortb[aria-pressed="false"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ag-gin .gn-act { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; }
.ag-gin .gn-btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 44px; min-width: 76px; max-width: 100%; padding: 4px 14px; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-ink); font: 700 15px/1.1 var(--sans); cursor: pointer; transition: transform .08s; }
.ag-gin .gn-btn small { font: 600 10.5px/1.1 var(--mono); opacity: .85; white-space: nowrap; }
.ag-gin .gn-btn:active { transform: scale(.96); }
.ag-gin .gn-btn.gn-gin { background: var(--gold); color: #1A1305; }
.ag-gin .gn-btn[data-a="pass"] { background: var(--raised); color: var(--ink); border: 1px solid var(--line); }
.ag-gin .gn-me.gn-turn .gn-msc { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }

/* your hand: absolutely placed cards, two rows on a phone, one row when there is room */
.ag-gin .gn-hand { position: relative; height: var(--handh, 240px); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ag-gin .gn-hand .pcard { --cw: var(--hcw, 64px); position: absolute; left: 0; top: 0; cursor: pointer; transition: transform .22s cubic-bezier(.2, .8, .3, 1), box-shadow .15s; -webkit-tap-highlight-color: transparent; }
.ag-gin .gn-hand .pcard.gn-sel { box-shadow: 0 0 0 3px var(--accent), 0 10px 22px -8px rgba(0, 0, 0, .55); }
.ag-gin .gn-hand .pcard.gn-new::after { content: ""; position: absolute; right: 7%; top: 5%; width: calc(var(--cw) * .11); height: calc(var(--cw) * .11); min-width: 7px; min-height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px #FBFAF4; }
.ag-gin .gn-hand .pcard.gn-taken::after { background: var(--gold); }
.ag-gin .gn-hand .pcard.gn-drag { transition: none; z-index: 100 !important; box-shadow: 0 18px 34px -10px rgba(0, 0, 0, .6); }
.ag-gin .gn-hand .pcard.gn-flying { pointer-events: none; }
.ag-gin .gn-hand.gn-hot { outline: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; border-radius: 12px; }
.ag-gin .gn-mbar { position: absolute; left: 0; top: 0; height: 4px; border-radius: 3px; background: var(--gn-m0); pointer-events: none; transition: transform .22s cubic-bezier(.2, .8, .3, 1), width .22s; }
.ag-gin .gn-mbar[data-m="1"] { background: var(--gn-m1); } .ag-gin .gn-mbar[data-m="2"] { background: var(--gn-m2); } .ag-gin .gn-mbar[data-m="3"] { background: var(--gn-m3); }
.ag-gin .gn-ghost { position: absolute; left: 0; top: 0; z-index: 80; pointer-events: none; transform-origin: 0 0; box-shadow: 0 12px 24px -8px rgba(0, 0, 0, .55); }

/* sheets: the hand, the game, a new game */
.ag-gin .gn-sheet { position: fixed; left: 0; top: 0; width: 100%; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 6px; background: rgba(5, 8, 5, .62); border-radius: 14px; }
.ag-gin .gn-card { width: min(100%, 540px); max-height: 100%; overflow: auto; overscroll-behavior: contain; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 8px; box-shadow: 0 18px 50px rgba(0, 0, 0, .5); animation: gnin .18s ease-out; }
@keyframes gnin { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.ag-gin .gn-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ag-gin .gn-card h4 { font-size: 20px; line-height: 1.15; }
.ag-gin .gn-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ag-gin .gn-x { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; width: 44px; height: 44px; margin: -8px -8px 0 0; border-radius: 10px; flex: 0 0 auto; }
.ag-gin .gn-sd.win h4, .ag-gin .gn-final.win h4 { color: var(--good); }
.ag-gin .gn-sd.loss h4, .ag-gin .gn-final.loss h4 { color: var(--crit); }
.ag-gin .gn-sd { --scw: 42px; }
.ag-gin .gn-sd.gn-short { width: min(100%, 760px); grid-template-columns: minmax(0, 1.27fr) minmax(0, 1fr); column-gap: 16px; align-content: start; }
.ag-gin .gn-sd.gn-short > .gn-card-head, .ag-gin .gn-sd.gn-short > .gn-acts { grid-column: 1 / -1; }
.ag-gin .gn-sd.gn-short > .gn-h1 { grid-column: 1; grid-row: 2; }
.ag-gin .gn-sd.gn-short > .gn-h2 { grid-column: 1; grid-row: 3; }
.ag-gin .gn-sd.gn-short > .gn-math { grid-column: 2; grid-row: 2; align-self: start; }
.ag-gin .gn-sd.gn-short > .gn-take { grid-column: 2; grid-row: 3; align-self: start; }
.ag-gin .gn-sd-hand { display: grid; gap: 2px; }
.ag-gin .gn-sd-lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; }
.ag-gin .gn-sd-lab span { font: 600 12px var(--mono); color: var(--muted); }
.ag-gin .gn-sd-cards { display: flex; flex-wrap: wrap; gap: 6px 9px; align-items: flex-end; min-height: calc(var(--scw) * 1.4 + 8px); }
.ag-gin .gn-grp { display: inline-flex; padding-top: 5px; border-top: 3px solid var(--gn-m0); border-radius: 2px; }
.ag-gin .gn-grp[data-m="1"] { border-top-color: var(--gn-m1); } .ag-gin .gn-grp[data-m="2"] { border-top-color: var(--gn-m2); } .ag-gin .gn-grp[data-m="3"] { border-top-color: var(--gn-m3); }
.ag-gin .gn-grp.gn-dead { border-top: 3px dotted var(--muted); }
.ag-gin .gn-grp.gn-lay { border-top: 3px dashed var(--gold); }
.ag-gin .gn-slot { display: block; position: relative; }
.ag-gin .gn-slot + .gn-slot { margin-left: calc(var(--scw) * -.45); }
.ag-gin .gn-slot .pcard { --cw: var(--scw); }
.ag-gin .gn-slot.gn-laid .pcard { box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0, 0, 0, .35); }
.ag-gin .gn-math { list-style: none; margin: 0; padding: 6px 10px; display: grid; gap: 1px; border-radius: 10px; background: var(--raised); font-size: 13.5px; line-height: 1.4; opacity: 0; transition: opacity .25s; }
.ag-gin .gn-math li { display: flex; justify-content: space-between; gap: 10px; }
.ag-gin .gn-math li b { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ag-gin .gn-math li.tot { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; font-weight: 700; }
.ag-gin .gn-shown .gn-math { opacity: 1; }
.ag-gin .gn-tally { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1 1 150px; align-self: center; }
.ag-gin .gn-tally div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 6px; align-items: baseline; font-size: 12.5px; }
.ag-gin .gn-tally span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-gin .gn-tally i { grid-column: 1 / -1; height: 6px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) calc(var(--p) * 100%), var(--raised) 0); border: 1px solid var(--line); }
.ag-gin .gn-tally div + div i { background: linear-gradient(90deg, var(--muted) calc(var(--p) * 100%), var(--raised) 0); }
.ag-gin .gn-tally b { font: 700 16px var(--mono); }
.ag-gin .gn-take { font-size: 13.5px; line-height: 1.4; color: var(--ink); padding: 8px 10px; border-left: 3px solid var(--gold); background: var(--gold-soft); border-radius: 0 8px 8px 0; }
.ag-gin .gn-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; position: sticky; bottom: -12px; margin: 0 -12px -12px; padding: 8px 12px 12px; background: var(--surface); }
.ag-gin .gn-acts .btn { flex: 1 1 auto; justify-content: center; min-height: 46px; font-size: 15px; border-radius: 11px; }
.ag-gin .gn-tot { width: 100%; border-collapse: collapse; font-size: 14px; }
.ag-gin .gn-tot th, .ag-gin .gn-tot td { padding: 6px 4px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ag-gin .gn-tot th[scope="row"], .ag-gin .gn-tot thead th:first-child { text-align: left; font-weight: 500; color: var(--muted); }
.ag-gin .gn-tot thead th { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ag-gin .gn-tot tr.sum td, .ag-gin .gn-tot tr.sum th { font-weight: 800; color: var(--ink); border-bottom: 0; font-size: 16px; }
.ag-gin .gn-rc { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 17px; color: var(--muted); }
.ag-gin .gn-rc b { font-size: 30px; color: var(--ink); font-family: var(--display); }
.ag-gin .gn-rc em { font: 700 15px var(--mono); font-style: normal; }
.ag-gin .gn-rc em.up { color: var(--good); } .ag-gin .gn-rc em.dn { color: var(--crit); }
.ag-gin .gn-rc small { flex-basis: 100%; font-size: 12px; }
.ag-gin .gn-streak { color: var(--gold); font-weight: 700; }
.ag-gin .gn-lvls { display: grid; gap: 6px; }
.ag-gin .gn-lvl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--raised); color: var(--ink); font: inherit; cursor: pointer; }
.ag-gin .gn-lvl[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.ag-gin .gn-lvl b { font-size: 15px; }
.ag-gin .gn-lvl b i { font: 500 12px var(--mono); font-style: normal; color: var(--muted); margin-left: 4px; }
.ag-gin .gn-lvl small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; margin-top: 2px; }
.ag-gin .gn-lvl:not([aria-checked="true"]) small { display: none; }
.ag-gin .gn-lvl em { font: 600 12px var(--mono); font-style: normal; color: var(--muted); }
.ag-gin .gn-opt { display: flex; gap: 10px; align-items: center; min-height: 44px; font-size: 14px; cursor: pointer; }
.ag-gin .gn-opt input { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.ag-gin .gn-warn { color: var(--warn); font-size: 13px; }

/* the panel below (or beside) the table */
.ag-gin .gn-side { display: grid; gap: 14px; margin-top: 18px; }
.ag-gin .gn[data-side="1"] .gn-side { margin-top: 0; }
.ag-gin .gn-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.ag-gin .gn-panel:empty { display: none; }
.ag-gin .gn-rate-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.ag-gin .gn-big { font: 800 34px/1 var(--display); }
.ag-gin .gn-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.ag-gin .gn-stats b { color: var(--ink); font-family: var(--mono); }
.ag-gin .gn-spark { width: 100%; height: 40px; display: block; margin: 8px 0 2px; }
.ag-gin .gn-spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.8; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.ag-gin .gn-ladder { display: grid; gap: 2px; margin-top: 10px; }
.ag-gin .gn-rung { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 9px; font-size: 14px; }
.ag-gin .gn-rung.cur { background: var(--accent-soft); }
.ag-gin .gn-rung i, .ag-gin .gn-rung span { font: 500 12px var(--mono); font-style: normal; color: var(--muted); }
.ag-gin .gn-pilelist { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.ag-gin .gn-mini .pcard { --cw: 30px; }
.ag-gin .gn-held { margin-top: 8px; color: var(--muted); }
.ag-gin .gn-held b { color: var(--ink); }
.ag-gin .gn-hh { margin-top: 12px; }
.ag-gin .gn-hist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 13.5px; }
.ag-gin .gn-hist li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; padding: 4px 2px; border-bottom: 1px solid var(--line); }
.ag-gin .gn-hist li span { color: var(--muted); }
.ag-gin .gn-hist li em { font-style: normal; }
.ag-gin .gn-hist li b { font-family: var(--mono); }
.ag-gin .gn-hist li.up b { color: var(--good); } .ag-gin .gn-hist li.dn b { color: var(--crit); }
.ag-gin .gn-rules summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.ag-gin .gn-rules-body { font-size: 14px; line-height: 1.5; }
.ag-gin .gn-rules-body h5 { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 14px 0 4px; }
.ag-gin .gn-rules-body ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

@media (prefers-reduced-motion: reduce) {
  .ag-gin .gn-hand .pcard, .ag-gin .gn-mbar { transition: none; }
  .ag-gin .gn-go::after, .ag-gin .gn-dots i { animation: none; }
  .ag-gin .gn-card { animation: none; }
}
