/* Game Art (js/gameart.js): the games, a game's slots, the slot canvas's menu and the live preview window. */

/* ---- Home */
.mega-gameart { --shade: #b01f6a; background: linear-gradient(135deg, #ff7ab8, #e8338f); box-shadow: 0 7px 0 var(--shade), 0 18px 34px rgba(232, 51, 143, 0.3); }

/* ---- the games */
.ga-games { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.ga-game { position: relative; }
.ga-icon { width: 104px; height: 104px; display: grid; place-items: center; }
.ga-icon img { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 6px 16px rgba(42, 36, 64, 0.22); display: block; }
.ga-icon-none { width: 96px; height: 96px; border-radius: 24px; background: linear-gradient(135deg, #ff7ab8, #8a78ff); display: block; }
.ga-count { font-style: normal; font-size: 13px; color: var(--green-d); min-height: 1.2em; }
@media (max-width: 480px) { .ga-icon, .ga-icon img, .ga-icon-none { width: 72px; height: 72px; border-radius: 18px; } }

/* ---- a game's slots */
.ga-body { width: min(1100px, 100%); justify-content: flex-start; }
.ga-head { display: flex; align-items: center; gap: 16px; margin: 0 0 14px; }
.ga-head .ga-lead { flex: 1; text-align: left; font-size: 15.5px; margin: 0; text-wrap: pretty; }
.ga-play { flex: none; text-decoration: none; height: 44px; color: var(--accent-d); background: #fff; box-shadow: 0 4px 0 var(--press); }
.ga-play .ic { width: 20px; height: 20px; }
@media (max-width: 640px) { .ga-head { flex-direction: column; align-items: stretch; gap: 10px; } .ga-play { align-self: flex-start; } }
.ga-tools { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; }
.ga-groups { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; padding: 2px 2px 6px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); padding-right: 26px; }
.ga-groups::-webkit-scrollbar { display: none; }
.ga-group { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 20px; background: rgba(255, 255, 255, 0.85); color: #4d466a; font-size: 14.5px; box-shadow: 0 3px 0 var(--press); transition: background 0.15s, color 0.15s, transform 0.1s; }
.ga-group small { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #ece9f5; color: var(--muted); font-size: 12px; display: grid; place-items: center; }
.ga-group.on { background: var(--accent); color: #fff; box-shadow: 0 3px 0 var(--accent-d); }
.ga-group.on small { background: rgba(255, 255, 255, 0.25); color: #fff; }
.ga-group:active { transform: translateY(2px); }
.ga-find { flex: none; display: flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px; border-radius: 21px; background: #fff; box-shadow: inset 0 0 0 2px var(--line); color: var(--muted); }
.ga-find .ic { width: 18px; height: 18px; }
.ga-find input { width: 130px; border: 0; outline: 0; background: none; font: inherit; font-size: 15px; color: var(--ink); -webkit-user-select: text; user-select: text; }
.ga-find:focus-within { box-shadow: inset 0 0 0 2px var(--accent); }
@media (max-width: 640px) { .ga-tools { flex-direction: column; align-items: stretch; } .ga-find input { width: 100%; } }

.ga-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 0; color: var(--muted); text-align: center; }
.ga-wait .spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid #e4e0f0; border-top-color: var(--accent); animation: kitSpin 0.8s linear infinite; }
.ga-wait small { font-weight: 700; max-width: 420px; }
.ga-wait .btn { margin-top: 6px; }

.ga-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 14px; padding-bottom: 12px; }
.ga-slot {
  position: relative; display: flex; flex-direction: column; border-radius: 22px; background: #fff;
  box-shadow: 0 5px 0 var(--press), 0 12px 24px rgba(42, 36, 64, 0.09);
  animation: popin 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(var(--i) * 25ms);
}
.ga-slot-main { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 9px 9px 11px; text-align: left; border-radius: 22px; }
.ga-slot:has(.ga-slot-main:active) { transform: translateY(3px); box-shadow: 0 2px 0 var(--press), 0 6px 14px rgba(42, 36, 64, 0.09); }
@media (hover: hover) and (pointer: fine) { .ga-slot:has(.ga-slot-main:hover) { box-shadow: 0 5px 0 var(--press), 0 0 0 3px color-mix(in srgb, var(--c) 55%, transparent), 0 12px 24px rgba(42, 36, 64, 0.12); } }
.ga-extras { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 9px 10px; margin-top: -3px; }
.ga-extra { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px 0 9px; border-radius: 15px; background: #f1eff8; color: #4d466a; font-size: 13px; transition: background 0.15s, transform 0.1s; }
.ga-extra:active { transform: translateY(2px); }
@media (hover: hover) and (pointer: fine) { .ga-extra:hover { background: color-mix(in srgb, var(--c) 22%, #f1eff8); color: var(--ink); } }
.ga-dot { width: 9px; height: 9px; border-radius: 50%; background: #c9c4da; flex: none; }
.ga-dot.sent { background: var(--green); } .ga-dot.drawn { background: var(--accent); } .ga-dot.has { background: #2f6cf0; }
.ga-thumb { position: relative; aspect-ratio: 1; border-radius: 15px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 42%, color-mix(in srgb, var(--c) 30%, #2a2140) 0%, #120d1f 70%, #07050f 100%); }
.ga-thumb canvas { width: 100%; height: 100%; display: block; object-fit: contain; opacity: 0; transition: opacity 0.3s; }
.ga-thumb canvas.in { opacity: 1; }
.ga-thumb::after { content: ''; position: absolute; width: 42%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--c) 70%, #fff); opacity: 0.22; filter: blur(8px); pointer-events: none; transition: opacity 0.3s; }
.ga-thumb:has(canvas.in)::after { opacity: 0; }
.ga-slot-text { display: flex; flex-direction: column; min-width: 0; padding: 0 3px; }
.ga-slot-text b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-slot-text small { color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-badge { position: absolute; top: 15px; left: 15px; font-style: normal; font-size: 11px; letter-spacing: 0.3px; padding: 3px 8px; border-radius: 10px; color: #fff; background: rgba(20, 16, 34, 0.62); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.ga-badge.sent { background: var(--green); box-shadow: 0 2px 0 var(--green-d); }
.ga-badge.drawn { background: var(--accent); box-shadow: 0 2px 0 var(--accent-d); }
.ga-badge.has { background: rgba(47, 108, 240, 0.9); }
.ga-badge.empty { background: rgba(20, 16, 34, 0.5); color: rgba(255, 255, 255, 0.85); }
.ga-none { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 30px 0; }
@media (max-width: 480px) { .ga-grid { grid-template-columns: 1fr 1fr; gap: 11px; } }

/* NB Cell's own password, asked the plain way the site asks */
.ga-locked { align-self: center; width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 18px; margin: 20px auto; border-radius: 22px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.ga-locked p { margin: 0; color: var(--muted); font-size: 15px; }
.ga-locked p b { color: var(--ink); }
.ga-pw { display: flex; gap: 8px; }
.ga-pw input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border-radius: 14px; border: 0; background: #f4f2fa; font: inherit; font-size: 16px; color: var(--ink); outline: 0; -webkit-user-select: text; user-select: text; }
.ga-pw input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.ga-err { color: var(--red-d); font-size: 14px; min-height: 1.1em; }

/* ---- the slot canvas: its menu */
body.kind-gameart .solo-only, body.kind-gameart .party-only { display: none !important; }
body:not(.kind-gameart) .gameart-only { display: none !important; }
body:not(.ga-is-sent) .ga-sent-only { display: none !important; }

/* ---- the live preview: a window over the canvas, the game's own page in it */
.ga-pv {
  position: fixed; z-index: 13; display: flex; flex-direction: column; overflow: hidden;
  border-radius: 20px; background: #120d1f; box-shadow: 0 16px 40px rgba(20, 16, 40, 0.32), 0 0 0 2px rgba(255, 255, 255, 0.85);
  animation: ga-pv-in 0.35s cubic-bezier(0.3, 1.4, 0.5, 1) both;
}
@keyframes ga-pv-in { from { opacity: 0; transform: translateY(-8px) scale(0.96); } }
.ga-pv-head { flex: none; display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 12px; background: #fff; color: var(--ink); cursor: grab; touch-action: none; }
.ga-pv.moving .ga-pv-head { cursor: grabbing; }
.ga-pv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.15; }
.ga-pv-title b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-pv-title small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ga-pv-btn { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); flex: none; }
.ga-pv-btn .ic { width: 20px; height: 20px; }
.ga-pv-btn.off { opacity: 0.45; }
.ga-pv-btn:active { background: #f1eff8; }
@media (hover: hover) and (pointer: fine) { .ga-pv-btn:hover { background: #f1eff8; color: var(--ink); } }
.ga-pv [data-pv="min"] .ic { transition: transform 0.2s; transform: rotate(90deg); }
.ga-pv.min [data-pv="min"] .ic { transform: rotate(-90deg); }
.ga-pv-body { flex: 1; min-height: 0; position: relative; display: grid; place-items: center; }
.ga-pv.min .ga-pv-body, .ga-pv.min .ga-pv-size { display: none; }
.ga-pv-wait { color: rgba(255, 255, 255, 0.55); font-size: 13px; }
.ga-pv-size { position: absolute; right: 0; bottom: 0; width: 26px; height: 26px; cursor: nwse-resize; touch-action: none; z-index: 2;
  background: linear-gradient(135deg, transparent 52%, rgba(255, 255, 255, 0.55) 52% 58%, transparent 58% 70%, rgba(255, 255, 255, 0.55) 70% 76%, transparent 76%); }
/* the game's frame, laid over the window's body (it can't move into it: a frame moved in the page starts again) */
.ga-bay-host { position: fixed; left: -4000px; top: 0; width: 320px; height: 320px; z-index: 14; visibility: hidden; pointer-events: none; overflow: hidden; border-radius: 0 0 18px 18px; }
.ga-bay-host.on { visibility: visible; pointer-events: auto; }
.ga-bay-host iframe { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
body:not(.kind-gameart):not(.ga-3d) .ga-bay-host { visibility: hidden !important; pointer-events: none !important; }
body.ui-hidden .ga-pv, body.ui-hidden .ga-bay-host { visibility: hidden !important; }
