/* =========================================================
   RIDE GIRLS / MOBILE OPTIMIZATION v1
   Add AFTER all existing stylesheets. PC layout unchanged.
   ========================================================= */
@media (max-width: 900px) {
  html, body { max-width: 100%; }
  body { overflow-x: clip; }
  img, video { max-width: 100%; }
  /* Main site navigation: no squashed or wrapped menu items */
  body:not(.rg-reading-page):not(.rg-movies-page):not(.rg-gallery-page) > header {
    height: auto;
    min-height: 58px;
    padding: 10px 5% 9px;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
  }
  body:not(.rg-reading-page):not(.rg-movies-page):not(.rg-gallery-page) > header .site-logo { flex: none; }
  body:not(.rg-reading-page):not(.rg-movies-page):not(.rg-gallery-page) > header img {
    width: min(215px, 65vw);
    height: 43px;
    object-fit: contain;
    object-position: left center;
  }
  body:not(.rg-reading-page):not(.rg-movies-page):not(.rg-gallery-page) > header nav {
    display: flex;
    width: 100%;
    min-width: 0;
    gap: 18px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding: 2px 0 6px;
  }
  body:not(.rg-reading-page):not(.rg-movies-page):not(.rg-gallery-page) > header nav a {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 11px;
  }
  .characters-inner, .rg-comic-section .comic-inner,
  #extra .extra-lite-inner, .rg-gallery-inner,
  .rg-movies-inner, .rg-world-inner, .news-inner {
    max-width: 100%;
  }
}

@media (max-width: 760px) {
  /* HERO: keep the artwork cinematic, not stretched */
  #hero {
    height: min(78svh, 720px);
    min-height: 480px;
    max-height: none;
    padding: 0;
  }
  .hero-visual img { object-position: 55% 40%; }
  #hero::after {
    background: linear-gradient(to top,
      rgba(10,11,14,.78) 0%, rgba(10,11,14,.35) 36%, transparent 68%);
  }
  .hero-content {
    left: 6%; right: 6%; top: auto; bottom: 36px;
    width: auto; max-width: 100%; transform: none;
  }
  .hero-label { font-size: 10px; letter-spacing: .17em; margin-bottom: 13px; }
  .hero-content h2 {
    font-size: clamp(43px, 12.5vw, 76px);
    line-height: .94;
    overflow-wrap: anywhere;
  }
  .hero-description { font-size: 13px; line-height: 1.65; margin-top: 16px; }

  /* ABOUT desktop has a fixed 440px height: MUST release it on mobile */
  .about { height: auto; min-height: 0; margin-top: 22px; }
  .about-inner {
    display: block;
    height: auto;
    min-height: 0;
    padding: 46px 6% 0;
  }
  .about-copy { width: 100%; max-width: 100%; padding-bottom: 30px; }
  .about-copy h2 { font-size: clamp(40px, 10.8vw, 62px); margin-bottom: 24px; }
  .about-lead { font-size: 16px; line-height: 1.7; margin-bottom: 18px; }
  .about-text { font-size: 13px; line-height: 1.8; margin-bottom: 20px; }
  .about-visual {
    position: relative;
    inset: auto;
    width: calc(100% + 12%);
    height: auto;
    aspect-ratio: 16 / 10;
    margin-left: -6%;
    overflow: hidden;
  }
  .about-visual img {
    display: block; width: 100%; height: 100%;
    object-fit: cover; object-position: center;
    -webkit-mask-image: none; mask-image: none;
  }
  /* Allow mobile section height to follow content rather than inherited desktop sizes */
  .characters { padding: 64px 0 76px; }
  .characters-inner { width: 92%; }
  .characters-heading { margin-bottom: 38px; }
  .characters-heading h2 { font-size: clamp(43px, 12vw, 72px); }
  .character-group { margin-top: 50px; }
  .character-grid-main, .character-grid-small, .character-grid-rivals {
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 12px;
  }
  .character-card { min-width: 0; }
  .character-info h3 { overflow-wrap: anywhere; }
  .character-group-heading { gap: 12px; flex-wrap: wrap; }
  .character-group-link { white-space: nowrap; }

  #comic.rg-comic-section, #rivals.rg-comic-section { padding: 68px 0 80px; }
  .rg-comic-section .comic-inner { width: 92%; }
  .rg-comic-section .comic-featured {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 15px;
  }
  .rg-comic-section .comic-featured-info { padding: 5px 4px 12px; }
  .rg-comic-section .comic-featured-info h3 { font-size: clamp(23px, 6.3vw, 34px); }
  .rg-comic-section .comic-archive { margin-top: 55px; }
  .rg-comic-section .comic-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .rg-comic-section .comic-archive-heading { flex-wrap: wrap; }

  main #extra.rg-extra-lite, main section#gallery.rg-gallery,
  main #world.rg-world, main section#news { padding-top: 64px; padding-bottom: 75px; }
  #extra .extra-lite-inner, .rg-gallery-inner, .rg-movies-inner,
  .rg-world-inner, .news-inner { width: 92%; }
  #extra .extra-lite-heading, .rg-gallery-heading,
  .rg-movies-heading { gap: 12px; flex-wrap: wrap; }
  #extra .extra-lite-grid, .rg-gallery-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
  .rg-movies-home { grid-template-columns: 1fr; }
  .rg-movies-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .rg-movie-visual img { object-fit: cover; }
  #world.rg-world .rg-world-inner { width: 92%; grid-template-columns: 1fr; gap: 25px; }
  .rg-world-map { min-height: 0; aspect-ratio: 16/10; }
  .news-item { grid-template-columns: 1fr; gap: 8px; }

  /* Standalone reading / gallery / world pages */
  .reader-content { width: min(94%, 900px); padding: 34px 0 65px; }
  .archive-content { width: 92%; padding: 40px 0 75px; }
  .reader-page img { width: auto; height: auto; max-width: 100%; max-height: 90dvh; object-fit: contain; margin: 0 auto; }
  .rg-gallery-page .rg-gallery-modal img { max-width: 100%; max-height: 84dvh; object-fit: contain; }
  .rg-world-page-main { width: 92%; padding: 50px 0 80px; }
  .rg-world-page-title { font-size: clamp(48px, 14vw, 80px); }
}

