/* Social screens share one viewport. Only the list or message log scrolls. */
body:is([data-page=messages],[data-page=friends]){--social-top:80px;--social-bottom:calc(96px + env(safe-area-inset-bottom));overflow:hidden;padding-bottom:0!important}
body:is([data-page=messages],[data-page=friends]) .app-header{height:var(--social-top)!important;min-height:0!important;padding-top:10px!important;padding-bottom:10px!important}
body[data-page=messages] .hub-pages{position:fixed;inset:var(--social-top) 0 var(--social-bottom);width:min(100%,900px);margin:auto;padding:0 18px!important;overflow:hidden}
#messagesPage:not(.hidden){display:flex;flex-direction:column;height:100%;min-height:0;padding:0!important;background:transparent!important;border:0!important;box-shadow:none!important}
#messagesPage>.page-heading{flex:none;margin:0;padding:12px 4px 18px;text-align:left}
#messagesPage>.page-heading h1{font-size:26px;margin:0}
#conversationList{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding-bottom:12px}
.conversation-row{width:100%;display:flex;align-items:center;gap:12px;min-height:80px;padding:13px 4px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);text-align:left;box-shadow:none;cursor:pointer}
.conversation-row:hover{background:#ad87dd0b}.conversation-row:active{background:#ad87dd18}
.conversation-row>.illustrated-avatar,#directPortrait>.illustrated-avatar{flex:none;width:48px!important;height:48px!important}
.conversation-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:5px}
.conversation-copy strong{font-size:16px;line-height:1.25;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.conversation-preview{font-size:13px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.conversation-time{align-self:flex-start;flex:none;padding-top:4px;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
#messagesPage:has(#directConversation:not(.hidden))>.page-heading{display:none}
#directConversation:not(.hidden){display:flex;flex:1;flex-direction:column;min-height:0;height:100%;overflow:hidden;border:1px solid var(--line);border-radius:22px;background:var(--surface)}
.direct-heading{display:flex;align-items:center;gap:10px;flex:none;min-height:70px;padding:10px 12px;border-bottom:1px solid var(--line);background:var(--surface)}
.direct-heading .icon-button{flex:none;width:40px;height:40px;border:0;background:transparent;box-shadow:none;color:var(--ink)}
#directPortrait{flex:none;display:block;width:44px;height:44px}#directPortrait>.illustrated-avatar{width:44px!important;height:44px!important}
#directName{min-width:0;flex:1;font-size:17px;line-height:1.3;margin:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
#directMessages{height:auto!important;flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-gutter:stable;gap:8px;padding:16px 14px!important;background:linear-gradient(#ab7bd807,#ab7bd807)}
#directMessages .conversation-date{align-self:center;flex:none;border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:4px 10px;margin:8px 0;font-size:10px;color:var(--muted)}
.direct-message{flex:none;max-width:85%;padding:9px 12px;border-radius:15px 15px 15px 4px;line-height:1.45;font-size:14px;background:#463254;box-shadow:0 1px 2px #10061914;overflow-wrap:anywhere}
.direct-message.own{border-radius:15px 15px 4px 15px;background:#7148a6}
.direct-message small{margin:3px 0 0 18px;font-variant-numeric:tabular-nums}
#olderDirect{flex:none;align-self:center;min-height:30px;margin:6px 0;padding:4px 14px;border:0;border-radius:15px;background:transparent;color:var(--muted);box-shadow:none;font-size:11px}
#directComposer{flex:none;display:flex;align-items:center;gap:8px;margin:0;padding:10px;border-top:1px solid var(--line);background:var(--surface)}
#directInput{height:46px;min-height:46px;flex:1;min-width:0;border-radius:24px;padding:10px 16px;font-size:16px;background:#a681d814;border:1px solid var(--line)}
#directComposer button{flex:none;width:46px;height:46px;min-height:46px;display:grid;place-items:center;border-radius:50%;padding:12px;background:#8a4eca;color:#fff;border:0;box-shadow:none}
#directComposer button .icon{width:22px;height:22px}#directStatus:empty{display:none}#directStatus{flex:none;margin:0;padding:0 14px 8px;font-size:12px;color:var(--muted)}
body[data-page=friends] #friendsDialog.nav-page[open]{display:flex!important;flex-direction:column;inset:var(--social-top) 0 var(--social-bottom)!important;width:min(864px,calc(100% - 36px))!important;height:auto!important;min-height:0;padding:8px 0 0!important;overflow:hidden!important;background:transparent!important}
#friendsDialog.nav-page>.drawer-heading{flex:none;margin:0;padding:4px 2px 14px}#friendsDialog.nav-page>.drawer-heading h2{font-size:26px}
#friendsDialog.nav-page>.friend-entry{flex:none;min-height:48px;padding:7px 12px!important;border-radius:14px!important;background:#a681d812}
#friendsDialog.nav-page .friends-form{flex:none;margin:12px 0 4px;gap:8px}#friendsDialog.nav-page .friends-form input{height:46px;padding:10px 14px;border-radius:14px;font-size:16px}
#friendsDialog.nav-page .friends-form button{height:46px;min-height:46px;border-radius:14px}
#friendsDialog.nav-page .friends-status{flex:none;margin:6px 4px;font-size:12px}#friendsDialog.nav-page .friends-status:empty{display:none}
#friendsList{min-height:0;overscroll-behavior:contain;scrollbar-width:thin}
#friendsDialog.nav-page #friendsList{flex:1;overflow-y:auto;padding:0 3px 20px}
#friendsList .friend-heading{position:sticky;top:0;z-index:2;margin:0;padding:18px 4px 9px;background:var(--bg);font-size:12px;font-weight:800;letter-spacing:.02em}
body:is([data-view=home],[data-view=hub]) #friendsDialog #friendsList .friend-entry{gap:9px;margin:0;border:0;border-bottom:1px solid var(--line);border-radius:0;padding:12px 1px;background:transparent;min-height:76px}
#friendsList .friend-entry>.illustrated-avatar{flex:none;width:46px!important;height:46px!important}
#friendsList .friend-profile{background:transparent!important;border:0!important;box-shadow:none!important;text-align:left;padding:0;align-self:stretch;display:flex;flex-direction:column;justify-content:center;gap:5px;color:var(--ink);border-radius:8px}
#friendsList .friend-profile b{font-size:15px;max-width:100%}#friendsList .friend-profile small{font-size:11px;max-width:100%}
#friendsList .friend-entry>.icon-button{width:40px;height:40px;min-height:40px;padding:10px;border:0;border-radius:13px;background:#a681d815;color:#bd98e7;box-shadow:none}
#friendsList .friend-entry>.icon-button:active{background:#a681d83a}
body[data-theme=day] #friendsList .friend-heading{background:#f7f4ff}body[data-theme=day] #friendsList .friend-entry{background:transparent!important}body[data-theme=day] #friendsList .friend-entry>.icon-button{color:#7950a2}
body[data-theme=day] #directConversation{background:#fff}body[data-theme=day] .direct-message{background:#ede5f6}body[data-theme=day] .direct-message.own{background:#7752b5;color:#fff}
@media(max-width:540px){body:is([data-page=messages],[data-page=friends]){--social-top:64px;--social-bottom:calc(82px + env(safe-area-inset-bottom))}body[data-page=messages] .hub-pages{padding:0 12px!important}body[data-page=friends] #friendsDialog.nav-page[open]{width:calc(100% - 24px)!important}#directConversation:not(.hidden){border-radius:18px}.direct-heading{min-height:62px;padding:8px;gap:7px}#directMessages{padding:12px 10px!important}#messagesPage>.page-heading{padding:8px 2px 12px}#messagesPage>.page-heading h1,#friendsDialog.nav-page>.drawer-heading h2{font-size:24px}}
@media(max-width:350px){#friendsList .friend-entry{gap:6px!important}#friendsList .friend-entry>.icon-button{width:36px;height:40px;padding:9px}#friendsList .friend-entry>.illustrated-avatar{width:40px!important;height:40px!important}.conversation-row{gap:9px}.conversation-row>.illustrated-avatar{width:43px!important;height:43px!important}}

@media(max-width:540px){body[data-page=messages]:has(#directInput:focus){--social-bottom:env(safe-area-inset-bottom)}body[data-page=messages]:has(#directInput:focus) .bottom-nav{display:none}}

body[data-theme=day]:is([data-page=messages],[data-page=friends]){--surface:#fff;--ink:#352a49;--muted:#776684;--line:#dfd4ec;--bg:#f7f4ff;color:var(--ink)!important}

.message-delivery{display:block;opacity:.6;font-size:11px}.message-retry{font:inherit;font-size:12px;border:0;border-radius:8px;padding:5px 9px;background:#703b65;color:white}

.open-game-turn{display:grid;place-items:center;flex:0 0 38px;width:38px;height:38px;border-radius:50%;margin-left:auto}.open-game-turn .icon{width:21px;height:21px}.open-game-turn.is-own{color:#6ff4aa;background:#1cb86b25;border:1px solid #49db8c66}.open-game-turn.is-rival{color:#ffcf60;background:#edb02c20;border:1px solid #edb02c55}[data-theme=day] .open-game-turn.is-own{color:#12733e;background:#e0f6e9;border-color:#9edbb5}[data-theme=day] .open-game-turn.is-rival{color:#946000;background:#fff2cd;border-color:#ead08a}

#turnPill{display:none!important}.syncing-move #commit{opacity:.72}.syncing-move .board-area{transition:box-shadow .2s}

/* Browse pages share the home canvas. Only the individual controls get surfaces. */
body[data-theme=day]:is([data-view=home],[data-view=hub]){
 background:radial-gradient(ellipse 85vw 40rem at 50% 0,#ede3f8 0,transparent 65%),#f5f1fb!important;
}
body:is([data-view=home],[data-view=hub]) .app-header{
 border-bottom:0!important;
 background:transparent!important;
 box-shadow:none!important;
}
#hubPages,#hubPages .hub-page{
 background:transparent!important;
 border:0!important;
 border-radius:0;
 box-shadow:none!important;
}
#leadersPage{
 max-width:720px;
 margin-inline:auto;
 padding:0;
}
#leadersPage .page-heading{padding:12px 4px 18px}
#leadersPage .period-tabs{
 display:grid;
 grid-template-columns:repeat(3,minmax(0,1fr));
 margin-bottom:16px;
 background:#2d2141;
 border:1px solid #583f70;
}
#leadersPage .period-tabs button{
 height:auto;
 min-height:44px;
 padding:7px 4px;
}
#leadersPage .period-tabs button[aria-pressed=true]{box-shadow:0 4px 14px #10051e18}
#leadersList{display:grid;gap:8px}
#leadersList .leader-row{
 display:grid;
 grid-template-columns:1.45em auto minmax(0,1fr) auto;
 gap:10px;
 margin:0;
 padding:12px 14px;
 color:var(--ink);
 border-color:#58446b;
 background:#292038;
 box-shadow:0 8px 26px #12072014;
}
#leadersList .leader-row>b{color:#d6b6eb;font-size:14px;text-align:center}
#leadersList .leader-row>span{min-width:0;white-space:nowrap}
#leadersList .leader-row small{overflow:hidden;text-overflow:ellipsis}
#leadersList .leader-row>strong{min-width:0;font-variant-numeric:tabular-nums}
#leadersList .empty-state{margin:0}
body[data-theme=day] #leadersPage .period-tabs{
 background:#ede3f7!important;
 border-color:#d6c9e3!important;
}
body[data-theme=day] #leadersPage .period-tabs button:not([aria-pressed=true]){
 background:transparent!important;
 border-color:transparent!important;
}
body[data-theme=day] #leadersList .leader-row{
 color:#342542!important;
 border-color:#ded2e9!important;
 background:#fffefd!important;
 box-shadow:0 8px 26px #55347612!important;
}
body[data-theme=day] #leadersList .leader-row>b,
body[data-theme=day] #leadersList .leader-row small{color:#665175}
@media(max-width:360px){
 #leadersList .leader-row{gap:7px;padding-inline:10px}
 #leadersPage .period-tabs button{font-size:11px}
}
