/* ===== Help & Guide Page ===== */

.help-page {
  overflow-x: hidden;
  overflow-y: auto;
  user-select: text;
}

.help-layout {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* Header */
.help-header {
  text-align: center;
  margin-bottom: 28px;
}

.help-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding: 8px 16px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  transition: all 0.2s;
}

.help-back:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(-2px);
}

.help-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.help-title-block h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 2.6rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.help-title-block p {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Table of contents */
.help-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 32px;
  padding: 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
}

.help-toc a {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.help-toc a:hover {
  background: rgba(255, 107, 157, 0.2);
  border-color: rgba(255, 107, 157, 0.4);
  color: var(--accent-pink);
}

/* Sections */
.guide-section {
  background: var(--glass);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 28px 24px;
  margin-bottom: 20px;
  scroll-margin-top: 20px;
}

.guide-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-purple);
  background: rgba(196, 77, 255, 0.15);
  padding: 4px 10px;
  border-radius: 8px;
  letter-spacing: 0.05em;
}

.section-lead {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.guide-section h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.guide-section p {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
}

.guide-section strong {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Guide cards grid */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.guide-grid.two-col {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.guide-card {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.guide-card.highlight {
  border: 1px solid rgba(255, 217, 61, 0.3);
  background: rgba(255, 217, 61, 0.06);
}

.guide-visual {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  margin-bottom: 14px;
}

/* Mini candy demos */
.mini-candy {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  position: relative;
}

.mini-candy::before {
  content: '';
  position: absolute;
  top: 18%;
  left: 22%;
  width: 28%;
  height: 18%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: rotate(-30deg);
}

.c-red { background: radial-gradient(circle at 35% 30%, #ff6b7a, var(--candy-red)); }
.c-orange { background: radial-gradient(circle at 35% 30%, #ffb86b, var(--candy-orange)); }
.c-yellow { background: radial-gradient(circle at 35% 30%, #ffe566, var(--candy-yellow)); }
.c-green { background: radial-gradient(circle at 35% 30%, #5eed8b, var(--candy-green)); }
.c-blue { background: radial-gradient(circle at 35% 30%, #5b65ff, var(--candy-blue)); }
.c-purple { background: radial-gradient(circle at 35% 30%, #c084fc, var(--candy-purple)); }

.swap-arrow {
  font-size: 1.4rem;
  color: var(--accent-cyan);
  animation: swapPulse 1.2s ease infinite;
}

@keyframes swapPulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
}

.mini-candy.pop {
  animation: miniPop 1.5s ease infinite;
}

.mini-candy.pop.delay-1 { animation-delay: 0.2s; }
.mini-candy.pop.delay-2 { animation-delay: 0.4s; }

@keyframes miniPop {
  0%, 70%, 100% { transform: scale(1); opacity: 1; }
  85% { transform: scale(1.2); opacity: 0.6; }
}

.fall-arrow {
  font-size: 1.2rem;
  color: var(--accent-gold);
  animation: fallBounce 1s ease infinite;
}

@keyframes fallBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.goal-bar {
  display: block;
  width: 120px;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.goal-fill {
  display: block;
  height: 100%;
  width: 65%;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-gold));
  border-radius: 4px;
  animation: goalGrow 2s ease infinite alternate;
}

@keyframes goalGrow {
  from { width: 40%; }
  to { width: 85%; }
}

.goal-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Special candy previews */
.special-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.special-item {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  padding: 18px 20px;
}

.special-preview {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.demo-candy {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.demo-candy::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 30%;
  height: 20%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: rotate(-30deg);
}

.demo-candy[data-type="2"] { background: radial-gradient(circle at 35% 30%, #ffe566, var(--candy-yellow)); }
.demo-candy[data-type="4"] { background: radial-gradient(circle at 35% 30%, #5b65ff, var(--candy-blue)); }
.demo-candy[data-type="1"] { background: radial-gradient(circle at 35% 30%, #ffb86b, var(--candy-orange)); border-radius: 18%; }

.demo-candy.striped-v::after {
  content: '';
  position: absolute;
  inset: 18% 12%;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255,255,255,0.5) 3px, rgba(255,255,255,0.5) 6px);
}

.demo-candy.striped-h::after {
  content: '';
  position: absolute;
  inset: 12% 18%;
  border-radius: 4px;
  background: repeating-linear-gradient(0deg, transparent, transparent 3px, rgba(255,255,255,0.5) 3px, rgba(255,255,255,0.5) 6px);
}

.demo-candy.wrapped {
  animation: wrappedGlow 1.5s ease infinite;
}

.demo-candy.rainbow {
  background: conic-gradient(
    var(--candy-red), var(--candy-orange), var(--candy-yellow),
    var(--candy-green), var(--candy-blue), var(--candy-purple), var(--candy-red)
  ) !important;
  animation: rainbowSpin 3s linear infinite;
}

.special-info h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.badge {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-cyan);
  background: rgba(110, 231, 255, 0.12);
  padding: 3px 10px;
  border-radius: 50px;
  border: 1px solid rgba(110, 231, 255, 0.25);
}

/* Combo table */
.combo-table {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.combo-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.combo-row:last-child {
  border-bottom: none;
}

.combo-row:nth-child(even):not(.combo-header) {
  background: rgba(0, 0, 0, 0.15);
}

.combo-header {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text);
  background: rgba(196, 77, 255, 0.12);
}

/* HUD guide */
.hud-guide {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hud-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.hud-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.hud-item strong {
  display: block;
  color: var(--accent-pink);
  font-family: var(--font-display);
  margin-bottom: 2px;
}

/* Controls grid */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.control-card {
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 14px;
  padding: 20px 16px;
}

.control-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.control-card h3 {
  margin-bottom: 6px;
}

/* Levels table */
.levels-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.levels-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.levels-table th,
.levels-table td {
  padding: 12px 16px;
  text-align: left;
}

.levels-table th {
  font-family: var(--font-display);
  font-weight: 600;
  background: rgba(196, 77, 255, 0.12);
  color: var(--text);
}

.levels-table td {
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.levels-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.stars-guide ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stars-guide li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.stars {
  font-size: 1.1rem;
  color: var(--accent-gold);
  min-width: 48px;
  letter-spacing: 2px;
}

/* Tips */
.tips-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tips-list li {
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 0.95rem;
  padding-left: 4px;
}

.tips-list li::marker {
  color: var(--accent-pink);
  font-weight: 700;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color 0.2s;
}

.faq-item[open] {
  border-color: rgba(255, 107, 157, 0.25);
}

.faq-item summary {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text);
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: '+';
  font-size: 1.2rem;
  color: var(--accent-pink);
  transition: transform 0.2s;
}

.faq-item[open] summary::after {
  transform: rotate(45deg);
}

.faq-item p {
  padding: 0 18px 16px;
  margin: 0;
}

/* Footer */
.help-footer {
  text-align: center;
  margin-top: 32px;
}

.help-play-btn {
  display: inline-block;
  text-decoration: none;
  color: white;
}

.help-footer-note {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 520px) {
  .special-item {
    flex-direction: column;
    text-align: center;
  }

  .combo-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .combo-header {
    display: none;
  }

  .combo-row span:first-child {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--text);
  }
}
