/*
 * MWI site v5 — home page (Figma "Home — Desktop 1440" 201:7924 / "Home — Mobile 390" 201:7469). Needs base.css.
 * Template: scripts/v5/build_home.py. Desktop hero geometry = Figma hero frames (logo box 360x136 at +72, H1 slot
 * +236 bottom-aligned, pitch +348, buttons +452, meta +524, switcher +628 inside 760); stacked hero <=1080px.
 */
main > section + section { margin-top: var(--sec); }

/* ---------- hero (D11: fixed slots for every game; D17: local gradients, art right-anchored) ---------- */
.hero { position: relative; height: clamp(41.25rem, calc(100svh - var(--hdr)), 47.5rem); container-type: size; overflow: hidden; isolation: isolate; }
.hero-slides, .hero-slide { position: relative; height: 100%; }
/* owner 02.12: the art sits flush with the right edge at full hero height; where the leftmost face (--fl, share of art
   width) would land under the text column (wrap + 40rem) the art shrinks, top-anchored, until it clears it.
   --art-r (CMS) = right edge offset in px at 1440 (default 0, negative = past the edge) */
.hero-art { --te: calc((100% - var(--wrap)) / 2 + 40rem); --aw: min(100cqh * 16 / 9, (100% - var(--te)) / (1 - var(--fl)));
  position: absolute; z-index: -1; top: 0; width: var(--aw); aspect-ratio: 16 / 9; right: calc(var(--art-r) * 100cqh / 760); }
