/* /css/memory-settings.css
   Settings page for Synups.Club memory games
   Uses color variables from colors.css, grid-based layout (no flex)
*/

/* Ensure box sizing is predictable to avoid overflow */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Page body */

body.memory-settings-body {
  min-height: 100vh;
  background: var(--color-page-bg);
  color: var(--color-page-text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

/* Remove extra gap from the global header on this page only */
body.memory-settings-body > header {
  margin-bottom: 0;
}

/* Main content below header */

.settings-wrap {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 24px;
  display: grid;
  gap: 12px;
}

@media (min-width: 900px) {
  .settings-wrap {
    padding: 18px 24px 24px;
  }
}

/* Header (local to this page) */
.settings-header {
  text-align: center;
  position: relative;
}

.settings-header h1 {
  position: absolute !important;
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  width: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  white-space: nowrap;
}

/* Grid of panels */
.settings-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

@media (max-width: 768px) {
  .settings-wrap {
    padding: 12px 12px 16px;
  }
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

/* Panel styling */
.settings-panel {
  background: var(--color-cell-bg);
  color: var(--color-cell-text);
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 8px;
}

.settings-panel h2 {
  margin: 0;
  font-family: "Oswald", system-ui, -apple-system, sans-serif;
  font-size: 1.05rem;
}

.panel-hint {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.8;
}

.panel-note {
  margin: 4px 0 0;
  font-size: 0.8rem;
  opacity: 0.75;
}

.settings-panel--reserved {
  opacity: 0.95;
}

/* Options / forms */
.settings-form {
  margin-top: 4px;
}

.options-group {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.options-group--motives,
.options-group--levels {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 769px) {
  .options-group--motives,
  .options-group--levels {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Radio row */
.option-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition:
    background 0.18s ease-out,
    box-shadow 0.18s ease-out;
}

/* Subtle hover effect for the row */
.option-row:hover {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 0 1px var(
    --color-cell-hover-bg,
    rgba(255, 255, 255, 0.15)
  );
}

/* --- KEY LINE: Only the radio is orange when checked --- */
.option-row input[type="radio"] {
  accent-color: var(--color-cell-hover-bg, orange);
}

/* REMOVE/COMMENT OUT all highlight for label, span, or panel when checked! */
.option-row input[type="radio"]:checked + span,
.option-row input[type="radio"]:checked + strong,
.option-row input[type="radio"]:checked + em,
.option-row input[type="radio"]:checked + div,
.option-row input[type="radio"]:checked + label,
.option-row input[type="radio"]:checked + p {
  background: none !important;
  color: inherit !important;
  border: none !important;
  box-shadow: none !important;
  font-weight: inherit !important;
}

/* Buttons */
.launch-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 6px;
}

.launch-btn {
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  background: var(--color-grid-area-bg);
  color: var(--color-page-text);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.15s ease-out,
    box-shadow 0.15s ease-out,
    background 0.2s ease-out,
    color 0.2s ease-out;
}

.launch-btn--primary {
  background: var(--color-cell-hover-bg);
  color: var(--color-cell-hover-text);
}

.launch-btn--secondary {
  background: rgba(0, 0, 0, 0.25);
}

.launch-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.35);
}

.launch-btn:active {
  transform: translateY(0);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Accessibility helper */
.visually-hidden {
  position: absolute !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  clip-path: inset(50%);
}

/* ============================================================
   MOBILE DENSITY REDUCTION (Motives panel focus)
============================================================ */
@media (max-width: 768px) {

  /* Reduce general panel padding on mobile */
  .settings-panel {
    padding: 12px 10px;
    gap: 6px;
  }

  /* Motives panel: tighter grid */
  .options-group--motives {
    gap: 4px;
  }

  /* Motive rows: reduce height */
  .options-group--motives .option-row {
    padding: 4px 6px;
    gap: 6px;
  }

  /* Motive text slightly smaller */
  .options-group--motives .option-row span {
    font-size: 0.9rem;
    line-height: 1.15;
  }

  /* Radios slightly smaller */
  .options-group--motives input[type="radio"] {
    transform: scale(0.95);
  }
	/* Motives: use 3 columns on mobile to reduce height */
  .options-group--motives {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  
}
