/* The waiting room of a table with friends in the app (js/gclobby.js): over the table until the owner deals.
   Laid out for the Duo's outer display upright first; a wider screen keeps the same column in the middle. */
#gclobby { position: fixed; inset: 0; z-index: 7; display: flex; flex-direction: column; gap: 10px; overflow: hidden;
  padding: calc(10px + var(--safe-t)) calc(14px + var(--safe-r)) calc(14px + var(--safe-b)) calc(14px + var(--safe-l)); color: var(--ink);
  background: linear-gradient(180deg, rgba(var(--scrim), .72), rgba(var(--scrim), .28) 38%, rgba(var(--scrim), .3) 62%, rgba(var(--scrim), .88)); }
#gclobby[hidden] { display: none; }
#gclobby > * { flex: none; width: min(100%, 440px); align-self: center; }
/* the middle scrolls if the screen is short; the title and the buttons at the bottom stay put */
.gl-body { flex: 1 1 auto !important; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; display: flex; flex-direction: column; gap: 10px; margin: -6px -6px 0; padding: 6px 6px 8px; width: min(calc(100% + 12px), 452px) !important; }
.gl-body::-webkit-scrollbar { display: none; }
.gl-body > * { flex: none; }
.gl-body > .gl-have { align-self: center; }
html.duo-outer #gclobby { padding-right: calc(14px + var(--safe-l)); }
/* the table's own HUD waits underneath */
body.gc-lobby :is(#topbar, #dock, #center, #banner, #hold, #overlay, #fxbar, #atk, #selffx, #approvals) { visibility: hidden !important; }

.gl-card { background: var(--paper); border: 3px solid var(--ink); border-radius: var(--wob); box-shadow: 0 4px 0 var(--ink), var(--cel); padding: 10px 10px 12px; }
.gl-top { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.gl-top > .gc { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 3px solid var(--ink); border-radius: 50%; background: var(--purple); color: #fff; box-shadow: 0 2px 0 var(--ink); }
.gl-top > .gc .ic { width: 24px; height: 24px; }
.gl-top > div { flex: 1; min-width: 0; }
.gl-top b { display: block; font: 900 19px/1.1 var(--display); overflow-wrap: anywhere; }
.gl-top small { display: block; margin-top: 3px; font: 800 11.5px/1.25 var(--font); color: var(--ink2); }
.gl-count { flex: none; padding: 4px 9px; border: 2.5px solid var(--ink); border-radius: 999px; background: var(--yellow); font: 900 15px/1 var(--display); rotate: 3deg; }

/* the seats: five a row; a seat is a portrait, a badge, a name and what they are */
.gl-seats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 4px; }
.gl-seat { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-align: center; cursor: pointer; }
.gl-seat:disabled { cursor: default; opacity: 1; filter: none; }
.gl-seat:not(:disabled):active .gl-ava { scale: .92; }
.gl-ava { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--ink); background: #f3dcb6; box-shadow: 0 3px 0 var(--ink); overflow: hidden; display: grid; place-items: center; transition: scale .1s; }
.gl-ava img { width: 140%; height: 140%; object-fit: cover; object-position: 50% 30%; translate: 0 6%; }
.gl-seat.me .gl-ava { background: var(--yellow); outline: 3px solid var(--pink); outline-offset: 2px; }
.gl-seat.in .gl-ava, .gl-seat.host .gl-ava { background: #bfe8d5; }
.gl-seat.bot .gl-ava { background: #d8d2ea; }
.gl-seat.way .gl-ava { background: #fff; border-style: dashed; box-shadow: none; }
.gl-seat.way .gl-ava i { display: flex; gap: 3px; }
.gl-seat.way .gl-ava i b { width: 7px; height: 7px; margin: 0; border-radius: 50%; background: var(--purple); animation: gl-dot 1.2s infinite; }
.gl-seat.way .gl-ava i b:nth-child(2) { animation-delay: .2s; } .gl-seat.way .gl-ava i b:nth-child(3) { animation-delay: .4s; }
@keyframes gl-dot { 0%, 60%, 100% { opacity: .2; } 30% { opacity: 1; } }
.gl-seat.empty .gl-ava { background: rgba(255, 255, 255, .55); border-style: dashed; border-color: var(--muted); box-shadow: none; color: var(--muted); }
.gl-seat.empty .gl-ava .ic { width: 24px; height: 24px; }
.gl-seat.pick .gl-ava { background: var(--yellow); border-style: solid; border-color: var(--ink); color: var(--ink); scale: 1.08; box-shadow: 0 3px 0 var(--ink); }
.gl-badge { position: absolute; top: -4px; right: calc(50% - 34px); width: 22px; height: 22px; display: grid; place-items: center; border: 2.5px solid var(--ink); border-radius: 50%; color: var(--ink); font-style: normal; }
.gl-badge .ic { width: 14px; height: 14px; }
.gl-badge.crown { background: var(--yellow); } .gl-badge.ok { background: var(--teal); color: #fff; } .gl-badge.bot { background: #fff; }
.gl-seat > b { display: block; max-width: 100%; margin-top: 5px; font: 900 12px/1.1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-seat > small { display: block; max-width: 100%; margin-top: 1px; font: 800 10px/1.1 var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gl-seat.empty > b, .gl-seat.empty > small { color: var(--muted); }
.gl-seat.way > small { color: var(--purple); }

/* the game: three rows of choices (the owner), or one line (a friend) */
.gl-rules { display: grid; gap: 9px; }
.gl-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px; }
.gl-row > span { min-width: 44px; font: 900 13px/1 var(--display); color: var(--ink2); }
.gl-seg { display: flex; gap: 6px; min-width: 0; }
.gl-seg button { flex: 1; min-width: 0; padding: 7px 4px 8px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; font: 900 13px/1 var(--display); color: var(--ink); box-shadow: 0 2px 0 var(--ink); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gl-seg button.on { background: var(--pink); color: #fff; text-shadow: 0 1px 0 var(--ink); rotate: -1deg; }
.gl-seg button:active { scale: .95; }
.gl-ro { padding: 8px 10px; border: 2.5px dashed var(--ink2); border-radius: 12px; font: 900 13px/1.3 var(--display); text-align: center; }
.gl-note { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px; font: 800 12px/1.35 var(--font); color: #fff; text-shadow: 0 1px 0 var(--ink), 0 0 6px rgba(0, 0, 0, .6); }
.gl-note .ic { flex: none; width: 18px; height: 18px; }

/* the bottom: invite + deal (the owner), or waiting + leave (a friend) */
.gl-bar { display: flex; gap: 10px; align-items: stretch; padding-top: 2px; }
.gl-inv { flex: none; width: 112px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 4px; border: 3.5px solid var(--ink); border-radius: var(--wob);
  background: var(--sky); box-shadow: 0 6px 0 var(--ink), var(--cel); font: 900 15px/1.1 var(--display); color: var(--ink); cursor: pointer; }
.gl-inv .ic { width: 26px; height: 26px; }
.gl-inv:active { scale: 1.05 .9; }
.gl-bar .ld-fight { flex: 1; width: auto; min-width: 0; }
.gl-bar .ld-fight b { display: block; font: 900 28px/1 var(--display); }
.gl-wait { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 58px; padding: 6px 10px; border: 3px dashed #fff; border-radius: var(--wob); color: #fff; font: 900 16px/1.15 var(--display); text-shadow: 0 2px 0 var(--ink); text-align: center; }
.gl-wait .ic { flex: none; width: 22px; height: 22px; animation: gl-spin 2.4s linear infinite; }
@keyframes gl-spin { to { rotate: 360deg; } }
.gl-leave { flex: none; width: 96px; border: 3.5px solid var(--ink); border-radius: var(--wob); background: var(--paper); box-shadow: 0 6px 0 var(--ink), var(--cel); font: 900 16px/1 var(--display); color: var(--ink); cursor: pointer; }

/* my table's party code (a link went out): tap to send it again */
.gl-code { display: flex; align-items: center; gap: 8px; width: 100%; margin: -2px 0 10px; padding: 6px 10px; border: 2.5px dashed var(--ink); border-radius: 12px; background: #fff7dc; color: var(--ink); cursor: pointer; font: inherit; }
.gl-code span { font: 800 12px/1 var(--font); color: var(--ink2); }
.gl-code b { flex: 1; text-align: start; font: 900 18px/1 var(--display); letter-spacing: 2px; }
.gl-code small { flex: none; font: 800 11px/1 var(--font); color: var(--ink2); }
.gl-code .ic { width: 20px; height: 20px; flex: none; }
/* got a party code? (the owner still alone at a new table) */
.gl-have { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; border: 2.5px solid #fff; border-radius: 999px; background: rgba(0, 0, 0, .25); color: #fff; font: 900 13px/1.1 var(--display); text-shadow: 0 1px 0 var(--ink); cursor: pointer; width: auto !important; }
.gl-have .ic { width: 18px; height: 18px; }

/* the little menu under a seat (above a button at the bottom: .up) */
.gl-pop { position: fixed; z-index: 2; width: max-content; max-width: min(240px, calc(100vw - 20px)); padding: 8px; background: var(--paper); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink), 0 10px 26px rgba(0, 0, 0, .4); display: grid; gap: 7px; animation: popin .15s; }
.gl-pop::before { content: ''; position: absolute; top: -12px; left: var(--ax, 50%); width: 18px; height: 18px; background: var(--paper); border: 3px solid var(--ink); border-right: 0; border-bottom: 0; rotate: 45deg; translate: -50% 0; }
.gl-pop button { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 8px; padding: 7px 10px 7px 8px; border: 2.5px solid var(--ink); border-radius: 12px; background: #fff; text-align: start; color: var(--ink); box-shadow: 0 2px 0 var(--ink); cursor: pointer; font: inherit; }
.gl-pop button:first-child { background: var(--sky); }
.gl-pop button.alt { background: #e9e0ff; }
.gl-pop.up::before { top: auto; bottom: -12px; border: 3px solid var(--ink); border-left: 0; border-top: 0; }
/* a friend's party code typed in: a card near the top, in the middle, clear of the keyboard (gclobby.js openCode) */
.gl-pop.code { left: 50%; top: calc(var(--safe-t) + 64px); translate: -50% 0; max-width: calc(100vw - 24px); padding: 12px; }
.gl-pop.code::before { display: none; }
.gl-pop.code .gl-codein input { flex: 1; width: auto; }
.gl-codein { display: grid; gap: 6px; padding: 2px; }
.gl-codein > b { font: 900 14px/1.1 var(--display); }
.gl-codein > span { display: flex; gap: 6px; }
.gl-codein input { width: 150px; min-width: 0; height: 40px; padding: 0 10px; border: 2.5px solid var(--ink); border-radius: 10px; font: 900 18px/1 var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--ink); background: #fff; outline: none; }
.gl-pop .gl-codein button { display: block; flex: none; padding: 0 14px; background: var(--yellow); font: 900 15px/1 var(--display); white-space: nowrap; }
.gl-pop button[data-gl=pkick] { background: #ffd9d2; }
.gl-pop button .ic { width: 28px; height: 28px; }
.gl-pop button b { display: block; font: 900 15px/1.1 var(--display); }
.gl-pop button small { display: block; margin-top: 2px; font: 800 10.5px/1.2 var(--font); color: var(--ink2); }
@media (prefers-reduced-motion: reduce) { .gl-seat.way .gl-ava i b, .gl-wait .ic, .gl-pop { animation: none; } }
html.rm .gl-seat.way .gl-ava i b, html.rm .gl-wait .ic, html.rm .gl-pop { animation: none; }
