/* Colors, fonts, page background */
:root{
  --page:#0b0406;
  --felt:#0d6a42;
  --felt-deep:#04331f;
  --felt-mid:#0a5634;
  --gold:#e4c374;
  --gold-hi:#fff0bf;
  --gold-lo:#9b7426;
  --gold-dim:rgba(228,195,116,.5);
  --ink:#f7f1e1;
  --muted:rgba(247,241,225,.66);
  --panel:#140c0a;
  --win:#4ee08a;
  --lose:#ff5d62;
  --push:#f0c75e;
  --red:#b5182a;
  --cw:76px;
  --ch:106px;
  --chip:52px;
  --noise:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --page:#080305; } }
:root[data-theme="dark"]{ --page:#080305; }

*{box-sizing:border-box}
html,body{margin:0;min-height:100%}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
/* no pull-to-refresh / bounce in the middle of a hand */
html,body{overscroll-behavior-y:none}
/* taps: no 300 ms delay, no double-tap zoom on controls, no grey flash (each control has its own :active state) */
a,button,input,select,textarea,label,summary,[role="button"],[data-act],.chip,.spot,.tcard,.pack{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
/* the installed iPhone app draws under the status bar (black-translucent): keep content out of the notch and home bar */
:root{--sa-t:env(safe-area-inset-top,0px);--sa-r:env(safe-area-inset-right,0px);--sa-b:env(safe-area-inset-bottom,0px);--sa-l:env(safe-area-inset-left,0px)}
body{
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(140,30,45,.45), transparent 70%),
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.9), transparent 60%),
    var(--page);
  color:var(--ink);
  font-family:Inter,system-ui,sans-serif;
  -webkit-font-smoothing:antialiased;
  user-select:none;-webkit-user-select:none;
  overflow-x:hidden;
}
button{font-family:inherit;color:inherit}
/* keyboard / game controller: always see where the focus is */
:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
.spot:focus-visible{outline-offset:4px;border-radius:50%}
/* fewer animations when the phone asks for it (the game's own moves use JS and stay, only decoration stops) */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}
}
.hidden{display:none !important}
.update-banner{position:fixed;left:50%;bottom:calc(16px + var(--sa-b));z-index:98;transform:translateX(-50%);display:flex;align-items:center;gap:10px;
  padding:8px 8px 8px 16px;border-radius:14px;background:linear-gradient(180deg,#2c1d0d,#140b07);border:1px solid var(--gold);
  box-shadow:0 14px 34px rgba(0,0,0,.6);font-size:14px;font-weight:700;white-space:nowrap;animation:panelIn .3s ease-out}
.update-banner .btn{padding:9px 14px;font-size:13px}
.update-banner .ub-x{width:36px;height:36px;border-radius:50%;border:1px solid rgba(255,255,255,.18);background:none;cursor:pointer;font-size:16px}

/* another tab of the game took over (js/keyboard.js) */
.tab-lock{position:fixed;inset:0;z-index:300;display:none;align-items:center;justify-content:center;padding:16px;
  background:rgba(8,4,3,.82);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
.tab-lock.on{display:flex}
.tl-box{max-width:380px;text-align:center;padding:26px 24px;border-radius:18px;background:linear-gradient(180deg,#1f130e,#0e0806);
  border:1px solid rgba(212,175,90,.35);box-shadow:0 20px 60px rgba(0,0,0,.6);color:#f3e7c9}
.tl-box strong{display:block;font-size:17px;margin:6px 0 8px}
.tl-box p{margin:0 0 16px;color:var(--muted);font-size:14px;line-height:1.45}
.tl-ico{font-size:30px;color:var(--gold)}

/* Big screens: the page laid out for a ~1920×950 window (a 1080p screen minus the browser bars), zoomed up by steps (js/display.js fixes measures and --vz the vh units) */
@media (min-width:2200px) and (min-height:1080px){ html{zoom:1.15} }
@media (min-width:2500px) and (min-height:1240px){ html{zoom:1.3} }
@media (min-width:2860px) and (min-height:1420px){ html{zoom:1.5} }
@media (min-width:3360px) and (min-height:1660px){ html{zoom:1.75} }
@media (min-width:3800px) and (min-height:1900px){ html{zoom:2} }

/* Réglages → Cartes S / M / L (computers) */
@media (min-width:861px) and (min-height:881px){
  html.cards-s{--cw:62px;--ch:87px}
  html.cards-l{--cw:90px;--ch:126px}
}
@media (min-width:861px) and (min-height:821px) and (max-height:880px){
  html.cards-s{--cw:56px;--ch:78px}
  html.cards-l{--cw:74px;--ch:104px}
}
@media (min-width:861px) and (max-height:820px){
  html.cards-s{--cw:47px;--ch:66px}
  html.cards-l{--cw:60px;--ch:84px}
}
/* Réglages → Tapis « Nuit »: each room's felt colors darkened, see applyFelt() in js/display.js */
