:root {
  --cell: clamp(46px, 11vw, 66px);
}

.coronas-panel {
  margin-top: 0.5rem;
  text-align: center;
}

.queens-board {
  width: max-content;
  margin: 1.4rem auto 0;
  display: grid;
  gap: 3px;
  justify-content: center;
  align-items: center;
  padding: 0.35rem;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.queens-board .cell {
  width: var(--cell);
  height: var(--cell);
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 12px;
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  user-select: none;
  transition: transform 0.08s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.queens-board .cell:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
}

.queens-board .cell:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.region-a { background: #dbeafe; }
.region-b { background: #dcfce7; }
.region-c { background: #fef3c7; }
.region-d { background: #fee2e2; }
.region-e { background: #ede9fe; }
.region-f { background: #fce7f3; }
.region-g { background: #ccfbf1; }
.region-h { background: #ffedd5; }

@media (max-width: 480px) {
  :root {
    --cell: clamp(38px, 14vw, 54px);
  }

  .queens-board {
    gap: 2px;
    border-radius: 18px;
  }

  .queens-board .cell {
    border-radius: 10px;
  }
}

.queens-board .cell.error {
  outline: 3px solid #ef4444;
  outline-offset: -3px;
  box-shadow: inset 0 0 0 999px rgba(239, 68, 68, 0.12);
}

.queens-board .cell:not(:empty) {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
}

.coronas-progreso {
  width: min(100%, 520px);
  margin: 1rem auto 1.2rem;
}

.progreso-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.progreso-bar {
  height: 10px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

#progressFill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.25s ease;
}

.final-actions {
  margin-top: 2.25rem;
  padding-top: 1.4rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.final-actions[hidden] {
  display: none !important;
}

.final-actions .btn {
  width: min(100%, 360px);
  border-radius: 999px;
}

.final-actions a.btn.secundario {
  background: #ffffff;
  color: #0f172a !important;
  border: 1px solid #dbe2ea;
  text-decoration: none;
}

@media (min-width: 640px) {
  .final-actions {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }
}

.btn-ayuda {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: white;
  border: 1px solid #dbe2ea;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(15,23,42,.08);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,23,42,.55);
  padding: 1rem;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-card {
  width: min(100%, 680px);
  background: white;
  border-radius: 18px;
  padding: 1.5rem;
  max-height: 86vh;
  overflow: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
}

.modal-tabs {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
  border: 0;
  background: transparent;
  padding-bottom: .6rem;
  cursor: pointer;
  font-weight: 800;
  color: #64748b;
}

.tab-btn--active {
  color: #0f172a;
  border-bottom: 2px solid #84cc16;
}

.modal-text {
  margin-bottom: .8rem;
}

.modal-list {
  padding-left: 1.2rem;
}

.modal-actions {
  margin-top: 1rem;
  display: flex;
  justify-content: flex-end;
}
