/* Optional table skins (presentation only). Default look is untouched when data-table-skin is unset.
   Ornament is painted as background layers inside the existing .game frame: no extra layout, no card resizing. */
html[data-table-skin="woven"]{--skin-w:16px}
html[data-table-skin="diamonds"]{--skin-w:22px}
@media(min-width:768px){html[data-table-skin="woven"]{--skin-w:29px}html[data-table-skin="diamonds"]{--skin-w:36px}}
/* 1: woven frame. Strip is uniformly scaled (274x29 at 29px), side strips are the same art rotated rigidly 90deg. */
html[data-table-skin="woven"] body .game.game{
 background:
  url(/skins/woven-h@2x.png) 0 0/auto var(--skin-w) repeat-x,
  url(/skins/woven-h@2x.png) 0 100%/auto var(--skin-w) repeat-x,
  url(/skins/woven-v@2x.png) 0 0/var(--skin-w) auto repeat-y,
  url(/skins/woven-v@2x.png) 100% 0/var(--skin-w) auto repeat-y,
  radial-gradient(ellipse at 50% 45%,#faf0d9,#e4cc98)!important;
 border-color:#6e4930}
/* 2: cream cloth with green/gold/red diamond rails (square tiles, never stretched). */
html[data-table-skin="diamonds"] body .game.game{
 background:
  url(/skins/diamond-tile-42.svg) 50% 0/var(--skin-w) var(--skin-w) repeat-x,
  url(/skins/diamond-tile-42.svg) 50% 100%/var(--skin-w) var(--skin-w) repeat-x,
  url(/skins/diamond-tile-42.svg) 0 50%/var(--skin-w) var(--skin-w) repeat-y,
  url(/skins/diamond-tile-42.svg) 100% 50%/var(--skin-w) var(--skin-w) repeat-y,
  url(/skins/cream-cloth-4.svg) 0 0/4px 4px repeat,
  #f5eddb!important;
 border-color:#6e4930}
/* picker */
.table-skin-picker{margin:8px 0;padding:8px;border:1px solid #bfa36380;border-radius:10px;background:#fffdf5;color:#251f21;font-size:14px;direction:rtl}
.table-skin-picker summary{cursor:pointer;font-weight:700;min-height:36px;display:flex;align-items:center}
.table-skin-picker .skin-row{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.table-skin-picker button{min-height:44px;padding:6px 12px;border:1px solid #9a7b43;border-radius:8px;background:#fff;color:#251f21;font:inherit;cursor:pointer}
.table-skin-picker button[aria-pressed="true"]{background:#6e4930;color:#fff;border-color:#6e4930}
/* quiet cream backing for the bottom status line so it stays readable over the ornament */
html[data-table-skin] body .game #basras{position:relative;z-index:1;background:#fff8e6f2;color:#3d2616;border-radius:8px}
/* quiet cream backings for small labels/controls that sit over the ornament (positions and sizes unchanged) */
html[data-table-skin] body .game #two-opponent strong{background:#fff8e6f2;color:#3d2616;border-radius:10px;padding:2px 8px}
html[data-table-skin] body details.game-settings>summary,
html[data-table-skin] body details.language-settings>summary{background:#fff8e6f2;color:#3d2616;border-radius:10px;box-shadow:0 0 0 1px #bfa36366}
html[data-table-skin] body .rules-fab{box-shadow:0 0 0 2px #fff8e6,0 2px 6px #0004}
/* hue pass: table surface tinted from each ornament's own palette (cards stay white, text colours unchanged) */
html[data-table-skin="woven"]{--sk-a:#f3e1b6;--sk-b:#e4c78d;--sk-c:#cfa869;--sk-edge:#5e3117;--sk-edge2:#7b3a24;--sk-edge3:#3d1f0e}
html[data-table-skin="diamonds"]{--sk-a:#eef0d6;--sk-b:#dde3b9;--sk-c:#c4cf9c;--sk-edge:#21573d;--sk-edge2:#2f6b4c;--sk-edge3:#173f2c}
html[data-table-skin] body .game.game{border-color:var(--sk-edge)}
html[data-table-skin="woven"] body .game.game{background:
  url(/skins/woven-h@2x.png) 0 0/auto var(--skin-w) repeat-x,
  url(/skins/woven-h@2x.png) 0 100%/auto var(--skin-w) repeat-x,
  url(/skins/woven-v@2x.png) 0 0/var(--skin-w) auto repeat-y,
  url(/skins/woven-v@2x.png) 100% 0/var(--skin-w) auto repeat-y,
  radial-gradient(ellipse at 50% 45%,var(--sk-a),var(--sk-b) 70%,var(--sk-c))!important}
html[data-table-skin="diamonds"] body .game.game{background:
  url(/skins/diamond-tile-42.svg) 50% 0/var(--skin-w) var(--skin-w) repeat-x,
  url(/skins/diamond-tile-42.svg) 50% 100%/var(--skin-w) var(--skin-w) repeat-x,
  url(/skins/diamond-tile-42.svg) 0 50%/var(--skin-w) var(--skin-w) repeat-y,
  url(/skins/diamond-tile-42.svg) 100% 50%/var(--skin-w) var(--skin-w) repeat-y,
  radial-gradient(ellipse at 50% 45%,var(--sk-a),var(--sk-b) 70%,var(--sk-c))!important}
/* /computer inner oval */
html[data-table-skin] body.compact-basra .game:before,html[data-table-skin] .compact-basra .game:before{background:radial-gradient(ellipse at 50% 40%,var(--sk-a) 0%,var(--sk-b) 55%,var(--sk-c) 100%)!important;border-color:var(--sk-edge)!important;border-top-color:var(--sk-edge2)!important;border-bottom-color:var(--sk-edge3)!important}
html[data-table-skin] body #basras,html[data-table-skin] body #two-opponent strong,html[data-table-skin] body details.game-settings>summary,html[data-table-skin] body details.language-settings>summary{background:color-mix(in srgb,var(--sk-a) 55%,#fffdf5)}
/* menu cleanup: recent-moves list removed from the open settings menu (element kept for the game log writer) */
#settings .settings-body>h2,#settings .settings-body>ol#log{display:none!important}
/* skin picker: visual table previews instead of name-only buttons */
.table-skin-picker button{display:flex;flex-direction:column;align-items:center;gap:5px;padding:8px;min-width:104px}
.table-skin-picker .skin-preview{display:block;width:96px;height:64px;border-radius:10px;border:3px solid #6b3f1e;box-shadow:inset 0 0 0 1px #d9bf7a99;pointer-events:none}
.table-skin-picker .skin-preview[data-skin=""]{background:radial-gradient(ellipse at 50% 45%,#1e7048,#0f4a30 70%,#0c3a27)}
.table-skin-picker .skin-preview[data-skin="woven"]{background:
 url(/skins/woven-h@2x.png) 0 0/auto 9px repeat-x,
 url(/skins/woven-h@2x.png) 0 100%/auto 9px repeat-x,
 url(/skins/woven-v@2x.png) 0 0/9px auto repeat-y,
 url(/skins/woven-v@2x.png) 100% 0/9px auto repeat-y,
 radial-gradient(ellipse at 50% 45%,#faf0d9,#e4cc98)}
.table-skin-picker .skin-preview[data-skin="diamonds"]{background:
 url(/skins/diamond-tile-42.svg) 50% 0/9px 9px repeat-x,
 url(/skins/diamond-tile-42.svg) 50% 100%/9px 9px repeat-x,
 url(/skins/diamond-tile-42.svg) 0 50%/9px 9px repeat-y,
 url(/skins/diamond-tile-42.svg) 100% 50%/9px 9px repeat-y,
 url(/skins/cream-cloth-4.svg) 0 0/4px 4px repeat,
 radial-gradient(ellipse at 50% 45%,#faf0d9,#e4cc98)}
.table-skin-picker button[aria-pressed="true"] .skin-preview{box-shadow:inset 0 0 0 1px #d9bf7a99,0 0 0 2px #ead79d}
/* 3: Ethiopian tibeb weave - warm white cloth with green/gold/red woven chevron rails (tiles cleanly both directions). */
html[data-table-skin="tibeb"]{--skin-w:22px}
@media(min-width:768px){html[data-table-skin="tibeb"]{--skin-w:32px}}
html[data-table-skin="tibeb"]{--sk-a:#fdf8ea;--sk-b:#f3ead2;--sk-c:#e6d7b6;--sk-edge:#7c3a1e;--sk-edge2:#96502a;--sk-edge3:#54260f}
html[data-table-skin="tibeb"] body .game.game{background:
 url(/skins/tibeb-tile-42.svg) 50% 0/var(--skin-w) var(--skin-w) repeat-x,
 url(/skins/tibeb-tile-42.svg) 50% 100%/var(--skin-w) var(--skin-w) repeat-x,
 url(/skins/tibeb-tile-42.svg) 0 50%/var(--skin-w) var(--skin-w) repeat-y,
 url(/skins/tibeb-tile-42.svg) 100% 50%/var(--skin-w) var(--skin-w) repeat-y,
 radial-gradient(ellipse at 50% 45%,var(--sk-a),var(--sk-b) 70%,var(--sk-c))!important;
 border-color:var(--sk-edge)}
.table-skin-picker .skin-preview[data-skin="tibeb"]{background:
 url(/skins/tibeb-tile-42.svg) 50% 0/9px 9px repeat-x,
 url(/skins/tibeb-tile-42.svg) 50% 100%/9px 9px repeat-x,
 url(/skins/tibeb-tile-42.svg) 0 50%/9px 9px repeat-y,
 url(/skins/tibeb-tile-42.svg) 100% 50%/9px 9px repeat-y,
 radial-gradient(ellipse at 50% 45%,#fdf8ea,#f3ead2)}
/* tibeb: put the weave ON the table itself - friend in-game oval gets a woven rim inside the border, and the rail ring becomes the green/gold/red weave. */
html[data-table-skin="tibeb"] body.in-game .game:before{
 background:radial-gradient(ellipse at 50% 40%,var(--sk-a) 0%,var(--sk-b) 58%,transparent 80%),url(/skins/tibeb-tile-42.svg) 0 0/24px 24px repeat!important;
 border-color:var(--sk-edge)!important;border-top-color:var(--sk-edge2)!important;border-bottom-color:var(--sk-edge3)!important}
html[data-table-skin="tibeb"] body.in-game .game:after{
 background:repeating-linear-gradient(45deg,#1d6b3c 0 5px,#f2dcb0 5px 7px,#e3ac1e 7px 12px,#f2dcb0 12px 14px,#c03428 14px 19px,#f2dcb0 19px 21px)!important}
/* tibeb: same woven rim for the vs-computer oval (interior stays light so cards and labels keep their contrast) */
html[data-table-skin="tibeb"] body.compact-basra .game:before,html[data-table-skin="tibeb"] .compact-basra .game:before{
 background:radial-gradient(ellipse at 50% 40%,var(--sk-a) 0%,var(--sk-b) 58%,transparent 80%),url(/skins/tibeb-tile-42.svg) 0 0/24px 24px repeat!important;
 border-color:var(--sk-edge)!important;border-top-color:var(--sk-edge2)!important;border-bottom-color:var(--sk-edge3)!important}
