#familyPanel{box-sizing:border-box;width:min(92vw,440px);margin:clamp(16px,7vh,68px) auto;padding:clamp(18px,4vw,32px);border:3px solid #72432e;border-radius:22px;background:#fff6e1;box-shadow:0 5px 0 #bb8863;max-height:calc(100dvh - 104px);overflow:auto}
.family-lobby main{display:none!important}
#familyPanel h1{margin:0;letter-spacing:-.05em;font-size:clamp(32px,7vw,46px);line-height:1.06}
.family-head{display:flex;align-items:center;gap:12px}.family-head img{width:54px;height:54px;object-fit:contain}
#familyStatus{line-height:1.33;margin:6px 0 0;font-size:15px}
#guestAccess,#familyLogin,#familyRoleBox,#familyMembers{margin-top:20px}
#familyPanel label,.family-list-heading h2{font-size:14px;font-weight:850;display:block;margin:0 0 6px}
#familyPanel small{font-weight:500}#familyPanel select,#familyPanel input{font:inherit;width:100%;border:1.5px solid #997153;border-radius:8px;background:#fffaf1;padding:8px;color:#492619}
#familyRoleTip{font-size:14px;margin:6px 0 0;line-height:1.33}
#googleJoin{margin-top:13px;min-height:42px}
.family-list-heading,.family-footer{display:flex;align-items:center;justify-content:space-between;gap:8px}
#familyPanel button:not(.primary){border:1.5px solid #95694f;background:#fff4d6;border-radius:10px;padding:6px 10px;font-weight:750;min-height:36px;font-size:13px}
#familyRoster{padding:0;margin:6px 0 0;list-style:none;max-height:23dvh;overflow:auto}
#familyRoster li{display:flex;align-items:center;gap:8px;padding:4px 0;border-bottom:1px solid #efd9af;font-size:14px}
#familyRoster img{width:28px;height:30px;object-fit:contain;flex:none}
#familyRoster strong{min-width:0;overflow-wrap:anywhere;flex:1}
.member-label{flex:none;margin-left:auto;font-size:12px;color:#704d35}
#familyPanel #familyRoster .kick-member{min-width:48px;min-height:44px;color:#843d2b;flex:none}
#familyPanel .primary,.family-footer{margin-top:16px}
body.family-playing .keys,body.family-playing #play,body.family-playing #roles{display:none!important}
body.family-playing #playMode{color:inherit;padding:0}
@media(max-height:560px){#familyPanel{margin:5px auto;max-height:calc(100dvh - 60px);padding:12px 16px}.family-head img{width:38px;height:38px}#guestAccess,#familyLogin,#familyRoleBox,#familyMembers{margin-top:10px}}

.family-links{display:flex;gap:1rem;justify-content:center;margin-top:12px}.family-links a{font-size:12px;color:#73503b;text-underline-offset:2px}

#familyLogin .primary{margin-top:0}
.family-lobby #openFamily,#googleJoin:empty{display:none}
#familyPanel :is(select,input){min-height:44px}

/* iOS's painted native select can stay shorter than its requested minimum. */
#familyPanel select{
  appearance:none;-webkit-appearance:none;min-height:44px;padding-right:32px;
  background-image:linear-gradient(45deg,transparent 50%,#704d35 50%),linear-gradient(135deg,#704d35 50%,transparent 50%);
  background-position:right 16px center,right 10px center;background-size:6px 6px;background-repeat:no-repeat;
}
@media(any-pointer:coarse){#familyPanel .family-footer button:not(.primary){min-height:44px}}

#lobbyPicker,#lobbySeating,#lobbyVoting{margin-top:15px}
#lobbyPickerLabel{margin:0 0 6px;font-size:15px}
#lobbyChoices{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
#familyPanel #lobbyChoices button{display:grid;align-content:center;line-height:1.22;gap:3px;padding:5px 2px;min-height:48px}
#lobbyChoices small{font-size:11px}
#publicLobbyTitle{margin:0 0 6px;font-size:15px}
#publicLobbyEmpty{margin:0;font-size:13px;color:#704d35}
#publicLobbyList{list-style:none;margin:0;padding:0;max-height:clamp(90px,24dvh,225px);overflow:auto}
#publicLobbyList li+li{margin-top:5px}
#familyPanel #publicLobbyList button{display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;min-height:44px;text-align:left}
#publicLobbyList small{color:#704d35;text-align:right}
#familyPanel #lobbyPrivacyBox:not([hidden]){display:flex;align-items:center;gap:8px;min-height:44px;margin:4px 0 0}
#familyPanel #lobbyPrivate{accent-color:#65402c;width:18px;height:18px;min-height:0;margin:0}
#familyPanel :is(#lobbyChoices,.vote-options) button[aria-pressed="true"]{background:#d9ecce;border:2px solid #376349;color:#234b37}
#entrySeatsBox:not([hidden]),#lobbySeating:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:8px}
#entrySeatsBox{margin-top:7px}
#familyPanel :is(#entrySeatsBox,#lobbySeating) label{margin:0}
#familyPanel :is(#entrySeats,#lobbyCapacity){width:auto;max-width:60%}
#familyPanel #lobbyReady{width:100%;margin-top:0}
#familyPanel #lobbyReady[aria-pressed="true"]{background:#d9ecce;color:#234b37;border-color:#376349}
#lobbyAIProposal,#lobbySwitch{margin-top:11px;padding:12px;border:1px solid #ba996c;border-radius:12px;background:#fff0c9}
#lobbyAIProposal p,#lobbySwitch p{margin:0 0 5px}
#lobbySwitch{grid-column:1/-1}
#lobbyAIQuestion{font-weight:800}
#lobbyAICount{font-size:13px}
.vote-options{display:flex;gap:6px}
#familyPanel .vote-options button{flex:1;min-height:44px}
@media(max-width:345px){#lobbyChoices{grid-template-columns:repeat(2,minmax(0,1fr))}}
.lobby-code-row:not([hidden]){display:flex;align-items:center;gap:8px;margin:8px 0}
.lobby-code-row input{min-width:0;flex:1}
#familyPanel .lobby-code-row button,#familyPanel #shareLobby,#familyPanel #friendList button{min-height:44px}
#shareLobby,#friendsPanel{margin-top:13px}
#friendsPanel{border-top:1px solid #dfc5a1;padding-top:4px}
#friendsPanel summary{cursor:pointer;font-weight:800;padding:10px 0}
#friendBadge{color:#774727;font-size:.85em}
#friendStatus{margin:8px 0;font-size:13px}
#friendStatus:empty{display:none}
#friendList{list-style:none;margin:0;padding:0}
#friendList li{display:flex;align-items:center;gap:6px;flex-wrap:wrap;border-top:1px solid #efd9af;padding:5px 0}
#friendList strong{flex:1;min-width:7em;overflow-wrap:anywhere}
@media(orientation:landscape) and (min-width:700px) and (max-height:920px){
  .family-lobby #familyPanel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:12px 20px;width:min(92vw,820px);padding:18px 24px}
  .family-lobby #familyPanel :is(.family-head,.family-footer,.family-links){grid-column:1/-1}
  .family-lobby #familyPanel #familyRoleBox{grid-column:2;grid-row:2/span 4;margin-top:0}
  .family-lobby #familyPanel :is(#guestAccess,#familyLogin,#familyMembers,#familyWatch,#lobbySwitch){grid-column:1;margin-top:0}
  .family-lobby #familyPanel :is(#friendsPanel,#shareLobby){grid-column:1;margin-top:0}
}
@media(any-pointer:coarse) and (orientation:landscape) and (max-height:480px),
      (orientation:landscape) and (min-width:700px) and (max-height:920px){
  .family-lobby #familyPanel :is(#lobbyPicker,#lobbySeating,#lobbyVoting){grid-column:1;margin-top:0}
}

#playerNameHint{display:block;margin-top:5px;line-height:1.25}
#savePlayerName{margin-top:7px}