#hero-farm .hero-art { --fl: .47; } #hero-cabaret .hero-art { --fl: .41; } #hero-xspace .hero-art { --fl: .42; }
#hero-guns .hero-art { --fl: .44; } #hero-amorai .hero-art { --fl: .37; }
.hero-art img { width: 100%; height: 100%; max-width: none;
  -webkit-mask: linear-gradient(90deg, transparent, #000 17.5%), linear-gradient(#000 75%, transparent); -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, transparent, #000 17.5%), linear-gradient(#000 75%, transparent); mask-composite: intersect; }
/* text gradient (Figma 0..860 at 1440: 96% -> 78% at 55% -> 0) and bottom fade under the switcher (200 of 760) */
.hero-slide::before, .hero-slide::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.hero-slide::before { top: 0; bottom: 0; left: 0; width: calc((100% - var(--wrap)) / 2 + 48.75rem);
  background: linear-gradient(90deg, rgba(9, 7, 12, .96), rgba(9, 7, 12, .78) 55%, rgba(9, 7, 12, 0)); }
.hero-slide::after { left: 0; right: 0; bottom: 0; height: calc(200 * 100cqh / 760); background: linear-gradient(rgba(9, 7, 12, 0), rgba(9, 7, 12, .85) 60%, var(--bg)); }
.hero-copy { padding-top: clamp(1.5rem, 100cqh - 43rem, 4.5rem); }
.hero-logo { display: flex; align-items: flex-end; height: 8.5rem; }
.hero-logo img { width: calc(var(--lw) * var(--k)); height: calc(var(--lh) * var(--k)); object-fit: contain; object-position: left bottom; }
.hero-h { display: flex; align-items: flex-end; min-height: 5.75rem; max-width: 40rem; margin-top: 1.75rem; font-weight: 600; font-size: 2.5rem; line-height: 2.875rem; }
.hero-pitch { min-height: 4.875rem; max-width: 32.5rem; margin-top: 1.25rem; font-size: 1.0625rem; line-height: 1.5625rem; color: var(--text-2); }
.hero-pitch .m { display: none; }
.hero .actions { margin-top: 1.625rem; }
.hero .actions .link { padding-left: 0.5rem; }
.hero-meta { margin-top: 1.5rem; font-weight: 500; font-size: 0.875rem; line-height: 1.25rem; color: var(--text-3); }
.hero-bar { position: absolute; left: 0; right: 0; bottom: 2rem; }
.hero-bar .gsw-head { margin-bottom: 0.875rem; }
.hero-slide.enter .hero-copy > * { animation: hero-in .45s cubic-bezier(.2, .7, .2, 1) both; }
.hero-slide.enter .hero-copy > :nth-child(2) { animation-delay: .04s; } .hero-slide.enter .hero-copy > :nth-child(3) { animation-delay: .08s; }
.hero-slide.enter .hero-copy > :nth-child(n+4) { animation-delay: .12s; }
.hero-slide.enter .hero-art { animation: art-in .6s ease both; }
@keyframes hero-in { from { opacity: 0; transform: translateY(0.5rem); } }
@keyframes art-in { from { opacity: 0; } }

@media (max-width: 1080px) {
  /* stacked hero (D05): art zone, logo box overlapping its bottom, offer, short pitch, both buttons, link, switcher */
  .hero { height: auto; container-type: normal; overflow: visible; }
  .hero-slides, .hero-slide { height: auto; }
  .hero-slide::before, .hero-slide::after { display: none; }
  .hero-art { position: relative; z-index: 0; left: auto; right: auto; width: auto; height: 27.5rem; overflow: hidden; }
  .hero-art::before, .hero-art::after { content: ""; position: absolute; pointer-events: none; }
  .hero-art::before { left: 0; top: 0; bottom: 0; width: 12.5rem; background: linear-gradient(90deg, rgba(9, 7, 12, .55), rgba(9, 7, 12, 0)); z-index: 1; }
  .hero-art::after { left: 0; right: 0; bottom: 0; height: 50%; background: linear-gradient(rgba(9, 7, 12, 0), var(--bg)); z-index: 1; }
  .hero-art img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: var(--mpos); -webkit-mask: none; mask: none; }
  .hero-copy { position: relative; z-index: 1; margin-top: -5.5rem; padding-top: 0; }
  .hero-logo { height: 4.75rem; }
  .hero-logo img { width: calc(var(--lw) * .56); height: calc(var(--lh) * .56); }
  .hero-h { min-height: 3.75rem; max-width: 32.5rem; margin-top: 0.75rem; font-size: 1.5rem; line-height: 1.875rem; }
  .hero-pitch { min-height: 2.75rem; max-width: 32.5rem; margin-top: 0.375rem; font-size: 0.9375rem; line-height: 1.375rem; }
  .hero-pitch .d { display: none; } .hero-pitch .m { display: inline; }
  .hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; max-width: 32.5rem; margin-top: 1rem; }
  .hero .actions .btn { padding: 0 0.75rem; }
  .hero .actions .link { grid-column: 1 / -1; justify-self: start; padding-left: 0; font-size: 0.9375rem; line-height: 1.375rem; }
  .hero .actions:not(:has(.btn-primary:not([hidden]))) .btn-nutaku { grid-column: 1 / -1; }
  .hero-meta { display: none; }
  .hero-bar { position: static; margin-top: 1.125rem; padding-bottom: 0.75rem; }
}
@media (max-width: 760px) { .hero-art { height: 18.75rem; } }

