/* NYAAS PHONE LAYOUT V2 — screenshot-driven 2026-09-29
   Loaded after R5/TRUE FINAL. Phone-only; desktop assets/layout remain unchanged. */
@media (max-width:600px){
  html,body{width:100%;min-width:0;overflow-x:hidden!important;-webkit-text-size-adjust:100%}
  input,textarea,select{font-size:16px!important}
  button{touch-action:manipulation}

  /* PASS / code entry */
  #pass.pass-screen{overflow-y:auto!important;overflow-x:hidden!important;-webkit-overflow-scrolling:touch!important}
  .pass-content,#pass.pass-active .pass-content{
    display:block!important;width:auto!important;max-width:none!important;
    margin:0!important;padding:14px 12px calc(28px + env(safe-area-inset-bottom))!important
  }
  .paper-card{padding:20px 15px!important;margin-bottom:12px!important;border-radius:20px!important}
  .paper-card h2{font-size:23px!important;margin:11px 0!important}
  .paper-card p{font-size:12px!important;line-height:1.6!important}
  .plan-grid{grid-template-columns:1fr 1fr!important;gap:8px!important}
  .plan{padding:14px 9px!important;border-radius:16px!important}
  .plan b{font-size:20px!important}
  .rank-form{display:grid!important;grid-template-columns:1fr!important;gap:8px!important}
  .rank-form input{width:100%!important;min-width:0!important;min-height:52px!important;padding:12px 13px!important;font-size:16px!important;-webkit-user-select:text!important;user-select:text!important}
  .rank-form button{width:100%!important;min-height:48px!important;padding:0 14px!important}
  #continueProfile,#beginnerBtn{min-height:52px!important}

  /* First-run start overlay / code */
  .start-overlay{align-items:flex-start!important;overflow-y:auto!important;padding:14px 10px calc(20px + env(safe-area-inset-bottom))!important;-webkit-overflow-scrolling:touch!important}
  .start-card{width:100%!important;min-height:0!important;margin:auto 0!important;padding:42px 16px 22px!important;border-width:6px!important;outline-width:3px!important;border-radius:28px!important}
  .start-close{right:12px!important;top:10px!important;width:42px!important;height:42px!important;font-size:23px!important}
  .start-card>h2{font-size:31px!important;margin:8px 0!important}
  .start-summary{font-size:12px!important;margin-bottom:17px!important}
  .start-choice-buttons{grid-template-columns:1fr!important;gap:10px!important}
  .start-choice-buttons>button{min-height:108px!important;padding:16px!important;border-radius:22px!important}
  .start-choice-buttons span{font-size:34px!important;margin-bottom:5px!important}
  .start-choice-buttons b{font-size:19px!important;margin-bottom:4px!important}
  .new-game-panel{padding:22px 14px 17px!important;border-radius:22px!important}
  .new-game-code-form{grid-template-columns:1fr!important;gap:8px!important}
  .new-game-code-form input{font-size:16px!important;min-height:52px!important;-webkit-user-select:text!important;user-select:text!important}

  /* Tutorial: no narrow two-column copy like IMG_9791 */
  .tutorial-overlay{align-items:flex-start!important;overflow-y:auto!important;padding:12px 10px calc(18px + env(safe-area-inset-bottom))!important;-webkit-overflow-scrolling:touch!important}
  .tutorial-card{
    width:100%!important;max-width:520px!important;max-height:none!important;margin:auto!important;
    display:block!important;border-width:5px!important;outline-width:3px!important;border-radius:25px!important;overflow:hidden!important
  }
  .tutorial-photos{height:170px!important;display:grid!important;grid-template-columns:1fr 1fr!important;padding:10px!important;gap:8px!important}
  .tutorial-photos img{height:150px!important;border-radius:15px!important;object-position:center 28%!important}
  .tutorial-copy{padding:20px 17px 18px!important}
  .tutorial-copy>span{padding:6px 10px!important;font-size:9px!important}
  .tutorial-copy h2{font-size:27px!important;line-height:1.15!important;margin:10px 0!important}
  .tutorial-copy p{font-size:14px!important;line-height:1.65!important;white-space:pre-line!important}
  .tutorial-copy footer{margin-top:16px!important;gap:8px!important}
  .tutorial-copy footer button{min-height:48px!important}

  /* CAST */
  .cast-screen{overflow-y:auto!important;-webkit-overflow-scrolling:touch!important}
  .cast-head{height:auto!important;min-height:72px!important;padding:10px!important;display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;gap:8px!important}
  .cast-head h2{font-size:18px!important;line-height:1.2!important}
  .cast-head p{display:none!important}
  .polaroid-grid{height:auto!important;grid-template-columns:1fr 1fr!important;gap:9px!important;padding:12px 10px 24px!important}
  .polaroid{transform:none!important}
  .polaroid b{font-size:15px!important}

  /* ROOM: reduce desktop VH artwork to a deliberate mobile HUD */
  #room.room-screen{position:fixed!important;inset:0!important;overflow:hidden!important}
  #room.room-screen::before,#room.room-screen::after{display:none!important}
  #room .room-visual{inset:0!important}
  #room .service-video,#room .cast-fallback{width:100%!important;height:100%!important;object-fit:cover!important;object-position:center center!important}

  #room .room-head{
    top:max(8px,env(safe-area-inset-top))!important;left:8px!important;right:8px!important;height:auto!important;
    display:grid!important;grid-template-columns:minmax(0,1fr) 50px!important;
    grid-template-areas:"name menu" "visits visits" "hud hud"!important;
    gap:7px!important;align-items:start!important
  }
  #room .room-name-card{
    grid-area:name!important;position:relative!important;left:auto!important;top:auto!important;
    width:100%!important;height:58px!important;padding:0!important;
    border:3px solid #fff!important;outline:1px solid #f6b4cb!important;border-radius:18px!important;
    background:rgba(255,252,253,.95)!important;background-image:none!important;
    box-shadow:0 4px 12px rgba(83,45,61,.13)!important
  }
  #room .room-name-card::before,#room .room-name-card::after{display:none!important}
  #room .room-name-card>small{
    position:absolute!important;left:12px!important;right:auto!important;top:8px!important;
    font-size:8px!important;text-align:left!important;letter-spacing:.12em!important
  }
  #room .room-name-card>div{
    position:absolute!important;left:12px!important;right:8px!important;top:24px!important;
    min-height:0!important;display:flex!important;justify-content:flex-start!important;align-items:center!important;
    gap:7px!important;text-align:left!important
  }
  #room .room-name-card b{font-size:22px!important}
  #room .room-name-card em{font-size:9px!important}

  #room .room-hamburger{
    grid-area:menu!important;position:relative!important;left:auto!important;top:auto!important;
    width:48px!important;height:48px!important;margin:5px 0 0!important;border-width:3px!important;border-radius:16px!important
  }
  #room .room-hamburger::before{display:none!important}
  #room .room-hamburger i{width:21px!important;height:3px!important}

  #room .room-visit-actions{
    grid-area:visits!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important
  }
  #room .room-visit-actions button{
    width:100%!important;height:42px!important;padding:0 8px!important;border-width:3px!important;border-radius:15px!important;
    font-size:10px!important;box-shadow:0 3px 10px rgba(83,45,61,.11)!important
  }

  #room .room-hud{
    grid-area:hud!important;justify-self:stretch!important;display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important
  }
  #room .room-hud span{
    min-width:0!important;width:auto!important;height:42px!important;padding:5px 8px!important;
    border-width:3px!important;border-radius:15px!important;box-shadow:0 3px 10px rgba(83,45,61,.11)!important
  }
  #room .room-hud small{font-size:6px!important}
  #room .room-hud b{font-size:14px!important;margin-top:0!important}

  /* Music becomes a slim strip; staff/rank stay in drawer on phone */
  #room .buddy-bubble,#room .oshi-float,#room .right-bottom-tools,#room #cheersCorner,#room #pawMenu{display:none!important}
  #room .left-ui-stack{
    position:absolute!important;z-index:45!important;left:8px!important;right:8px!important;top:max(174px,calc(env(safe-area-inset-top) + 166px))!important;
    width:auto!important;display:block!important
  }
  #room .music-widget{
    width:100%!important;min-height:48px!important;height:48px!important;padding:5px 8px!important;
    border-width:3px!important;border-radius:15px!important;box-shadow:0 3px 12px rgba(70,45,61,.12)!important;
    overflow:hidden!important;background:rgba(255,252,253,.93)!important
  }
  #room .music-widget::before{display:none!important}
  #room .music-now{min-height:36px!important;height:36px!important;grid-template-columns:28px minmax(0,1fr)!important;gap:7px!important;padding:0!important}
  #room .music-note-icon{position:static!important;width:28px!important;height:28px!important;border-width:2px!important;font-size:12px!important}
  #room .music-copy small{font-size:6px!important}
  #room .music-copy b{font-size:11px!important;line-height:1.05!important;max-width:none!important;-webkit-line-clamp:1!important}
  #room .music-copy em{display:none!important}
  #room .music-room-controls{display:none!important}

  /* Bottom seven actions: same supplied artwork, actually scaled to phone width */
  #room .quick-actions{
    left:8px!important;right:8px!important;bottom:calc(8px + env(safe-area-inset-bottom))!important;
    transform:none!important;width:auto!important;min-width:0!important;height:auto!important;
    aspect-ratio:1536/434!important;padding:0!important;display:block!important;
    background:url("assets/ui_final_0815/quick_dock_user_exact.png") center/100% 100% no-repeat!important;
    border:0!important;outline:0!important;border-radius:0!important;box-shadow:none!important;overflow:visible!important
  }
  #room .quick-actions .qa{
    position:absolute!important;top:24%!important;height:46%!important;width:12.0%!important;
    padding:0!important;margin:0!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    gap:1px!important;overflow:hidden!important;background:transparent!important;border:0!important;outline:0!important;box-shadow:none!important
  }
  #room .quick-actions .qa:nth-child(1){left:5.8%!important}
  #room .quick-actions .qa:nth-child(2){left:18.6%!important}
  #room .quick-actions .qa:nth-child(3){left:31.4%!important}
  #room .quick-actions .qa:nth-child(4){left:43.9%!important}
  #room .quick-actions .qa:nth-child(5){left:56.7%!important}
  #room .quick-actions .qa:nth-child(6){left:69.5%!important}
  #room .quick-actions .qa:nth-child(7){left:82.3%!important}
  #room .quick-actions .qa span{width:18px!important;height:18px!important;font-size:15px!important;line-height:1!important}
  #room .quick-actions .qa.cheers>span{width:19px!important;height:19px!important}
  #room .quick-actions .qa b{font-size:7px!important;line-height:1!important;white-space:nowrap!important;max-width:100%!important}
  #room .quick-actions .qa.private b{font-size:6.5px!important}
  #room .quick-actions .qa small{display:none!important}
  #room .quick-collapse-toggle{display:none!important}

  /* Talk opens above the action dock */
  #room .talk-dock{
    left:8px!important;right:8px!important;bottom:calc(118px + env(safe-area-inset-bottom))!important;
    transform:none!important;width:auto!important;border-width:3px!important;border-radius:18px!important;zoom:1!important
  }
  #room .talk-dock>header{height:50px!important;padding:0 11px!important;gap:8px!important}
  #room .talk-heart{width:32px!important;height:32px!important}
  #room .talk-dock>header button{width:34px!important;height:34px!important;font-size:20px!important}
  #room .talk-dock .talk-content{max-height:35dvh!important;padding:0 9px 9px!important;overflow:auto!important}
  #room .talk-content form{display:grid!important;grid-template-columns:40px minmax(0,1fr) 56px!important;gap:6px!important}
  #room .talk-content input{min-width:0!important;font-size:16px!important}

  /* Celebration copy from IMG_9792 becomes a small toast, never giant body text */
  #room .first-text-burst{
    left:12px!important;right:12px!important;top:auto!important;bottom:calc(126px + env(safe-area-inset-bottom))!important;
    max-width:none!important;width:auto!important;padding:9px 12px!important;
    border:3px solid #fff!important;outline:1px solid #f3aec5!important;border-radius:999px!important;
    background:rgba(255,248,251,.95)!important;
    color:#dc4e7c!important;font-size:18px!important;line-height:1.15!important;text-align:center!important;
    -webkit-text-stroke:0!important;text-shadow:none!important
  }
  .moment-card{
    left:12px!important;right:12px!important;bottom:calc(126px + env(safe-area-inset-bottom))!important;
    max-width:none!important;width:auto!important;text-align:center!important
  }
  .moment-card h2{
    display:inline-block!important;padding:9px 13px!important;border:3px solid #fff!important;outline:1px solid #f2adc5!important;border-radius:999px!important;
    background:rgba(255,248,251,.95)!important;font-size:18px!important;line-height:1.15!important;
    -webkit-text-stroke:0!important;text-shadow:none!important
  }

  /* Overlays/drawers */
  .nav-drawer{width:92vw!important;max-width:390px!important;padding-bottom:env(safe-area-inset-bottom)!important}
  .sheet,.menu-overlay,.event-overlay{max-width:100vw!important}
}
@media (max-width:390px){
  .plan-grid{grid-template-columns:1fr!important}
  .polaroid-grid{grid-template-columns:1fr 1fr!important}
  #room .room-name-card b{font-size:20px!important}
  #room .room-visit-actions button{font-size:9px!important}
  #room .quick-actions{left:5px!important;right:5px!important}
  #room .quick-actions .qa span{width:16px!important;height:16px!important;font-size:13px!important}
  #room .quick-actions .qa b{font-size:6.5px!important}
}


