/* GM Games demo — builds on tactics-trainer chess.css */

.gm-games__choice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.9rem 1rem;
  margin-bottom: 0.65rem;
  border: 1px solid #dee2e6;
  border-radius: 0.35rem;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.gm-games__choice:hover,
.gm-games__choice:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 1px #007bff;
  background: #f0f7ff;
  outline: none;
}

.gm-games__choice-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gm-games__choice-title {
  font-weight: 700;
  font-size: 1.05rem;
}

.gm-games__choice-sub {
  color: #495057;
}

.gm-games__choice-meta {
  font-size: 0.85rem;
  color: #6c757d;
}

.gm-games__annotation-panel {
  max-width: 520px;
  margin: 1rem auto 0;
  padding: 0.85rem 1rem;
  background: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

.gm-games__movelist-panel {
  max-width: 520px;
  margin: 0.75rem auto 0;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 0.25rem;
}

.gm-games__movelist-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #004085;
  margin-bottom: 0.35rem;
}

.gm-games__movelist {
  font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #212529;
  word-break: break-word;
}

.gm-games__ml-num {
  font-weight: 700;
  color: #6c757d;
  margin-right: 0.15rem;
}

.gm-games__ml-move {
  margin-right: 0.35rem;
}

button.gm-games__ml-move {
  display: inline;
  margin: 0 0.35rem 0 0;
  padding: 0 0.12rem;
  border: none;
  border-radius: 0.2rem;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

button.gm-games__ml-move:hover,
button.gm-games__ml-move:focus {
  background: #e7f1ff;
  color: #003d80;
  outline: none;
}

button.gm-games__ml-move.is-current {
  background: #cfe2ff;
  color: #084298;
  font-weight: 700;
}

.gm-games__ml-move--future {
  color: #868e96;
}

.gm-games__ml-move--review {
  color: #b35c00;
  font-style: italic;
}

.gm-games__ml-move--correct {
  color: #155724;
  background: #d4edda;
  border-radius: 0.2rem;
  padding: 0 0.15rem;
}

.gm-games__ml-move--wrong {
  color: #721c24;
  background: #f8d7da;
  border-radius: 0.2rem;
  padding: 0 0.15rem;
}

.gm-games__ml-expected {
  color: #6c757d;
  font-size: 0.85em;
  font-style: italic;
}

.gm-games__ml-empty {
  color: #6c757d;
  font-family: inherit;
}

.gm-games__memorize-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid #e3e7eb;
}

.gm-games__memorize-replay {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
}

.gm-games__replay-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.4rem;
  line-height: 1;
}

.gm-games__replay-icon-btn .material-icons {
  font-size: 1.25rem;
}

.gm-games__replay-icon-btn:disabled {
  opacity: 0.45;
}

.chess-trainer .gm-games__sq-correct {
  box-shadow: inset 0 0 0 4px rgba(40, 167, 69, 0.65);
}

.chess-trainer .gm-games__sq-wrong {
  box-shadow: inset 0 0 0 4px rgba(220, 53, 69, 0.7);
}

/* Inline span so long variations wrap mid-line with surrounding prose. */
.gm-games__variation {
  display: inline;
  margin: 0;
  padding: 0 0.05em;
  border: none;
  border-radius: 0.15rem;
  background: transparent;
  color: #0056b3;
  font: inherit;
  font-weight: 600;
  line-height: inherit;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  text-decoration: underline;
  text-decoration-style: dotted;
  cursor: pointer;
}

.gm-games__variation:hover,
.gm-games__variation:focus {
  color: #003d80;
  background: #e7f1ff;
  outline: none;
}

.gm-games__annotation-lead {
  margin: 0 0 0.85rem;
  line-height: 1.45;
}

.gm-games__deep {
  margin-top: 0.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid #dee2e6;
}

.gm-games__deep-banner {
  font-weight: 700;
  font-size: 0.95rem;
  color: #155724;
  background: #eaf7ee;
  border-left: 4px solid #28a745;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.85rem;
}

.gm-games__deep-block + .gm-games__deep-block {
  margin-top: 0.75rem;
}

.gm-games__deep-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: #004085;
  margin-bottom: 0.25rem;
}

.gm-games__deep-p {
  margin: 0;
  line-height: 1.5;
}

.gm-games__deep-sides {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .gm-games__deep-sides {
    grid-template-columns: 1fr 1fr;
  }
}

.gm-games__annotation-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.gm-games__move-label {
  font-weight: 700;
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.gm-games__annotation-edit-btn--top {
  margin-top: 0;
  flex-shrink: 0;
}

.gm-games__annotation {
  margin: 0;
  line-height: 1.45;
  color: #212529;
}

.gm-games__annotation-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.55rem;
  padding: 0.2rem;
  border: none;
  background: transparent;
  color: #6c757d;
  line-height: 1;
  cursor: pointer;
}

