/* ============================================================================
 * Save Your Chess — layout & components
 * Tokens live in theme.css (var(--sc-*)). This file styles the shell,
 * filter panel, game list, board frame, and controls.
 * ========================================================================== */

html {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background:
    radial-gradient(1100px 500px at 78% -8%, rgba(70, 178, 107, 0.06), transparent 60%),
    var(--sc-bg);
  font-family: var(--sc-font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(70, 178, 107, 0.28);
}

/* Slim, on-theme scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--sc-surface-3) transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: var(--sc-surface-3);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---- Typography --------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-family: var(--sc-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--sc-text);
}

/* Chess data — Elos, dates, times, ratings — reads as instrument data */
.cm-mono,
.mono {
  font-family: var(--sc-font-mono);
  font-variant-numeric: tabular-nums;
}

a {
  text-decoration: none;
}

/* ---- App shell ---------------------------------------------------------- */
.content {
  flex: 1 0 auto;
  width: 100%;
}

.container,
.container-fluid {
  max-width: 1240px;
}

.dev-env-banner {
  background: repeating-linear-gradient(
    -45deg,
    #7a2018,
    #7a2018 10px,
    #872219 10px,
    #872219 20px
  );
  color: #fff;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
}

/* ---- Header / nav ------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 1030;
  border-bottom: 1px solid var(--sc-border-soft);
  box-shadow: var(--sc-shadow-1);
  /* board-green hairline accent along the very top */
  background-image: linear-gradient(var(--sc-accent), var(--sc-accent));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: top left;
  backdrop-filter: saturate(1.1);
}

.header .container-fluid {
  max-width: 1240px;
  margin-inline: auto;
  padding-block: 0.55rem;
}

.logo {
  gap: 0.7rem;
  align-items: center;
  color: var(--sc-text) !important;
}
.logo img {
  height: 40px;
  width: auto;
  border-radius: 8px;
}
.logo h1 {
  font-family: var(--sc-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--sc-text);
}
.header .sitetitle {
  font-family: var(--sc-font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sc-faint);
}

.header .nav-link {
  --bs-nav-link-color: var(--sc-muted);
  font-weight: 500;
  padding-inline: 0.9rem;
  border-radius: 0.5rem;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.header .nav-link:hover,
.header .nav-link:focus-visible {
  color: var(--sc-text);
  background: var(--sc-surface-2);
}

.navbar-toggler {
  border-color: var(--sc-border);
  padding: 0.35rem 0.5rem;
}
.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem rgba(70, 178, 107, 0.35);
}

/* ---- Footer ------------------------------------------------------------- */
.footer {
  position: static;
  flex-shrink: 0;
  border-top: 1px solid var(--sc-border-soft);
  margin-top: 2.5rem;
}
.footer .copyright {
  margin-bottom: 0;
  padding-block: 0.35rem;
  font-family: var(--sc-font-mono);
  font-size: 12px;
  color: var(--sc-faint);
}
.footer a {
  color: var(--sc-accent-hi);
}

/* ---- Games header (title + import) -------------------------------------- */
#container > .clearfix {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-block: 0.5rem 1.25rem;
}
#container > .clearfix .btn.float-end {
  float: none !important;
}
#container > .clearfix h2 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
}
#container > .clearfix h2 {
  color: var(--sc-muted);
  font-weight: 500;
}

/* ---- Cards / panels ----------------------------------------------------- */
.cm-card {
  background-color: var(--sc-surface-1);
  border: 1px solid var(--sc-border);
  border-radius: var(--bs-border-radius-lg);
}

.card {
  box-shadow: var(--sc-shadow-1);
}

/* Filter panel */
.card .card-body.bg-black {
  background-color: var(--sc-surface-1) !important;
  border-radius: inherit;
  padding: 1.25rem 1.35rem;
}

.form-label {
  font-family: var(--sc-font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sc-faint);
  margin-bottom: 0.35rem;
}

