/* Shared full-page frame; the top navigation and question editor stay mounted. */
.section-page,#duel-dialog.section-page{flex:1 1 auto;min-height:0;width:100%;max-width:none;max-height:none;height:auto;margin:0;padding:0;overflow:auto;box-sizing:border-box;border:0;border-radius:0;background:var(--bg);color:var(--ink)}
.section-page[hidden]{display:none!important}.section-content{width:min(1280px,100%);margin:0 auto;padding:32px 28px 40px;box-sizing:border-box}
.section-heading{margin-bottom:24px}.section-heading .eyebrow{font-size:10px;letter-spacing:.1em;color:var(--good);margin:0 0 9px}.section-heading h1{font-size:30px;letter-spacing:-.03em;margin:0 0 10px;line-height:1.25}.section-heading h1:focus{outline:none}.section-heading>p:last-child{font-size:14px;color:var(--muted);line-height:1.7;margin:0}
.app-shell[data-section]:not([data-section="questions"])>.layout,.app-shell[data-section]:not([data-section="questions"])>.game-notice{display:none!important}
.topbar button[aria-current="page"],#desktop-navigation>button[aria-current="page"]{border:1px solid var(--accent);background:var(--tint);color:var(--accent)}
.section-page button:focus-visible,.section-page summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}.section-page input,.section-page select,.section-page textarea{box-sizing:border-box}
.section-page #social-status:empty{display:none}
/* Friends: a quiet list alongside a dedicated conversation surface. */
.social-dialog.section-page .social-layout{grid-template-columns:minmax(290px,360px) minmax(0,1fr);gap:20px;margin-top:20px;align-items:start}
.social-dialog.section-page .social-sidebar,.social-dialog.section-page .social-chat{background:var(--surface-2);border:1px solid var(--line);border-radius:14px;padding:18px;box-sizing:border-box;min-width:0}
.social-dialog.section-page .social-sidebar{max-height:none;overflow:visible}.social-dialog.section-page .social-chat{position:sticky;top:20px}
.social-dialog.section-page .social-code-details{border:1px solid var(--line);border-radius:12px;padding:12px 16px;background:var(--surface-2)}
.social-dialog.section-page .social-code-details>summary{min-height:24px;color:var(--ink)}.social-dialog.section-page .social-add{border:1px solid var(--line);border-radius:10px;padding:0 12px;background:var(--field)}
.social-dialog.section-page .social-tabs{gap:6px}.social-dialog.section-page .social-tabs button{border:1px solid var(--line);flex:1;min-height:42px;padding:9px 7px}.social-dialog.section-page .social-tabs button[aria-pressed="true"]{border-color:var(--accent);color:var(--accent)}
.social-dialog.section-page .social-person{border-color:var(--line);padding:12px;margin:10px 0}.social-dialog.section-page .social-person[data-selected="true"]{border-color:var(--accent)}
.social-dialog.section-page #chat-content{height:clamp(400px,64dvh,760px);min-height:0}.social-dialog.section-page #chat-placeholder{min-height:360px;padding:20px 8px;max-height:none}.social-dialog.section-page .chat-header{gap:8px}.social-dialog.section-page #chat-form{background:transparent;padding-top:14px}.social-dialog.section-page #chat-input{background:var(--field);box-sizing:border-box}.social-dialog.section-page .chat-picker-card{background:var(--field)}
/* Ranking: the real top three, personal result and a readable full table. */
.leaderboard-podium{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:24px 0}.leaderboard-podium:empty{display:none}
.leader-card{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:14px;padding:22px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);min-width:0}.leader-card:first-child{border-color:var(--accent)}.leader-card-rank{grid-column:1/-1;font-size:22px;color:var(--accent);font-weight:750}.leader-card .leaderboard-avatar{width:42px;height:42px;margin:0;background:var(--tint)}.leader-card strong{font-size:15px;overflow-wrap:anywhere;min-width:0}.leader-card>span:last-child{grid-column:1/-1;color:var(--muted);font-size:13px}
.section-page .leaderboard-table-wrap{max-height:none;background:var(--surface-2)}.section-page .leaderboard-table th{position:static}.section-page .leaderboard-table td{padding-top:17px;padding-bottom:17px}.section-page .leaderboard-note{padding:16px 0;font-size:12px;line-height:1.8;color:var(--muted)}
/* Duel: setup, explanation and history fill a balanced lobby. */
#duel-dialog.section-page #duel-setup{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:20px;align-items:start;margin-top:24px}
#duel-dialog.section-page #duel-setup[hidden]{display:none}#duel-invite-form,.duel-info-card,#duel-history{padding:24px;border:1px solid var(--line);border-radius:14px;background:var(--surface-2);min-width:0;box-sizing:border-box}
#duel-dialog.section-page h2{font-size:18px;margin:0 0 20px}#duel-dialog.section-page #duel-opponent,#duel-dialog.section-page select{background:var(--field);border:1px solid var(--line);border-radius:9px;color:var(--ink);font:inherit;min-height:46px;padding:11px 12px;font-size:14px}
#duel-dialog.section-page .duel-options{margin:20px 0 24px;gap:16px}.duel-info-card{grid-column:2;grid-row:1}.duel-info-card ol{padding-left:23px;margin:0;color:var(--muted);font-size:14px;line-height:1.85}.duel-info-card li{padding:4px 0 8px 5px}.duel-info-card li::marker{color:var(--accent);font-weight:700}.duel-info-card .duel-rules{border-top:1px solid var(--line);padding-top:18px;margin-top:20px}.duel-rules summary,#duel-history>summary{min-height:32px;cursor:pointer;font-weight:650}
#duel-dialog.section-page #duel-history{grid-column:1/-1;margin:0}#duel-history-list>p{border-top:1px solid var(--line);padding:14px 0;font-size:13px;line-height:1.7;color:var(--ink)}#duel-history-status{color:var(--muted);font-size:13px}#duel-dialog.section-page #duel-statistics{padding:14px 18px;border:1px solid var(--line);border-radius:10px;background:var(--surface-2);font-size:13px;line-height:1.7}#duel-statistics:empty{display:none}
#duel-dialog.section-page .duel-question{max-height:65dvh}#duel-dialog.section-page #duel-editor,#duel-dialog.section-page #duel-code-input{height:48dvh}.section-page #duel-room{padding-top:12px}
@media(max-width:760px){
 .section-content{padding:24px 16px 32px}.section-heading h1{font-size:26px}.section-heading>p:last-child{font-size:13px}
 .social-dialog.section-page .social-layout{grid-template-columns:1fr;gap:14px}.social-dialog.section-page .social-sidebar,.social-dialog.section-page .social-chat{padding:14px}.social-dialog.section-page .social-chat{position:static}.social-dialog.section-page[data-chat-open="true"]{height:auto;max-height:none;overflow:auto}.social-dialog.section-page[data-chat-open="true"] .section-heading{display:none}.social-dialog.section-page[data-chat-open="true"] #chat-content{height:calc(var(--visible-height,100dvh) - 162px);min-height:280px}.social-dialog.section-page #chat-placeholder{min-height:240px}
 .social-dialog.section-page[data-chat-open="true"] .section-content{padding:12px}.social-dialog.section-page[data-chat-open="true"] .social-layout{margin-top:0}.social-dialog.section-page[data-chat-open="true"] #chat-content{height:calc(var(--visible-height,100dvh) - 116px)}
 .leaderboard-podium{gap:10px;grid-template-columns:1fr}.leader-card{padding:16px;grid-template-columns:40px 34px minmax(0,1fr) auto;gap:10px}.leader-card-rank,.leader-card>span:last-child{grid-column:auto}.leader-card-rank{font-size:18px}.leader-card .leaderboard-avatar{width:34px;height:34px}.leader-card strong{font-size:13px}.leader-card>span:last-child{font-size:11px;white-space:nowrap}
 #duel-dialog.section-page #duel-setup{grid-template-columns:1fr;gap:14px}.duel-info-card{grid-column:auto;grid-row:auto}#duel-dialog.section-page #duel-history{grid-column:auto}#duel-invite-form,.duel-info-card,#duel-history{padding:18px}#duel-dialog.section-page .duel-workspace{grid-template-columns:1fr}#duel-dialog.section-page .duel-question{max-height:40dvh}#duel-dialog.section-page #duel-editor,#duel-dialog.section-page #duel-code-input{height:40dvh}#duel-dialog.section-page .duel-options{gap:10px}
}
