.tag-help-trigger {
  align-self: center;
  justify-self: center;
  width: fit-content;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--color-text-30);
  cursor: pointer;
  font-size: var(--font-sm);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: var(--transition);
}

.tag-help-trigger:hover {
  color: var(--color-yellow);
}

.tag-help-dialog {
  width: min(500px, calc(100% - var(--margin-xl)));
  max-height: calc(100dvh - var(--margin-xl));
  margin: auto;
  padding: 0;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius);
  background: var(--color-bg);
  color: var(--color-text-50);
  box-shadow: 0 0 24px 4px rgba(255, 190, 32, 0.08);
  overflow: hidden;
}

.tag-help-dialog::backdrop {
  background: rgba(0, 0, 0, 0.82);
}

.tag-help-dialog-content {
  max-height: calc(100dvh - var(--margin-xl));
  padding: var(--margin-lg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.tag-help-header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 36px;
  align-items: center;
  min-height: 36px;
  margin-bottom: var(--margin-lg);
  text-align: center;
}

.tag-help-header h2 {
  grid-column: 2;
  color: var(--color-text-80);
  font-size: var(--font-xl);
}

.tag-help-close {
  grid-column: 3;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--color-text-50);
  cursor: pointer;
  transition: var(--transition);
}

.tag-help-close:hover {
  color: var(--color-text-30);
}

.tag-help-close svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.tag-help-steps {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: tag-help-step;
}

.tag-help-steps li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--margin-sm);
  padding: var(--margin-lg) 0;
  border-top: 1px solid var(--color-border);
  text-align: center;
  counter-increment: tag-help-step;
}

.tag-help-steps li:first-child {
  padding-top: 0;
  border-top: 0;
}

.tag-help-steps li:last-child {
  padding-bottom: 0;
}

.tag-help-steps li::before {
  content: counter(tag-help-step);
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid rgba(255, 190, 32, 0.28);
  border-radius: 999px;
  background: rgba(255, 190, 32, 0.08);
  color: var(--color-yellow);
  font-size: var(--font-sm);
  font-weight: 700;
  line-height: 1;
}

.tag-help-steps p {
  margin: 0;
  color: var(--color-text-80);
  font-weight: 600;
}

.tag-help-steps strong {
  color: var(--color-cyan);
}

.tag-help-steps img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}

.tag-help-game-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--color-cyan);
  border-radius: var(--border-radius);
  background: var(--color-cyan);
  color: #000;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
}

.tag-help-game-link:hover {
  border-color: var(--color-yellow);
  background: var(--color-yellow);
  color: #000;
}

@media (max-width: 600px) {
  .tag-help-dialog {
    width: calc(100% - (2 * var(--margin-sm)));
    max-height: calc(100dvh - (2 * var(--margin-sm)));
  }

  .tag-help-dialog-content {
    max-height: calc(100dvh - (2 * var(--margin-sm)));
    padding: var(--margin-base);
  }

  .tag-help-header {
    margin-bottom: var(--margin-base);
  }

  .tag-help-steps li {
    padding: var(--margin-base) 0;
  }
}