/* PHONE MUSIC FOLD — 2026-09-29
   Default: hidden. Open only when the small MUSIC pill is tapped. */
@media (max-width:600px){
  #room .left-ui-stack{
    top:auto!important;
    bottom:calc(176px + env(safe-area-inset-bottom))!important;
    left:8px!important;
    right:8px!important;
    width:auto!important;
    pointer-events:none!important;
  }
  #room .music-widget{
    display:none!important;
    width:100%!important;
    height:88px!important;
    min-height:88px!important;
    padding:8px 10px!important;
    border-width:3px!important;
    border-radius:17px!important;
    background:rgba(255,252,253,.97)!important;
    box-shadow:0 8px 24px rgba(70,45,61,.18)!important;
    pointer-events:auto!important;
  }
  #room.nyaas-mobile-music-open .music-widget{display:block!important}
  #room.nyaas-mobile-music-open .music-now{
    min-height:34px!important;
    height:34px!important;
    grid-template-columns:28px minmax(0,1fr)!important;
    gap:8px!important;
    padding:0!important;
  }
  #room.nyaas-mobile-music-open .music-copy small{font-size:6px!important}
  #room.nyaas-mobile-music-open .music-copy b{
    font-size:11px!important;
    line-height:1.05!important;
    max-width:none!important;
    -webkit-line-clamp:1!important;
  }
  #room.nyaas-mobile-music-open .music-copy em{display:block!important;font-size:6px!important;margin-top:2px!important}
  #room.nyaas-mobile-music-open .music-room-controls{
    display:grid!important;
    grid-template-columns:34px 34px 34px 54px minmax(72px,1fr)!important;
    gap:5px!important;
    margin-top:7px!important;
  }
  #room.nyaas-mobile-music-open .music-room-controls button{
    height:28px!important;
    min-height:28px!important;
    padding:0 4px!important;
    border-width:2px!important;
    font-size:8px!important;
  }

  #room #nyaasMobileMusicToggle{
    position:absolute!important;
    z-index:84!important;
    left:10px!important;
    bottom:calc(126px + env(safe-area-inset-bottom))!important;
    width:92px!important;
    height:36px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    padding:0 12px!important;
    border:3px solid #fff!important;
    outline:1px solid #e7b8d8!important;
    border-radius:999px!important;
    background:rgba(255,250,253,.96)!important;
    color:#8d63b4!important;
    box-shadow:0 5px 14px rgba(68,45,75,.16)!important;
    font-size:9px!important;
    font-weight:950!important;
    letter-spacing:.08em!important;
    white-space:nowrap!important;
  }
  #room #nyaasMobileMusicToggle::before{
    content:"♪"!important;
    display:grid!important;
    place-items:center!important;
    width:19px!important;
    height:19px!important;
    border-radius:50%!important;
    background:#8d63b4!important;
    color:#fff!important;
    font-size:11px!important;
  }
  #room.nyaas-mobile-music-open #nyaasMobileMusicToggle{
    background:#8d63b4!important;
    color:#fff!important;
  }
  #room.nyaas-mobile-music-open #nyaasMobileMusicToggle::before{
    content:"×"!important;
    background:#fff!important;
    color:#8d63b4!important;
  }
}
