/* Royal Gambit — Help & Game Guide */

.help-app {
  max-width: 1100px;
}

.help-header {
  margin-bottom: 1.25rem;
}

.logo-link {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s;
}

.logo-link:hover {
  opacity: 0.85;
}

.help-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--bg-card-border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-btn:hover {
  border-color: rgba(232, 197, 71, 0.4);
  background: rgba(232, 197, 71, 0.08);
}

.nav-btn.primary {
  background: linear-gradient(135deg, var(--accent-gold-dim), var(--accent-gold));
  color: #1a1508;
  border-color: transparent;
  font-weight: 600;
}

.nav-btn.primary:hover {
  box-shadow: 0 4px 16px rgba(232, 197, 71, 0.35);
  transform: translateY(-1px);
}

/* Layout */
.help-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: start;
  flex: 1;
}

.help-toc {
  position: sticky;
  top: 1.5rem;
}

.help-toc h2 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.toc-list {
  list-style: none;
  counter-reset: toc;
}

.toc-list li {
  counter-increment: toc;
  margin-bottom: 0.15rem;
}

.toc-list a {
  display: block;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.15s;
  line-height: 1.35;
}

.toc-list a:hover {
  color: var(--accent-gold);
  background: rgba(232, 197, 71, 0.06);
}

.help-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-width: 0;
}

/* Sections */
.help-section {
  scroll-margin-top: 1.5rem;
}

.help-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--bg-card-border);
}

.help-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin: 1.25rem 0 0.5rem;
}

.help-section h3:first-of-type {
  margin-top: 0.5rem;
}

.help-section p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.help-section p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1rem !important;
  line-height: 1.7 !important;
}

.help-section ul {
  margin: 0.5rem 0 0.75rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.help-section li {
  margin-bottom: 0.35rem;
}

.inline-link {
  color: var(--accent-gold);
  text-decoration: none;
  border-bottom: 1px solid rgba(232, 197, 71, 0.3);
  transition: border-color 0.2s;
}

.inline-link:hover {
  border-bottom-color: var(--accent-gold);
}

.note {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(232, 197, 71, 0.06);
  border-left: 3px solid var(--accent-gold);
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bg-card-border);
}

.feature-icon {
  font-size: 1.25rem;
}

.feature-item strong {
  font-size: 0.85rem;
}

.feature-item span:last-child {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Steps */
.steps-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.7;
}

.steps-list li {
  margin-bottom: 0.6rem;
  padding-left: 0.25rem;
}

.steps-list strong {
  color: var(--accent-gold);
}

/* Mode blocks */
.mode-block {
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.mode-block:first-of-type {
  margin-top: 0;
}

.mode-block h3 {
  margin-top: 0;
}

/* Tables */
.help-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin: 0.75rem 0;
}

.help-table th,
.help-table td {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--bg-card-border);
}

.help-table th {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.15);
}

.help-table td code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.help-table.compact th,
.help-table.compact td {
  padding: 0.4rem 0.6rem;
}

/* Definition list */
.def-list {
  margin: 0.75rem 0;
}

.def-list dt {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent-gold);
  margin-top: 0.75rem;
}

.def-list dt:first-child {
  margin-top: 0;
}

.def-list dd {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0.25rem 0 0 0;
  padding-left: 0.5rem;
  border-left: 2px solid var(--bg-card-border);
}

/* Highlight legend */
.highlight-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.85rem;
}

.legend-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
}

.legend-swatch.selected { background: var(--accent-gold); }
.legend-swatch.legal { background: var(--square-dark); }
.legend-swatch.legal::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.3);
}
.legend-swatch.capture { background: var(--square-light); }
.legend-swatch.capture::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 3px solid rgba(200, 50, 50, 0.55);
}
.legend-swatch.last-move { background: rgba(232, 197, 71, 0.45); }
.legend-swatch.check {
  background: var(--square-dark);
  box-shadow: inset 0 0 12px rgba(232, 93, 117, 0.6);
}

/* Piece guide */
.piece-guide {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.piece-card {
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bg-card-border);
}

.piece-symbol {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.35rem;
  filter: drop-shadow(1px 2px 3px rgba(0, 0, 0, 0.4));
}

.piece-card h3 {
  margin: 0 0 0.35rem !important;
  font-size: 0.95rem !important;
}

.piece-card p {
  font-size: 0.82rem !important;
  margin: 0 !important;
  color: var(--text-muted) !important;
  line-height: 1.5 !important;
}

/* Tips grid */
.tips-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.tip-card {
  padding: 1rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--bg-card-border);
}

.tip-card h3 {
  margin: 0 0 0.5rem !important;
  font-size: 0.9rem !important;
}

.tip-card ul {
  margin: 0 0 0 1rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tip-card li {
  margin-bottom: 0.25rem;
}

/* FAQ */
.faq-item {
  border-bottom: 1px solid var(--bg-card-border);
  padding: 0.65rem 0;
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-item summary {
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: '›';
  font-size: 1.1rem;
  color: var(--accent-gold);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.faq-item[open] summary::before {
  transform: rotate(90deg);
}

.faq-item summary:hover {
  color: var(--accent-gold);
}

.faq-item p {
  margin: 0.5rem 0 0 1.25rem !important;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

/* CTA */
.help-cta {
  text-align: center;
  padding: 2rem 1.5rem !important;
  background: linear-gradient(135deg, rgba(232, 197, 71, 0.08), rgba(62, 207, 142, 0.05)) !important;
}

.help-cta h2 {
  border: none !important;
  margin-bottom: 0.35rem !important;
  padding: 0 !important;
}

.help-cta p {
  color: var(--text-muted) !important;
  margin-bottom: 1.25rem !important;
}

.cta-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Keyboard */
kbd {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 5px;
  border: 1px solid var(--bg-card-border);
  background: rgba(0, 0, 0, 0.3);
  font-family: var(--font-body);
  font-size: 0.8rem;
}

code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* Responsive */
@media (max-width: 800px) {
  .help-layout {
    grid-template-columns: 1fr;
  }

  .help-toc {
    position: static;
  }

  .toc-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.15rem;
  }

  .feature-grid,
  .piece-guide,
  .tips-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .toc-list {
    grid-template-columns: 1fr;
  }

  .help-section h2 {
    font-size: 1.25rem;
  }
}
