/* Table felt colors (PREVIEW, Design Bot 2026-10-18). Prefix tfelt-, global PBLFelt.
   The felt changes the TABLE; PBLBg (table-bg) changes the ROOM. Everything is driven by CSS variables set on
   #tableWrap[data-tfelt="<id>"]. With no attribute (or data-tfelt="green") the live look is reproduced exactly.
   Load AFTER index.html's <style> and static/fx/fx.css (fx.css forces the watermark color with !important). */

#tableWrap{
  /* ---- live values (index.html L22-29 + fx.css L7), sampled 2026-10-18 = Classic Green ---- */
  --tfelt-hi:#3a9a55; --tfelt-mid:#237a3c; --tfelt-lo:#14552a;          /* felt radial gradient 0% / 45% / 100% */
  --tfelt-edge:#0b3a1b;                                                    /* 2px inner line at the felt edge */
  --tfelt-vig:#000a;                                                       /* inner vignette (inset 0 0 25px) */
  --tfelt-grain:0;                                                         /* felt texture overlay opacity (0 = live, none) */
  --tfelt-mark:#ffffff26;                                                  /* SUPERINTELLIGENCEPOKER.COM™ watermark */
  --tfelt-rail-a:#5a3a22; --tfelt-rail-b:#2e1a0c; --tfelt-rail-c:#1a0e05; /* rail (wood) gradient */
  --tfelt-rim:transparent;                                                 /* thin outer rim line on the rail (0 = none) */
  --tfelt-rim-in:transparent;                                              /* thin line where rail meets felt */
  --tfelt-bet-bg:#0007; --tfelt-bet-fg:#fff; --tfelt-bet-ring:transparent; --tfelt-bet-sh:none;   /* .bet pill */
  --tfelt-pot-bg:#0008; --tfelt-pot-fg:#ffe9a8; --tfelt-pot-sh:none;      /* #pot pill (#totpot keeps its #000b + gold border) */
  --tfelt-chip:drop-shadow(0 1px 1px #000);                               /* chip image shadow (live) */
  --tfelt-muck:.82;                                                        /* folded/mucked card opacity (folded.css) */
  --tfelt-ft-ring:#FFC83D; --tfelt-ft-glow:#E8B923cc; --tfelt-ft-glow2:#E8B92355;   /* final table (tourney-fx v2) */
}

/* ---- presets ---- */
#tableWrap[data-tfelt="red"]{          /* Oxblood: deep, muted burgundy; never bright */
  --tfelt-hi:#6b2a31; --tfelt-mid:#521d25; --tfelt-lo:#351118; --tfelt-edge:#1f070b; --tfelt-vig:#000b; --tfelt-grain:.10;
  --tfelt-mark:#ffffff1a;
  --tfelt-rail-a:#4a3121; --tfelt-rail-b:#26170d; --tfelt-rail-c:#140b05;  /* espresso wood: a touch darker than live so it doesn't go muddy */
  --tfelt-rim-in:#c9a24a33;
  --tfelt-ft-ring:#FFC83D; --tfelt-ft-glow:#E8B923d9; --tfelt-ft-glow2:#E8B92360;
}
#tableWrap[data-tfelt="grey"]{         /* Slate Grey: cool, mid-dark */
  --tfelt-hi:#646b72; --tfelt-mid:#4b5259; --tfelt-lo:#2f3439; --tfelt-edge:#1a1d20; --tfelt-vig:#000a; --tfelt-grain:.12;
  --tfelt-mark:#ffffff1c;
  --tfelt-bet-bg:#00000080; --tfelt-pot-bg:#0009;   /* slightly darker pills: grey is the lightest felt */
  --tfelt-ft-ring:#FFC83D; --tfelt-ft-glow:#E8B923e0; --tfelt-ft-glow2:#E8B92366;
}
#tableWrap[data-tfelt="black"]{        /* Midnight Black: lifted charcoal, black leather rail, faint gold rim */
  --tfelt-hi:#34373c; --tfelt-mid:#24262a; --tfelt-lo:#16171a; --tfelt-edge:#0a0a0b; --tfelt-vig:#000c; --tfelt-grain:.16;
  --tfelt-mark:#E8B33A24;                                   /* gold-tinted watermark reads better than white on charcoal */
  --tfelt-rail-a:#2e2e31; --tfelt-rail-b:#171719; --tfelt-rail-c:#0b0b0c;
  --tfelt-rim:#c9a24aa6; --tfelt-rim-in:#E8B33A66;
  --tfelt-bet-ring:#ffffff1f; --tfelt-chip:drop-shadow(0 1px 1px #000) drop-shadow(0 0 1px #ffffff55);   /* dark chips keep an edge */
  --tfelt-muck:.92;
  --tfelt-ft-ring:#FFD45A; --tfelt-ft-glow:#E8B923e6; --tfelt-ft-glow2:#E8B92370;
}

