/* === Layout Wrappers === */
.main {
  display: grid;
}

.query {
  padding: 0.5rem;
  background: #f9f9f9;
  border-bottom: 1px solid #ddd;
}

.results {
  padding: 0.5rem;
}

/* === Filter Styling === */
.query-flex {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.filters-primary,
.filters-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filters-primary select,
.filters-secondary select,
.filters-secondary input {
  padding: 0.35rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  min-width: 100px;
}

.filters-secondary {
  background: #fff;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #eee;
}

.hidden {
  display: none;
}

/* Create Game Button */
.btn-create {
  background-color: #2d8cff;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s;
}

.btn-create:hover {
  background-color: #1a6edc;
  transform: scale(1.03);
}

.btn-create:active {
  background-color: #155ab2;
  transform: scale(0.97);
}

/* Toggle button */
.btn-toggle {
  align-self: flex-end;
  background: none;
  border: none;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
  text-decoration: underline;
}

/* === Results Table === */
.results-flex table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.results-flex th,
.results-flex td {
  padding: 0.5rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.results-flex th {
  background: #f0f0f0;
  font-weight: bold;
}

.results-flex tr:nth-child(even) {
  background: #fafafa;
}

.results-flex tr:hover {
  background: #f1f7ff;
}

.results-flex td button {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 4px;
  border: 1px solid #2d8cff;
  background: #fff;
  color: #2d8cff;
  cursor: pointer;
  transition: background 0.2s;
}

.results-flex td button:hover {
  background: #2d8cff;
  color: #fff;
}

/* === Mobile Optimization === */
@media (max-width: 767px) {
  .filters-primary select,
  .filters-secondary select,
  .filters-secondary input {
    flex: 1 1 45%;
    min-width: unset;
  }

  .results-flex table,
  .results-flex thead,
  .results-flex tbody,
  .results-flex th,
  .results-flex td,
  .results-flex tr {
    display: block;
    width: 100%;
  }

  .results-flex thead {
    display: none; /* hide table header */
  }

  .results-flex tr {
    margin-bottom: 0.75rem;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0.5rem;
    background: #fff;
  }

  .results-flex td {
    border: none;
    padding: 0.25rem 0;
  }

  .results-flex td::before {
    font-weight: bold;
    display: inline-block;
    width: 90px;
    color: #555;
  }

  .results-flex td:nth-of-type(1)::before { content: "Game ID"; }
  .results-flex td:nth-of-type(2)::before { content: "Players"; }
  .results-flex td:nth-of-type(3)::before { content: "Rated"; }
  .results-flex td:nth-of-type(4)::before { content: "Time"; }
  .results-flex td:nth-of-type(5)::before { content: "Action"; }
}
/* Mobile game cards */
@media (max-width: 767px) {
  .game-card {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .gc-players {
    font-weight: bold;
    font-size: 0.95rem;
    color: #333;
  }
  .gc-info {
    font-size: 0.85rem;
    color: #666;
  }
  .gc-actions button {
    margin-top: 0.25rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 4px;
    border: 1px solid #2d8cff;
    background: #fff;
    color: #2d8cff;
    cursor: pointer;
    align-self: flex-start;
  }
  .gc-actions button:hover {
    background: #2d8cff;
    color: #fff;
  }
}
