/* the field: them above, you below; benches beside, the clock between */
.ga-field { width: 100%; height: 100%; max-width: 1200px; display: grid; gap: 6px 22px; align-items: center; justify-items: center;
  grid-template-columns: 1fr auto 1fr; grid-template-rows: auto 1fr auto 1fr auto;
  grid-template-areas: "tplate tcard tlog" "tbench tcard tlog" "mid mid mid" "mbench mcard macts" "mplate mcard macts"; }
.a-theirsplate { grid-area: tplate; justify-self: end; } .a-theirscard { grid-area: tcard; } .a-theirsbench { grid-area: tbench; justify-self: end; }
.a-mineplate { grid-area: mplate; justify-self: end; } .a-minecard { grid-area: mcard; } .a-minebench { grid-area: mbench; justify-self: end; }
.a-mid { grid-area: mid; } .a-acts { grid-area: macts; justify-self: start; } .a-log { grid-area: tlog; justify-self: start; align-self: stretch; }
.ga-slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ga-slot::before { content: ""; position: absolute; left: 50%; bottom: -6px; width: 120%; height: 30px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, 0.55), transparent 70%); z-index: -1; }
.ga-slot .gcard { --gw: min(210px, 25vh); transition: transform 0.15s; will-change: transform; }
.ga-bench { display: flex; gap: 10px; }
.ga-bench .gcard.mini { --gw: min(112px, 13.5vh); position: relative; }
.ga-bench .gcard.can { cursor: pointer; box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(242, 182, 50, 0.5); animation: gabreathe 1.6s ease-in-out infinite; }
.ga-bench .gcard.can:hover { transform: translateY(-8px) scale(1.05); }
@keyframes gabreathe { 50% { box-shadow: 0 0 0 2px var(--gold), 0 0 28px rgba(242, 182, 50, 0.85); } }
.ga-swaptag { position: absolute; left: 50%; top: 32%; transform: translate(-50%, -50%); z-index: 3; padding: 2px 8px; border-radius: 999px; background: var(--gold); color: #2b1d02; font-family: var(--f-ui); font-size: 11px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
.gcard.ko { filter: grayscale(1) brightness(0.45); }
.gcard.ko::before { content: "K.O."; position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-14deg); z-index: 3; padding: 0 8px; border: 3px solid #c0262f; border-radius: 6px; color: #ff5a4a; font-family: var(--f-ui); font-size: 1.4em; background: rgba(0, 0, 0, 0.6); }
.gcard.struck { animation: gastruck 0.45s ease-out; }
@keyframes gastruck { 0% { filter: brightness(3) saturate(0); } 20% { transform: translateX(-10px) rotate(-3deg); } 45% { transform: translateX(8px) rotate(2deg); filter: brightness(1.4) sepia(0.6) hue-rotate(-40deg); } 70% { transform: translateX(-4px); } 100% { transform: none; filter: none; } }
.gcard.cracked::after { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(115deg, transparent 46%, rgba(0, 0, 0, 0.8) 47%, transparent 49%), linear-gradient(35deg, transparent 56%, rgba(0, 0, 0, 0.7) 57%, transparent 58.5%), linear-gradient(160deg, transparent 30%, rgba(0, 0, 0, 0.7) 31%, transparent 32.5%); }
.ga-hp { position: relative; width: 100%; height: 16px; border-radius: 8px; overflow: hidden; background: rgba(0, 0, 0, 0.7); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.5); }
.ga-hp i { position: absolute; left: 0; top: 0; bottom: 0; }
.ga-hp .lag { background: #fff3b0; transition: width 0.6s ease-in; }
.ga-hp .now { background: linear-gradient(#8ff07a, #2e9a2a); transition: width 0.25s ease-out; }
.ga-hp.low .now { background: linear-gradient(#ff9a7a, #c0262f); animation: galow 0.8s ease-in-out infinite alternate; }
@keyframes galow { to { filter: brightness(1.4); } }
.ga-hp span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--f-ui); font-size: 11px; color: #fff; text-shadow: 0 1px 2px #000; }
.ga-hp.small { height: 6px; position: absolute; left: 6%; right: 6%; bottom: 3px; width: auto; }
.ga-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 18px; }
.ga-badges span { padding: 1px 8px; border-radius: 999px; font-family: var(--f-ui); font-size: 13px; background: rgba(0, 0, 0, 0.55); border: 1px solid rgba(255, 255, 255, 0.15); }
.ga-badges .poison { color: #d58aff; } .ga-badges .shell { color: #8fd0ff; } .ga-badges .ambush { color: #ffcf4a; }
.ga-plate { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.3)); border: 1px solid rgba(242, 182, 50, 0.35); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5); }
.ga-face { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; display: flex; align-items: flex-end; justify-content: center; background: radial-gradient(circle at 50% 30%, #4a3a20, #1a1e26); border: 2px solid var(--gold); }
.ga-pinfo { display: flex; flex-direction: column; } .ga-pinfo b { font-family: var(--f-ui); font-size: 15px; }
.ga-status { font-family: var(--f-ui); font-size: 14px; }
.ga-status.think { color: var(--ink-dim); } .ga-status.think::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: currentColor; animation: gapulse 1s infinite; }
.ga-status.ready { color: #7aff2a; animation: cardpop 0.4s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes gapulse { 50% { opacity: 0.2; } }
.ga-mid { width: 100%; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 4px 0; border-top: 1px solid rgba(242, 182, 50, 0.2); border-bottom: 1px solid rgba(242, 182, 50, 0.2); background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.45), transparent); }
.ga-turn { font-family: var(--f-ui); color: var(--gold); font-size: 16px; }
.ga-tri { font-size: 15px; opacity: 0.85; } .ga-tri span { margin: 0 2px; }
.ga-match { font-family: var(--f-ui); color: var(--ink-dim); }
.ga-said { font-family: var(--f-ui); font-size: 16px; max-width: 46%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-acts { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ga-ring { --p: 1; position: relative; width: 132px; height: 132px; display: flex; align-items: center; justify-content: center; }
.ga-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ga-ring circle { fill: none; stroke-width: 6; } .ga-ring .bg { stroke: rgba(0, 0, 0, 0.5); }
.ga-ring .fg { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p) * 100); transition: stroke-dashoffset 0.1s linear; filter: drop-shadow(0 0 6px rgba(242, 182, 50, 0.7)); }
.ga-ring.hurry .fg { stroke: #ff5a4a; filter: drop-shadow(0 0 8px rgba(255, 90, 74, 0.9)); }
.ga-ring.hurry { animation: gahurry 0.5s ease-in-out infinite alternate; }
@keyframes gahurry { to { transform: scale(1.05); } }
.ga-secs { position: absolute; right: -2px; top: -2px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 14px; display: flex; align-items: center; justify-content: center; background: #1a1e26; border: 2px solid var(--gold); font-family: var(--f-ui); font-size: 13px; }
.ga-ring.hurry .ga-secs { border-color: #ff5a4a; color: #ff8a7a; }
.ga-attack { width: 108px; height: 108px; border-radius: 50%; border: 3px solid #1a1e26; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; color: #fff3b0;
  background: radial-gradient(circle at 35% 30%, #ff7a5a, #b3202c 55%, #5a0a10); box-shadow: 0 6px 0 #3a0508, 0 10px 24px rgba(0, 0, 0, 0.6), inset 0 2px 8px rgba(255, 255, 255, 0.35); transition: transform 0.1s; }
.ga-attack .sw { font-size: 34px; filter: drop-shadow(0 2px 2px #000); }
.ga-attack b { font-family: var(--f-ui); font-size: 15px; text-shadow: 0 2px 2px #000; }
.ga-attack:hover:not(:disabled) { transform: translateY(-3px) scale(1.04); }
.ga-attack:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 #3a0508, 0 4px 10px rgba(0, 0, 0, 0.6); }
.ga-attack:disabled { cursor: default; filter: grayscale(0.6) brightness(0.7); }
.ga-attack.done { filter: none; background: radial-gradient(circle at 35% 30%, #a8f07a, #2e8a2a 55%, #0f3a0a); box-shadow: 0 6px 0 #0a2a05, 0 10px 24px rgba(0, 0, 0, 0.6); }
.ga-strong { font-family: var(--f-ui); font-size: 12px; color: #ffcf4a; animation: gapulse 1s infinite; }
.ga-hint { font-family: var(--f-ui); color: var(--ink-dim); font-size: 14px; text-align: center; max-width: 220px; }
.ga-log { width: min(260px, 100%); max-height: 100%; overflow-y: auto; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.08); font-family: var(--f-ui); font-size: 14px; }
.ga-log .gl { padding: 2px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); animation: galine 0.3s ease-out; }
.ga-log .gl.mine { color: #7aff2a; } .ga-log .gl.theirs { color: #ff9a8a; }
@keyframes galine { from { transform: translateX(-10px); opacity: 0; } }

/* effects */
.ga-pop { position: fixed; transform: translate(-50%, -50%); font-family: var(--f-ui); font-size: 34px; color: #fff; text-shadow: 0 3px 0 #000, 0 0 12px rgba(0, 0, 0, 0.8); white-space: nowrap; animation: gapop 1.3s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.ga-pop.dmg { color: #ff5a4a; } .ga-pop.crit { color: #ffcf4a; font-size: 48px; } .ga-pop.small { font-size: 20px; }
.ga-pop.heal { color: #8ff07a; } .ga-pop.poison { color: #d58aff; font-size: 24px; } .ga-pop.block { color: #8fd0ff; font-size: 26px; } .ga-pop.dodge { color: #fff3b0; font-size: 26px; }
.ga-pop.ko { color: #ff3a2a; font-size: 56px; } .ga-pop.go { color: #fff3b0; font-size: 26px; } .ga-pop.rage { color: #ff6a4a; font-size: 22px; } .ga-pop.ambush { color: #ffcf4a; font-size: 22px; }
@keyframes gapop { 0% { transform: translate(-50%, -20%) scale(0.3); opacity: 0; } 15% { transform: translate(-50%, -60%) scale(1.25); opacity: 1; } 30% { transform: translate(-50%, -70%) scale(1); } 100% { transform: translate(-50%, -170%) scale(0.9); opacity: 0; } }
.ga-spark { position: fixed; width: 9px; height: 9px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 10px #ffcf4a; }
.ga-spark.hit { background: #ffb04a; } .ga-spark.crit { background: #fff; width: 12px; height: 12px; box-shadow: 0 0 14px #ffcf4a, 0 0 4px #fff; }
.ga-spark.heal { background: #8ff07a; box-shadow: 0 0 10px #4fd03a; border-radius: 2px; transform: rotate(45deg); }
.ga-spark.poison { background: #b86ae0; box-shadow: 0 0 10px #8a2ab0; width: 12px; height: 12px; }
.ga-shield { position: absolute; inset: -14px; z-index: 6; border-radius: 30%; pointer-events: none; border: 3px solid rgba(143, 208, 255, 0.9); background: radial-gradient(circle, rgba(143, 208, 255, 0.15), rgba(143, 208, 255, 0.45)); box-shadow: 0 0 30px rgba(143, 208, 255, 0.8); animation: gashield 0.7s ease-out forwards; }
@keyframes gashield { 0% { transform: scale(0.6); opacity: 0; } 30% { transform: scale(1.05); opacity: 1; } 70% { opacity: 1; } 100% { transform: scale(1.3); opacity: 0; } }
.ga-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-family: var(--f-ui); font-size: clamp(36px, 9vw, 96px); white-space: nowrap; color: #fff3b0; text-shadow: 0 6px 0 #1a1e26, 0 0 40px rgba(242, 182, 50, 0.8); animation: gabanner 1.5s cubic-bezier(.2, 1.3, .4, 1) forwards; }
.ga-banner.turn { font-size: clamp(26px, 6vw, 56px); animation: gaturn 1.2s ease-in-out forwards; }
.ga-banner.crit { font-size: clamp(28px, 7vw, 64px); color: #ffcf4a; top: 50%; }
.ga-banner.win { color: #7aff2a; text-shadow: 0 6px 0 #0f2a08, 0 0 50px rgba(122, 255, 42, 0.9); } .ga-banner.lose { color: #ff5a4a; text-shadow: 0 6px 0 #2a0505, 0 0 50px rgba(255, 90, 74, 0.8); }
@keyframes gabanner { 0% { transform: translate(-50%, -50%) scale(3); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(0.95); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1.05); } 80% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
@keyframes gaturn { 0% { transform: translate(-150%, -50%); opacity: 0; } 25%, 75% { transform: translate(-50%, -50%); opacity: 1; } 100% { transform: translate(50%, -50%); opacity: 0; } }
.ga-intro { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 4vw; background: rgba(0, 0, 0, 0.55); transition: opacity 0.5s; }
.ga-intro.out { opacity: 0; }
.ga-iname { font-family: var(--f-ui); font-size: clamp(24px, 6vw, 64px); color: #fff3b0; text-shadow: 0 4px 0 #000; }
.ga-iname.theirs { animation: gaslidel 0.5s cubic-bezier(.2, 1.3, .4, 1); color: #ff9a8a; } .ga-iname.mine { animation: gasliger 0.5s cubic-bezier(.2, 1.3, .4, 1); color: #7aff2a; }
.ga-ivs { font-family: var(--f-ui); font-size: clamp(40px, 10vw, 110px); color: var(--gold); text-shadow: 0 6px 0 #000, 0 0 40px rgba(242, 182, 50, 0.9); animation: gabanner 1.5s cubic-bezier(.2, 1.3, .4, 1) both; position: static; transform: none; }
@keyframes gaslidel { from { transform: translateX(-60vw); } } @keyframes gasliger { from { transform: translateX(60vw); } }

/* waiting, picking, and the result */
.ga-wait, .ga-pick, .ga-result { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 900px; width: 100%; max-height: 100%; text-align: center; }
.ga-vs { font-family: var(--f-ui); font-size: 48px; color: var(--gold); text-shadow: 0 4px 0 #000; }
.ga-big { font-family: var(--f-ui); font-size: 22px; }
.ga-dots { display: flex; gap: 8px; } .ga-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); animation: gapulse 1.2s infinite; } .ga-dots i:nth-child(2) { animation-delay: 0.2s; } .ga-dots i:nth-child(3) { animation-delay: 0.4s; }
.ga-title { margin: 0; font-family: var(--f-ui); font-size: clamp(24px, 5vw, 40px); color: var(--gold); text-shadow: 0 4px 0 #000; }
.ga-picktop { display: flex; align-items: center; gap: 18px; }
.ga-picktop .ga-ring { width: 64px; height: 64px; } .ga-picktop .ga-secs { position: static; border: none; background: none; font-size: 18px; }
.ga-pickslots { display: flex; gap: 14px; justify-content: center; }
.ga-pslot { position: relative; width: min(130px, 26vw); aspect-ratio: 5 / 7; border: 2px dashed rgba(242, 182, 50, 0.5); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.3); }
.ga-pslot.first { border-color: var(--gold); box-shadow: 0 0 20px rgba(242, 182, 50, 0.3); }
.ga-pslot .gcard.mini { --gw: min(130px, 26vw); position: absolute; inset: 0; }
.ga-plabel { position: absolute; bottom: -20px; left: 0; right: 0; font-family: var(--f-ui); font-size: 13px; color: var(--ink-dim); }
.ga-lock { margin-top: 14px; }
.ga-hand { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; overflow-y: auto; padding: 8px; flex: 1; min-height: 120px; }
.ga-hand .gcard.mini { --gw: min(118px, 25vw); transition: transform 0.15s, opacity 0.2s; }
.ga-hand .gcard.mini:hover { transform: translateY(-8px) rotate(-1deg); }
.ga-hand .gcard.taken { opacity: 0.3; transform: scale(0.92); }
.ga-result { position: relative; justify-content: center; }
.ga-result h1 { margin: 0; font-family: var(--f-ui); font-size: clamp(48px, 12vw, 110px); animation: gabanner 2s cubic-bezier(.2, 1.3, .4, 1) both; animation-name: garesult; }
@keyframes garesult { from { transform: scale(3); opacity: 0; } }
.ga-result.won h1 { color: #7aff2a; text-shadow: 0 6px 0 #0f2a08, 0 0 60px rgba(122, 255, 42, 0.8); } .ga-result.lost h1 { color: #ff5a4a; text-shadow: 0 6px 0 #2a0505, 0 0 50px rgba(255, 90, 74, 0.7); } .ga-result.draw h1 { color: var(--gold); }
.ga-result p { margin: 0; font-family: var(--f-ui); font-size: 19px; }
.ga-rays { position: absolute; left: 50%; top: 30%; width: 160vmax; height: 160vmax; transform: translate(-50%, -50%); z-index: -1; pointer-events: none; opacity: 0.25; animation: garays 30s linear infinite;
  background: repeating-conic-gradient(from 0deg, rgba(242, 182, 50, 0.35) 0 6deg, transparent 6deg 18deg); -webkit-mask-image: radial-gradient(circle, #000 0, transparent 50%); mask-image: radial-gradient(circle, #000 0, transparent 50%); }
.ga-result.lost .ga-rays { opacity: 0.1; filter: hue-rotate(-40deg); }
@keyframes garays { to { transform: translate(-50%, -50%) rotate(360deg); } }
.ga-teams { display: flex; gap: 28px; flex-wrap: wrap; justify-content: center; }
.ga-tcol { display: flex; flex-direction: column; align-items: center; gap: 6px; font-family: var(--f-ui); }
.ga-tcards { display: flex; gap: 6px; } .ga-tcards .gcard.mini { --gw: min(96px, 26vw); }
.ga-reward { display: flex; gap: 10px; } .ga-reward span { padding: 4px 14px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--gold); font-family: var(--f-ui); animation: cardpop 0.5s 0.6s cubic-bezier(.2, 1.6, .4, 1) both; }
.ga-racts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; }

/* decks */
.gdecks { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
/* play mats: a series felt with a gold-stamped crest; the grandmaster one in holo foil with a little glitter.
   Kept quiet: they sit under the cards. Each series brings its own colours (--m1 felt, --m2 edge, --m3 deep). */
.gmat { position: relative; overflow: hidden; border-radius: 18px; isolation: isolate; --gold1: #f6dd8a; --gold2: #c9a23a;
  background: radial-gradient(ellipse 75% 70% at 50% 50%, var(--m1), var(--m2) 62%, var(--m3)); border: 2px solid var(--gold2);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 6px 24px rgba(0, 0, 0, 0.45); }
.gmat.s-s1 { --m1: #4b2160; --m2: #2c1038; --m3: #14061a; }
.gmat.s-s1.t-grand { --m1: #2a1650; --m2: #150a2e; --m3: #07030f; }
.gmat::before { content: ""; position: absolute; inset: 8px; border-radius: 12px; border: 1px solid rgba(246, 221, 138, 0.45); pointer-events: none; }
.gmat .gmfelt { position: absolute; inset: 0; opacity: 0.18; pointer-events: none; background: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 1px, transparent 1px 5px), repeating-linear-gradient(-45deg, rgba(0, 0, 0, 0.3) 0 1px, transparent 1px 6px); }
.gmat { container-type: inline-size; }
/* the middle is where the active card stands: a soft light and a thin gold ring round its feet, nothing to hide */
.gmat .gmstage { position: absolute; left: 50%; top: 50%; width: min(46%, 380px); aspect-ratio: 1.9; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none;
  background: radial-gradient(ellipse, rgba(246, 221, 138, 0.13), transparent 68%); }
.gmat .gmstage::before, .gmat .gmstage::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(246, 221, 138, 0.28); }
.gmat .gmstage::before { inset: 8%; } .gmat .gmstage::after { inset: 15%; border-style: dashed; border-color: rgba(246, 221, 138, 0.16); }
/* the crest sits at the two ends, clear of the cards; on a narrow mat the cards fill it, so they go */
.gmat .gmend { position: absolute; top: 50%; width: min(12cqw, 130px); max-height: 74%; aspect-ratio: 1; transform: translateY(-50%); opacity: 0.4; pointer-events: none; }
.gmat .gmend.l { left: max(3%, 22px); } .gmat .gmend.r { right: max(3%, 22px); }
.gmat .gmend svg, .gmat .gmcrest svg { width: 100%; height: 100%; display: block; }
@container (max-width: 560px) { .gmat .gmend { display: none; } }
/* the mid-edge marks: a little diamond on each long edge, and a rule running out from it */
.gmat .gmedge { position: absolute; left: 50%; width: min(30%, 240px); height: 9px; transform: translateX(-50%); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(246, 221, 138, 0.5) 30%, rgba(246, 221, 138, 0.5) 70%, transparent) center / 100% 1px no-repeat; }
.gmat .gmedge::after { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; background: var(--gold1); transform: translate(-50%, -50%) rotate(45deg); }
.gmat .gmedge.t { top: 3px; } .gmat .gmedge.b { bottom: 3px; }
/* with nothing on it (the popup, the little previews), the crest goes in the middle instead */
.gmat .gmcrest { position: absolute; left: 50%; top: 50%; height: 84%; aspect-ratio: 1; transform: translate(-50%, -50%); opacity: 0.4; pointer-events: none; }
.gmat.solo .gmstage, .gmat.solo .gmend { display: none; }
.gmat .gmc { position: absolute; width: 22px; height: 22px; border: 2px solid var(--gold2); opacity: 0.7; pointer-events: none; }
.gmat .gmc::after { content: ""; position: absolute; width: 6px; height: 6px; background: var(--gold1); transform: rotate(45deg); }
.gmat .gmc.tl { left: 14px; top: 14px; border-right: none; border-bottom: none; } .gmat .gmc.tl::after { left: 4px; top: 4px; }
.gmat .gmc.tr { right: 14px; top: 14px; border-left: none; border-bottom: none; } .gmat .gmc.tr::after { right: 4px; top: 4px; }
.gmat .gmc.bl { left: 14px; bottom: 14px; border-right: none; border-top: none; } .gmat .gmc.bl::after { left: 4px; bottom: 4px; }
.gmat .gmc.br { right: 14px; bottom: 14px; border-left: none; border-top: none; } .gmat .gmc.br::after { right: 4px; bottom: 4px; }
.gmat.t-grand { border-color: var(--gold1); box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 0 18px rgba(246, 221, 138, 0.25), 0 6px 24px rgba(0, 0, 0, 0.45); }
.gmat.t-grand .gmcrest, .gmat.t-grand .gmend { opacity: 0.5; }
/* the foil: a slow rainbow sheen over everything, faint */
.gmat.t-grand::after { content: ""; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.12; background-size: 300% 300%;
  background-image: linear-gradient(115deg, transparent 34%, #ff7ad9 41%, #7ad9ff 46%, #b4ff7a 51%, #ffe27a 56%, transparent 63%); animation: gmfoil 14s ease-in-out infinite alternate; }
@keyframes gmfoil { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
.gmat .gmg { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: #fff8d6; box-shadow: 0 0 6px 1px rgba(255, 240, 180, 0.9); opacity: 0; pointer-events: none; animation: gmtwinkle 4.5s ease-in-out infinite; }
@keyframes gmtwinkle { 0%, 70%, 100% { opacity: 0; transform: scale(0.4); } 80% { opacity: 0.9; transform: scale(1.3); } }
body.idle .gmat::after, body.idle .gmat .gmg, body.idle #gmatwin * { animation-play-state: running !important; }
@media (prefers-reduced-motion: reduce) { .gmat::after, .gmat .gmg { animation: none; } }
/* the mat under each side in battle */
.ga-field { position: relative; z-index: 0; }
.ga-mat { z-index: -1; grid-column: 1 / -1; align-self: stretch; justify-self: center; width: min(100%, 900px); margin: -4px 0; }
.a-theirsmat { grid-row: 1 / 3; transform: rotate(180deg); } .a-minemat { grid-row: 4 / 6; }
/* the mat on a deck, and picking one */
.gdcards.hasmat { position: relative; padding: 10px; border-radius: 14px; isolation: isolate; }
.gdcards.hasmat > .gmat { position: absolute; inset: 0; z-index: -1; }
.gdmats { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; }
.gdmats > span { font-family: var(--f-ui); font-size: 16px; color: var(--ink-dim); }
.gdmat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border-radius: 12px; cursor: pointer; background: none; border: 2px solid transparent; color: var(--ink); font-family: var(--f-ui); font-size: 14px; }
.gdmat .gmat, .gdmat .gmnone { width: 132px; height: 54px; border-radius: 10px; }
.gdmat .gmat::before { inset: 4px; border-radius: 7px; } .gdmat .gmat .gmc, .gdmat .gmat .gmedge { display: none; }
.gdmat .gmnone { display: grid; place-items: center; border: 2px dashed rgba(255, 255, 255, 0.2); color: var(--ink-dim); }
.gdmat.on { border-color: var(--gold); background: rgba(242, 182, 50, 0.1); }
/* collection goals */
.gsets { display: flex; flex-direction: column; gap: 10px; }
.gset { display: grid; grid-template-columns: 52px 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(242, 182, 50, 0.25); }
.gset.done { border-color: rgba(126, 224, 122, 0.6); background: rgba(126, 224, 122, 0.07); }
.gset .gsico { grid-row: 1 / 3; font-size: 30px; text-align: center; }
.gset .gsname { font-family: var(--f-ui); font-size: 16px; } .gset .gstext { font-family: var(--f-ui); font-size: 15px; color: var(--ink-dim); }
.gset .gsbar { grid-column: 2; height: 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.gset .gsbar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #8fbf3a, #f2b632); }
.gset.done .gsbar i { background: #7ee07a; }
.gset .gsrw { grid-row: 1 / 3; grid-column: 3; display: flex; flex-direction: column; align-items: center; gap: 4px; font-family: var(--f-ui); font-size: 14px; text-align: center; min-width: 92px; }
.gset .gsrw .gmat { width: 110px; height: 44px; border-radius: 9px; } .gset .gsrw .gmat::before { inset: 3px; border-radius: 6px; } .gset .gsrw .gmat .gmc, .gset .gsrw .gmat .gmedge { display: none; }
.gset .gsn { font-family: var(--f-ui); font-size: 14px; color: var(--ink-dim); grid-column: 2; }
.gset.done .gsn { color: #7ee07a; }
@media (max-width: 560px) { .gset { grid-template-columns: 40px 1fr; } .gset .gsrw { grid-row: auto; grid-column: 1 / -1; flex-direction: row; justify-content: center; } }
/* a mat won: a popup like a mythical find */
#gmatwin { position: fixed; inset: 0; z-index: 96; display: none; align-items: center; justify-content: center; padding: 16px; overflow: hidden; background: radial-gradient(circle at 50% 45%, rgba(110, 60, 20, 0.9), rgba(10, 5, 2, 0.96) 70%); }
#gmatwin.open { display: flex; }
#gmatwin .myrays { position: absolute; inset: -50%; pointer-events: none; animation: myspin 30s linear infinite; background: repeating-conic-gradient(from 0deg, rgba(246, 221, 138, 0.14) 0deg 8deg, transparent 8deg 22deg); }
#gmatwin .gmwcard { position: relative; width: min(620px, 100%); padding: 22px 20px 18px; border-radius: 22px; text-align: center; background: linear-gradient(170deg, #2a1c0c, #0d0804); border: 3px solid #f2b632; box-shadow: 0 0 60px rgba(242, 182, 50, 0.55); animation: cardpop 0.8s cubic-bezier(.2, 1.6, .4, 1); }
#gmatwin .mylab { font-family: var(--f-ui); font-size: 14px; letter-spacing: 0.3em; text-transform: uppercase; color: #f6dd8a; }
#gmatwin .gmwmat { margin: 14px auto 10px; width: 100%; aspect-ratio: 5 / 2; animation: gmwrise 1.1s cubic-bezier(.2, 1.3, .4, 1) both 0.15s; }
#gmatwin .gmwmat .gmat { width: 100%; height: 100%; }
@keyframes gmwrise { from { opacity: 0; transform: perspective(700px) rotateX(55deg) translateY(30px) scale(0.8); } to { opacity: 1; transform: none; } }
#gmatwin .gmwshine { position: absolute; inset: 0; pointer-events: none; border-radius: 18px; background: linear-gradient(105deg, transparent 35%, rgba(255, 248, 214, 0.55) 50%, transparent 65%); background-size: 250% 100%; animation: gmwshine 1.6s ease-out 1s both; }
@keyframes gmwshine { from { background-position: 150% 0; } to { background-position: -50% 0; } }
#gmatwin h3 { margin: 4px 0 6px; font-family: var(--f-head); font-weight: 400; font-size: clamp(24px, 5.5vw, 34px); color: #ffe9a8; }
#gmatwin p { margin: 6px 0; font-family: var(--f-ui); font-size: 17px; color: var(--ink); }
#gmatwin .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 12px; }
#gmatwin .gmwspark { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #fff3b0; box-shadow: 0 0 10px 3px rgba(255, 220, 120, 0.9); pointer-events: none; animation: gmwspark 2.4s ease-out forwards; }
@keyframes gmwspark { from { opacity: 1; transform: translate(0, 0) scale(1); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.2); } }
.gdeck { padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(242, 182, 50, 0.3); }
.gdeck.broken { opacity: 0.6; }
.gdhead { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; } .gdhead b { font-family: var(--f-ui); font-size: 17px; }
.gdfirst { font-family: var(--f-ui); font-size: 13px; padding: 1px 8px; border-radius: 999px; background: rgba(242, 182, 50, 0.2); color: var(--gold); }
.gdcards { display: flex; gap: 8px; } .gdcards .gcard.mini { --gw: min(110px, 26vw); } .gdcards .gcard.lead { box-shadow: 0 0 0 3px var(--gold), 0 6px 18px rgba(0, 0, 0, 0.5); }
.gdacts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.gdedit { display: flex; gap: 8px; margin-bottom: 18px; }
.gdname { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 2px solid var(--gold); background: rgba(0, 0, 0, 0.4); color: var(--ink); font-family: var(--f-ui); font-size: 16px; }
.gdslots { margin-bottom: 26px; }
.gdgrid { max-height: 46vh; margin-top: 10px; }
.gcard.locked { opacity: 0.35; filter: grayscale(0.7); }
.glock { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%) rotate(-8deg); z-index: 4; padding: 1px 6px; border-radius: 6px; background: #1a1e26; color: #ffd23c; font-family: var(--f-ui); font-size: 10px; white-space: nowrap; border: 1px solid #ffd23c; }
.ga-lockrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.ga-lockrow .ga-lock { margin-top: 0; }
.ga-decks { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.ga-dlab { font-family: var(--f-ui); color: var(--ink-dim); }
.ga-deckbtn { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 14px; border-radius: 12px; cursor: pointer; color: var(--ink); background: linear-gradient(#3a2a14, #1a1e26); border: 2px solid var(--gold); box-shadow: 0 4px 0 #0a0603, 0 6px 14px rgba(0, 0, 0, 0.5); transition: transform 0.1s; }
.ga-deckbtn:hover { transform: translateY(-3px); } .ga-deckbtn:active { transform: translateY(2px); }
.ga-deckbtn b { font-family: var(--f-ui); font-size: 14px; }
.ga-dicons { display: flex; gap: 3px; } .ga-dicons i { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; border: 2px solid #8a8a80; background: #2a2a2a; }
.ga-dicons i.r-rare { border-color: #4fb6ff; } .ga-dicons i.r-legendary { border-color: #ffd23c; box-shadow: 0 0 6px #ffd23c; }

