/* Playnook responsive fixes (Oct 2026): keeps every page inside the screen
   on phones (normal + "desktop site"), tablets and laptops. */

/* Safety net: never allow sideways scrolling (clip keeps sticky bars working) */
body{overflow-x:clip;}

/* Game option rows (difficulty, mode, speed, etc.): keep a 16px gap from screen edges */
.game-main > .diff-row,
.game-main > .difficulty-row,
.game-main > .mode-row,
.game-main > .speed-row,
.game-main > .blitz-row,
.game-main > .ng-row,
.game-main > .theme-row{
  width:calc(100% - 32px) !important; box-sizing:border-box;
}
.game-main > .draw-row{ width:calc(100% - 24px) !important; box-sizing:border-box; }

/* Button rows under the board: wrap onto two lines instead of running off-screen */
.game-main > .controls{
  flex-wrap:wrap; justify-content:center;
  max-width:calc(100% - 32px); box-sizing:border-box;
}

/* Footer links: never split a link across lines or push the page wider */
footer a{ display:inline-block; white-space:nowrap; margin-bottom:6px; }

/* Phones: header scrolls away so the board gets more room; score bar stays on top */
@media (max-width:600px){
  body:has(.game-main) > header,
  body:has(.game-main) header{ position:relative !important; }
  .game-main .status-bar{ top:0 !important; }
}

/* Score bar: on wider screens show it as a rounded panel instead of a hard dark block */
@media (min-width:601px){
  .game-main .status-bar{ border-radius:16px; }
}
/* Help line under the board: keep it the same width as the board area */
.game-main > .hint{ max-width:460px; box-sizing:border-box; }

/* Embed box at the bottom of each game page */
.pn-embed h2{ margin:0 0 8px; }
.pn-embed label{ display:block; font-weight:700; margin:12px 0 6px; }
.pn-embed textarea{ width:100%; box-sizing:border-box; min-height:110px; resize:vertical; font:0.8rem/1.45 ui-monospace,Menlo,Consolas,monospace; padding:10px; border-radius:12px; border:1px solid rgba(127,130,170,.4); background:var(--bg-raised,#fff); color:var(--text,#1C1D3A); }
.pn-embed .pn-embed-copy{ margin-top:10px; min-height:44px; padding:0 22px; border-radius:22px; border:0; font:inherit; font-weight:700; cursor:pointer; color:#fff; background:linear-gradient(90deg,var(--pink,#E84393),#6C5CE7); }
.pn-embed .pn-embed-copy:focus-visible{ outline:3px solid var(--gold,#F2A93B); outline-offset:2px; }
.pn-embed .pn-embed-msg{ display:block; margin-top:8px; font-weight:600; }
html.gp-embed .pn-embed{ display:none !important; }

/* Game-over popups: readable in light, dark and high-contrast themes (old dark gradient made text hard to read) */
.overlay-card{background:var(--bg-raised,#FFFFFF)!important;border:2px solid rgba(108,92,231,.35)!important;color:var(--text,#1C1D3A)!important;}
.overlay-card h2{background:none!important;-webkit-background-clip:border-box!important;background-clip:border-box!important;color:var(--text,#1C1D3A)!important;-webkit-text-fill-color:currentColor!important;}
.overlay-card p,.overlay-card .sub,.overlay-card small{color:var(--text,#1C1D3A)!important;opacity:1!important;}
.overlay-card .best-line{color:var(--text,#1C1D3A)!important;}

/* a11y: stronger contrast for score cards in light theme (WCAG AA) */
html:not([data-pn-theme="dark"]):not([data-pn-theme="contrast"]) .status-card .status-label{color:#4B5064 !important}
html:not([data-pn-theme="dark"]):not([data-pn-theme="contrast"]) .status-card .status-value{color:#A3300F !important}
html:not([data-pn-theme="dark"]):not([data-pn-theme="contrast"]) .seo-section p,
html:not([data-pn-theme="dark"]):not([data-pn-theme="contrast"]) .seo-section li,
html:not([data-pn-theme="dark"]):not([data-pn-theme="contrast"]) .side-panel p{color:#3F4458 !important}
html:not([data-pn-theme="dark"]):not([data-pn-theme="contrast"]) .seo-section a{color:#A3300F !important}
