/* Turma: recent players, open tables of the turma and table invites. */
.turma-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.turma-panel {
  background: #fffdf7d9;
  border: 1px solid #cfc6b3;
  border-radius: 16px;
  padding: 20px;
  box-shadow:
    0 1px 0 #fff inset,
    0 8px 24px #2e2a2312;
  backdrop-filter: blur(6px);
  min-width: 0;
}
.turma-heading h2 {
  font-family: Bricolage, sans-serif;
  font-size: 22px;
  margin: 6px 0 14px;
}
.turma-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}
.turma-tables,
.recent-players {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.turma-table,
.recent-player {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #fffdf7;
  border: 1px solid var(--line);
  border-radius: 13px;
  min-width: 0;
}
.turma-table[data-status="playing"] {
  background: #f6f1e4;
}
.turma-table-copy,
.recent-copy {
  flex: 1;
  min-width: 0;
}
.turma-table-copy .eyebrow {
  font-size: 9px;
}
.turma-table-copy h3 {
  margin: 4px 0;
  font-size: 17px;
  overflow-wrap: anywhere;
}
.turma-table-copy p,
.recent-copy span {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.recent-copy strong {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.recent-tag {
  font-size: 10px;
  font-weight: 600;
  color: #6b5a12;
  background: #fff1b8;
  border: 1px solid #e8d27a;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
}
.turma-pawns {
  display: flex;
  flex-shrink: 0;
}
.turma-pawn,
.recent-avatar,
.table-invite-avatar {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 2px solid var(--avatar-border, #cfc6b3);
  overflow: hidden;
}
.turma-pawn + .turma-pawn {
  margin-left: -12px;
}
.turma-pawn .character-pawn,
.recent-avatar .character-pawn,
.table-invite-avatar .character-pawn {
  width: 86%;
  height: 86%;
}
.recent-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.turma-table .button,
.recent-actions .button {
  min-height: 44px;
  white-space: nowrap;
}
.turma-empty {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px dashed #cfc6b3;
  border-radius: 13px;
  background: #fbf7ee;
}
.turma-empty p {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.turma-empty strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}
.turma-empty-pawns {
  display: flex;
  flex-shrink: 0;
}
.turma-empty-pawns i {
  width: 18px;
  height: 26px;
  border-radius: 9px 9px 6px 6px;
  border: 2px solid #39342b;
  background: var(--red);
}
.turma-empty-pawns i:nth-child(2) {
  background: var(--yellow);
  margin: -4px -3px 0;
}
.turma-empty-pawns i:nth-child(3) {
  background: var(--blue);
}
.room-list-title {
  font-family: Bricolage, sans-serif;
  font-size: 20px;
  margin: 0 0 12px;
}
.library-turma {
  margin: 0 0 24px;
}
.turma-dialog {
  width: min(620px, calc(100% - 32px));
  max-height: min(86vh, 760px);
  overflow: auto;
}
.turma-dialog h2 {
  font-size: 28px;
}
.table-invites {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 40;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100% - 32px));
}
.table-invite {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 12px;
  align-items: center;
  padding: 14px;
  background: var(--surface);
  border: 1px solid #cfc6b3;
  border-radius: 16px;
  box-shadow: 0 18px 40px #2e2a2333;
  backdrop-filter: blur(8px);
  animation: table-invite-in 0.24s ease-out;
}
.table-invite-copy strong {
  display: block;
  font-size: 14px;
}
.table-invite-copy p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.table-invite-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.table-invite-actions .button {
  min-height: 44px;
}
@keyframes table-invite-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .table-invite {
    animation: none;
  }
}
@media (max-width: 850px) {
  .turma-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .turma-panel {
    padding: 14px;
  }
  .turma-table,
  .recent-player {
    flex-wrap: wrap;
  }
  .turma-table .button {
    width: 100%;
  }
  .recent-actions {
    width: 100%;
    justify-content: stretch;
  }
  .recent-actions .button {
    flex: 1;
  }
  .table-invites {
    top: auto;
    bottom: 16px;
    left: 16px;
    right: 16px;
    width: auto;
  }
}
