﻿/* ==========================================================================
   Section 2 Styles
   --------------------------------------------------------------------------
   Feature carousel, section layout, and ratio-mode overrides driven by JS.
   ========================================================================== */

/* Section 2 container spacing */
#game-guide .section-content {
  padding-top: 32px;
  padding-bottom: 0;
}

/* Section title art placement */
.feature-title-image {
  margin: 25px 0 0;
  text-align: left;
}

.feature-title-image img {
  width: min(100%, 760px);
  margin-left: clamp(20px, 8vw, 170px);
  display: block;
}

/* Main feature split layout */
.feature-stage {
  margin: 30px auto 0;
  width: min(94vw, 960px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.feature-main {
  flex: 0 0 70%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Carousel viewport and frame shell */
.feature-screen {
  width: 100%;
  background: transparent;
  padding: 8px 8px 11px;
  position: relative;
}

.feature-screen-inner {
  position: relative;
  overflow: hidden;
}

.feature-screen-viewport {
  position: absolute;
  top: 8.75%;
  left: 5.6%;
  width: 82.94%;
  height: 82.5%;
  overflow: hidden;
  z-index: 2;
}

.feature-screen-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  z-index: 1;
  transform: translateX(0);
  transition: none;
  will-change: transform;
}

.feature-screen-image.is-feature-incoming {
  z-index: 2;
}

.feature-screen-image.is-sliding {
  transition: transform 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.feature-screen-image.is-enter-from-right {
  transform: translateX(100%);
}

.feature-screen-image.is-enter-from-left {
  transform: translateX(-100%);
}

.feature-screen-image.is-leave-to-left {
  transform: translateX(-100%);
}

.feature-screen-image.is-leave-to-right {
  transform: translateX(100%);
}

.feature-screen-frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
}

/* Carousel arrow controls */
.feature-screen-arrow {
  position: absolute;
  top: 8.75%;
  bottom: 8.75%;
  width: clamp(36px, 5.8vw, 72px);
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  text-shadow: 0 4px 12px rgba(12, 20, 52, 0.55);
  transition: color 180ms ease, transform 180ms ease, background 180ms ease;
}

.feature-screen-arrow:hover,
.feature-screen-arrow:focus-visible {
  color: #ffffff;
  transform: scale(1.04);
  outline: none;
}

.feature-screen-arrow:focus-visible {
  background: rgba(255, 255, 255, 0.08);
}

.feature-screen-arrow span {
  font-size: clamp(34px, 3.2vw, 54px);
  line-height: 1;
  pointer-events: none;
}

.feature-screen-arrow-left {
  left: 5.6%;
  justify-content: flex-start;
  padding-left: clamp(4px, 0.7vw, 10px);
}

.feature-screen-arrow-right {
  right: 11.46%;
  justify-content: flex-end;
  padding-right: clamp(4px, 0.7vw, 10px);
}

.feature-slide-indicator {
  position: absolute;
  left: calc(100% * 551 / 1178);
  top: calc(100% * 586 / 617);
  transform: translate(-50%, -50%);
  width: calc(100% * 100 / 1150);
  height: calc(100% * 25 / 617);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  justify-items: center;
  z-index: 6;
  pointer-events: none;
}

.feature-slide-dot {
  width: calc(100% * 60/ 95);
  height: calc(100% * 60/ 95);
  border-radius: 50%;
  background: #06090f;
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 180ms ease, transform 180ms ease;
}

.feature-slide-dot.is-active {
  opacity: 0.96;
  transform: scale(1);
}

.feature-dots {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  background: #3c4458;
  border-radius: 999px;
  padding: 5px 10px;
}

.feature-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f4f5f7;
}

/* Character portrait area */
.feature-portrait {
  flex: 0 0 30%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.feature-portrait img {
  width: min(100%, 400px);
  max-height: 500px;
  object-fit: contain;
  display: block;
  transform: translateY(-24px);
}

.feature-detail-image {
  margin-top: 18px;
}

.feature-detail-image img {
  width: min(100%, 620px);
  display: block;
}

/* Mid-to-large desktop refinements */
@media (max-width: 1599px) and (min-width: 1201px) {
  .bg-page-2 {
    background-size: cover;
    background-position: center top;
  }

  #game-guide .section-content {
    width: min(96vw, 1280px);
    padding-top: 24px;
    padding-bottom: 0;
  }

  .feature-title-image {
    margin-top: 20px;
  }

  .feature-title-image img {
    width: min(100%, 820px);
    margin-left: clamp(18px, 5vw, 90px);
  }

  .feature-stage {
    width: 100%;
    margin-top: 20px;
    gap: 8px;
  }

  .feature-main {
    flex: 0 0 69%;
    min-width: 0;
  }

  .feature-portrait {
    flex: 0 0 31%;
    min-width: 0;
    min-height: 430px;
    justify-content: center;
  }

  .feature-portrait img {
    width: min(100%, 420px);
    max-height: 560px;
    transform: translate(-10px, -24px);
  }

  .feature-detail-image img {
    width: min(100%, 690px);
  }
}

/* Tablet refinements */
@media (max-width: 1200px) and (min-width: 901px) {
  .bg-page-2 {
    background-size: cover;
    background-position: center top;
  }

  #game-guide .section-content {
    padding-top: 20px;
    padding-bottom: 0;
  }

  .feature-title-image {
    margin-top: 18px;
  }

  .feature-title-image img {
    width: min(100%, 680px);
    margin-left: clamp(10px, 4vw, 80px);
  }

  .feature-stage {
    width: 100%;
    margin-top: 18px;
    gap: 6px;
  }

  .feature-main {
    flex: 0 0 68%;
    min-width: 0;
  }

  .feature-portrait {
    flex: 0 0 32%;
    min-width: 0;
    justify-content: center;
  }

  .feature-portrait img {
    width: min(100%, 340px);
    max-height: 430px;
    transform: translate(-8px, -16px);
  }

  .feature-detail-image img {
    width: min(100%, 560px);
  }
}