/* ---------- Only Farm flagship (D08/D09): 3 features tied to 3 real game screens ---------- */
.of-grid { container-type: inline-size; display: grid; grid-template-columns: 25rem minmax(0, 1fr); column-gap: 2.5rem; align-items: start; }
.of-feat { position: relative; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); align-content: start; min-height: 7.5rem; padding-top: 1rem; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1); }
.of-feat::before { content: ""; position: absolute; left: 0; top: 0; width: 7.5rem; height: 2px; background: var(--acc-hi); transform: scaleX(0); transform-origin: left; transition: transform .3s cubic-bezier(.2, .7, .2, 1); }
.of-feat.on::before { transform: none; }
.of-num { grid-row: span 2; padding-top: 0.25rem; font-weight: 600; font-size: 0.875rem; line-height: 1.25rem; color: var(--text-3); transition: color .3s; }
.of-feat.on .of-num { color: var(--acc-hi); }
.of-feat h3 { font-weight: 600; font-size: 1.25rem; line-height: 1.8125rem; }
.of-feat p { margin-top: 0.1875rem; font-size: 1rem; line-height: 1.4375rem; color: var(--text-2); }
.of .actions { margin-top: 2.25rem; row-gap: 1.25rem; }
.of .actions .link { flex-basis: 100%; min-height: 2rem; }
/* screens column: width follows the viewport height so the whole block fits one screen (D22) */
.of-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.75rem 1rem; width: min(100%, (100svh - 20.75rem) / .672); justify-self: end; }
.of-shot:first-child { grid-column: 1 / -1; }
.of-img { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 0.625rem; overflow: hidden; background: var(--s2); cursor: zoom-in; }
.of-shot:first-child .of-img { border-radius: var(--r-card); }
.of-img::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1); transition: box-shadow .3s; pointer-events: none; }
.of-shot.on .of-img::after { box-shadow: inset 0 0 0 1px rgba(255, 111, 181, .55); }
.of-img img { width: 100%; height: auto; aspect-ratio: 1680 / 753; object-fit: cover; }
.of-img .mthumb-zoom { opacity: 0; transition: opacity .2s; }
.of-img:hover .mthumb-zoom, .of-img:focus-visible .mthumb-zoom { opacity: 1; }
.of-shot figcaption .mthumb-kind { margin-top: 0.75rem; }
.of-dots { display: none; }

@media (max-width: 1100px) { .of-grid { grid-template-columns: 21.25rem minmax(0, 1fr); } }
@media (max-width: 760px) {
  .of .sh { margin-bottom: 1.25rem; }
  .of-grid { display: flex; flex-direction: column-reverse; }
  .of-copy { margin-top: 1.625rem; }
  .of-shots { position: relative; display: flex; width: calc(100% + 2 * var(--gut)); min-width: 0; margin-inline: calc(-1 * var(--gut)); padding-inline: var(--gut); gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); scrollbar-width: none; }
  .of-shots::-webkit-scrollbar { display: none; }
  .of-shot { flex: none; width: 100cqw; scroll-snap-align: start; }
  .of-shot .of-img, .of-shot:first-child .of-img { border-radius: 0.625rem; }
  .of-shot .of-img .mthumb-zoom { opacity: 1; }
  .of-shot figcaption .mthumb-kind { margin-top: 1.5rem; }
  .of-dots { position: absolute; left: 0; right: 0; top: calc(100cqw * 753 / 1680 + 0.75rem); display: flex; justify-content: center; gap: 2px; pointer-events: none; }
  .of-dot { width: 1.625rem; height: 1.5rem; margin-top: -0.5625rem; padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto; position: relative; }
  .of-dot::before { content: ""; position: absolute; left: 50%; top: 0.5625rem; width: 0.375rem; height: 0.375rem; margin-left: -0.1875rem; border-radius: 0.1875rem; background: rgba(255, 255, 255, .3); transition: width .25s, margin .25s, background-color .25s; }
  .of-dot[aria-current="true"]::before { width: 1.25rem; margin-left: -0.625rem; background: var(--acc-hi); }
  .of-feat { grid-template-columns: 2.25rem minmax(0, 1fr); min-height: 5.75rem; padding: 0.8125rem 0 0.75rem; }
  .of-feat::before { width: 6rem; }
  .of-num { padding-top: 0.1875rem; }
  .of-feat h3 { font-size: 1.125rem; line-height: 1.625rem; }
  .of-feat p { margin-top: 2px; font-size: 0.9375rem; line-height: 1.375rem; }
  .of .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 0.5rem; }
  .of .actions .btn { padding: 0 0.75rem; }
  .of .actions .link { grid-column: 1 / -1; justify-self: start; min-height: 2.5rem; font-size: 0.9375rem; line-height: 1.375rem; }
  .of .actions:not(:has(.btn-primary:not([hidden]))) .btn-nutaku { grid-column: 1 / -1; }
}

