/* The idle table used to hide its next action in a crowded toolbar.
   Keep the launch choices on the table and move specialist tools into More. */
body[data-nexus-surface="table"]{height:100dvh;}
body.table-idle .top-bar{display:none;}
body.table-idle .board-wrap{touch-action:pan-y;}
/* The welcome page is an actual destination, never a loading placeholder. */
html[data-table-startup] #boardHint,html[data-table-startup] .top-bar{display:none!important;}
body:has(#gamePanel.open,.dlg-overlay.open) #boardHint{display:none!important;}
.table-startup{display:none;position:absolute;inset:0;align-items:center;justify-content:center;padding:24px;text-align:center;color:var(--ui-text2);font:16px/1.5 'Spectral',serif;pointer-events:none;}
.table-startup a{color:var(--gold);pointer-events:auto;display:inline-block;padding:12px 4px;}
.ts-error{display:none;}
html[data-table-startup="pending"] .table-startup{display:flex;animation:table-startup-reveal .15s .5s both;}
html[data-table-startup="error"] .table-startup{display:flex;z-index:100;pointer-events:auto;background:var(--ui-bg);}
html[data-table-startup="error"] .ts-pending{display:none;}
html[data-table-startup="error"] .ts-error{display:block;}
html[data-table-startup="pending"]:is([data-campaign-entry],[data-game-launch]) .table-startup,
html[data-table-startup="pending"] body:has(#gamePanel.open,.dlg-overlay.open,.spectate-panel) .table-startup{display:none;}
@keyframes table-startup-reveal{from{opacity:0}to{opacity:1}}
.board-hint.table-entry{
  pointer-events:auto;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;
  display:block;padding:32px 24px calc(24px + env(safe-area-inset-bottom,0px));
}
.te-content{width:min(680px,100%);margin:auto;min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.te-eyebrow{font:11px/1.4 'Cinzel',serif;letter-spacing:2.4px;color:var(--gold);margin-bottom:16px;}
.table-entry .bh-title{font:600 clamp(28px,3.5vw,40px)/1.15 'Cormorant Garamond',serif;letter-spacing:0;text-transform:none;color:var(--ui-text);}
.table-entry .bh-sub{font:17px/1.5 'Spectral',serif;color:var(--ui-text2);margin:12px 0 0;}
.te-saved{font:15px/1.5 'Spectral',serif;color:var(--gold);margin-top:10px;}
.te-actions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap;margin-top:24px;}
.te-button{min-height:48px;padding:10px 24px;border:1px solid var(--ui-border);border-radius:8px;cursor:pointer;background:var(--ui-panel);color:var(--ui-text);font:600 17px/1.3 'Spectral',serif;}
.te-button.te-primary{background:var(--gold);border-color:var(--gold);color:var(--ui-bg);}
.te-button span{margin-left:16px;}
.te-button:disabled{opacity:.6;cursor:wait;}
.te-links{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap;margin-top:10px;}
.te-links button,.te-links a,.table-modes>summary{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 4px;border:0;background:none;color:var(--ui-text2);font:15px/1.4 'Spectral',serif;text-decoration:none;cursor:pointer;}
.te-links button:hover,.te-links a:hover,.table-modes>summary:hover{color:var(--gold);}
.table-modes>summary{list-style:none;gap:8px;}
.table-modes>summary::-webkit-details-marker{display:none;}
.table-modes[open]>summary{color:var(--gold);}
.te-menu{display:flex;flex-direction:column;gap:4px;padding:8px;width:280px;max-width:calc(100vw - 48px);background:var(--ui-panel);border:1px solid var(--ui-border);border-radius:12px;text-align:left;box-shadow:0 14px 32px #0002;}
.table-entry .te-menu{margin:4px auto 12px;}
.te-menu .tbtn{display:block;width:100%;min-height:44px;text-align:left;white-space:normal;font-size:12px;}
.te-menu [hidden],.table-entry [hidden]{display:none !important;}
.top-bar .te-menu{position:fixed;right:12px;top:var(--te-menu-top,100px);z-index:400;max-height:calc(100dvh - var(--te-menu-top,100px) - 12px);overflow:auto;}
.top-bar:has(.table-modes[open]){overflow:visible;}
.te-example{width:100%;margin:22px 0 0;}
.te-cards{display:flex;justify-content:center;align-items:center;gap:36px;position:relative;width:max-content;max-width:100%;margin:auto;}
.te-cards::before{content:'';position:absolute;left:0;right:0;top:50%;border-top:1px solid var(--gold-dim);}
.te-card{width:126px;height:176px;position:relative;border:1px solid var(--ui-border);border-radius:10px;overflow:hidden;background:var(--ui-panel);box-shadow:0 8px 22px #0003;cursor:zoom-in;}
.te-card img{width:100%;height:100%;object-fit:cover;}
.te-card:nth-child(2) img{object-fit:contain;background:#e6e9e7;padding:12px 8px 30px;}
.te-card span{position:absolute;bottom:0;left:0;right:0;padding:10px 5px;background:#0c1118e8;color:#fff;font:600 15px/1.2 'Spectral',serif;text-align:center;}
.te-example figcaption{max-width:440px;margin:18px auto 0;font:16px/1.45 'Spectral',serif;color:var(--ui-text2);}
.te-inspect{margin-top:8px;font:13px/1.4 'Spectral',serif;color:var(--ui-text3);}
.te-card:focus-visible,.te-button:focus-visible,.te-links :focus-visible,.table-modes summary:focus-visible{outline:2px solid var(--gold);outline-offset:4px;}
.te-credits{padding:4px 8px;color:var(--ui-text2);font:13px/1.5 'Spectral',serif;}
.te-credits summary,.te-credits a{display:block;min-height:44px;padding:10px 0;color:inherit;cursor:pointer;}
/* A selected campaign level must never expose the general Resume/New game
   entrance while scripts, account details or the deck are loading. */
.game-launch{display:none;position:absolute;inset:0;z-index:25;padding:24px 20px;overflow:auto;text-align:center;}
html[data-game-launch] .game-launch{display:block;}
html[data-game-launch] #boardHint,html[data-game-launch] .top-bar,
html[data-game-launch] #hand,html[data-game-launch] #gamePanel,
html[data-game-launch] #gameInstructions,html[data-game-launch] #gpReveal{display:none!important;}
.game-launch h1{font:600 clamp(28px,3.5vw,40px)/1.2 'Cormorant Garamond',serif;color:var(--ui-text);}
.game-launch p[role]{max-width:520px;margin:16px 0 24px;font:17px/1.5 'Spectral',serif;color:var(--ui-text2);}
.game-launch a{display:inline-flex;align-items:center;text-decoration:none;}
.campaign-entry{display:none;position:absolute;inset:0;z-index:25;padding:24px 20px;overflow:auto;text-align:center;}
html[data-campaign-entry] .campaign-entry{display:block;}
html[data-campaign-entry] #boardHint,html[data-campaign-entry] .top-bar,
html[data-campaign-entry] #hand,html[data-campaign-entry] #gamePanel{display:none!important;}
.campaign-entry h1{font:600 clamp(28px,3.5vw,40px)/1.2 'Cormorant Garamond',serif;color:var(--ui-text);}
.campaign-entry p[role]{max-width:520px;margin:16px 0 24px;font:17px/1.5 'Spectral',serif;color:var(--ui-text2);}
.campaign-entry a{display:inline-flex;align-items:center;text-decoration:none;}
.campaign-intro-panel{max-height:calc(100dvh - 40px);overflow:auto;overscroll-behavior:contain;}
/* A phone needs its start/resume action before the example, with a scrollable
   welcome area when a short screen or the options menu needs more room. */
@media(max-width:640px){
  .board-hint.table-entry{padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));}
  .te-eyebrow{font-size:10px;margin-bottom:12px;}
  .table-entry .bh-title{font-size:30px;}
  .table-entry .bh-sub{font-size:16px;}
  .te-actions{margin-top:18px;gap:8px;}
  .te-button{padding:10px 16px;font-size:16px;}
  .te-button span{margin-left:8px;}
  .te-example{margin-top:16px;}
  .te-cards{gap:18px;}
  .te-card{width:82px;height:116px;}
  .te-card span{font-size:13px;padding:8px 3px;}
  .te-example figcaption{font-size:15px;margin-top:14px;}
  /* Campaign dialogue must use the phone's width, not squeeze each sentence
     into the narrow column left beside a desktop-sized Patron portrait. */
  .campaign-intro-panel .ld-say{flex-direction:column;gap:12px!important;}
  .campaign-intro-panel .ld-face .pp{width:88px!important;height:112px!important;}
  .campaign-intro-panel .ld-back,.campaign-intro-panel a{display:inline-flex;align-items:center;min-height:44px;}
}