/* Wide tablet/desktop spacing tweak */
@media (max-width: 1400px) and (min-width: 901px) {
  .feature-detail-image {
    margin-bottom: clamp(14px, 1.8vw, 26px);
  }
}

/* Large desktop refinements */
@media (min-width: 1600px) {
  #game-guide .section-content {
    padding-top: 30px;
  }

  .feature-title-image img {
    width: min(100%, 960px);
  }

  .feature-stage {
    width: min(94vw, 1700px);
    margin-top: 22px;
    gap: 0;
  }

  .feature-main {
    flex: 0 0 65%;
  }

  .feature-screen {
    padding: 12px 12px 15px;
  }

  .feature-dots {
    bottom: -18px;
    gap: 7px;
    padding: 7px 14px;
  }

  .feature-dots span {
    width: 14px;
    height: 14px;
  }

  .feature-portrait {
    flex: 0 0 35%;
    min-height: 600px;
  }

  .feature-portrait img {
    width: min(100%, 600px);
    max-height: 740px;
    transform: translateY(-40px);
  }

  .feature-detail-image {
    margin-top: 24px;
  }

  .feature-detail-image img {
    width: min(100%, 860px);
  }
}

/* Mobile layout */
@media (max-width: 900px) {
  .bg-page-2 {
    background-size: cover;
    background-position: center top;
  }

  #game-guide .section-content {
    padding-top: 22px;
    padding-bottom: 18px;
  }

  .feature-title-image {
    text-align: center;
    margin-top: 16px;
  }

  .feature-title-image img {
    width: min(96vw, 680px);
    margin-left: auto;
    margin-right: auto;
  }

  .feature-stage {
    margin-top: 0;
    width: min(95vw, 520px);
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .feature-main {
    width: min(100%, 520px);
    flex: none;
  }

  .feature-screen {
    width: 100%;
  }

  .feature-portrait {
    min-height: 0;
    width: min(72vw, 320px);
    margin-top: clamp(18px, 4vw, 30px);
  }

  .feature-portrait img {
    transform: none;
  }

  .feature-detail-image {
    margin-top: 14px;
  }

  .feature-detail-image img {
    width: min(96vw, 520px);
    margin: 0 auto;
  }
}

/* Main-site compact pass: Section 2 */
#game-guide .section-content {
  padding-top: calc(32px * var(--compact-space));
}

.feature-title-image {
  margin-top: calc(25px * var(--compact-space));
}

.feature-title-image img {
  width: min(100%, calc(680px * var(--compact-ui)));
  margin-left: clamp(
    calc(20px * var(--compact-space)),
    calc(8vw * var(--compact-space)),
    calc(170px * var(--compact-space))
  );
}

.feature-stage {
  margin-top: calc(30px * var(--compact-space));
  width: min(calc(94vw * var(--compact-ui)), calc(960px * var(--compact-ui)));
  gap: calc(8px * var(--compact-space));
}

.feature-screen {
  padding: calc(8px * var(--compact-space))
    calc(8px * var(--compact-space))
    calc(11px * var(--compact-space));
}

.feature-screen-arrow {
  width: clamp(
    calc(36px * var(--compact-ui)),
    calc(5.8vw * var(--compact-ui)),
    calc(72px * var(--compact-ui))
  );
}

.feature-screen-arrow span {
  font-size: clamp(
    calc(34px * var(--compact-type)),
    calc(3.2vw * var(--compact-type)),
    calc(54px * var(--compact-type))
  );
}

.feature-screen-arrow-left {
  padding-left: clamp(
    calc(4px * var(--compact-space)),
    calc(0.7vw * var(--compact-space)),
    calc(10px * var(--compact-space))
  );
}