/* ---------- catalog (D02/D20): 2 L + 3 M on desktop (both rows exactly the container); phone 1 wide + 2x2 ---------- */
/* short desktop screens (1366x768): the whole 2+3 block narrows so it still fits one screen (height ~ 339 + .436 x width + 22 when a pitch wraps) */
@media (min-width: 761px) { .cat .wrap { width: min(var(--wrap), max(45rem, (100svh - 22.75rem) / .436)); } }
.cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2rem 1.5rem; }
.cat-grid .gcard { grid-column: span 2; }
.cat-grid .gcard.l { grid-column: span 3; }
.gcard-meta .m { display: none; }
@media (max-width: 760px) {
  .cat .sh { margin-bottom: 0.875rem; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .cat-grid .gcard, .cat-grid .gcard.l { grid-column: span 1; }
  .cat-grid .gcard:first-child { grid-column: 1 / -1; }
  .cat-grid .gcard + .gcard .gcard-cover { border-radius: 0.625rem; }
  .cat-grid .gcard + .gcard .gcard-name { font-size: 0.9375rem; line-height: 1.375rem; }
  .cat-grid .gcard + .gcard .gcard-pitch, .cat-grid .gcard + .gcard .gcard-meta .d { display: none; }
  .cat-grid .gcard + .gcard .gcard-meta { margin-top: 0.25rem; }
  .cat-grid .gcard + .gcard .gcard-meta .m { display: inline; }
}

/* ---------- community (D13): compact panel, game icons, no scene ---------- */
.com-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 2.5rem; padding: 2.25rem 2.25rem 2.25rem 3rem; border-radius: var(--r-panel); background: var(--s1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.com-copy { padding-top: 0.75rem; }
.com-copy h2 { margin-top: 0.5625rem; font-weight: 600; font-size: 2.25rem; line-height: 2.5625rem; }
.com-copy p { margin-top: 0.8125rem; max-width: 30rem; font-size: 1.0625rem; line-height: 1.5625rem; color: var(--text-2); }
.com-list { display: grid; grid-template-columns: repeat(2, 18.75rem); gap: 1rem 0.75rem; }
@media (max-width: 1100px) { .com-panel { grid-template-columns: 1fr; row-gap: 1.5rem; } .com-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .com-panel { padding: 1.5rem 1.25rem; }
  .com-copy { padding-top: 0; }
  .com-copy h2 { margin-top: 0.3125rem; font-size: 1.5rem; line-height: 2.1875rem; }
  .com-copy p { margin-top: 1px; font-size: 0.9375rem; line-height: 1.375rem; }
  .com-panel { row-gap: 1rem; }
  .com-list { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ---------- news (D19) ---------- */
.news .sh { margin-bottom: 3.8125rem; }
.ncards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; }
@media (max-width: 760px) {
  .news .sh { margin-bottom: 1.25rem; }
  .ncards { grid-template-columns: 1fr; gap: 1rem; }
}

/* ---------- screen lightbox (home.js) ---------- */
.v5-box { width: min(105rem, 100vw - 3rem); max-width: none; max-height: 100vh; padding: 0; border: 0; background: none; overflow: visible; }
.v5-box::backdrop { background: rgba(5, 4, 7, .92); }
.v5-box img { width: 100%; height: auto; max-height: calc(100vh - 6rem); object-fit: contain; border-radius: var(--r-card); }
.v5-box p { margin-top: 0.75rem; text-align: center; font-size: 0.9375rem; line-height: 1.375rem; color: var(--text-2); }
.v5-box button { position: absolute; width: 2.75rem; height: 2.75rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: var(--text); font-size: 1.375rem; line-height: 2.75rem; cursor: pointer; }
.v5-box button:hover { background: rgba(255, 255, 255, .22); }
.v5-box .x { right: 0; top: -3.25rem; } .v5-box .prev { left: 0.5rem; top: calc(50% - 2.5rem); } .v5-box .next { right: 0.5rem; top: calc(50% - 2.5rem); }

@media (prefers-reduced-motion: reduce) { .hero-slide.enter .hero-copy > *, .hero-slide.enter .hero-art { animation: none; } }