.gm-games__annotation-edit-btn[hidden] {
  display: none !important;
}

.gm-games__annotation-edit-btn .material-icons {
  font-size: 1.15rem;
}

.gm-games__annotation-edit-btn:hover,
.gm-games__annotation-edit-btn:focus {
  color: #004085;
  outline: none;
}

.gm-games__annotation-edit {
  margin-top: 0.35rem;
}

.gm-games__edit-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: #004085;
  margin-bottom: 0.3rem;
}

.gm-games__edit-deep-heading {
  font-weight: 700;
  font-size: 0.95rem;
  color: #155724;
  padding-bottom: 0.25rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid #c3e6cb;
}

.gm-games__annotation-textarea {
  font-size: 0.95rem;
  line-height: 1.45;
  resize: vertical;
}

.gm-games__annotation-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.gm-games__intro-block + .gm-games__intro-block {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e3e7eb;
}

.gm-games__intro-label {
  font-weight: 700;
  font-size: 0.92rem;
  color: #004085;
  margin-bottom: 0.3rem;
}

.gm-games__intro-p {
  margin: 0;
  line-height: 1.45;
}

.gm-games__intro-lessons {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}

.gm-games__intro-lessons li {
  margin-bottom: 0.35rem;
}

.gm-games__intro-lessons li:last-child {
  margin-bottom: 0;
}

.gm-games__intro-pivotal {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

.gm-games__intro-pivotal li {
  margin-bottom: 0.45rem;
  line-height: 1.45;
}

.gm-games__intro-pivotal li:last-child {
  margin-bottom: 0;
}

.gm-games__intro-move {
  font-weight: 700;
  color: #1a1a1a;
  white-space: nowrap;
}

button.gm-games__intro-move {
  display: inline;
  margin: 0;
  padding: 0 0.1em;
  border: none;
  border-radius: 0.15rem;
  background: transparent;
  color: #1a1a1a;
  font: inherit;
  font-weight: 700;
  line-height: inherit;
  text-decoration: underline;
  text-decoration-style: solid;
  text-underline-offset: 0.12em;
  cursor: pointer;
  white-space: nowrap;
}

button.gm-games__intro-move:hover,
button.gm-games__intro-move:focus {
  color: #004085;
  background: #f1f3f5;
  outline: none;
}

.gm-games__deep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0 0.15rem;
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #2c3338;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.gm-games__deep-toggle input {
  margin: 0;
  cursor: pointer;
}

.gm-games__meta {
  max-width: 520px;
  margin: 0 auto 0.75rem;
  text-align: center;
  font-size: 0.95rem;
  color: #495057;
}

/* —— Top 10 grandmaster “baseball cards” —— */
.gm-games__hall {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid #dee2e6;
}

.gm-games__hall-title {
  margin-bottom: 0.35rem;
  color: #1a1a1a;
}

.gm-games__hall-lead {
  margin: 0 0 1.25rem;
  max-width: 40rem;
  color: #495057;
  font-size: 0.98rem;
}

.gm-games__hall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.15rem;
}

.gm-games__card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 3px solid #1e3a2f;
  border-radius: 0.55rem;
  background:
    linear-gradient(180deg, #f7f3ea 0%, #efe8d8 100%);
  box-shadow: 0 6px 0 #0f241c, 0 10px 22px rgba(15, 36, 28, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.gm-games__card:hover,
a.gm-games__card:focus {
  transform: translateY(-4px);
  box-shadow: 0 10px 0 #0f241c, 0 16px 28px rgba(15, 36, 28, 0.22);
  color: inherit;
  text-decoration: none;
  outline: none;
}

a.gm-games__card:focus {
  box-shadow: 0 10px 0 #0f241c, 0 0 0 3px rgba(0, 123, 255, 0.35);
}

.gm-games__card-photo {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #24362e;
  border-bottom: 3px solid #1e3a2f;
}

.gm-games__card-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(15, 36, 28, 0.35) 100%);
  pointer-events: none;
}

.gm-games__card-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.gm-games__card-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.85rem 0.9rem 1rem;
  flex: 1;
}

.gm-games__card-name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #132820;
  line-height: 1.2;
}

.gm-games__card-meta {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #5a6b45;
}

.gm-games__card-bio {
  margin: 0.35rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #2c3338;
}

.gm-games__hall-note {
  margin: 1.15rem 0 0;
  font-size: 0.88rem;
  color: #6c757d;
}

@media (max-width: 575.98px) {
  .gm-games__hall-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .gm-games__card-body {
    padding: 0.65rem 0.7rem 0.8rem;
  }

  .gm-games__card-name {
    font-size: 0.92rem;
  }

  .gm-games__card-bio {
    font-size: 0.78rem;
  }
}