.form-control,
.form-select {
  background-color: var(--sc-surface-2);
  border-color: var(--sc-border);
  color: var(--sc-text);
  border-radius: 0.5rem;
}
.form-control::placeholder {
  color: var(--sc-faint);
}
.form-control:focus,
.form-select:focus {
  background-color: var(--sc-surface-2);
  border-color: var(--sc-accent);
  color: var(--sc-text);
  box-shadow: 0 0 0 0.2rem rgba(70, 178, 107, 0.22);
}

/* User field: input + Go button seam */
.form-control + .btn,
.input-group .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* ---- Applied filter chips ---------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--sc-surface-2) !important;
  color: var(--sc-text) !important;
  border: 1px solid var(--sc-border);
  border-radius: 999px !important;
  font-family: var(--sc-font-mono);
  font-weight: 500;
  font-size: 12px;
}
.badge .btn-close {
  --bs-btn-close-color: var(--sc-muted);
  padding: 0;
  width: 0.6em;
  height: 0.6em;
  opacity: 0.7;
  filter: invert(1) grayscale(1);
}
.badge .btn-close:hover {
  opacity: 1;
}

/* ---- Games list --------------------------------------------------------- */
/* Subtle count line sitting between the filters and the list. */
.cm-games-count {
  font-size: 0.8rem;
  color: var(--sc-muted);
  margin: 0 0.15rem 0.6rem;
  letter-spacing: 0.01em;
}

.cm-games {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

/* Pager for the paged game list (10 games per page). */
.cm-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 0 0.25rem;
}
.cm-pager-btn {
  background: var(--sc-surface-1);
  border: 1px solid var(--sc-border);
  border-radius: var(--bs-border-radius);
  color: inherit;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}
.cm-pager-btn:hover:not(:disabled) {
  background: var(--sc-surface-2);
  border-color: color-mix(in srgb, var(--sc-accent) 45%, var(--sc-border));
}
.cm-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.cm-pager-status {
  font-size: 0.85rem;
  color: var(--sc-muted);
}

/* Each game is a single row: color played, result, date/time, platform,
 * players + ratings, opening, time control, and the evaluate action. */
.cm-game-row {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.9rem;
  flex-wrap: wrap;
  padding: 0.7rem 1.1rem;
  background: var(--sc-surface-1);
  border: 1px solid var(--sc-border);
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--sc-shadow-1);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cm-game-row.pointer:hover {
  border-color: color-mix(in srgb, var(--sc-accent) 40%, var(--sc-border));
  background: var(--sc-surface-2);
}

/* Small disc showing which color the user played this game. */
.cm-game-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid var(--sc-border);
}
.cm-game-color.white {
  background: #f4f4f4;
}
.cm-game-color.black {
  background: #1c1c1c;
}

.cm-result-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}
.cm-result-dot.win {
  background: var(--sc-win);
  color: var(--sc-win);
}
.cm-result-dot.loss {
  background: var(--sc-loss);
  color: var(--sc-loss);
}
.cm-result-dot.draw {
  background: var(--sc-draw);
  color: var(--sc-draw);
}

.cm-game-date {
  font-size: 0.85rem;
  color: var(--sc-muted);
  flex: 0 0 auto;
}
.cm-platform {
  font-family: var(--sc-font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sc-muted) !important;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  flex: 0 0 auto;
}
.cm-platform:hover {
  color: var(--sc-accent-hi) !important;
  border-color: var(--sc-accent-lo);
}
/* Skeleton rows shown the instant the alternatives dropdown opens, before the
   real moves have loaded, so the menu appears immediately at full size. */
/* Enlarge the click target of the dropdown carets (alternatives + move type)
   into an easy-to-hit square. */