/* ---- wiring (only active once felt.js sets data-tfelt; green resolves to the live values above) ---- */
#tableWrap[data-tfelt] .rail{background:radial-gradient(ellipse at 50% 30%,var(--tfelt-rail-a),var(--tfelt-rail-b) 70%,var(--tfelt-rail-c));
  box-shadow:0 10px 30px #000c,0 0 0 1px var(--tfelt-rim),inset 0 2px 3px #ffffff22,inset 0 -4px 10px #0009}
#tableWrap[data-tfelt] .felt{background:radial-gradient(ellipse at 50% 45%,var(--tfelt-hi) 0%,var(--tfelt-mid) 45%,var(--tfelt-lo) 100%);
  box-shadow:inset 0 0 25px var(--tfelt-vig),inset 0 0 0 2px var(--tfelt-edge),0 0 0 1px var(--tfelt-rim-in)}
/* felt texture: fine fibre noise, clipped to the oval (no image file) */
#tableWrap[data-tfelt] .felt::before{content:'';position:absolute;inset:0;border-radius:50%;pointer-events:none;opacity:var(--tfelt-grain);mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.4 -.2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E")}
#tableWrap[data-tfelt="green"] .felt::before{content:none}   /* green = live: no texture layer at all (keeps rendering pixel-identical) */
#tableWrap[data-tfelt] .felt::after{color:var(--tfelt-mark)!important}
#tableWrap[data-tfelt] .bet{background:var(--tfelt-bet-bg);color:var(--tfelt-bet-fg);box-shadow:0 0 0 1px var(--tfelt-bet-ring);text-shadow:var(--tfelt-bet-sh)}
#tableWrap[data-tfelt] #pot:not(.multi){background:var(--tfelt-pot-bg);color:var(--tfelt-pot-fg);text-shadow:var(--tfelt-pot-sh)}
#tableWrap[data-tfelt] .stack img{filter:var(--tfelt-chip)}
#tableWrap[data-tfelt] .fc-muck{opacity:var(--tfelt-muck)}
#tableWrap[data-tfelt].fx-final .rail{box-shadow:0 10px 30px #000c,0 0 0 4px var(--tfelt-ft-ring),0 0 48px var(--tfelt-ft-glow),0 0 120px var(--tfelt-ft-glow2),inset 0 2px 3px #ffffff22,inset 0 -4px 10px #0009}
#tableWrap[data-tfelt].fx-final .felt{box-shadow:inset 0 0 25px var(--tfelt-vig),inset 0 0 0 2px var(--tfelt-edge),0 0 0 1px var(--tfelt-ft-ring)}

