/* MIT License: see LICENSE at project root. */
/* Lobbyoverzicht: gamekaarten, boardfilters, tegels en de boardtabel. Hoort bij
   `render-lobby.js`. */

.game-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: 1rem;
  border: 1px solid var(--border);
  background: var(--surface-1);
  box-shadow: inset 0 1px 0 var(--surface-2);
}

.game-thumb {
  width: 100%;
  min-height: 86px;
  border-radius: 0.85rem;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
}

.game-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: center;
}

.game-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.game-card h3 {
  margin: 0;
}

.pill.subtle {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.game-start {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.game-start input {
  flex: 1;
  min-width: 180px;
}

.game-start select {
  flex: 1;
  min-width: 180px;
}

.game-start button {
  white-space: nowrap;
}

.board-filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--muted);
}

.board-filters label {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  text-transform: none;
  letter-spacing: 0;
}

.board-view-toggle {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.board-view-toggle button.is-active {
  background: linear-gradient(135deg, #2de2c1, #1aa38c);
  color: #041019;
  border-color: transparent;
}

.board-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 0.6rem;
}

.board-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(45, 226, 193, 0.1), rgba(255, 179, 122, 0.08)),
    var(--game-surface);
}

.board-tile-thumb {
  width: 100%;
  min-height: 96px;
  border-radius: 0.6rem;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--border);
}

.board-tile-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.board-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.board-tile p {
  margin: 0;
  font-size: 0.85rem;
}

.board-tile .board-actions {
  justify-content: flex-end;
}

.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.board-table th,
.board-table td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.board-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.board-table tbody tr:hover {
  background: rgba(45, 226, 193, 0.08);
}

.board-table tbody tr:last-child td {
  border-bottom: 0;
}

.board-table-actions {
  text-align: right;
  white-space: nowrap;
}

.board-table-actions button + button {
  margin-left: 0.3rem;
}

@media (max-width: 620px) {
  .board-table,
  .board-table tbody,
  .board-table tr,
  .board-table td {
    display: block;
    width: 100%;
  }

  .board-table thead {
    display: none;
  }

  .board-table tr {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    padding: 0.4rem 0.2rem;
  }

  .board-table td {
    border-bottom: 0;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .board-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
  }

  .board-table td.board-table-actions {
    justify-content: flex-end;
  }
}

.boards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lobby-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
