/* Sudoku Demo - module-specific styles
   Reuses maze_demo.css design tokens and layout conventions */

/* ── Layout ── */
.sudoku-main {
  display: grid;
  grid-template-columns: 280px 1.5fr;
  gap: 0;
  min-height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
}

.sudoku-col-1 {
  padding: 1rem;
  border-right: 1px solid var(--mg-border);
  overflow-y: auto;
  background: var(--mg-surface);
}

.sudoku-col-2 {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Section titles ── */
.sudoku-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mg-text-muted);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--mg-border);
}
.sudoku-section-title i {
  color: var(--mg-primary);
}

/* ── Type cards ── */
.sudoku-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sudoku-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 0.5rem;
  border: 2px solid var(--mg-border);
  border-radius: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: var(--mg-surface);
  text-align: center;
  min-height: 44px;
}

.sudoku-type-card:hover {
  border-color: var(--mg-primary);
  background: color-mix(in srgb, var(--mg-primary) 8%, transparent);
}

.sudoku-type-card.selected {
  border-color: var(--mg-primary);
  background: color-mix(in srgb, var(--mg-primary) 12%, transparent);
  box-shadow: 0 0 0 1px var(--mg-primary);
}

.sudoku-type-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.sudoku-type-card.locked:hover {
  border-color: var(--mg-border);
  background: var(--mg-surface);
}

.sudoku-type-card.locked .lock-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.65rem;
  color: var(--mg-text-muted);
}

.sudoku-type-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sudoku-type-card .type-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  color: var(--mg-primary);
}

.sudoku-type-card .type-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--mg-text);
}

/* ── Mobile tab bar ── */
.sudoku-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--mg-surface);
  border-top: 1px solid var(--mg-border);
  z-index: 1000;
}

.sudoku-tabbar .sudoku-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--mg-text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  min-height: 44px;
}

.sudoku-tabbar .sudoku-tab.active {
  color: var(--mg-primary);
}

.sudoku-tabbar .sudoku-tab i {
  font-size: 1.1rem;
}

@media (max-width: 767.98px) {
  .sudoku-main {
    grid-template-columns: 1fr;
    padding-bottom: 60px;
  }

  .sudoku-col-1,
  .sudoku-col-2 {
    display: none;
    border-right: none;
  }

  .sudoku-col-1.active-panel,
  .sudoku-col-2.active-panel {
    display: block;
  }

  .sudoku-tabbar {
    display: flex;
  }
}

@media (min-width: 768px) and (max-width: 992px) {
  .sudoku-main {
    grid-template-columns: 260px 1fr;
  }
}

/* ── Focus indicators ── */
.sudoku-type-card:focus-within {
  outline: 2px solid var(--mg-primary);
  outline-offset: 2px;
}

.sudoku-tabbar .sudoku-tab:focus-visible {
  outline: 2px solid var(--mg-primary);
  outline-offset: 2px;
}

/* ── Print ── */
@media print {
  .sudoku-col-1,
  .sudoku-tabbar {
    display: none !important;
  }

  .sudoku-col-2 {
    display: block !important;
  }
}

/* ── Loading state ── */
#preview-container.is-loading #image-container {
  opacity: 0.3;
}

/* ── Clickable toast (upgrade prompt) ── */
.toast-clickable {
  cursor: pointer;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .sudoku-type-card {
    transition: none;
  }
}