.cm-alt-toggle,
.cm-type-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.3rem;
  transition: background-color 0.12s ease;
}
.cm-alt-toggle:hover,
.cm-type-toggle:hover {
  background: var(--sc-surface-3);
}
.cm-alt-skeleton {
  display: flex;
  align-items: center;
  min-height: 1.9rem;
  cursor: default;
}
/* The alternative matching the move you're currently on, highlighted on open. */
.cm-alt-current {
  border-left: 3px solid #b0b0b0;
  background-color: rgba(176, 176, 176, 0.15);
  font-weight: 600;
}

/* Keep the overlay body at a stable height so switching to a different game
   (loading state) doesn't shrink the modal and shift everything around. */
.cm-modal-body {
  min-height: 75vh;
}
.cm-modal-loading {
  min-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-applied-filters-heading {
  font-family: var(--sc-font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sc-muted);
  margin-bottom: 0.35rem;
}
.cm-termination {
  font-size: 0.85rem;
  color: var(--sc-muted);
  margin-top: 0.15rem;
}
.cm-game-matchup {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.7rem;
  flex: 0 1 auto;
  font-size: 1.5rem;
}
.cm-side {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
.cm-name {
  font-weight: 600;
  font-size: 0.9em;
  color: var(--sc-text);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.cm-name:hover {
  color: var(--sc-accent, #4a90d9);
  text-decoration: underline;
}
.cm-elo {
  font-size: 0.95rem;
  color: var(--sc-faint);
}
.cm-crown {
  font-size: 1.05rem;
}
.cm-vs {
  font-family: var(--sc-font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sc-faint);
}
.cm-game-opening {
  color: var(--sc-muted);
  flex: 1 1 200px;
  min-width: 0;
}
.cm-game-tc {
  font-size: 0.78rem;
  color: var(--sc-muted);
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border-soft);
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
  flex: 0 0 auto;
}
.cm-game-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Full-width footer line under the row: your comments on the left, the evaluate
   button pinned to the right so it shares this line instead of widening the row above. */
.cm-game-footer {
  flex: 1 1 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-top: 0.15rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--sc-border-soft);
}
.cm-game-comment-actions {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Your own comments on this game's moves. */
.cm-game-comments {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
/* Each comment is a clickable card: mini-board on the left, text on the right.
   Clicking opens the game overlay jumped to that move. */
.cm-game-comment {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  text-align: left;
  font-size: 0.85rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cm-game-comment:hover {
  background: var(--sc-surface-2);
  border-color: color-mix(in srgb, var(--sc-accent) 35%, var(--sc-border));
}

/* Small static board for the commented move. Chessground sizes nothing itself,
   so give the `.cg-wrap` an explicit square. */
.cm-mini-board {
  flex: 0 0 auto;
}
.cm-mini-board.cg-wrap {
  width: 136px;
  height: 136px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px var(--sc-border);
  overflow: hidden;
}

.cm-game-comment-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.cm-game-comment-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.cm-game-comment-type {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}
.cm-game-comment-type svg {
  width: 18px;
  height: 19px;
  overflow: visible;
}
.cm-game-comment-move {
  flex: 0 0 auto;
  color: var(--sc-accent);
}
.cm-game-comment-type-label {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sc-faint);
}
.cm-game-comment-text {
  color: var(--sc-muted);
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.cm-eval {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cm-eval-check {
  color: var(--sc-win, #2e9e4f);
  font-size: 1rem;
}

/* Move notation */
.cm-move a {
  font-family: var(--sc-font-mono);
  color: var(--sc-text);
  border-radius: 0.3rem;
  transition: background-color 0.12s ease, color 0.12s ease;
}
.cm-move a:hover {
  background: var(--sc-surface-3);
}
.table td.cm-move {
  padding: 0.1rem 0.25rem;
}
.cm-move-clickable {
  cursor: pointer;
}
.cm-move-clickable:hover {
  background: var(--sc-surface-2);
}
.yellow {
  border-radius: 4px;
  background: var(--sc-accent);
  color: var(--sc-accent-ink) !important;
  font-weight: 600;
}

.pointer {
  cursor: pointer;
}

/* ---- Evaluation bar ----------------------------------------------------- */
.progress {
  --bs-progress-height: 0.55rem;
  background-color: #0a0c0f;
  border: 1px solid var(--sc-border-soft);
  border-radius: 999px;
  overflow: hidden;
}
.progress .progress-bar {
  background-color: #f4f5f7 !important;
  border-radius: 0;
}

/* ---- Board frame -------------------------------------------------------- */
/*
 * Chessground sizes nothing itself: it adds `cg-wrap` to the element we hand
 * it (our `.cm-chessboard` div) and positions the board absolutely inside.
 * Without an explicit size the board collapses to a strip, so give it a
 * responsive square and frame it like a real analysis board.
 */
.cm-chessboard.cg-wrap {
  width: min(88vw, 460px);
  height: min(88vw, 460px);
  border-radius: 8px;
  box-shadow:
    0 0 0 1px var(--sc-border),
    var(--sc-shadow-board);
  overflow: hidden;
}

.cm-chessboard-wrapper {
  justify-content: center;
}

/* ---- Move control buttons ---------------------------------------------- */
.d-flex.justify-content-center .btn-secondary {
  border-radius: 0.5rem;
}

/* ---- Modal -------------------------------------------------------------- */
.modal-content {
  border-radius: var(--bs-border-radius-lg);
  box-shadow: var(--sc-shadow-2);
}
.modal-header {
  align-items: center;
  border-bottom: 1px solid var(--sc-border-soft);
}
.modal-header .modal-title h3 {
  font-size: 1.15rem;
  margin: 0;
}

/* Game meta block under the modal header */
.cm-game-meta {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--sc-border-soft);
}
.cm-meta-players {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.9rem;
}
.cm-meta-player {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  text-decoration: none;
  color: var(--sc-text) !important;
}
.cm-meta-color {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--sc-border);
  flex: 0 0 auto;
}
.cm-meta-color.white {
  background: #f4f4f4;
}
.cm-meta-color.black {
  background: #1c1c1c;
}
.cm-meta-name {
  font-weight: 600;
  font-size: 1rem;
  transition: color 0.12s ease;
}
.cm-meta-player:hover .cm-meta-name {
  color: var(--sc-accent-hi);
}
.cm-meta-elo {
  font-family: var(--sc-font-mono);
  font-size: 0.8rem;
  color: var(--sc-faint);
}
.cm-meta-crown {
  font-size: 0.85rem;
}
.cm-meta-vs {
  font-family: var(--sc-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sc-faint);
}
.cm-meta-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.55rem;
}
.cm-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  font-size: 0.82rem;
  color: var(--sc-muted) !important;
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border-soft);
  border-radius: 999px;
  padding: 0.22rem 0.75rem;
  text-decoration: none;
  transition:
    border-color 0.12s ease,
    color 0.12s ease;
}
.cm-meta-chip:hover {
  color: var(--sc-text) !important;
  border-color: var(--sc-accent-lo);
}
.cm-meta-chip-icon {
  font-size: 0.9rem;
  line-height: 1;
}

/* Move table inside the game modal */
.modal-body .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: color-mix(in srgb, var(--sc-surface-1) 55%, transparent);
  --bs-table-striped-color: var(--sc-text);
  --bs-table-color: var(--sc-text);
  --bs-table-border-color: var(--sc-border-soft);
  margin-bottom: 0.75rem;
}
.modal-body .table thead th {
  font-family: var(--sc-font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--sc-faint);
  border-bottom: 1px solid var(--sc-border);
  padding-bottom: 0.5rem;
}
.modal-body .table td {
  vertical-align: middle;
}
.modal-body .table tbody tr:hover td {
  background: var(--sc-surface-2);
}
.cm-edit-icon {
  color: var(--sc-faint);
  transition: color 0.12s ease;
}
.cm-edit-icon:hover {
  color: var(--sc-accent-hi);
}
.cm-edit-icon.active {
  color: var(--sc-accent-hi);
}

/* ---- Move tree (openings) ---------------------------------------------- */
.cm-path a {
  color: var(--sc-body-color, var(--sc-text));
}
.tree {
  --spacing: 1.5rem;
  --radius: 10px;
  padding: 0;
}
.tree li {
  display: block;
  position: relative;
}
.tree ul {
  padding-left: 20px;
}
.tree summary::marker,
.tree summary::-webkit-details-marker {
  display: none;
}
.tree summary:focus {
  outline: none;
}
.tree summary:focus-visible {
  outline: 1px dotted var(--sc-accent);
}

/* ---- Misc --------------------------------------------------------------- */
.list-group-item-action:focus,
.list-group-item-action:hover {
  cursor: pointer;
}
.material-symbols-outlined {
  font-variation-settings:
    'FILL' 0,
    'wght' 400,
    'GRAD' 0,
    'opsz' 24;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
.btn:focus-visible,
.nav-link:focus-visible {
  outline: 2px solid var(--sc-accent-hi);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 991.98px) {
  .header .navbar-collapse {
    background: var(--sc-surface-1);
    border: 1px solid var(--sc-border);
    border-radius: 0.6rem;
    margin-top: 0.5rem;
    padding: 0.5rem;
  }
}

@media (max-width: 575.98px) {
  #container > .clearfix {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  #container > .clearfix h2 {
    font-size: 1.3rem;
  }
  .card .card-body.bg-black {
    padding: 1rem;
  }
}

/* ── Favorites filter toggle ─────────────────────────────────────────── */
.cm-fav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.375rem 0.9rem;
  font-size: 0.9rem;
  color: var(--sc-muted);
  background: var(--sc-surface-2);
  border: 1px solid var(--sc-border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.cm-fav-toggle:hover {
  border-color: color-mix(in srgb, #e0245e 45%, var(--sc-border));
  color: var(--sc-text);
}
.cm-fav-toggle-icon {
  color: color-mix(in srgb, #e0245e 55%, var(--sc-muted));
}
.cm-fav-toggle.active {
  color: #fff;
  background: color-mix(in srgb, #e0245e 22%, var(--sc-surface-2));
  border-color: #e0245e;
}
.cm-fav-toggle.active .cm-fav-toggle-icon {
  color: #ff5c8a;
}

/* ── Advanced (collapsed) filters ────────────────────────────────────── */
.cm-advanced-filters {
  margin-top: 1rem;
  border-top: 1px solid var(--sc-border-soft);
  padding-top: 0.6rem;
}
.cm-advanced-toggle {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0;
  background: none;
  border: 0;
  font-family: var(--sc-font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-muted);
  cursor: pointer;
  transition: color 0.15s ease;
}
.cm-advanced-toggle:hover {
  color: var(--sc-text);
}
.cm-advanced-caret {
  transition: transform 0.18s ease;
}
.cm-advanced-caret.open {
  transform: rotate(180deg);
}

/* ── Import prompt (top of games list) — deliberately understated ────── */
.cm-import-prompt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--sc-faint);
  padding: 0 0.15rem;
}
.cm-import-prompt-icon {
  opacity: 0.7;
}
.cm-import-prompt-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  color: var(--sc-accent-hi);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--sc-accent) 45%, transparent);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.cm-import-prompt-link:hover {
  color: var(--sc-text);
  background: color-mix(in srgb, var(--sc-accent) 14%, transparent);
  border-color: var(--sc-accent);
}

/* ── Favorite heart on each game row ─────────────────────────────────── */
.cm-game-fav {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--sc-faint);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}
.cm-game-fav:hover {
  color: #ff5c8a;
  background: color-mix(in srgb, #e0245e 15%, transparent);
}
.cm-game-fav:active {
  transform: scale(0.9);
}
.cm-game-fav.active {
  color: #e0245e;
}
