/* Canonical phone surface.
   Real phones and iPad Split View render the same 390px mobile composition.
   Split View is only an outer frame; no split-only HOME/WORLD geometry belongs here. */

/* HOME on a phone has no global header. The page itself starts with the archive greeting. */
html[data-clean-viewport='mobile'] body[data-clean-page='home'] .clean-header,
html[data-clean-viewport='framed-mobile'] body[data-clean-page='home'] .clean-header{display:none!important}
html[data-clean-viewport='mobile'] body[data-clean-page='home'] .clean-main,
html[data-clean-viewport='framed-mobile'] body[data-clean-page='home'] .clean-main{min-height:100svh}

/* WORLD keeps the compact header, but the brand is deliberately quiet in the approved phone design. */
html[data-clean-viewport='mobile'] body[data-clean-page='world'] .clean-brand,
html[data-clean-viewport='framed-mobile'] body[data-clean-page='world'] .clean-brand{
  font-family:'Helvetica Neue','Hiragino Sans','Yu Gothic',Arial,sans-serif;
  font-weight:600;font-size:17px;line-height:.88;letter-spacing:.04em;opacity:.15
}

@container clean-main (max-width:700px){
  /* ---------- HOME: approved old completed phone composition ---------- */
  .home-page{
    position:relative;left:0;width:100%;max-width:100%;height:auto;min-height:100svh;margin:0 auto;padding:0;
    display:block;overflow-x:clip;background-color:#fdfcfa;
    background-image:repeating-linear-gradient(90deg,#fdfcfa 0 12px,#f6efed 13px,#fdfcfa 15px);color:#715b4f
  }
  .home-mobile-lace.top,.home-mobile-lace.bottom,.home-greeting{display:none}
  .home-mobile-intro{
    display:flex;width:100%;height:30px;align-items:center;justify-content:center;border-top:0;border-bottom:1px solid #e4d8d4;
    background:#fffdfb;color:#816761;font:600 8px/1 Georgia,serif;letter-spacing:.15em
  }
  .home-shell{
    width:100%;max-width:100%;height:auto;max-height:none;min-height:0;aspect-ratio:auto;margin:0 auto;padding:0 6px;
    display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto 395px 184px 150px;gap:6px;
    background:transparent;border:0;box-shadow:none
  }
  .home-shell::before,.home-shell>footer{display:none}
  .home-top,.home-main,.home-left,.home-right,.home-bottom-cards{display:contents}

  .home-hero{
    position:relative;z-index:2;grid-column:1/-1;grid-row:1;height:48cqw;min-height:180px;margin:0 -6px;
    overflow:visible;border:0;border-bottom:1px solid #eadfdb;background:transparent
  }
  .home-hero-picture{position:absolute;inset:0;z-index:1;overflow:hidden}
  .home-hero-picture img{width:100%;height:100%;object-fit:cover}
  .home-hero-frill{
    display:block;position:absolute;z-index:4;left:0;right:0;bottom:-34px;width:100%;height:38px;
    background-size:100% auto;background-position:center top;background-repeat:no-repeat;pointer-events:none
  }

  .home-info{
    position:relative;z-index:1;grid-column:1/-1;grid-row:2;width:calc(100% + 12px);max-width:none;min-height:172px;
    margin:-6px -6px 0;padding:60px 22px 29px;text-align:center;border:0;background:transparent;box-shadow:none;overflow:visible
  }
  .home-info>h3{
    width:auto;height:auto;margin:0 auto 15px;border:0;background:transparent;box-shadow:none;color:#bd7582;
    font:700 14px/1 system-ui,sans-serif;letter-spacing:.20em;text-shadow:none
  }
  .home-info>h3::before,.home-info>h3::after{content:none}
  .home-info p{max-width:340px;margin:0 auto;color:#765c58;font-size:11px;line-height:2}
  .home-info small{display:none}

  .home-worlds{
    grid-column:1/-1;grid-row:3;display:grid;grid-template-rows:23px 78px minmax(0,1fr) 22px;height:395px;margin:0;padding:0 6px 7px;
    border:1px solid #e2d7d3;background:#fffdfb;box-shadow:none;overflow:hidden
  }
  .home-worlds>h3{
    --head-base:#f7eeee;height:23px;margin:0 -6px;border-bottom:1px solid #dfd3d0;font-size:7px;letter-spacing:.24em;
    background:linear-gradient(180deg,rgba(118,89,84,.11) 0%,rgba(255,255,255,.92) 16%,rgba(255,255,255,.47) 44%,rgba(255,255,255,.08) 100%),#f7eeee;
    box-shadow:inset 0 4px 5px -4px rgba(91,66,61,.42),inset 0 1px 0 rgba(255,255,255,.72),inset 0 -1px 0 rgba(116,86,80,.08),0 1px 2px rgba(92,66,61,.07)
  }
  .home-world-title{
    width:44%;max-width:190px;height:50px;margin:0 auto;align-self:center;background-size:contain;background-position:center;background-repeat:no-repeat
  }
  .home-world-stage{display:contents}
  .home-world-track{height:auto;min-height:0;display:flex;align-items:stretch;gap:5px;overflow-x:auto;overflow-y:hidden;padding:0;border:0;background:transparent;scroll-snap-type:x mandatory}
  .home-world-card{flex:0 0 calc((100% - 10px)/3);min-width:calc((100% - 10px)/3);height:100%;border-radius:999px 999px 0 0;scroll-snap-align:start;box-shadow:none}
  .home-world-card>span:last-child{
    left:3px;right:3px;bottom:7px;text-align:center;font:700 clamp(8px,2.4cqw,10px)/1.08 'Yu Mincho',serif;
    letter-spacing:0;white-space:nowrap;overflow:hidden;text-overflow:clip
  }
  .home-world-nav,.home-world-spacer{display:none}
  .home-world-caption{display:flex;align-items:end;justify-content:center;padding-bottom:2px;font-size:6px}

  .home-calendar{grid-column:1;grid-row:4;min-height:184px}
  .home-pickup{grid-column:2;grid-row:4;min-height:184px;display:grid;grid-template-rows:24px 160px}
  .home-calendar>h3,.home-pickup>h3,.home-updates>h3,.home-status-card>h3{
    height:24px;font-size:7px;position:relative;overflow:hidden;border-bottom-color:#d8cbc7;
    box-shadow:inset 0 4px 5px -4px rgba(91,66,61,.42),inset 0 1px 0 rgba(255,255,255,.72),inset 0 -1px 0 rgba(116,86,80,.08),0 1px 2px rgba(92,66,61,.07)
  }
  .home-calendar>h3{--head-base:#eef2e9;background:linear-gradient(180deg,rgba(118,89,84,.11) 0%,rgba(255,255,255,.92) 16%,rgba(255,255,255,.47) 44%,rgba(255,255,255,.08) 100%),#eef2e9}
  .home-pickup>h3{--head-base:#edf1f3;background:linear-gradient(180deg,rgba(118,89,84,.11) 0%,rgba(255,255,255,.92) 16%,rgba(255,255,255,.47) 44%,rgba(255,255,255,.08) 100%),#edf1f3}
  .home-updates>h3{--head-base:#f4eeeb;background:linear-gradient(180deg,rgba(118,89,84,.11) 0%,rgba(255,255,255,.92) 16%,rgba(255,255,255,.47) 44%,rgba(255,255,255,.08) 100%),#f4eeeb}
  .home-status-card>h3{--head-base:#efedf2;background:linear-gradient(180deg,rgba(118,89,84,.11) 0%,rgba(255,255,255,.92) 16%,rgba(255,255,255,.47) 44%,rgba(255,255,255,.08) 100%),#efedf2}
  .home-calendar-body{padding:12px 10px}.home-calendar-body>strong{font-size:14px;margin-bottom:10px}.home-calendar-body>div{gap:4px;font-size:7px}
  .home-pickup>button{height:160px;padding:0}.home-pickup>button::after{display:none}
  .home-pickup-plate{width:152px;max-width:96%;transform:translateY(-10px);background-color:transparent;box-shadow:none}
  .home-pickup-plate img{width:auto;height:auto;max-width:87px;max-height:87px;transform:translateX(2px)}
  .home-pickup button>b{display:none}

  .home-updates{grid-column:1;grid-row:5;min-height:150px}.home-status-card{grid-column:2;grid-row:5;min-height:150px}
  .home-update-list{padding:7px 9px}.home-update-list>div{padding:8px 0}
  .home-status{height:auto;padding:12px 8px;gap:5px}.home-status>div{padding:8px 3px}.home-status b{font-size:18px}.home-status .last b{font-size:9px}

  .home-mobile-notice{
    display:block;width:calc(100% - 12px);margin:12px 6px 0;padding:0;min-height:150px;border:1px solid #dfd3d0;background:#fffdfb;text-align:center;color:#745d58
  }
  .home-mobile-notice>b{
    --head-base:#edf2f3;display:flex;height:24px;align-items:center;justify-content:center;border-bottom:1px solid #dfd3d0;
    font:700 7px/1 system-ui,sans-serif;letter-spacing:.23em;position:relative;overflow:hidden;
    background:linear-gradient(180deg,rgba(118,89,84,.11) 0%,rgba(255,255,255,.92) 16%,rgba(255,255,255,.47) 44%,rgba(255,255,255,.08) 100%),#edf2f3;
    box-shadow:inset 0 4px 5px -4px rgba(91,66,61,.42),inset 0 1px 0 rgba(255,255,255,.72),inset 0 -1px 0 rgba(116,86,80,.08),0 1px 2px rgba(92,66,61,.07)
  }
  .home-mobile-notice p{padding:22px 18px 24px;margin:0;font-size:9px;line-height:1.85}
  .home-banner{
    position:relative;width:52%;height:auto;aspect-ratio:4/1;margin:40px auto 0;border:1px solid #e2d7d3;background:#fffdfb center/cover no-repeat;display:grid;place-items:center
  }
  .home-banner img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
  .home-fence{
    display:block;position:relative;z-index:1;inset:auto;left:0;right:auto;top:auto;bottom:auto;
    width:100cqw;max-width:none;height:clamp(158px,44cqw,190px);margin:68px 0 -2px 0;
    transform:none;translate:none;background-size:117cqw auto;background-position:center bottom;background-repeat:no-repeat;opacity:1
  }
}

@container app-surface (max-width:700px){
  /* ---------- WORLD: exact old phone composition, shared with Split View ---------- */
  .world-overview{position:relative;padding:12px 16px 0;background:#fffdf9;isolation:isolate}
  .world-overview::before{
    height:40px;top:-1px;background-image:none;background-color:color-mix(in srgb,var(--accent) 48%,#fff 52%);
    -webkit-mask-image:var(--lace,none);mask-image:var(--lace,none);-webkit-mask-repeat:repeat-x;mask-repeat:repeat-x;
    -webkit-mask-size:auto 40px;mask-size:auto 40px;-webkit-mask-position:left top;mask-position:left top;opacity:.82
  }
  .world-local{min-height:42px;padding-top:6px;gap:13px}
  .world-local button{padding:9px 18px;font-size:12px}.world-local>span{font-size:11px}
  .world-overview>h1{
    position:relative;z-index:2;right:auto;top:auto;width:100%;margin:30px 0 9px;text-align:right;
    color:var(--cream);font-family:'Kaisei Opti','Shippori Mincho','Yu Mincho','Hiragino Mincho ProN',serif;
    font-size:clamp(24px,6.6cqw,29px);font-weight:700;transform:translateX(5px);
    line-height:1.15;letter-spacing:.015em;white-space:nowrap;word-break:keep-all
  }
  .world-overview>h1::after{display:none}
  .world-overview-grid{display:contents}
  .world-notice{
    display:grid;width:100%;min-height:0;margin:24px 0 28px;padding:0;transform:none;grid-template-columns:24px 1fr;gap:22px;align-items:start
  }
  .world-notice>i{width:24px;height:100%;min-height:138px;border-radius:6px;background:var(--accent)}
  .world-notice>div{font-size:11px;line-height:1.55}.world-notice b{font-size:9px;margin-bottom:9px}

  .world-feature{
    position:relative;top:auto;right:auto;width:calc(100% + 16px);height:244px;min-height:0;margin-right:-16px;
    display:grid;grid-template-columns:42% 58%;overflow:hidden;border-radius:28px 0 0 28px;background:var(--accent);color:var(--wtext)
  }
  .world-feature-image{height:100%;min-height:0}.world-feature-copy{position:relative;padding:10px 10px 8px;min-height:0;overflow:hidden}
  /* Phone and Split View share this readable type scale. Full iPad uses world.css unchanged. */
  .world-copy-flow{height:100%;min-height:0;font-size:12.6px;line-height:1.5;padding-bottom:48px}
  .world-copy-flow.is-tight{font-size:11.4px;line-height:1.43}.world-copy-flow.is-very-tight{font-size:10.5px;line-height:1.36}
  .world-copy-bottom{display:block;margin-top:auto}
  .world-side-note{
    position:absolute;left:10px;right:10px;bottom:8px;width:auto;height:36px;min-height:0;display:grid;
    grid-template-columns:minmax(0,1fr) 36px;grid-template-rows:36px;gap:8px;align-items:end;background:transparent
  }
  .phone-note{
    display:block;align-self:end;width:auto;max-height:36px;text-align:left;font:600 7.6px/1.55 'Yu Gothic',sans-serif;
    letter-spacing:0;opacity:.5;color:inherit;white-space:normal;word-break:normal;overflow-wrap:normal;line-break:strict
  }
  .wide-note{display:none}
  .world-qr{width:36px;height:36px;border:0;background:transparent;padding:0;box-shadow:none;overflow:visible}
  .world-qr img{width:100%;height:100%;display:block;background:transparent}

  .world-character-script{
    width:100%;height:120px;margin:0;color:transparent;font-size:0;line-height:0;background-color:var(--cream);
    background-image:none;-webkit-mask-image:url('../assets/character-heading.svg');mask-image:url('../assets/character-heading.svg');
    -webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-position:center bottom;mask-position:center bottom;
    -webkit-mask-size:82% auto;mask-size:82% auto
  }

  .world-table{position:relative;min-height:112cqw;background-size:cover;background-position:center;overflow:hidden}
  .world-cutlery{left:-2cqw;bottom:-4px;max-width:36cqw;max-height:78%;z-index:3}
  .world-tray-wrap{display:contents}
  /* Fit both tray handles inside the shared 390px surface, keeping logos at its center. */
  .world-tray{position:relative;z-index:4;width:96cqw;height:82cqw;min-height:0;margin:0 auto;display:grid;place-items:center;transform:translateY(-26px)}
  .world-tray-art{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
  .world-logos{position:relative;left:auto;top:auto;transform:translateY(-4px);width:68%;height:60%;display:flex;align-items:center;justify-content:center;gap:2% 4%;flex-wrap:wrap}
  .world-char-logo{flex:0 1 46%;width:46%;height:92%;max-height:none}
  .world-char-name{z-index:4;transform:translateY(-1px)}.world-char-name text{font-size:30px}.world-char-name .name-full{display:none}.world-char-name .name-short{display:inline}
  .world-char-art{z-index:2;left:7%;right:7%;top:20%;bottom:3%;transform:translateY(1px)}
  .world-char-logo .logo-soft-base{
    z-index:1;left:-10%;right:-10%;top:-5%;height:52%;border-radius:50%;
    background:radial-gradient(ellipse at 50% 40%,rgba(255,255,255,.58) 0%,rgba(255,255,255,.36) 34%,rgba(255,255,255,.16) 57%,rgba(255,255,255,.05) 72%,transparent 87%);
    filter:blur(9px);opacity:.92
  }
  .world-logos[data-density='compact'],.world-logos[data-density='tiny']{display:grid;align-content:center;justify-content:center;place-items:center;gap:0 3%}
  .world-logos[data-density='compact']{width:65%;height:68%;grid-template-columns:repeat(2,minmax(0,1fr))}
  .world-logos[data-density='compact'] .world-char-logo{width:100%;height:29cqw;max-height:none;min-width:0}
  .world-logos[data-density='compact'] .world-char-name text{font-size:23px}
  .world-logos[data-density='tiny']{width:68%;height:68%;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 1%}
  .world-logos[data-density='tiny'] .world-char-logo{width:100%;height:21cqw;max-height:none;min-width:0}
  .world-logos[data-density='tiny'] .world-char-name text{font-size:17px}

  .world-nav{top:73%;width:min(44cqw,189px);max-width:none;transform:translate(4px,-50%)}
  .world-nav.prev{left:26%}.world-nav.next{right:-2%}.world-nav span{font-size:42px}
  /* The arrows must sit at the visual center of each plate, not drift toward the tray. */
  .world-nav.prev span,.world-nav.next span{transform:none}
  .world-table::before{
    content:'';position:absolute;z-index:6;left:67%;bottom:18px;width:min(50cqw,215px);height:24px;transform:translateX(-50%);
    border-radius:999px;background:rgba(255,255,255,.34);filter:blur(8px);pointer-events:none
  }
  .world-table::after{
    content:'矢印をタップして WORLDを切り替え';position:absolute;z-index:7;left:67%;bottom:23px;transform:translateX(-50%);
    width:max-content;max-width:52cqw;color:var(--cream);font:600 8.6px/1.2 'Yu Gothic','Hiragino Sans',sans-serif;
    letter-spacing:.07em;text-align:center;white-space:nowrap;opacity:.70;pointer-events:none
  }

  /* ---------- DETAIL: explicit phone reset so tablet media rules can never leak into Split View ---------- */
  .detail-hero{min-height:100svh;display:block;padding:0}
  .detail-visual{height:58svh;min-height:500px;border:0;border-radius:0}
  .detail-info{padding:30px 7cqw 56px}
  .detail-info h1{font-size:min(var(--name-size),clamp(46px,12.5cqw,72px))}.detail-catch{font-size:clamp(17px,4.8cqw,24px)}.detail-reading{font-size:19px}.detail-world{margin-bottom:16px}
  .detail-data{grid-template-columns:repeat(2,minmax(0,1fr));margin-top:18px}.detail-data>div{padding:9px 8px 9px 0}.detail-data span{font-size:15px}.detail-profile{margin-top:18px;font-size:14px;line-height:1.78}
  .detail-outfit-arrow{font-size:42px}.detail-change{bottom:11%;right:4%}.detail-visual:has(.detail-mini.right) .detail-change{left:4%;right:auto}
  .detail-more{padding:48px 7cqw 78px}.image-song-card{grid-template-columns:42px minmax(0,1fr) 42px;gap:10px;align-items:center}.image-song-card>div{min-width:0}.image-song-card>a{grid-column:3;justify-self:end;align-self:center;width:40px;height:40px;min-width:40px;max-width:40px;border-radius:50%}
}
