/* A single safe rectangle owns the lobby, table, overlays and rotated layout.
   display.js resolves the physical safe-area edges before sizing this rectangle. */
:root{--lobby-header:60px}
body.compact-screen{--lobby-header:44px}
#landscape-shell{border-radius:12px}
#landscape-shell .app-header{height:var(--lobby-header);padding:0 16px;gap:16px}
#landscape-shell .brand{flex-shrink:0;font-size:18px;gap:9px}
#landscape-shell .brand-tile{width:25px;height:32px;font-size:24px}
#landscape-shell .brand small{display:none}
#landscape-shell .header-tools{gap:12px;min-width:0}
#landscape-shell .header-tools>button{min-height:40px;min-width:36px}
#landscape-shell #home-screen{width:100%;max-width:1180px;height:calc(var(--app-height) - var(--lobby-header));margin:0 auto;padding:14px 18px;display:grid;grid-template-columns:minmax(160px,.72fr) minmax(0,1.28fr);grid-template-rows:minmax(0,1fr);gap:14px 24px;align-items:stretch;overflow:hidden}
#landscape-shell #home-screen .welcome{min-width:0;padding:14px 0;align-self:center;overflow:hidden}
#landscape-shell #home-screen .eyebrow{font-size:10px;letter-spacing:1.5px;gap:8px}
#landscape-shell #home-screen h1{font-size:clamp(26px,calc(var(--app-height)*.073),44px);line-height:1.4;letter-spacing:2px;margin:14px 0 10px}
#landscape-shell #home-screen .welcome>p{font-size:12px;line-height:1.8;margin:8px 0}
#landscape-shell #home-screen .hero-tiles{transform:scale(.52);transform-origin:0 0;height:88px;width:300px;margin:12px 0 0 10px}
#landscape-shell #home-screen .home-bottom,#landscape-shell #home-screen .home-footnote{display:none}
#landscape-shell #home-screen .entry-card{min-width:0;min-height:0;width:100%;height:100%;align-self:stretch;padding:18px;border-radius:16px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin}
#landscape-shell .auth-card>.eyebrow{display:none}
#landscape-shell .auth-card h2{font-size:24px;line-height:1.2;margin:0 0 10px}
#landscape-shell .auth-tabs{margin:0 0 12px;gap:24px}
#landscape-shell .auth-tabs button{font-size:14px;padding:5px 0 9px;min-height:34px}
#auth-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 14px}
#landscape-shell #auth-form label{font-size:12px;line-height:1.4;margin:0;min-width:0}
#landscape-shell input:not([type=radio]):not([type=hidden]){font-size:16px;line-height:20px;padding:10px 12px;height:42px;border-radius:8px}
#auth-form input{margin-top:5px}
#auth-form .form-error{grid-column:1/-1;margin:0;min-height:0;font-size:12px;line-height:1.4}
#auth-form .form-error:empty{display:none}
#landscape-shell #auth-form .big-button{grid-column:1/-1;justify-content:center;margin:2px 0 0;min-height:42px;padding:10px 16px;font-size:15px}
#landscape-shell .rejoin-note{font-size:11px;line-height:1.5;margin:10px 0 0;color:#a2bbaa}
body.compact-screen #landscape-shell #home-screen .auth-card{padding:14px}
body.compact-screen #landscape-shell .auth-card h2{font-size:20px;margin-bottom:6px}
body.compact-screen #landscape-shell .auth-tabs{margin-bottom:8px}
body.compact-screen #landscape-shell #auth-form{gap:8px 14px}
body.compact-screen #landscape-shell #auth-form input{height:40px;padding:9px 12px}
body.compact-screen #landscape-shell .auth-card[data-mode=register]>.rejoin-note{display:none}
#landscape-shell #home-screen .family-home{min-width:0;grid-column:1/-1;padding:8px 2px 0;gap:12px;min-height:48px;flex-direction:row}
#landscape-shell .family-avatar{width:36px;height:36px;border-radius:10px}
#landscape-shell .family-identity{gap:8px;min-width:0}
#landscape-shell .family-identity strong{display:block;max-width:160px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
#landscape-shell .family-identity small{font-size:10px;margin-top:2px}
#landscape-shell #home-screen .family-shortcuts{width:auto;gap:16px;font-size:12px;flex-shrink:0}
#landscape-shell .family-shortcuts button{min-height:40px}
body.signed-in #landscape-shell #home-screen{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;gap:10px}
body.signed-in #home-screen>.welcome{display:none}
#landscape-shell #home-screen #entry-card{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px;padding:0;border:0;background:none;box-shadow:none;overflow:auto}
.room-create,.room-join{min-width:0;min-height:min-content;padding:20px;border:1px solid #b5c1a62b;border-radius:16px;background:linear-gradient(145deg,#284d3fcc,#1a3a30cc);display:flex;flex-direction:column;justify-content:center}
#entry-card .card-heading{margin:0 0 14px;gap:10px}
#entry-card .card-heading h2{font-size:20px;line-height:1.3;margin:0 0 4px;letter-spacing:1px}
#entry-card .card-heading p{font-size:11px;line-height:1.5}
#entry-card .section-number{font-size:26px;padding-right:10px}
#entry-card #round-options{margin:0 0 12px}
#entry-card #round-options legend{font-size:12px;margin-bottom:6px}
#entry-card #round-options small{font-size:11px;margin-top:6px}
#entry-card .round-options{gap:8px}
#entry-card .round-options span{padding:10px 0;font-size:14px;line-height:18px}
#entry-card .big-button{margin:0;padding:10px 14px;min-height:42px;font-size:14px}
#entry-card .field-label{margin:0 0 6px;font-size:12px}
#entry-card .join-row{gap:8px}
#entry-card .join-row button{min-height:42px;padding:8px 16px;font-size:14px}
#entry-card .practice-button{margin:12px 0 0;padding:10px 0 0;gap:10px;min-height:44px;font-size:13px}
#entry-card .practice-button small{margin-top:3px;font-size:10px}
body.short-screen #landscape-shell #home-screen{padding:8px 12px;gap:8px 18px}
body.short-screen #landscape-shell #home-screen .hero-tiles{display:none}
body.short-screen #landscape-shell #home-screen .entry-card{padding:12px}
body.short-screen #landscape-shell .auth-card h2{display:none}
body.short-screen #landscape-shell .auth-tabs{margin-bottom:8px}
body.short-screen #landscape-shell #auth-form{gap:8px 12px}
body.short-screen #landscape-shell #auth-form label{line-height:14px}
body.short-screen #landscape-shell #auth-form input{height:34px;padding:6px 10px;margin-top:3px}
body.short-screen #landscape-shell #auth-form .big-button{min-height:38px;padding:8px 14px}
body.short-screen #landscape-shell .auth-card>.rejoin-note{display:none}
body.short-screen .room-create,body.short-screen .room-join{padding:12px 16px}
body.short-screen #entry-card .card-heading{margin-bottom:8px}
body.short-screen #entry-card .card-heading h2{font-size:18px}
body.short-screen #entry-card .card-heading p,body.short-screen #entry-card .rejoin-note{display:none}
body.short-screen #entry-card #round-options{margin-bottom:8px}
body.short-screen #entry-card #round-options legend{display:none}
body.short-screen #entry-card .practice-button{margin-top:8px;padding-top:6px}
body.short-screen #landscape-shell #home-screen .family-home{padding-top:2px;min-height:40px}
body.narrow-screen #landscape-shell #home-screen{grid-template-columns:minmax(0,1fr)}
body.narrow-screen #home-screen>.welcome{display:none}
body.narrow-screen #landscape-shell .connection{display:none}
body.narrow-screen #landscape-shell .header-tools{gap:5px}
body.narrow-screen #landscape-shell .family-identity small{display:none}
body.narrow-screen #landscape-shell #home-screen .family-shortcuts{gap:10px;font-size:11px}
body.narrow-screen #entry-card .section-number{display:none}
body.narrow-screen #landscape-shell #home-screen #entry-card{gap:10px}
body.keyboard-screen #landscape-shell #home-screen{overflow:auto;grid-template-rows:auto}
body.keyboard-screen #landscape-shell #home-screen .entry-card{height:auto;min-height:min-content}
body.keyboard-screen #home-screen>.welcome{display:none}
body.keyboard-screen #landscape-shell #home-screen{grid-template-columns:minmax(0,1fr)}
/* Dialogs are native top-layer elements, so they share the safe rectangle's centre. */
body .sheet{display:flex;flex-direction:column;overflow:hidden;padding:16px;max-height:calc(var(--app-height) - 12px);width:min(720px,calc(var(--app-width) - 16px))}
body .sheet:not([open]){display:none}
body .sheet-top{flex-shrink:0;margin:0 0 10px;padding:0 0 10px;min-height:36px}
body .sheet-top h2{font-size:20px}
body #sheet-body{min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:0 4px 6px}
body .close-button{min-width:40px;min-height:40px}
body .sheet input{font-size:16px}
body .toast{bottom:12px;max-width:calc(var(--app-width) - 32px)}
