/* lobby.html: the lobby (create + open games | chat) and a game's waiting room (seats | chat). */
.gate { min-height: calc(100vh - 60px); display: grid; place-items: center; padding: 24px; }
.gatecard { width: min(440px, 100%); padding: 30px; display: grid; gap: 12px; text-align: center; }
.gatecard h1 { font-size: 26px; color: var(--gold); }
.gatecard input { font-size: 17px; text-align: center; }

.lobby, .room { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; max-width: 1200px; margin: 0 auto; padding: 22px 20px 30px; align-items: start; }
.col { display: grid; gap: 18px; min-width: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1; }

.create form { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: end; }
.create form .field.grow { flex: 1 1 240px; }
.create form .field:not(.grow) { flex: 0 1 280px; }
.create form .check { flex: 1 1 220px; align-self: center; }
.create form .actions { flex: 0 0 auto; margin-left: auto; flex-wrap: nowrap; }
.create form .err { flex-basis: 100%; margin: 0; }
.create .err:empty { display: none; }
.roomrow.mine { border-color: rgba(124, 196, 255, .3); background: rgba(124, 196, 255, .05); }
.create .err:empty { display: none; }

.rooms { list-style: none; margin: 0; padding: 10px 12px 14px; display: grid; gap: 8px; }
.roomrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line); transition: border-color .15s, background .15s; }
.roomrow:hover { border-color: rgba(240, 180, 60, .35); background: rgba(240, 180, 60, .05); }
.roomrow .info { flex: 1; min-width: 0; display: grid; }
.roomrow .info b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomrow .info b.asks { display: inline; font-size: inherit; color: var(--gold); } /* "Bilbo wants a rematch" */
.roomrow .info span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roomrow.live { padding: 8px 12px; background: transparent; }
.rooms .none { padding: 14px 6px; color: var(--muted); font-style: italic; }
.games header.sub2 { padding-top: 6px; }
.games header.sub2 h2 { font-size: 14px; color: var(--muted); }

.lobbychat, .roomchat { position: sticky; top: 76px; height: calc(100vh - 110px); max-height: 720px; }
.chat > header { padding-bottom: 10px; border-bottom: 1px solid var(--line); }

/* waiting room */
.roomhead .titlerow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.roomhead h1 { font-size: 28px; overflow-wrap: anywhere; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line2); margin-left: 6px; vertical-align: middle; }
.tag.you { color: var(--blue); border-color: rgba(124, 196, 255, .4); }
.invite { display: flex; gap: 8px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.invite input { flex: 1; min-width: 200px; font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.lastresult { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(240, 180, 60, .08); border: 1px solid rgba(240, 180, 60, .25); }

.seats { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: stretch; }
.seats .vs { align-self: center; font-size: 26px; font-weight: 900; color: var(--gold); text-shadow: 0 2px 12px rgba(240, 180, 60, .4); }
.seat { display: grid; justify-items: center; align-content: center; gap: 8px; padding: 26px 18px; text-align: center; min-height: 230px; transition: border-color .2s, box-shadow .2s; }
.seat .av.big { width: 72px; height: 72px; font-size: 30px; }
.seat .who b { font-size: 19px; }
.seat .deck { font-size: 13.5px; }
.seat .state { font-weight: 800; letter-spacing: .02em; }
.seat .state .rd { color: var(--good); }
.seat .state .off { color: var(--bad); }
.seat.ready { border-color: rgba(90, 210, 138, .55); box-shadow: 0 0 0 1px rgba(90, 210, 138, .3), 0 18px 50px rgba(0, 0, 0, .35); }
.seat.you { background: linear-gradient(180deg, rgba(124, 196, 255, .06), transparent 60%), var(--panel); }
.seat.empty { border-style: dashed; border-color: var(--line2); background: rgba(17, 20, 22, .6); }
.waitdots { display: flex; gap: 7px; margin-bottom: 6px; }
.waitdots i { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); animation: wd 1.2s infinite ease-in-out; }
.waitdots i:nth-child(2) { animation-delay: .15s; } .waitdots i:nth-child(3) { animation-delay: .3s; }
@keyframes wd { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1.1); } }

.mine .body { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.mine .err { padding: 0 18px 14px; margin: 0; }
.mine .err:empty { display: none; }

@media (max-width: 900px) {
  .lobby, .room { grid-template-columns: 1fr; padding: 14px 12px 24px; }
  .lobbychat, .roomchat { position: static; height: 420px; }
}
@media (max-width: 560px) {
  .seats { grid-template-columns: 1fr; }
  .seats .vs { justify-self: center; font-size: 20px; }
  .seat { min-height: 0; padding: 18px; }
  .roomhead h1 { font-size: 22px; }
}

.seat .botav { background: linear-gradient(135deg, #8aa0b8, #56657a); color: #fff; font-size: 30px; }
.seat.empty .b { margin-top: 6px; }

/* my games: finished games with their result and a replay */
.roomrow.hist .res { flex: none; width: 52px; text-align: center; padding: 4px 0; border-radius: 8px; font-weight: 800; font-size: 12.5px; letter-spacing: .03em; }
.roomrow.hist .res.won { background: rgba(92, 200, 120, .16); color: #7fe09a; }
.roomrow.hist .res.lost { background: rgba(255, 107, 94, .14); color: #ff8a7e; }
.roomrow.hist .res.draw, .roomrow.hist .res.unfinished { background: rgba(255, 255, 255, .08); color: var(--muted); }
#historyBox .more { margin: 8px 12px 12px; }
