/* ============================================================
 * Hint system styles — Classic Sudoku
 * Uses custom properties from sudoku.css (color-brand, radius-*,
 * space-*, etc.) and hint highlight colors defined there.
 * ============================================================ */

/* ---- Hint button ------------------------------------------- */

.sudoku-hint-btn {
  appearance: none;
  min-height: var(--touch-target);
  padding: var(--space-sm);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-brand-dark);
  background: var(--color-surface);
  border: 1px solid var(--color-brand);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  transition: background-color var(--transition-fast),
              transform var(--transition-fast);
  position: relative;
}

.sudoku-hint-btn i { pointer-events: none; }
.sudoku-hint-btn:hover { background: var(--color-hint-region); }
.sudoku-hint-btn:active { transform: scale(0.97); }
.sudoku-hint-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.sudoku-hint-btn--depleted {
  color: var(--color-text-muted);
  border-color: var(--color-border-light);
  background: var(--color-bg);
}

.sudoku-hint-btn--depleted .sudoku-hint-btn-lock {
  display: inline-block;
}

.sudoku-hint-btn-lock {
  display: none;
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.sudoku-hint-btn--hidden { display: none !important; }

/* ---- Description panel ------------------------------------- */

.hint-description-panel {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-hint-region);
  border: 1px solid var(--color-brand-light);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: 0 auto var(--space-md);
  max-width: 480px;
}

.hint-description-panel[hidden] { display: none; }

.hint-description-icon {
  color: var(--color-brand-dark);
  flex-shrink: 0;
  font-size: 1.1rem;
}

.hint-description-text {
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
  color: var(--color-text);
  margin: 0;
  text-align: left;
}

.hint-description-dismiss {
  appearance: none;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}

.hint-description-dismiss:hover { background: var(--color-peer); }

/* ---- Modal overlay ----------------------------------------- */

.hint-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 24, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  z-index: 100;
}

.hint-modal-overlay[hidden] { display: none; }

.hint-modal {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  width: 90vw;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-md) var(--space-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.hint-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.hint-modal-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.hint-modal-close {
  appearance: none;
  background: transparent;
  border: none;
  padding: 4px 8px;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--color-text-muted);
  font-family: inherit;
}

.hint-modal-close:hover { color: var(--color-text); }
.hint-modal-close:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

/* ---- Token balance ----------------------------------------- */

.hint-modal-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-peer);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: var(--space-md);
  font-size: 0.9rem;
}

.hint-modal-balance[hidden] { display: none; }

.hint-balance-label {
  color: var(--color-text-muted);
}

.hint-balance-value {
  font-weight: 600;
  color: var(--color-brand-dark);
}

/* ---- Level cards ------------------------------------------- */

.hint-modal-levels {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.hint-level-card {
  appearance: none;
  width: 100%;
  text-align: left;
  background: var(--color-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  cursor: pointer;
  font-family: inherit;
  color: var(--color-text);
  transition: background-color var(--transition-fast),
              border-color var(--transition-fast);
}

.hint-level-card:hover:not(.hint-level-card--unaffordable) {
  background: var(--color-peer);
  border-color: var(--color-brand);
}

.hint-level-card:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.hint-level-card--unaffordable {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint-level-card--loading {
  opacity: 0.7;
  cursor: progress;
}

.hint-level-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.hint-level-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--color-hint-region);
  color: var(--color-brand-dark);
  padding: 2px 8px;
  border-radius: 99px;
}

.hint-level-cost {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.hint-level-name {
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
}

.hint-level-desc {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  line-height: 1.4;
}

/* ---- Modal loading / error --------------------------------- */

.hint-modal-loading,
.hint-modal-error {
  padding: var(--space-lg);
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.hint-modal-error { color: var(--color-invalid); }

/* ---- Anonymous depleted state ------------------------------ */

.hint-modal-anon-depleted {
  text-align: center;
  padding: var(--space-md);
}

.hint-modal-anon-depleted[hidden] { display: none; }

.hint-modal-anon-depleted p {
  font-size: 0.9rem;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

.hint-modal-signin-btn {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: var(--space-md);
  background: var(--color-brand);
  color: var(--color-surface);
  border-radius: var(--radius-sm);
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background-color var(--transition-fast);
}

.hint-modal-signin-btn:hover { background: var(--color-brand-dark); }
.hint-modal-signin-btn:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* ---- Purchase options -------------------------------------- */

.hint-modal-purchase {
  padding-top: var(--space-sm);
}

.hint-modal-purchase[hidden] { display: none; }

.hint-modal-purchase-msg {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

.hint-purchase-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.hint-purchase-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  text-align: center;
}

.hint-purchase-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.hint-purchase-card .tokens {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-brand-dark);
  line-height: 1;
}

.hint-purchase-card .price {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.hint-purchase-card .buy-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 32px;
  padding: 4px 8px;
  font-size: 0.8rem;
}

.hint-modal-purchase-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: var(--space-sm);
  font-style: italic;
}

/* ---- Pro subscribe CTA (inside purchase panel) -------------- */

.hint-modal-pro {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  text-align: center;
}

.hint-modal-pro-msg {
  font-size: 0.85rem;
  color: var(--color-text);
  margin: 0 0 var(--space-sm);
}

.hint-modal-pro-btn {
  width: 100%;
  background: var(--color-brand);
  color: var(--color-surface);
  border-color: var(--color-brand-dark);
  font-size: 0.9rem;
}

.hint-modal-pro-btn:hover:not(:disabled) {
  background: var(--color-brand-dark);
}

/* ---- Small screens ----------------------------------------- */

@media (max-width: 400px) {
  .hint-purchase-options {
    grid-template-columns: 1fr;
  }
  .hint-modal {
    padding: var(--space-md) var(--space-sm) var(--space-sm);
  }
}