.feature-screen-arrow-right {
  padding-right: clamp(
    calc(4px * var(--compact-space)),
    calc(0.7vw * var(--compact-space)),
    calc(10px * var(--compact-space))
  );
}

.feature-slide-dot {
  width: calc(100% * 50 / 95);
  height: calc(100% * 50 / 95);
}

.feature-portrait img {
  width: min(100%, calc(400px * var(--compact-ui)));
  max-height: calc(500px * var(--compact-ui));
  transform: translateY(calc(-24px * var(--compact-space)));
}

.feature-detail-image {
  margin-top: calc(18px * var(--compact-space));
}

.feature-detail-image img {
  width: min(100%, calc(620px * var(--compact-ui)));
}

@media (max-width: 1599px) and (min-width: 1201px) {
  #game-guide .section-content {
    width: min(95vw, 1220px);
    padding-top: calc(24px * var(--compact-space));
  }

  .feature-title-image {
    margin-top: calc(22px * var(--compact-space));
  }

  .feature-title-image img {
    width: min(100%, 560px);
    margin-left: clamp(
      calc(16px * var(--compact-space)),
      calc(4.8vw * var(--compact-space)),
      calc(92px * var(--compact-space))
    );
  }

  .feature-stage {
    width: min(95vw, 1220px);
    margin-top: calc(14px * var(--compact-space));
    gap: calc(8px * var(--compact-space));
  }

  .feature-main {
    flex: 0 0 70%;
  }

  .feature-screen {
    width: 93%;
    margin: 0 auto;
    padding: calc(8px * var(--compact-space))
      calc(8px * var(--compact-space))
      calc(10px * var(--compact-space));
  }

  .feature-portrait {
    flex: 0 0 30%;
    min-height: 420px;
  }

  .feature-portrait img {
    width: min(100%, 430px);
    max-height: 560px;
    transform: translate(
      calc(-10px * var(--compact-space)),
      calc(-20px * var(--compact-space))
    );
  }

  .feature-detail-image {
    margin-top: calc(16px * var(--compact-space));
  }

  .feature-detail-image img {
    width: min(100%, 640px);
  }
}

@media (max-width: 1200px) and (min-width: 901px) {
  #game-guide .section-content {
    width: min(95vw, 1020px);
    padding-top: calc(22px * var(--compact-space));
  }

  .feature-title-image {
    margin-top: calc(20px * var(--compact-space));
  }

  .feature-title-image img {
    width: min(100%, 580px);
    margin-left: clamp(
      calc(10px * var(--compact-space)),
      calc(3.9vw * var(--compact-space)),
      calc(72px * var(--compact-space))
    );
  }

  .feature-stage {
    width: min(95vw, 1020px);
    margin-top: calc(14px * var(--compact-space));
    gap: calc(6px * var(--compact-space));
  }

  .feature-main {
    flex: 0 0 69%;
  }

  .feature-screen {
    width: 92%;
    margin: 0 auto;
    padding: calc(8px * var(--compact-space))
      calc(8px * var(--compact-space))
      calc(10px * var(--compact-space));
  }

  .feature-portrait {
    flex: 0 0 31%;
  }

  .feature-portrait img {
    width: min(100%, 330px);
    max-height: 430px;
    transform: translate(
      calc(-7px * var(--compact-space)),
      calc(-14px * var(--compact-space))
    );
  }

  .feature-detail-image {
    margin-top: calc(14px * var(--compact-space));
  }

  .feature-detail-image img {
    width: min(100%, 540px);
  }
}

@media (min-width: 1600px) {
  #game-guide .section-content {
    padding-top: calc(26px * var(--compact-space));
  }

  .feature-title-image {
    margin-top: calc(20px * var(--compact-space));
  }

  .feature-title-image img {
    width: min(100%, 624px);
    margin-left: clamp(
      calc(20px * var(--compact-space)),
      calc(6vw * var(--compact-space)),
      calc(140px * var(--compact-space))
    );
  }

  .feature-stage {
    width: min(95vw, 1640px);
    margin-top: calc(16px * var(--compact-space));
    gap: calc(5px * var(--compact-space));
  }

  .feature-main {
    flex: 0 0 68%;
  }
  

  .feature-screen {
    width: 80%;
    margin: 0 auto;
    padding: calc(10px * var(--compact-space))
      calc(10px * var(--compact-space))
      calc(13px * var(--compact-space));
  }

  .feature-portrait {
    flex: 0 0 32%;
    min-height: 560px;
  }

  .feature-portrait img {
    width: min(100%, 560px);
    max-height: 720px;
    transform: translateY(calc(-36px * var(--compact-space)));
  }

  .feature-detail-image {
    margin-top: calc(20px * var(--compact-space));
  }

  .feature-detail-image img {
    width: min(100%, 800px);
  }
}

