/* =========================================================
   Tournament Site — Tutorial & Rules Stylesheet
   Loaded AFTER styles.css, home.css, and ban-status.css so it
   inherits the same header, bottom-nav, and color/type tokens.
   This file also carries the post-login popup styles used by
   tutorial-popup.js, since Home is the only other page that
   needs them (the popup only ever appears there).
   ========================================================= */

.tutorial-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 40px 24px 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ---------- YouTube eyebrow ---------- */

.tutorial-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  padding: 10px 22px;
}

.tutorial-eyebrow__icon {
  width: 26px !important;
  height: 19px !important;
  max-width: 26px !important;
  max-height: 19px !important;
  flex: none !important;
}

.tutorial-eyebrow span {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* ---------- Video ---------- */

.tutorial-video-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* One video = its title on top, then the thumbnail frame */
.tutorial-video-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tutorial-video__title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
  margin: 0;
  overflow-wrap: anywhere;
}

.tutorial-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-clip);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-video-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Thumbnail link: fills the whole 16:9 frame; the play badge sits in the
   middle and the whole thing opens the video on YouTube. */
.tutorial-video__link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.tutorial-video__thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover; /* also trims the black bars on the standard-size fallback thumbnail */
}

.tutorial-video__play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--crimson);
  border-radius: var(--radius-clip);
  transition: background 0.15s ease, transform 0.15s ease;
}

.tutorial-video__play svg {
  width: 26px;
  height: 26px;
  fill: #fff;
}

.tutorial-video__link:hover .tutorial-video__play,
.tutorial-video__link:focus-visible .tutorial-video__play {
  background: var(--crimson-dim);
  transform: translate(-50%, -50%) scale(1.06);
}

.tutorial-video__link:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: -2px;
}

.tutorial-video__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

.tutorial-video__empty svg {
  width: 30px;
  height: 30px;
  stroke: var(--text-muted);
  fill: none;
}

.tutorial-video__empty p {
  margin: 0;
  font-size: 13px;
}

/* ---------- Rules ---------- */

.tutorial-rules-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.tutorial-rules-section .section-title {
  text-align: center;
}

/* Glowing box — pulses so it draws the eye, the same intent as the
   Home marquee's glow animation (home.css .marquee-track span). */
.tutorial-rules-box {
  background: var(--panel);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-clip);
  padding: 22px 24px;
  box-shadow: 0 0 10px rgba(63, 224, 208, 0.25), 0 0 22px rgba(63, 224, 208, 0.12);
  animation: tutorial-rules-glow 3s ease-in-out infinite;
  min-width: 0;
  max-width: 100%;
  overflow: hidden; /* nothing may ever spill outside the box */
}

.tutorial-rules-box__text {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  white-space: pre-line;
  /* long words / strings with no spaces wrap inside the box */
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
  max-width: 100%;
}

.tutorial-rules-box__text.tutorial-rules__empty {
  color: var(--text-muted);
  white-space: normal;
}

@keyframes tutorial-rules-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(63, 224, 208, 0.25), 0 0 22px rgba(63, 224, 208, 0.12);
  }
  50% {
    box-shadow: 0 0 18px rgba(63, 224, 208, 0.55), 0 0 36px rgba(63, 224, 208, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tutorial-rules-box {
    animation: none;
  }
}

/* ---------- Post-login popup (tutorial-popup.js) ----------
   Same modal pattern as ban-status.css's .ban-modal, styled with
   the cyan accent since this is informational, not a warning. */

.tutorial-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 6, 9, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.tutorial-modal {
  width: 100%;
  max-width: 380px;
  background: var(--panel);
  border: 1px solid var(--cyan);
  border-radius: var(--radius-clip);
  padding: 28px 26px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 0 24px rgba(63, 224, 208, 0.2);
}

.tutorial-modal__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(63, 224, 208, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tutorial-modal__icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--cyan);
  fill: none;
}

.tutorial-modal__body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

.tutorial-modal__close {
  width: 100%;
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .tutorial-main {
    padding: 28px 16px calc(var(--nav-height-mobile) + 32px);
    gap: 22px;
  }
}

@media (max-width: 480px) {
  .tutorial-eyebrow span {
    font-size: 15px;
  }

  .tutorial-video__title {
    font-size: 15px;
  }

  .tutorial-rules-box {
    padding: 18px 16px;
  }

  .tutorial-modal {
    padding: 24px 20px;
  }
}
