/* Petteia - rules shared by every page of the website except the game (/r9/,
   which carries the same rules in its own file) and the admin page.
   Added 18 Oct 2026 (the owner's decisions of 17-18 Oct). Colours come from
   /shared/tokens.css, so this file only follows the site's own theme. */

/* 1. Nothing on the page can be selected or copied by accident: no text
      selection, and no long-press menu on pictures. Typing boxes stay selectable
      (they must, or typing and pasting break), and so do the support email and
      any block marked data-copy - the press kit's one-line description and its
      facts, which journalists are invited to use (owner, 18 Oct). Pictures
      cannot be dragged off the page (site.js does the same for the other
      browsers). */
html{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;}
input,textarea,select,[contenteditable="true"],a[href^="mailto:"],[data-copy]{
  -webkit-user-select:text;user-select:text;-webkit-touch-callout:default;
}
/* A link made of words keeps the phone's own long-press menu (Open in New Tab,
   Copy Link) - owner, 18 Oct. A link holding a picture (the logo, the press-kit
   downloads) keeps none, so its picture never offers "Save image". Only iPhones
   and iPads read this rule: Android browsers show their link menu anyway, and
   site.js stops it on pictures. Safari before 15.4 does not know :has(), drops
   this one rule, and so keeps no menu on any link. */
a[href]:not(:has(img, picture, svg, video, canvas)){-webkit-touch-callout:default;}
img,video,svg{-webkit-user-drag:none;}
/* so the email, and a link inside a block that may be copied, select instead of
   being dragged away */
a[href^="mailto:"],[data-copy] a{-webkit-user-drag:none;}

/* 2. No zoom. Fingers may scroll the page in any direction but not pinch or
      double-tap it larger (site.js catches the browsers that ignore this), and
      the phone may not enlarge the text by itself when it is turned sideways.
      The Aa button below is how text is made larger instead. */
html{touch-action:pan-x pan-y;-webkit-text-size-adjust:100%;text-size-adjust:100%;}

/* 3. Text size. site.js sets --ts on <html> before the page is drawn: 1
      (Standard), 1.15 (Large) or 1.3 (Larger). Each page's text sizes are written
      as calc(<size> * var(--ts,1)), so Standard is exactly the size it always was.
      The top bar and buttons keep their size, so they never crowd off a phone. */
:root{--ts:1;}

/* A table that scrolls sideways (larger text on a phone) can be reached with the
   Tab key; it shows where the focus is. */
table[data-wide]:focus-visible{outline:2px solid var(--bronze);outline-offset:2px;}

/* The Aa button, in the top bar beside Play Now. */
.ts-wrap{position:relative;display:inline-flex;align-items:center;flex:0 0 auto;}
.ts-wrap:empty{display:none;}
.ts-btn{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:36px;min-height:44px;padding:0 6px;margin:0;box-sizing:border-box;
  background:transparent;border:0;border-radius:6px;cursor:pointer;
  color:var(--parchment-dim);font-family:'Cinzel',Georgia,serif;font-weight:700;line-height:1;
  -webkit-tap-highlight-color:transparent;
}
.ts-btn .ts-glyph{display:inline-flex;align-items:baseline;}
.ts-btn .ts-big{font-size:17px;}
.ts-btn .ts-small{font-size:12.5px;}
.ts-btn:hover,.ts-btn[aria-expanded="true"]{color:var(--parchment);}
.ts-btn:focus-visible{outline:2px solid var(--bronze-bright);outline-offset:1px;}
.ts-panel{
  position:absolute;top:calc(100% + 8px);right:0;z-index:60;width:236px;max-width:calc(100vw - 24px);
  background:var(--stone);border:1px solid var(--stone-light);border-radius:10px;
  padding:10px 10px 8px;box-shadow:0 14px 40px rgba(0,0,0,.55);box-sizing:border-box;
  font-family:'Inter',system-ui,sans-serif;
}
.ts-panel[hidden]{display:none;}
.ts-title{font-family:'Cinzel',Georgia,serif;font-weight:700;font-size:11.5px;letter-spacing:.12em;
  text-transform:uppercase;color:var(--bronze-bright);margin:2px 6px 8px;}
.ts-opt{
  display:flex;align-items:center;gap:12px;width:100%;min-height:44px;margin:0 0 4px;padding:0 10px;
  background:transparent;border:1px solid transparent;border-radius:8px;cursor:pointer;box-sizing:border-box;
  color:var(--parchment);font-family:'Inter',system-ui,sans-serif;font-size:14px;text-align:left;
  -webkit-tap-highlight-color:transparent;
}
.ts-opt:hover{background:var(--stone-2);}
.ts-opt[aria-checked="true"]{border-color:var(--bronze-dim);background:var(--stone-2);}
.ts-opt:focus-visible{outline:2px solid var(--bronze-bright);outline-offset:1px;}
.ts-opt .ts-a{display:inline-block;width:26px;text-align:center;font-family:'Cinzel',Georgia,serif;font-weight:700;
  color:var(--bronze-bright);line-height:1;}
.ts-opt .ts-tick{margin-left:auto;color:var(--bronze-bright);font-size:14px;visibility:hidden;}
.ts-opt[aria-checked="true"] .ts-tick{visibility:visible;}
.ts-note{font-size:12px;line-height:1.5;color:var(--parchment-dim);margin:6px 6px 2px;}

/* On a phone the top bar has no room for "Play Now" beside the Aa button, so the
   button says "Play" there (the way "PGN Viewer" already becomes "Viewer"). */
.play-short{display:none;}
@media (max-width:420px){
  .play-full{display:none;}
  .play-short{display:inline;}
}
