/* Home: mobile-only overrides. Everything lives inside the media query so the PC design is untouched.
   Keep this file imported LAST in page.tsx so it wins over the PC rules. */
/* mobile-only pieces: hidden everywhere else */
.journey-slider { display: none; }
.mobile-intro { display: none; }

/* 5 screens (the 1st repeated at the end): hold 1.2s, slide 0.3s -> a new screen every 1.5s */
@keyframes journey-slide {
  0%, 20% { transform: translateX(0); }
  25%, 45% { transform: translateX(-20%); }
  50%, 70% { transform: translateX(-40%); }
  75%, 95% { transform: translateX(-60%); }
  100% { transform: translateX(-80%); }
}

@media (max-width: 899px) {
  /* safety net: flex/grid children must never push their parent wider than the screen */
  .desktop-site *, .desktop-site *::before, .desktop-site *::after { min-width: 0; }
  .desktop-site img, .desktop-site svg { max-width: 100%; }

  /* status strip ("공식 데이터 정상 / 마지막 확인") and the banner carousel are not shown on mobile.
     The banner rules below are kept so the carousel can be brought back by deleting the display: none line. */
  .desktop-site .status-strip,
  .desktop-site .brand-hero { display: none; }

  /* ---------- intro: title, subtitle and a small ball illustration at the very top ---------- */
  .desktop-site .mobile-intro {
    display: block;
    overflow: hidden;
    background: radial-gradient(circle at 85% 20%, rgba(255, 255, 255, .7), transparent 40%), linear-gradient(115deg, #fff0ea 0%, #ffe1d5 100%);
  }
  .desktop-site .mobile-intro-inner { position: relative; padding: 30px 0 32px; min-height: 282px; box-sizing: border-box; }
  .desktop-site .mobile-intro-copy { position: relative; z-index: 2; padding-right: 118px; }
  .desktop-site .mobile-intro-kicker { margin: 0 0 12px; color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .13em; line-height: 1; }
  .desktop-site .mobile-intro h2 { margin: 0; font-size: clamp(26px, 7.6vw, 32px); line-height: 1.28; letter-spacing: -.055em; font-weight: 800; }
  .desktop-site .mobile-intro h2 strong { color: var(--green); font-weight: 900; }
  .desktop-site .mobile-intro-sub { margin: 14px 0 0; padding-right: 24px; color: #5c5f65; font-size: 14px; line-height: 1.65; letter-spacing: -.02em; }

  /* app home screen in the silver phone frame (same asset / frame as the old app banner), scaled down */
  .desktop-site .mobile-intro-phone.silver-phone {
    --phone-radius: 1.7rem;
    --screen-radius: 1.3rem;
    --side-depth: .28rem;
    --button-width: .16rem;
    position: absolute;
    z-index: 1;
    right: 10px;
    top: 32px;
    width: 6.4rem;
    height: 12.8rem;
    transform: rotate(7deg);
  }
  .desktop-site .mobile-intro-phone.silver-phone::after {
    box-shadow: 0 .08rem .1rem rgba(0,0,0,.25), 0 2.2rem 0 -.012rem #b5c0cb, 0 2.2rem 0 .02rem #53606c, 0 4.4rem 0 -.012rem #b5c0cb, 0 4.4rem 0 .02rem #53606c;
  }
  .desktop-site .mobile-intro-phone.silver-phone > img { object-fit: cover; background: transparent; }

  /* ---------- hero carousel ---------- */
  .desktop-site .brand-hero-slide { min-height: 0; }
  .desktop-site .brand-hero-inner,
  .desktop-site .brand-hero-slide-main .brand-hero-inner { min-height: 0; padding-bottom: 64px; }
  .desktop-site .brand-hero-copy { width: 100%; padding: 32px 22px 0; }
  .desktop-site .brand-hero-copy h1,
  .desktop-site .app-promo-copy h2,
  .desktop-site .proof-hero-copy h2 { font-size: clamp(26px, 7.6vw, 34px); line-height: 1.28; }
  .desktop-site .brand-hero-copy > p:not(.brand-hero-kicker),
  .desktop-site .proof-hero-copy > p:not(.brand-hero-kicker) { font-size: 14px; margin-top: 12px; }
  .desktop-site .brand-hero-actions { flex-wrap: wrap; gap: 12px 18px; margin-top: 20px; }
  .desktop-site .hero-primary-action { min-width: 0; min-height: 48px; padding: 0 20px; font-size: 15px; white-space: nowrap; }
  .desktop-site .hero-secondary-action { padding: 12px 16px; font-size: 14px; white-space: nowrap; }
  /* banners 1 and 2: no illustration / phone mockup on mobile, text only */
  .desktop-site .hero-art-main, .desktop-site .hero-art-app, .desktop-site .brand-hero-visual, .desktop-site .app-promo-device { display: none; }
  .desktop-site .hero-art { max-width: 78%; height: 190px; }
  .desktop-site .brand-hero-note { display: none; }

  /* app banner: copy, buttons, phone stacked */
  .desktop-site .app-promo-inner { grid-template-columns: 1fr; min-height: 0; gap: 20px; padding: 32px 22px 64px; }
  .desktop-site .app-promo-copy > p:not(.brand-hero-kicker) { font-size: 14px; }
  .desktop-site .app-store-buttons { flex-wrap: wrap; }
  .desktop-site .app-store-buttons a { min-width: 0; flex: 1 1 140px; }
  .desktop-site .app-promo-qr { display: none; }

  /* proof banner */
  .desktop-site .proof-hero-inner { padding: 32px 22px 56px; gap: 20px; min-height: 0; }
  .desktop-site .proof-counts-3 strong,
  .desktop-site .proof-counts strong { font-size: clamp(20px, 6vw, 26px); }
  .desktop-site .proof-counts-3 span,
  .desktop-site .proof-counts span { font-size: 13px; padding: 4px 10px; }
  .desktop-site .proof-counts-3 div,
  .desktop-site .proof-counts div { padding: 12px; }
  .desktop-site .brand-hero-dots { bottom: 10px; }

  /* ---------- latest result card ---------- */
  .desktop-site .result-panel { padding: 24px 18px; }
  .desktop-site .result-panel .section-heading h1 { font-size: 26px; }
  .desktop-site .result-panel .draw-date { font-size: 14px; margin-top: 12px; }
  .desktop-site .result-body { flex-direction: column; align-items: stretch; gap: 20px; margin-top: 20px; }
  /* 6 balls + plus + bonus ball always stay on one line: ball size shrinks with the screen width */
  .desktop-site .result-body .winning-row { flex: 1 1 auto; flex-wrap: nowrap; gap: 6px; min-height: 0; }
  .desktop-site .winning-numbers { flex-wrap: nowrap; gap: 6px; }
  .desktop-site .result-panel .ball {
    --mobile-ball: min(44px, calc((100vw - 130px) / 7));
    width: var(--mobile-ball);
    height: var(--mobile-ball);
    font-size: calc(var(--mobile-ball) * .44);
  }
  .desktop-site .result-panel .plus { flex: 0 0 auto; font-size: 18px; }
  .desktop-site .bonus-number > span:last-child { display: none; }
  .desktop-site .result-body .result-summary {
    flex: 1 1 auto;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px 0 0;
    border-left: 0;
    border-top: 1px solid #e6eaf0;
  }
  .desktop-site .result-summary strong { font-size: 19px; }
  .desktop-site .result-summary div span { font-size: 13px; }
  .desktop-site .result-summary a { font-size: 15px; }

  /* ---------- app landing sections ---------- */
  /* "번호를 고르는 순간부터…" intro section is not shown on mobile */
  .app-intro { display: none; }
  .app-journey-heading { padding-left: 0; }
  .app-journey-heading h2, .app-reviews-heading h2 { font-size: clamp(2rem, 9vw, 2.7rem); }

  .app-journey { padding: 3.5rem 0 1rem; }
  .app-journey-heading { margin-bottom: 2rem; }
  .app-journey-grid { grid-template-columns: 1fr; gap: 2rem; }
  .journey-phone-stage { position: relative; top: 0; }
  .journey-phone-frame { width: min(17rem, 78vw); height: auto; aspect-ratio: 1 / 2.004; }
  /* phone: scroll-driven images off, auto slider on; the caption pill only made sense with scroll state */
  .journey-phone-frame > img { display: none; }
  .journey-screen-caption { display: none; }
  .journey-slider {
    position: absolute;
    z-index: 1;
    inset: 2.55% 2.8%;
    display: block;
    overflow: hidden;
    border-radius: var(--screen-radius);
    background: #f45140;
  }
  .journey-slider-track {
    display: flex;
    width: 500%;
    height: 100%;
    animation: journey-slide 6s cubic-bezier(.7, 0, .2, 1) infinite;
    will-change: transform;
  }
  /* .journey-phone-frame img (PC rule: absolute, opacity 0) also matches these images, so reset it explicitly */
  .journey-phone-frame .journey-slider-track img {
    position: static;
    inset: auto;
    flex: 0 0 20%;
    width: 20%;
    height: 100%;
    border-radius: 0;
    opacity: 1;
    transform: none;
    transition: none;
    object-fit: cover;
  }

  /* the four step texts are plain text: every step always looks "active" */
  .journey-steps { padding-bottom: 2rem; }
  .journey-steps article,
  .journey-steps article.is-passed { min-height: 0; padding: 2rem 0; color: #262a30; }
  .journey-steps article > span,
  .journey-steps article.is-passed > span { color: var(--green); }
  .journey-steps article p,
  .journey-steps article.is-passed p { color: #6b7179; }
  .journey-steps article .journey-chips i,
  .journey-steps article.is-passed .journey-chips i { border-color: #f6c8c2; background: #fff0ed; color: #d9493e; }
  .journey-steps h3 { font-size: clamp(1.6rem, 7vw, 2.1rem); }

  .app-reviews { padding: 4rem 0; }
  .app-reviews-heading { width: calc(100% - 2rem); padding-left: 0; }
  .app-review-card { width: min(19rem, 82vw); min-height: 0; padding: 1.3rem; }
  .app-review-card blockquote { font-size: 1.05rem; }

  .app-landing-cta { grid-template-columns: 1fr; min-height: 0; gap: 2.5rem; padding: 4rem 1.4rem 3rem; }
  .app-landing-cta-copy h2 { font-size: clamp(2rem, 9vw, 2.7rem); }
  .landing-store-links { flex-wrap: wrap; }
  .landing-store-links a { min-width: 0; flex: 1 1 9rem; }
  /* the two phone screens (and the QR card) in the footer CTA are not shown on mobile */
  .app-landing-cta-visual { display: none; }
  footer.app-landing-footer { min-height: 0; }
  .app-footer-info { grid-template-columns: 1fr; padding: 2.4rem 1.4rem 3rem; }
  .app-footer-links { justify-content: flex-start; flex-wrap: wrap; }
  .app-footer-meta { grid-template-columns: 1fr; gap: 1.4rem; }
  .app-footer-company-detail strong, .app-footer-company-detail a { overflow-wrap: anywhere; }
  .app-footer-wordmark { font-size: clamp(4rem, 22vw, 7rem); bottom: -2rem; }
}
