/* Entry screen: one complete mobile viewport, no vertical scrolling. */
@media (max-width:600px){
  html,body{position:fixed;inset:0;width:100%;height:100%;overflow:hidden!important;overscroll-behavior:none;touch-action:manipulation}
  main{position:fixed;inset:0;width:100%;height:100svh;max-height:100svh;overflow:hidden;padding:8px 12px calc(env(safe-area-inset-bottom,0px) + 72px)}
  body:has(#entry:not([hidden])){overflow:hidden}
  .landing{height:100%;min-height:0;overflow:hidden;display:grid;grid-template-rows:auto 105px 145px 190px auto;align-content:space-between;gap:5px}
  .brandbar{min-height:43px}.brand{gap:7px}.brand h1{font-size:22px}
  .brand-mark{width:43px;height:34px;grid-template-columns:repeat(2,14px);gap:3px;transform:none}.brand-mark i{border-width:4px}.brand-mark:after{font-size:28px;margin-left:34px;margin-top:-8px}
  .connection{padding:5px 10px;font-size:12px;border-width:1px}.connection i{width:9px;height:9px;box-shadow:0 0 0 3px #dff6e5}
  .hero{padding:3px 0 0;min-height:0;overflow:visible}.hero h2{font-size:clamp(29px,8vw,39px);letter-spacing:-1px;line-height:1.18}.hero p{font-size:clamp(11px,3.1vw,15px);margin:2px 0 3px}
  .letter{width:36px;height:36px;border-radius:9px;font-size:19px;box-shadow:0 4px 0 #0002,0 7px 13px #0002}.letter-a{right:4px;top:8px}.letter-b{left:4px;top:7px}.letter-c{left:2px;top:70px}.letter-d{right:2px;top:70px}
  .party-art{height:112px;background:#fff9e9;display:flex;align-items:center;justify-content:center;overflow:visible}
  .party-art img{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom}
  .stopwatch{width:66px;height:66px;border-width:7px;box-shadow:0 4px 0 #082d79;transform:none}.stopwatch:before{width:24px;height:8px;top:-18px;left:14px}.stopwatch:after{width:5px;height:24px;left:24px;top:14px}.stopwatch b{width:12px;height:12px;left:21px;top:21px;border-width:3px}
  .entry-card{margin:0;border-radius:20px;padding:9px 14px;min-height:0;display:flex;flex-direction:column;justify-content:center}.create-card,.join-card{border-bottom-width:5px}
  .entry-title{gap:8px;margin-bottom:6px}.entry-title h3{font-size:clamp(19px,5vw,25px);line-height:1.2}.round-icon{width:38px;height:38px;font-size:22px}
  .field{height:44px;min-height:44px;border-radius:12px;margin-bottom:7px;padding:0 12px}.field input{font-size:15px}.field span{font-size:18px}
  .primary{height:49px;min-height:49px;border-radius:13px;font-size:20px;box-shadow:inset 0 -4px 0 #0002,0 5px 10px #0002}
  .facts{gap:5px;min-height:33px;padding:7px 8px;font-size:clamp(9px,2.4vw,12px);box-shadow:0 3px 10px #18305317}.facts i{width:5px;height:5px}
}
@media (max-width:390px),(max-height:720px){
  main{padding:6px 10px calc(env(safe-area-inset-bottom,0px) + 54px)}.landing{grid-template-rows:auto 92px 132px 174px auto;gap:4px}
  .brandbar{min-height:38px}.brand h1{font-size:19px}.brand-mark{transform:scale(.86);transform-origin:right center}.connection{font-size:10px;padding:4px 8px}
  .hero h2{font-size:28px}.hero p{font-size:11px}.party-art{height:92px}
  .entry-card{padding:7px 12px}.entry-title{margin-bottom:4px}.entry-title h3{font-size:18px}.round-icon{width:32px;height:32px;font-size:18px}
  .field{height:39px;min-height:39px;margin-bottom:5px}.primary{height:43px;min-height:43px;font-size:18px}.facts{min-height:28px;padding:5px;font-size:9px}
}

/* Room lobby: a dedicated, single-screen team selection view. */
@media (max-width:600px){
  body:has(#game:not([hidden]) #lobby:not([hidden])){overflow:hidden}
  body:has(#game:not([hidden]) #lobby:not([hidden])) main{height:100svh;padding:8px 12px calc(env(safe-area-inset-bottom,0px) + 72px)}
  #game:not([hidden]):has(#lobby:not([hidden])){height:100%;display:grid;grid-template-rows:auto auto auto minmax(0,1fr);gap:7px}
  #game:not([hidden]):has(#lobby:not([hidden])) .game-brand{margin:0;min-height:42px}
  #game:not([hidden]):has(#lobby:not([hidden])) .game-brand h1{font-size:23px}
  #game:not([hidden]):has(#lobby:not([hidden])) .game-brand span{padding:5px 10px;font-size:12px}
  #game:not([hidden]):has(#lobby:not([hidden])) .top{margin:0;padding:11px 13px;border-radius:18px;flex-wrap:nowrap;font-size:13px}
  #game:not([hidden]):has(#lobby:not([hidden])) .score{font-size:19px;gap:7px}
  #game:not([hidden]):has(#lobby:not([hidden])) #timer{font-size:18px}
  #game:not([hidden]):has(#lobby:not([hidden]))>.notice{min-height:18px;font-size:12px;line-height:18px}
  #lobby:not([hidden]){margin:0;padding:13px;border-radius:21px;min-height:0;display:flex;flex-direction:column;overflow:hidden}
  #lobby>h2{font-size:25px;line-height:1.2;margin:0 0 9px;text-align:center}
  #lobby .teams{display:grid;grid-template-columns:1fr 1fr;gap:9px;min-height:0;flex:1}
  #lobby .teams>div{padding:9px;border-radius:16px;min-width:0;display:flex;flex-direction:column}
  #lobby .teams h3{font-size:20px;margin:0 0 5px;text-align:center}
  #redPlayers,#bluePlayers{min-height:0;flex:1}
  #lobby .player{padding:5px 7px;margin:3px 0;border-radius:8px;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #lobby .teams button{width:100%;padding:9px 5px;font-size:13px;min-height:39px}
  #lobby>.actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:9px;flex-wrap:nowrap}
  #lobby>.actions button{width:100%;min-height:43px;padding:9px 5px;font-size:14px}
}

@media (max-height:720px){
  main{padding:6px 10px calc(env(safe-area-inset-bottom,0px) + 58px)}
  #game:not([hidden]):has(#lobby:not([hidden])){gap:4px}
  #game:not([hidden]):has(#lobby:not([hidden])) .game-brand{min-height:34px}
  #game:not([hidden]):has(#lobby:not([hidden])) .game-brand h1{font-size:20px}
  #game:not([hidden]):has(#lobby:not([hidden])) .top{padding:8px 10px;font-size:11px}
  #lobby:not([hidden]){padding:9px}
  #lobby>h2{font-size:21px;margin-bottom:5px}
  #lobby .teams{gap:6px}
  #lobby .teams>div{padding:6px}
  #lobby .teams h3{font-size:17px;margin-bottom:3px}
  #lobby .player{padding:3px 5px;margin:2px 0;font-size:10px}
  #lobby .teams button,#lobby>.actions button{min-height:35px;padding:6px 4px;font-size:12px}
  #lobby>.actions{margin-top:6px;gap:6px}
}
