@import url("clanmembers_shared.css");

.cm {
  max-width: min(var(--page-max-width), 100%);
}

.cm-section .cc_pager {
  width: 100%;
  max-width: none;
  justify-content: flex-end;
  margin: 12px 0;
}

.cm-section .cc_pager_meta {
  width: 100%;
  text-align: right;
}

.cm-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}

.cm-game-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px 16px;
  background:
    linear-gradient(165deg, rgba(62, 207, 255, 0.07), transparent 42%),
    var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.cm-game-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
}

.cm-game-card:hover {
  border-color: rgba(62, 207, 255, 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 2px var(--accent-glow);
}

button.cm-game-icon,
button.cm-game-name {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  font: inherit;
  cursor: pointer;
  box-shadow: none;
}

.cm-game-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 108px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--inset);
  line-height: 0;
  color: inherit;
}

.cm-game-icon img {
  display: block;
  width: 72px;
  height: 108px;
  max-width: 72px;
  max-height: 108px;
  object-fit: cover;
  border: 0;
}

.cm-game-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cm-game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
}

.cm-game-name {
  display: inline;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.cm-game-name:hover,
.cm-game-name:focus-visible {
  color: var(--accent);
  outline: none;
}

.cm-game-players {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
}

.cm-game-players-trigger {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--inset);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: default;
  box-shadow: none;
}

.cm-game-players:hover .cm-game-players-trigger,
.cm-game-players:focus-within .cm-game-players-trigger {
  position: relative;
  z-index: 31;
  border-color: rgba(62, 207, 255, 0.55);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: rgba(62, 207, 255, 0.1);
  color: var(--accent);
}

.cm-game-players-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: currentColor;
}

.cm-game-players-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cm-game-players-pop {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 30;
  min-width: max(180px, 100%);
  max-width: min(280px, 70vw);
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(62, 207, 255, 0.55);
  border-top: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  background: rgba(12, 16, 22, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transform-origin: top center;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0.14s;
}

.cm-game-players:hover .cm-game-players-pop,
.cm-game-players:focus-within .cm-game-players-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.cm-game-players-pop-title {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cm-game-players-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 200px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.cm-game-players-item a {
  display: block;
  padding: 3px 4px;
  border-radius: 4px;
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
}

.cm-game-players-item a:hover {
  color: var(--accent);
  background: rgba(62, 207, 255, 0.08);
}

.cm-game-players-item.is-self a {
  color: var(--accent);
  font-weight: 700;
}

.cm-game-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.cm-member-games {
  width: 100%;
  overflow-x: auto;
}

.cm-member-games-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.cm-member-games-table th,
.cm-member-games-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(44, 53, 68, 0.7);
  vertical-align: middle;
  text-align: left;
}

.cm-member-games-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cm-member-games-table tr:last-child td {
  border-bottom: 0;
}

.cm-member-games-table tr:hover td {
  background: rgba(62, 207, 255, 0.04);
}

.cm-member-games-table .cm-nick {
  font-size: 0.95rem;
}

.cm-member-game-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cm-member-game-icons a,
button.cm-member-game-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--inset);
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
  transition: border-color var(--ease), background-color var(--ease);
}

.cm-member-game-icons a:hover,
button.cm-member-game-btn:hover,
button.cm-member-game-btn:focus-visible {
  border-color: var(--accent);
  background: var(--surface);
  outline: none;
}

.cm-member-game-icons img,
button.cm-member-game-btn img {
  display: block;
  width: 18px;
  height: 18px;
  border: 0;
}

.cm-member-game-none {
  color: var(--muted);
  font-size: 0.88rem;
}

.cm-member-games-count {
  display: inline-block;
  margin-left: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 650;
}

.cm-member-games-more {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin: 0;
  padding: 3px 10px;
  border: 1px dashed rgba(62, 207, 255, 0.45);
  border-radius: 999px;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: none;
}

.cm-member-games-more:hover,
.cm-member-games-more:focus-visible {
  border-style: solid;
  border-color: var(--accent);
  background: rgba(62, 207, 255, 0.1);
  outline: none;
}

@media (max-width: 640px) {
  .cm-game-card {
    gap: 8px;
    padding: 12px;
  }

  .cm-game-top {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
  }

  .cm-game-icon {
    width: 56px;
    height: 84px;
  }

  .cm-game-icon img {
    width: 56px;
    height: 84px;
    max-width: 56px;
    max-height: 84px;
  }
}
