/* BitRuta V7 · Únicamente nuevas piezas visuales. No modifica el tema base. */

/* La nueva ayuda destaca sin mover el tablero ni cambiar la distribución. */
#learningRequirement {
  border-color: #7798f1;
  background: linear-gradient(120deg, #f0f6ff 0%, #ffffff 49%, #f6f2ff 100%);
}
.guide-callout {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid #d8e4ff;
}
.guide-open-btn {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 56px;
  gap: 12px;
  padding: 11px 14px;
  border: 1.5px solid #8290fb;
  border-radius: 12px;
  background: linear-gradient(108deg, #eef3ff, #f7f2ff 70%, #e7f7ff);
  color: #223d87;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 13px rgba(74, 94, 198, .12);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.guide-open-icon {
  display: grid;
  place-items: center;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  border-radius: 10px;
  background: linear-gradient(135deg, #577cf2, #6c49dc);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: 0 5px 10px rgba(80, 83, 214, .20);
}
.guide-open-copy {display: grid; gap: 2px; flex: 1; min-width: 0}
.guide-open-copy strong {font-size: 13px; line-height: 1.25; font-weight: 850}
.guide-open-copy small {font-size: 11px; color: #5c7099; line-height: 1.45; font-weight: 650}
.guide-open-arrow {font-size: 18px; font-weight: 900; color: #6353d6; transition: transform .2s ease}
.guide-open-btn:focus-visible {outline: 3px solid #4268e8; outline-offset: 3px}
@media (hover: hover) and (pointer: fine) {
  .guide-open-btn:hover {
    transform: translateY(-2px);
    border-color: #595be8;
    background: linear-gradient(108deg, #e8f0ff, #f1eaff 70%, #dff4ff);
    box-shadow: 0 9px 22px rgba(74, 94, 198, .18);
  }
  .guide-open-btn:hover .guide-open-arrow {transform: translateX(4px)}
}

/* Ventana modal centrada y consistente con BitRuta. */
body.guide-is-open {overflow: hidden}
#guideModal {z-index: 65; padding: 16px; background: rgba(21, 36, 81, .48); backdrop-filter: blur(6px)}
#guideModal .guide-dialog {
  display: block;
  width: min(100%, 650px);
  max-width: 650px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
  margin: auto;
  text-align: left;
  border: 2px solid #a6b7fa;
  border-radius: 19px;
  background: #fff;
  box-shadow: 0 27px 78px rgba(19, 36, 88, .27);
  scrollbar-width: thin;
  scrollbar-color: #b2c2ed #f4f7ff;
}
.guide-modal-header {
  display: flex;
  align-items: start;
  gap: 13px;
  padding: 23px 24px 19px;
  background: linear-gradient(115deg, #edf4ff 0%, #fff 58%, #f4edff 100%);
  border-bottom: 1px solid #dce5fc;
}
.guide-modal-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 13px;
  background: linear-gradient(135deg, #547cf4, #6847d9);
  box-shadow: 0 6px 16px rgba(81, 85, 218, .20);
  color: white;
  font-size: 23px;
  font-weight: 850;
}
.guide-modal-titles {flex: 1; min-width: 0}
.guide-overline {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 850;
  color: #5968d2;
  text-transform: uppercase;
  letter-spacing: 1.25px;
}
#guideModal .guide-modal-titles h2 {
  margin: 0 0 4px;
  line-height: 1.2;
  letter-spacing: -.45px;
  font-size: clamp(20px, 3vw, 25px);
  color: #182d67;
}
.guide-topic {display: block; color: #566b9b; font-size: 12px; font-weight: 750}
.guide-close-btn {
  display: grid;
  place-items: center;
  height: 39px;
  width: 39px;
  flex: 0 0 39px;
  border-radius: 10px;
  border: 1px solid #d6e1f7;
  background: #fff;
  color: #284488;
  font-size: 22px;
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.guide-close-btn:hover {background: #eaf1ff; border-color: #8ba8f5}
.guide-close-btn:focus-visible, .guide-modal-footer .btn:focus-visible {outline: 3px solid #406bf2; outline-offset: 2px}
.guide-body {padding: 20px 24px 8px}
#guideModal .guide-intro {margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: #4c608b}
.guide-section-title {font-size: 13px; font-weight: 900; color: #263c78; letter-spacing: .04px; margin: 0 0 11px}
.guide-steps {list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 9px}
.guide-steps li {
  display: flex;
  align-items: start;
  gap: 11px;
  padding: 11px 12px;
  border: 1px solid #dce6fb;
  border-radius: 10px;
  background: #f9fbff;
  font-size: 12px;
  line-height: 1.55;
  color: #3d527c;
}
.guide-step-number {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  flex: 0 0 25px;
  border-radius: 8px;
  background: #e8eaff;
  color: #5b4ac4;
  font-weight: 850;
}
.guide-steps li:nth-child(2) .guide-step-number {background: #dff3ff; color: #176bb5}
.guide-steps li:nth-child(3) .guide-step-number {background: #ddf6ef; color: #127e64}
.guide-concepts {
  padding: 12px 14px;
  margin-bottom: 18px;
  background: #f5f8ff;
  border: 1px solid #d9e6fe;
  border-left: 4px solid #6279ea;
  border-radius: 10px;
}
#guideModal .guide-concepts p {margin: 4px 0 9px; color: #4b5d80; font-size: 12px; line-height: 1.55}
#guideModal .guide-concepts p:last-child {margin-bottom: 4px}
.guide-concepts strong {color: #25438f}
.guide-example-wrap {border: 1px solid #d8e6fa; border-radius: 11px; overflow: hidden; background: #fff}
.guide-example-caption {padding: 10px 13px; font-size: 11px; font-weight: 800; color: #48619c; background: #eef4ff; border-bottom: 1px solid #d8e6fa}
#guideModal .guide-example {
  display: block;
  margin: 0;
  padding: 12px 14px;
  color: #273e81;
  font-family: ui-monospace, SFMono-Regular, Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#guideModal .guide-no-answer {font-size: 11px; color: #57708d; margin: 10px 0 14px; line-height: 1.6}
.guide-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 24px 19px;
  background: #fbfcff;
  border-top: 1px solid #e6eafd;
}
.guide-modal-footer p {margin: 0; color: #5e6b95; font-size: 11px; line-height: 1.4; max-width: 260px}
.guide-modal-footer .btn {min-height: 44px; padding: 9px 17px; white-space: normal; font-size: 12px}
@media (max-width: 520px) {
  #guideModal {padding: 10px}
  #guideModal .guide-dialog {max-height: calc(100vh - 20px); border-radius: 15px}
  .guide-modal-header {padding: 16px 14px; gap: 9px}
  .guide-modal-badge {width: 40px; height: 40px; flex-basis: 40px; font-size: 19px}
  .guide-close-btn {width: 35px; height: 35px; flex-basis: 35px}
  .guide-body {padding: 15px 14px 4px}
  .guide-modal-footer {padding: 13px 14px 17px; flex-direction: column; align-items: stretch}
  .guide-modal-footer p {max-width: none}
  .guide-modal-footer .btn {width: 100%}
}
@media (prefers-reduced-motion: reduce) {
  .guide-open-btn, .guide-open-arrow, .guide-close-btn {transition: none !important; transform: none !important}
  #guideModal .guide-dialog {animation: none !important}
}