@media (max-width: 400px) {
  .hero-content h2 { font-size: clamp(39px, 11.5vw, 52px); }
  .hero-description { font-size: 12px; }
  .about-copy h2 { font-size: clamp(37px, 10.3vw, 48px); }
  .characters .character-info h3 { font-size: 15px; }
  .rg-comic-section .comic-card-info h4 { font-size: 14px; }
  #extra .extra-lite-grid, .rg-gallery-grid { gap: 9px; }
  .news-title { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =========================================================
   RIDE GIRLS MOBILE v2
   HEADER / HERO 改善
   PC版には影響させない
   ========================================================= */

@media (max-width: 760px) {

  /* =====================================
     HEADER / スクロール案内
  ===================================== */

  body > header {
    position: relative;
  }

  body > header nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-right: 40px;
    scrollbar-width: none;
  }

  body > header nav::-webkit-scrollbar {
    display: none;
  }

  /* 右端にスクロール案内 */

  body > header::after {
    content: "›";
    position: absolute;
    right: 0;
    bottom: 5px;

    width: 40px;
    height: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: linear-gradient(
      90deg,
      rgba(34,34,36,0),
      #222224 45%
    );

    color: #b58aff;
    font-size: 30px;
    font-weight: 300;

    pointer-events: none;
    z-index: 5;
  }


  /* =====================================
     HERO / 画像を切り抜かない
  ===================================== */

  #hero {
    display: flex;
    flex-direction: column;

    height: auto;
    min-height: 0;
    max-height: none;

    padding: 0;
    overflow: hidden;

    background: #17181b;
  }

  /* 画像エリア */

  #hero .hero-visual {
    position: relative;
    inset: auto;

    width: 100%;
    height: auto;

    flex: none;
  }

  #hero .hero-visual img {
    display: block;

    width: 100%;
    height: auto;

    object-fit: contain;
    object-position: center;
  }

  /* 以前の画像上グラデーションを解除 */

  #hero::after {
    display: none;
  }

  /* タイトルを画像の下へ */

  #hero .hero-content {
    position: relative;

    left: auto;
    right: auto;
    top: auto;
    bottom: auto;

    transform: none;

    width: 100%;
    max-width: none;

    padding: 28px 7% 38px;

    background: #17181b;
  }

  #hero .hero-label {
    margin-bottom: 12px;
    font-size: 10px;
    letter-spacing: 0.18em;
    color: #b9a2d8;
  }

  #hero .hero-content h2 {
    font-size: clamp(42px, 11vw, 64px);
    line-height: 1;
    letter-spacing: -0.05em;
    color: #fff;
  }

  #hero .hero-description {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.8;
    color: #ddd;
  }

}