/*
 * The lobby. The shared shell and felt (common.css), with a card per game instead of a table. Each
 * card's tile takes the game's own colour from --card-accent, set by lobby.js from games.js.
 */

.lobby-stage {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  padding: 18px 14px;
}

/* The games, a section per category. */
.lobby-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 980px;
  margin: 0 auto;
}

.lobby-category {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lobby-category-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 0 2px;
}

/* .small centres itself for the page's footers; here it sits beside the heading. */
.lobby-category-head .small {
  margin: 0;
  text-align: left;
}

.lobby-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 12px;
}

.lobby-card {
  appearance: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "icon name"
    "icon blurb"
    "live live";
  column-gap: 12px;
  row-gap: 3px;
  align-content: start;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.2s ease;
}

.lobby-card:hover,
.lobby-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--card-accent);
  box-shadow: 0 0 0 1px var(--card-accent), 0 0 18px color-mix(in srgb, var(--card-accent) 20%, transparent);
  outline: none;
}

.lobby-icon {
  grid-area: icon;
  width: 44px;
  height: 44px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--card-accent);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.18);
}

.lobby-name {
  grid-area: name;
  font-weight: 700;
  font-size: 16px;
  align-self: end;
}

.lobby-blurb {
  grid-area: blurb;
  font-size: 12px;
  color: var(--ink-dim);
}

.lobby-live {
  grid-area: live;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  color: var(--gold);
}

/* ------------------------------------------------------------------ rich list and shop */

.lobby-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 12px;
  max-width: 980px;
  margin: 16px auto 0;
  align-items: start;
}

.lobby-panel {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-heading {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.lobby-rich {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lobby-rich-row {
  display: grid;
  grid-template-columns: 28px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 7px;
}

.lobby-rich-row.you { background: rgba(255, 255, 255, 0.08); }

.lobby-rich-rank {
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}

.lobby-rich-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lobby-rich-balance {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.lobby-shop {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.shop-item.open { box-shadow: 0 0 0 1px var(--accent); }

.shop-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
}

.shop-name { font-weight: 700; }

.shop-price {
  margin-left: auto;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.shop-description,
.shop-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-dim);
}

.shop-note { color: var(--ink); }

.shop-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.shop-search { width: 100%; }

.shop-results:empty { display: none; }

.shop-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
