/* =========================================================
   HƯỚNG DẪN MINIGAME TRUNG THU — ECOMOBI
   Thiết kế tối giản, sang trọng, responsive đa màn hình
   ========================================================= */

/* --- Nút Hướng dẫn nhỏ trên Game Card --- */
.game-card {
  user-select: none;
}

.game-guide-btn {
  position: absolute;
  top: 18px;
  right: clamp(14px, 3.2vw, 28px);
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(18, 8, 7, 0.72);
  border: 1px solid rgba(255, 220, 160, 0.32);
  color: #f1dfca;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.game-guide-btn svg {
  flex: 0 0 auto;
  opacity: 0.9;
}

.game-guide-btn:hover {
  background: rgba(45, 18, 14, 0.92);
  border-color: rgba(255, 220, 160, 0.65);
  color: #ffffff;
  transform: translateY(-1px);
}

.game-guide-btn:active {
  transform: translateY(0);
}

.game-guide-btn:focus-visible {
  outline: 2px solid #ffd98a;
  outline-offset: 2px;
}

/* --- Modal Dialog Hướng Dẫn --- */
.game-guide-dialog {
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
  color: #ede4d8;
}

.game-guide-dialog::backdrop {
  background: rgba(6, 3, 4, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.guide-shell {
  position: absolute;
  inset: 0;
  margin: auto;
  width: min(840px, 92vw);
  height: min(84dvh, 700px);
  max-height: 84dvh;
  display: flex;
  flex-direction: column;
  background: #140908;
  border: 1px solid rgba(255, 220, 160, 0.15);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
  overflow: hidden;
}

/* --- Header Modal --- */
.guide-header {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  padding: 18px 24px 14px;
  background: #190b0a;
  border-bottom: 1px solid rgba(255, 220, 160, 0.1);
}

.guide-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.guide-heading h2 {
  margin: 0;
  font-family: 'SVN Gang of Three', 'Be Vietnam Pro', sans-serif;
  font-size: clamp(19px, 2.4vw, 24px);
  font-weight: 400;
  line-height: 1.15;
  color: #fcecd6;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.guide-heading span {
  display: block;
  color: #c49253;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.guide-close {
  display: flex;
  width: 34px;
  height: 34px;
  padding: 0;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 220, 160, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #cfc2af;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 0 0 auto;
}

.guide-close svg {
  width: 16px;
  height: 16px;
}

.guide-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 220, 160, 0.45);
}

.guide-close:focus-visible {
  outline: 2px solid #ffd98a;
  outline-offset: 2px;
}

/* --- Thân Modal (Scrollable) --- */
.guide-body {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px clamp(16px, 2.8vw, 28px) 26px;
  scrollbar-width: thin;
  scrollbar-color: #421812 #100605;
  -webkit-overflow-scrolling: touch;
}

.guide-body::-webkit-scrollbar {
  width: 5px;
}

.guide-body::-webkit-scrollbar-track {
  background: #100605;
}

.guide-body::-webkit-scrollbar-thumb {
  background: #421812;
  border-radius: 3px;
}

/* --- Quick Spec Bar --- */
.guide-quick-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 20px;
  padding: 7px 14px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 220, 160, 0.08);
  font-size: 11px;
  color: #b5a494;
}

.guide-quick-bar span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.guide-quick-bar strong {
  color: #f7e3c5;
  font-weight: 600;
}

.guide-quick-bar i.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 220, 160, 0.25);
}

/* --- Bố Cục So Le (Zigzag Rows) --- */
.guide-row {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 220, 160, 0.06);
}

.guide-row.is-reversed {
  grid-template-columns: 0.82fr 1.18fr;
}

.guide-row.is-reversed .guide-visual {
  order: 1;
}

.guide-row.is-reversed .guide-text {
  order: 2;
}

/* --- Cột Text --- */
.guide-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.guide-step-tag {
  display: inline-block;
  color: #dfaa6a;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.guide-step-tag.tag-danger {
  color: #e57373;
}

.guide-text h3 {
  margin: 0;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: #f8eee2;
}

.guide-text p {
  margin: 0;
  color: #b8a796;
  font-size: 12px;
  line-height: 1.6;
}

.guide-text ul {
  margin: 2px 0 0;
  padding-left: 16px;
  color: #b8a796;
  font-size: 12px;
  line-height: 1.6;
}

.guide-text li {
  margin-bottom: 3px;
}

.guide-text strong {
  color: #f4e8d8;
}

.guide-kbd {
  display: inline-block;
  padding: 1px 5px;
  border: 1px solid rgba(255, 220, 160, 0.25);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.4);
  color: #f7d296;
  font-size: 10px;
  font-family: inherit;
}

/* --- Cột Visual: Khung Canvas Tái Hiện Game Thật --- */
.guide-visual {
  position: relative;
  border-radius: 8px;
  background: #0e0506;
  border: 1px solid rgba(255, 220, 160, 0.14);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.guide-demo-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  display: block;
  background: #0e0506;
}

.guide-visual-label {
  padding: 5px 10px;
  text-align: center;
  font-size: 10px;
  color: #b2a292;
  background: rgba(14, 5, 6, 0.94);
  border-top: 1px solid rgba(255, 220, 160, 0.08);
  letter-spacing: 0.02em;
}

/* --- Footer Action --- */
.guide-footer-action {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 220, 160, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.guide-play-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 28px;
  border: 1px solid rgba(255, 220, 160, 0.35);
  border-radius: 6px;
  background: #341511;
  color: #fcebd2;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
}

.guide-play-now:hover {
  background: #4a1c15;
  border-color: rgba(255, 220, 160, 0.6);
  color: #ffffff;
  transform: translateY(-1px);
}

.guide-play-now:active {
  background: #2a100d;
  transform: translateY(0);
}

.guide-play-now:focus-visible {
  outline: 2px solid #ffd98a;
  outline-offset: 2px;
}

/* --- Responsive Mobile & Tablet --- */
@media (max-width: 768px) {
  .guide-shell {
    width: 95vw;
    height: 90dvh;
    max-height: 90dvh;
    border-radius: 12px;
  }

  .guide-header {
    padding: 14px 16px 10px;
  }

  .guide-heading h2 {
    font-size: 18px;
  }

  .guide-body {
    padding: 14px 12px 20px;
  }

  .guide-quick-bar {
    font-size: 10px;
    gap: 6px 12px;
    padding: 6px 10px;
    margin-bottom: 14px;
  }

  .guide-row,
  .guide-row.is-reversed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 10px;
    margin-bottom: 12px;
  }

  /* Đưa Text lên trên, Visual bên dưới để dễ theo dõi */
  .guide-row .guide-text,
  .guide-row.is-reversed .guide-text {
    order: 1 !important;
  }

  .guide-row .guide-visual,
  .guide-row.is-reversed .guide-visual {
    order: 2 !important;
    width: 100%;
  }

  .guide-text h3 {
    font-size: 14px;
  }

  .guide-text p,
  .guide-text ul {
    font-size: 11.5px;
    line-height: 1.55;
  }

  .guide-visual-label {
    font-size: 9.5px;
    padding: 4px 6px;
  }

  .guide-footer-action {
    margin-top: 12px;
    padding-top: 10px;
  }

  .guide-play-now {
    width: 100%;
    padding: 11px 0;
  }
}
