/* ── GitHub login modal ──────────────────────────────────────────────────── */

.gh-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.gh-modal[hidden] { display: none; }

.gh-modal-box {
  background: var(--s1);
  border: 1px solid var(--border2);
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.gh-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--s2);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--strong);
}

.gh-modal-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
  transition: color .1s;
}
.gh-modal-close:hover { color: var(--text); }

.gh-modal-body {
  padding: 20px 20px 22px;
  font-size: 0.82rem;
  color: var(--text);
  line-height: 1.55;
}

.gh-device-step {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.gh-device-step p { color: var(--muted); }

.gh-user-code {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--strong);
  background: var(--s2);
  border: 1px solid var(--border2);
  padding: 10px 16px;
  text-align: center;
  cursor: pointer;
  transition: background .1s;
  user-select: all;
  position: relative;
}
.gh-user-code:hover { background: var(--s3); }
.gh-copy-hint {
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  margin-top: -8px;
}

.gh-open-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  background: rgba(74,159,208,0.1);
  border: 1px solid rgba(74,159,208,0.35);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .12s;
}
.gh-open-link:hover { background: rgba(74,159,208,0.2); text-decoration: none; }

.gh-polling {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}
.gh-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

.gh-modal-cancel {
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.76rem;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  align-self: flex-start;
  transition: color .1s, border-color .1s;
}
.gh-modal-cancel:hover { color: var(--text); border-color: var(--accent); }

.gh-modal-err {
  color: #e07070;
  background: rgba(200,80,80,0.08);
  border: 1px solid rgba(200,80,80,0.2);
  padding: 9px 12px;
  font-size: 0.8rem;
}

.gh-modal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  color: var(--green);
}
.gh-modal-success .gh-check { font-size: 2rem; }

/* ── Gist action bar (configs section) ──────────────────────────────────── */

.gist-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

.gist-bar-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-right: 4px;
}

.gist-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color .1s, border-color .1s, background .1s;
}
.gist-btn:hover { color: var(--accent); border-color: var(--accent); background: rgba(74,159,208,0.06); }
.gist-btn:disabled { opacity: 0.4; cursor: default; }

.gist-btn-save { border-color: rgba(76,175,128,0.4); color: var(--green); }
.gist-btn-save:hover { border-color: var(--green); background: rgba(76,175,128,0.08); color: var(--green); }

.gist-status {
  font-size: 0.72rem;
  margin-left: 4px;
}
.gist-status.ok  { color: var(--green); }
.gist-status.err { color: #e07070; }

/* responsive */
@media (max-width: 980px) {
  .page-title { font-size: 1.5rem; }
}
@media (max-width: 640px) {
  .search-results {
    min-width: 0;
    width: min(92vw, 420px);
    max-width: calc(100vw - 20px);
  }
  .game-header {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .game-header img { max-height: 140px; }
  .game-header-side {
    width: 100%;
  }
  .source-summary-grid {
    grid-template-columns: 1fr;
  }
  .source-summary-tile {
    min-height: 0;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ss-details {
    padding-left: 0;
    border-left: none;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .source-summary-distribution {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .game-header-actions {
    justify-content: flex-start;
  }
  /* Mobile card layout: the 3-column (author | body | right) must collapse.
     Author goes on top as a compact horizontal bar, body fills the width,
     right column pins to the top of the body so badge + confidence stay
     scannable. Signal icons wrap freely below the body text */
  .card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .card-author {
    flex-direction: row;
    min-width: 0;
    max-width: none;
    gap: 10px;
    padding-right: 0;
    padding-bottom: 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    align-items: center;
  }
  .author-avatar {
    width: 42px;
    height: 42px;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
  }
  .author-avatar svg { width: 28px; height: 28px; }
  .card .card-body { min-width: 0; }
  .card .proton { font-size: 0.82rem; word-break: break-word; }
  .card .hw { word-break: break-word; }
  .card .right {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
  }
  .card-rating-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .signal-strip { flex-wrap: wrap; }
  .signal-icon { width: 26px; height: 26px; }
  .signal-icon svg { width: 17px; height: 17px; }
  .card-footer { flex-wrap: wrap; justify-content: flex-start; }
  .card-summary .row { flex-direction: column; gap: 2px; }
  .reports-section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .hub-links { gap: 4px; }
  .hub-link { font-size: 0.72rem; padding: 4px 8px; }
  .config-row { flex-direction: column; gap: 2px; }
  .config-lbl { width: auto; }
  .search-result-card { flex-direction: column; }
  .search-result-side { align-items: flex-start; min-width: 0; }
}

.submit-approval-banner {
  padding: 10px 14px;
  margin-bottom: 16px;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text);
  background: var(--s2);
  border: 1px solid var(--border);
}
.submit-approval-banner code {
  font-size: 0.75rem;
  background: rgba(255,255,255,0.06);
  padding: 1px 5px;
  border-radius: 3px;
}
.submit-approval-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 8px;
}
.submit-approval-badge--approved {
  background: rgba(76,175,128,0.15);
  border: 1px solid rgba(76,175,128,0.4);
  color: #a9d7b6;
}
.submit-approval-badge--pending {
  background: rgba(160,120,200,0.15);
  border: 1px solid rgba(160,120,200,0.4);
  color: #c0a8e0;
}
