/* Phone layout is shared by the game, account pages and tournament lobby. */
.cut-swipe-hint{display:none}
.board-layout>*{min-width:0}
.board-scroll{min-width:0;overflow:visible}
#cribbageBoard{display:block;width:100%;min-width:0;max-width:920px;height:auto;margin:auto}
@media(max-width:650px){
  .shell{padding:12px 10px max(16px,env(safe-area-inset-bottom));max-width:100%}
  .mast{gap:8px;align-items:center;margin-bottom:12px}
  .mast h1{font-size:clamp(1.65rem,6.3vw,2.5rem);line-height:1.15;overflow-wrap:anywhere}
  .mast-actions{flex-direction:row;gap:6px;align-items:center}
  .mast .account-menu{margin-left:0}
  .account-circle{width:44px;height:44px}
  .account-dropdown{top:52px;width:min(250px,calc(100vw - 24px))}
  .account-dropdown a,.account-dropdown button{min-height:44px}
  .sound-toggle{min-height:44px;padding:8px;font-size:.75rem;white-space:nowrap}
  button,a.textbutton,summary{touch-action:manipulation}
  input:not([type=checkbox]):not([type=radio]),select,textarea{font-size:16px;min-width:0;max-width:100%}
  .primary,.textbutton,.copyrow button,.chat-form button,.tour-chat-form button{min-height:44px}
  .panel{padding:20px 16px;margin:16px 0 24px}
  .panel-title{margin-bottom:18px}
  .panel h2{font-size:1.7rem}
  .choices{gap:10px;margin-top:16px}
  .big-choice{display:grid;grid-template-columns:36px 1fr;gap:4px 12px;padding:16px;min-height:88px}
  .big-choice .choice-icon{grid-row:1 / 3;align-self:center;font-size:1.75rem}
  .big-choice small{grid-column:2;line-height:1.4}
  .panel .textbutton{display:inline-flex;align-items:center;padding:10px 8px}
  .table-nav{gap:8px;flex-wrap:wrap;justify-content:space-between;padding:0 2px 8px}
  .table-nav .textbutton{display:inline-flex;align-items:center;font-size:.8rem;padding:8px 4px}
  .scoreboard{position:sticky;top:0;z-index:5;padding:8px 10px;gap:6px;box-shadow:0 4px 12px #0003}
  .scorebox,.scorebox.right{gap:0;align-items:center;min-width:0}
  .scorebox span{font-size:.8rem;line-height:1.2;text-align:center;max-width:100%}
  .scorebox strong{font-size:2rem;line-height:1.1}
  .score-mid>span{display:none}
  .score-mid div{font-size:.8rem;margin:3px 0}
  .score-mid small{display:block;font-size:.65rem;line-height:1.25;overflow-wrap:anywhere}
  .board-panel{padding:8px 10px}
  .board-layout,.board-layout:has(#starterArea.hidden){display:flex;flex-direction:column;gap:8px}
  .board-scroll{width:100%}
  #cribbageBoard{min-width:0;width:100%;height:auto}
  .starter-area{display:grid;grid-template-columns:1fr 52px;align-items:center;gap:2px 12px;width:100%;padding:8px 12px;text-align:left}
  .starter-area .subhead{color:#5d503c;letter-spacing:.12em}
  #starterCard{grid-column:2;grid-row:1 / 3}
  #starterCard .card{width:52px;height:72px;margin:0}
  .starter-area small{font-size:.7rem;line-height:1.35}
  .crib-banner{padding:8px 12px;gap:10px}
  .crib-note{display:none}
  .playfield{padding:14px 12px 16px}
  .topline{align-items:flex-start;gap:8px;flex-direction:column;margin-bottom:12px}
  .status{font-size:1.12rem;line-height:1.35;overflow-wrap:anywhere}
  #turn{display:none} /* The status already names the player whose turn it is. */
  #table[data-your-turn=true] .status{background:#fff1c9;color:#244333;padding:8px 12px;border-radius:8px;font-weight:800}
  .hand-head{align-items:flex-start;gap:8px;flex-wrap:wrap;margin-top:12px}
  #handHelp{font-size:.75rem;line-height:1.4}
  #hand{justify-content:center;gap:8px;padding-top:12px;margin:4px 0 8px;min-height:110px}
  #hand .card{width:clamp(52px,16vw,72px);height:96px;padding:6px}
  #table[data-phase=discard] #hand{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:5px}
  #table[data-phase=discard] #hand .card{width:100%;height:88px;padding:4px}
  #hand .card span{font-size:1.18rem}
  #hand .card .corner{font-size:1rem}
  #hand .card.selected{transform:translateY(-8px);outline:3px solid #f4c06d;box-shadow:0 6px 12px #0006}
  #hand .card:disabled{cursor:default}
  #controls .primary{width:100%;margin-top:6px;padding:14px}
  .peg-header{gap:8px;margin-bottom:8px}
  #countLabel{font-size:.85rem;white-space:nowrap}
  .peg-cards{gap:10px;min-height:118px;overscroll-behavior-x:contain}
  .peg-item{flex:0 0 64px}
  .peg-item>span{overflow-wrap:anywhere;line-height:1.3}
  .peg-item .card{width:60px;height:84px}
  .peg-item .card span{font-size:1.15rem}
  .peg-item .card .corner{font-size:.95rem}
  .cut-swipe-hint{display:block;font-size:.8rem;color:#f1dfb5;line-height:1.4}
  .cut-scroll{overscroll-behavior-x:contain}
  .cut-cards{gap:8px;min-width:740px}
  .cut-card{min-height:68px}
  .copyrow,.chat-form,.tour-chat-form{gap:8px}
  .copyrow input,.chat-form input,.tour-chat-form input{flex:1;min-width:0}
  .chat-panel summary,.tour-chat summary{min-height:48px;padding:14px}
  .tour-toolbar,.tour-banner{flex-wrap:wrap;gap:12px}
  .tour-panel,.profile-panel{padding:16px;min-width:0}
  .leaderboard-scroll{max-width:100%;overscroll-behavior-x:contain}
  .footer-links{gap:8px;flex-wrap:wrap}
  .footer-links a,.footer-links button{min-height:44px;display:inline-flex;align-items:center}
  .rules-dialog,.terms-dialog,.bug-dialog{width:calc(100% - 16px);max-height:90dvh;padding:16px}
  .rules-close,.terms-close,.bug-close{min-width:44px;min-height:44px}
}
@media(max-width:360px){
  .mast-actions{flex-direction:column-reverse;gap:2px}
  .mast h1{font-size:1.65rem}
  #hand{gap:6px}
  #table[data-phase=discard] #hand{gap:4px}
}
@media(hover:none){
  .card:not(:disabled):hover{transform:none}
  .card.selected:not(:disabled):hover{transform:translateY(-8px)}
  .big-choice:hover{transform:none}
}