/* ---- picker: 4 swatch chips ---- */
.tfelt-sec .tfelt-hd{display:flex;align-items:center;justify-content:space-between;margin:0 0 8px}
.tfelt-sec .tfelt-hd b{font:400 14px/1 'Archivo Black',Impact,sans-serif;letter-spacing:1px;color:#E8B33A}
.tfelt-row{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.tfelt-chip{all:unset;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;align-items:center;gap:5px;padding:7px 4px 6px;border-radius:10px;
  background:#0f0a04;border:1px solid #6b5426;text-align:center;transition:border-color .15s,box-shadow .15s}
.tfelt-chip:hover,.tfelt-chip:focus-visible{border-color:#c9a24a}
.tfelt-chip i{display:block;width:100%;max-width:92px;aspect-ratio:16/10;border-radius:50%/50%;
  background:radial-gradient(ellipse at 50% 45%,var(--h) 0%,var(--m) 45%,var(--l) 100%);
  box-shadow:0 0 0 4px var(--r),0 0 0 5px var(--rim,#0000),inset 0 0 8px #000a,0 2px 6px #000a;margin:5px 0 2px}
.tfelt-chip span{font-size:11px;font-weight:700;color:#e9dcc0;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;font-family:Verdana,Tahoma,system-ui,sans-serif}
.tfelt-chip.tfelt-sel{border:2px solid #F2C14E;padding:6px 3px 5px;box-shadow:0 0 0 2px #E8B33A55,0 0 10px #E8B33A66}
.tfelt-chip.tfelt-sel span{color:#F2C14E}
.tfelt-chip{position:relative}
.tfelt-chip.tfelt-sel::after{content:'✓';position:absolute;top:4px;right:5px;width:16px;height:16px;border-radius:50%;background:#F2C14E;color:#111;font:900 10px/16px Verdana,sans-serif;text-align:center;box-shadow:0 1px 3px #000a}
.tfelt-ft{font-size:10px;opacity:.65;margin-top:6px;color:#f3ead7;font-family:Verdana,Tahoma,system-ui,sans-serif}
/* inside the PBLBg modal: felt row above the background tiles */
.tbg-panel .tfelt-sec{margin:0 0 12px;padding:0 0 12px;border-bottom:1px solid #6b542699}
/* inside the My Dojo card */
.mdj-sec .tfelt-row{gap:6px}.mdj-sec .tfelt-chip span{font-size:10px}
@media (max-width:480px){.tfelt-row{gap:6px}.tfelt-chip{padding:6px 2px 5px}.tfelt-chip span{font-size:10px;white-space:normal;line-height:1.15;min-height:2.3em;display:flex;align-items:center}}
.tfelt-warn{display:none;margin-top:7px;font-size:11px;line-height:1.35;color:#ffcf7a;background:#2a1a08;border:1px solid #c9a24a66;border-radius:8px;padding:5px 8px;font-family:Verdana,Tahoma,system-ui,sans-serif}
.tfelt-warn.on{display:block}
/* replay panel mini-felt (index.html L339, outside #tableWrap): follows the felt via html[data-tfelt] */
html[data-tfelt="red"] #rp .rpfelt{background:radial-gradient(ellipse at center,#5e232b,#3d141b)}
html[data-tfelt="grey"] #rp .rpfelt{background:radial-gradient(ellipse at center,#565d64,#363b40)}
html[data-tfelt="black"] #rp .rpfelt{background:radial-gradient(ellipse at center,#2a2c30,#18191c);box-shadow:inset 0 0 0 1px #E8B33A55}

/* ---- earth tones (2026-10-20) ---- */
#tableWrap[data-tfelt="terracotta"]{--tfelt-hi:#b0613f;--tfelt-mid:#8e4a2e;--tfelt-lo:#5e2f1c;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;--tfelt-bet-bg:#00000085;--tfelt-pot-bg:#0009;}
#tableWrap[data-tfelt="ochre"]{--tfelt-hi:#b8913a;--tfelt-mid:#94722a;--tfelt-lo:#624a19;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;--tfelt-bet-bg:#00000085;--tfelt-pot-bg:#0009;}
#tableWrap[data-tfelt="olive"]{--tfelt-hi:#7a7f3c;--tfelt-mid:#5d622b;--tfelt-lo:#3c401a;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;}
#tableWrap[data-tfelt="moss"]{--tfelt-hi:#5f7a45;--tfelt-mid:#465d32;--tfelt-lo:#2c3c1f;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;}
#tableWrap[data-tfelt="clay"]{--tfelt-hi:#a0705a;--tfelt-mid:#7f5643;--tfelt-lo:#53372a;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;--tfelt-bet-bg:#00000085;--tfelt-pot-bg:#0009;}
#tableWrap[data-tfelt="sand"]{--tfelt-hi:#b9a27c;--tfelt-mid:#978260;--tfelt-lo:#65553d;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;--tfelt-bet-bg:#00000085;--tfelt-pot-bg:#0009;}
#tableWrap[data-tfelt="walnut"]{--tfelt-hi:#6e4b33;--tfelt-mid:#543823;--tfelt-lo:#362314;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;--tfelt-rail-a:#4a3121;--tfelt-rail-b:#26170d;--tfelt-rail-c:#140b05;}
#tableWrap[data-tfelt="sage"]{--tfelt-hi:#869a80;--tfelt-mid:#687c63;--tfelt-lo:#465542;--tfelt-edge:#00000066;--tfelt-vig:#000b;--tfelt-grain:.12;--tfelt-mark:#ffffff1c;--tfelt-bet-bg:#00000085;--tfelt-pot-bg:#0009;}

#tableWrap[data-tfelt="matte"]{--tfelt-hi:#1c1d1f;--tfelt-mid:#121314;--tfelt-lo:#08080a;--tfelt-edge:#000;--tfelt-vig:#000d;--tfelt-grain:.22;--tfelt-mark:#ffffff12;--tfelt-rail-a:#1a1a1c;--tfelt-rail-b:#0d0d0e;--tfelt-rail-c:#050505;}
html[data-tfelt="matte"] #rp .rpfelt{background:radial-gradient(ellipse at center,#1c1d1f,#08080a)}
