/* V69 — gameplay/readability pass on V68. */
:root{
 --v69-ink:#243f43;
 --v69-cream:#fff2c8;
 --v69-yellow:#f4ce58;
 --v69-coral:#ef7b63;
 --v69-mint:#9bc9a4;
 --v69-sky:#9ed6dc;
}

/* Lobby back button: simple, robust icon. It exists only in lobby via V66 rules. */
#globalTools #leaveBtn{
  width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important;
  padding:0!important;margin:0!important;border:1px solid rgba(255,248,220,.55)!important;
  border-radius:13px!important;background:rgba(28,61,66,.76)!important;color:#fff6dc!important;
  box-shadow:0 4px 14px rgba(11,35,39,.22)!important;backdrop-filter:blur(8px)!important;
  -webkit-backdrop-filter:blur(8px)!important;clip-path:none!important;font-size:0!important;
}
#globalTools #leaveBtn::before{
  content:'←';display:block;font:1000 23px/1 system-ui,sans-serif;color:#fff6dc;
  transform:translateY(-1px);
}
#globalTools #leaveBtn:active{transform:translateY(1px) scale(.94)!important}

/* Party box: same 4-column layout, but the object itself must be readable. */
.partyBoard{padding:6px!important;gap:3px!important}
.partyBoardHead{min-height:26px!important;padding:0 5px 2px!important}
.partyBoardHead h2{font-size:clamp(16px,2.2vw,22px)!important}
#partyCountHint,.partyLive{display:none!important}
.partyCards{gap:5px!important}
.partyPick{
  grid-template-rows:minmax(0,1fr) auto!important;
  padding:4px 5px 5px!important;
  border-radius:13px!important;
}
.partyPick img{
  width:min(92px,78%)!important;
  height:min(78px,72%)!important;
  min-height:42px!important;
}
.partyPick strong{
  font-size:clamp(11px,1.5vw,15px)!important;
  line-height:1.08!important;
  min-height:1.08em!important;
  color:#263f43!important;
  text-shadow:0 1px #fff8de!important;
}
.partyPick i{font-size:8px!important;max-width:76%!important}

/* Bright comic score sheet. */
#playPanel:has(.legacyScorePanel){
  background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;
}
.legacyScorePanel{
  position:relative;
  overflow:hidden;
  padding:16px!important;
  border:0!important;border-radius:24px!important;
  background:
    radial-gradient(circle at 10% 14%,#fff8dc 0 8%,transparent 8.5%),
    radial-gradient(circle at 89% 84%,#a8d5ad 0 8%,transparent 8.5%),
    linear-gradient(145deg,#ffe692,#fff2c8 45%,#bce0cf)!important;
  box-shadow:0 12px 30px #213b3b33,inset 0 0 0 3px #6d594329!important;
}
.legacyScorePanel::before,.legacyScorePanel::after{
  content:'';position:absolute;width:70px;height:18px;border-radius:5px;opacity:.5;pointer-events:none
}
.legacyScorePanel::before{left:-14px;top:8px;background:#ef7b63;transform:rotate(-18deg)}
.legacyScorePanel::after{right:-12px;bottom:12px;background:#82b9c1;transform:rotate(16deg)}
.legacyScorePanel .resultTitle{
  margin:0 0 8px!important;color:#294649!important;font-size:clamp(24px,4vw,38px)!important;
  font-weight:1000!important;letter-spacing:-.055em!important;transform:rotate(-1deg);
}
.legacyScorePanel .phaseHelp{color:#65573e!important;font-weight:900!important;margin:0 0 9px!important}
.roundRows{display:grid!important;gap:6px!important}
.roundRow{
  display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;align-items:center!important;
  min-height:48px!important;padding:6px 10px!important;border:0!important;border-radius:15px!important;
  background:rgba(255,255,239,.72)!important;color:#2a4446!important;box-shadow:0 3px 0 #6d59431a!important;
}
.roundRow:nth-child(2n){background:rgba(215,240,220,.74)!important;transform:rotate(.2deg)}
.roundRow:nth-child(2n+1){transform:rotate(-.15deg)}
.rankBadge{display:grid!important;place-items:center!important;width:34px!important;height:34px!important;border-radius:50%!important;background:#f5c955!important;color:#3c4239!important;font-weight:1000!important}
.roundRow b{font-size:15px!important}.roundRow small{display:block!important;color:#77664c!important;font-size:10px!important}.roundRow>strong{font-size:24px!important;color:#d96353!important}
.gameoverLobbyBtn{background:#315e61!important;color:#fff2c9!important;border:0!important;border-radius:14px!important}

/* Small landscape phones: four rows can still fit without shrinking the labels to dust. */
@media (orientation:landscape) and (pointer:coarse){
  #globalTools #leaveBtn{width:34px!important;min-width:34px!important;height:34px!important;min-height:34px!important;border-radius:10px!important}
  #globalTools #leaveBtn::before{font-size:20px!important}
  .partyBoard{padding:3px!important;gap:2px!important}
  .partyBoardHead{min-height:20px!important;height:20px!important;padding:0 3px!important}
  .partyBoardHead h2{font-size:13px!important;line-height:20px!important}
  .partyCards{gap:3px!important}
  .partyPick{padding:2px 3px 3px!important;border-radius:9px!important}
  .partyPick img{width:min(70px,76%)!important;height:min(56px,68%)!important;min-height:34px!important}
  .partyPick strong{font-size:clamp(9px,2.0vh,12px)!important;line-height:1.02!important;-webkit-line-clamp:2!important}
  .partyPick i{font-size:6.5px!important;padding:1px 3px!important}
}

/* Very short landscape devices get a final compact step, keeping names readable. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:390px){
  .partyBoardHead{height:18px!important;min-height:18px!important}
  .partyBoardHead h2{font-size:12px!important;line-height:18px!important}
  .partyPick img{width:min(62px,72%)!important;height:min(48px,64%)!important}
  .partyPick strong{font-size:9px!important}
}

/* Mobile browsers may restore a page with a horizontally panned visual
   viewport. Anchor the game shell to that viewport's live origin instead of
   layout x=0, otherwise the left edge is clipped and the right edge is blank. */
@media (orientation:landscape) and (pointer:coarse){
  html,body{width:100%!important;min-width:0!important;max-width:none!important;margin:0!important;overflow:hidden!important}
  body.touchUI:has(#app:not(.hidden)){position:static!important;width:100%!important;height:100%!important}
  body.touchUI #app:not(.hidden){
    position:fixed!important;
    left:var(--visible-vv-left,0px)!important;
    top:var(--visible-vv-top,0px)!important;
    right:auto!important;bottom:auto!important;
    width:calc(var(--visible-vw,100vw) + var(--visible-fill-extra,0px))!important;
    height:var(--visible-vh,100dvh)!important;
    min-width:0!important;max-width:none!important;
    margin:0!important;padding:0!important;overflow:hidden!important;
  }
  body.touchUI #app:not(.hidden)>main,
  body.touchUI #app:not(.hidden) .gameColumn,
  body.touchUI #app:not(.hidden) .gamewrap,
  body.touchUI #app:not(.hidden) #game{
    width:100%!important;max-width:none!important;margin-left:0!important;margin-right:0!important;
  }
}
