/* Dialog styles — promotion, save, load */

.dialog {
  background: #373532;
  border: 2px solid #646464;
  border-radius: 10px;
  padding: 16px;
  color: #dcdcdc;
  font-family: 'Inter', sans-serif;
}

.dialog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.dialog-label {
  font-size: 13px;
  color: #969696;
  margin-bottom: 4px;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.dialog-close {
  background: #505050;
  color: #e6e6e6;
  border: none;
  border-radius: 4px;
  width: 28px;
  height: 28px;
  font-size: 13px;
  cursor: pointer;
}
.dialog-close:hover { background: #646464; }

.dialog-input {
  width: 100%;
  background: #464441;
  border: 1px solid #969696;
  border-radius: 4px;
  color: #dcdcdc;
  font-size: 13px;
  padding: 6px 8px;
  font-family: 'Inter', sans-serif;
  outline: none;
  margin-bottom: 12px;
}
.dialog-input:focus { border-color: #aaa; }

.dialog-textarea {
  width: 100%;
  min-width: 300px;
  background: #464441;
  border: 1px solid #969696;
  border-radius: 4px;
  color: #dcdcdc;
  font-size: 13px;
  padding: 8px;
  font-family: 'Inter', sans-serif;
  resize: vertical;
  margin-bottom: 12px;
}
.dialog-textarea:focus { border-color: #aaa; outline: none; }

.note-dialog {
  min-width: 340px;
  z-index: 1100;
}

.dialog-btn-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.dialog-btn-row .panel-btn {
  min-width: 70px;
}

/* Promotion dialog */
.promo-dialog {
  min-width: 280px;
  text-align: center;
}

.promo-row {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.promo-btn {
  background: #505050;
  border: none;
  border-radius: 6px;
  width: 64px;
  height: 64px;
  font-size: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.promo-btn:hover { background: #646464; }

/* Load dialog */
.load-dialog {
  min-width: 360px;
  max-width: 480px;
  max-height: 420px;
}

.load-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.load-item {
  display: flex;
  align-items: center;
  background: #464441;
  border-radius: 6px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.load-item:hover { background: #646464; }

.load-item-info {
  flex: 1;
  font-size: 13px;
  line-height: 1.4;
}

.load-item-info .dim {
  font-size: 11px;
  color: #969696;
}

.load-delete {
  background: #505050;
  color: #e6e6e6;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: 8px;
}
.load-delete:hover { background: #963c3c; }

/* Save dialog */
.save-dialog {
  min-width: 320px;
}

/* Setup mode */
.setup-desc {
  font-size: 12px;
  color: #969696;
  padding: 4px 6px 8px;
  line-height: 1.5;
}

.palette-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 0 4px 8px;
}

.palette-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #505050;
  border-radius: 4px;
  font-size: 24px;
  cursor: pointer;
  transition: background 0.15s;
}
.palette-cell:hover { background: #646464; }
.palette-cell.palette-selected { background: #64a064; }

.fen-display {
  font-size: 10px;
  color: #969696;
  padding: 6px;
  word-break: break-all;
  font-family: 'JetBrains Mono', monospace;
}

.setup-btns {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: auto;
  padding-top: 8px;
}

/* Help overlay */
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-btn {
  width: 26px;
  height: 26px;
  background: #505050;
  color: #e6e6e6;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.help-btn:hover { background: #646464; }

#help-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 1001;
  overflow-y: auto;
  padding: 40px 24px;
}
#help-overlay.active { display: block; }

#help-close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 1002;
  background: #505050;
  color: #e6e6e6;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#help-close:hover { background: #646464; }

.help-content {
  max-width: 900px;
  margin: 0 auto;
  color: #dcdcdc;
  font-family: 'Inter', sans-serif;
}

.help-section { margin-bottom: 32px; }

.help-section-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
  color: #dcdcdc;
}

.help-section-sub {
  font-size: 14px;
  color: #969696;
  margin: 0 0 16px;
}

.help-grid {
  display: grid;
  gap: 12px;
}

.help-grid-2x2 { grid-template-columns: repeat(2, 1fr); }
.help-grid-3x3 { grid-template-columns: repeat(3, 1fr); }

.help-card {
  background: #373532;
  border: 1px solid #464441;
  border-radius: 10px;
  padding: 16px;
}

.help-card h3 {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 6px;
  color: #dcdcdc;
}

.help-card p {
  font-size: 13px;
  color: #969696;
  line-height: 1.5;
  margin: 0;
}

.help-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #464441;
}

.help-footer-contact {
  font-size: 13px;
  color: #969696;
}

.help-footer-contact a {
  color: #818cf8;
  text-decoration: none;
}
.help-footer-contact a:hover { text-decoration: underline; }

.help-footer-actions {
  display: flex;
  gap: 8px;
}

.help-theme-btn {
  background: none;
  border: 1px solid #646464;
  color: #969696;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, border-color 0.15s;
}
.help-theme-btn:hover {
  color: #dcdcdc;
  border-color: #999;
}

.help-reset-btn {
  background: none;
  border: 1px solid #646464;
  color: #969696;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: color 0.15s, border-color 0.15s;
}
.help-reset-btn:hover {
  color: #e06060;
  border-color: #e06060;
}

@media (max-width: 700px) {
  .help-grid-2x2,
  .help-grid-3x3 { grid-template-columns: 1fr; }

  #help-overlay { padding: 24px 12px; }
}