@media (max-width: 900px) {
  #game-guide .section-content {
    padding-top: calc(22px * var(--compact-space));
    padding-bottom: calc(18px * var(--compact-space));
  }

  .feature-title-image {
    margin-top: calc(20px * var(--compact-space));
  }

  .feature-title-image img {
    width: min(calc(96vw * var(--compact-ui)), calc(620px * var(--compact-ui)));
  }

  .feature-stage {
    width: min(95vw, 520px);
    gap: calc(10px * var(--compact-space));
  }

  .feature-main {
    width: min(100%, 520px);
  }

  .feature-portrait {
    width: min(calc(72vw * var(--compact-ui)), calc(320px * var(--compact-ui)));
  }

  .feature-detail-image {
    margin-top: calc(14px * var(--compact-space));
  }

  .feature-detail-image img {
    width: min(calc(96vw * var(--compact-ui)), calc(520px * var(--compact-ui)));
  }
}

/* Final Section 2 desktop rebalance: center title/tag and prioritize carousel */
@media (min-width: 901px) {
  #game-guide .section-content {
    width: min(98vw, 1680px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
  }

  .feature-title-image {
    text-align: center;
    margin: 0 0 clamp(8px, 1.2vh, 14px);
  }

  .feature-title-image img {
    width: min(100%, clamp(450px, 48vw, 690px));
    margin-left: auto;
    margin-right: auto;
  }

  .feature-stage {
    width: min(98vw, 1680px);
    margin: 0 auto;
    align-items: center;
    gap: clamp(12px, 1.5vw, 21px);
  }

  .feature-main {
    flex: 0 0 76%;
    align-items: center;
  }

  .feature-screen {
    width: min(100%, 1230px);
    margin: 0 auto;
    padding: clamp(9px, 1.2vw, 15px) clamp(9px, 1.2vw, 15px)
      clamp(12px, 1.5vw, 18px);
  }

  .feature-screen-arrow {
    width: clamp(54px, 8.7vw, 108px);
  }

  .feature-screen-arrow span {
    font-size: clamp(51px, 4.8vw, 81px);
  }

  .feature-detail-image {
    margin-top: clamp(12px, 1.5vw, 21px);
  }

  .feature-detail-image img {
    width: min(100%, 630px);
  }

  .feature-portrait {
    flex: 0 0 24%;
    min-height: 0;
    justify-content: center;
    align-items: center;
  }

  .feature-portrait img {
    width: min(100%, 375px);
    max-height: 480px;
    transform: none;
  }
}

/* Section 2 ratio-driven desktop/tablet fit mode (enabled by JS runtime class) */
@media (min-width: 901px) {
  #game-guide.section2-ratio-mode {
    --s2-scale: 1;
    --s2-title-w: 690px;
    --s2-screen-w: 1230px;
    --s2-detail-w: 630px;
    --s2-zoro-w: 375px;
    --s2-title-stage-gap: 14px;
    --s2-stage-gap: 21px;
    --s2-detail-gap: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #game-guide.section2-ratio-mode .section-content {
    width: max-content;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s2-title-stage-gap);
    text-align: center;
  }

  #game-guide.section2-ratio-mode .feature-title-image {
    margin: 0;
    text-align: center;
  }

  #game-guide.section2-ratio-mode .feature-title-image img {
    width: var(--s2-title-w);
    margin: 0;
  }

  #game-guide.section2-ratio-mode .feature-stage {
    width: max-content;
    margin: 0;
    align-items: center;
    justify-content: center;
    gap: var(--s2-stage-gap);
  }

  #game-guide.section2-ratio-mode .feature-main {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    align-items: center;
  }

  #game-guide.section2-ratio-mode .feature-screen {
    width: var(--s2-screen-w);
    margin: 0;
  }

  #game-guide.section2-ratio-mode .feature-detail-image {
    margin-top: var(--s2-detail-gap);
    margin-bottom: 0;
  }

  #game-guide.section2-ratio-mode .feature-detail-image img {
    width: var(--s2-detail-w);
    margin: 0 auto;
  }

  #game-guide.section2-ratio-mode .feature-portrait {
    flex: 0 0 auto;
    width: var(--s2-zoro-w);
    min-height: 0;
    margin: 0;
    justify-content: center;
    align-items: center;
  }

  #game-guide.section2-ratio-mode .feature-portrait img {
    width: 100%;
    max-height: none;
    transform: none;
  }

  #game-guide.section2-ratio-landscape .feature-stage {
    flex-direction: row;
  }

  #game-guide.section2-ratio-portrait .feature-stage {
    flex-direction: column;
  }

  #game-guide.section2-ratio-portrait .feature-main {
    order: 1;
  }

  #game-guide.section2-ratio-portrait .feature-portrait {
    order: 2;
  }
}

