/* Each finish has its own face, edge, back and response to the light. */
[data-tiles="jade"] {
  --tile-face:radial-gradient(ellipse at 20% 4%,#fffef6 2%,transparent 50%),linear-gradient(116deg,#f9f3de,#f2ebd3 70%,#dfd2ac);
  --tile-polish:linear-gradient(120deg,#ffffffe0,transparent 22%,transparent 78%,#b6a57135);
  --tile-band:linear-gradient(180deg,#c9c6a8 0%,#f9f0d8 19%,#86b29e 22%,#477e68 46%,#315d4e 80%,#91a891 94%,#293c31);
  --tile-back:radial-gradient(ellipse at 27% 15%,#9cc3a268 0%,transparent 59%),linear-gradient(145deg,#548a70,#33664e 65%,#214331);
  --back-color:#4e8065; --back-glint:#bbcfac; --edge-light:#fff6e0; --edge-dark:#a29873; --rim:#d1ccac;
}
[data-tiles="bamboo"] {
  --tile-face:repeating-linear-gradient(101deg,#a8874f08 0 1px,transparent 1.5px 6px),radial-gradient(ellipse at 26% 16%,#fff1d4,transparent 65%),linear-gradient(112deg,#f5e6bf,#e9d4a8 76%,#cfb384);
  --tile-polish:linear-gradient(120deg,#fff8dd8c,transparent 28%,transparent 80%,#9272413d);
  --tile-band:linear-gradient(180deg,#fff0c9 1%,#a0926a 24%,transparent 30%,#73421b73 86%,#4a311b),repeating-linear-gradient(97deg,#b78755 0 3px,#ce9e64 4px 10px) center / 64px;
  --tile-back:linear-gradient(120deg,#ffdf9866,transparent 55%,#61351245),repeating-linear-gradient(97deg,#b78755 0 3px,#ce9e64 4px 10px) center / 90px;
  --back-color:#b07a3d; --back-glint:#f1cd8a; --edge-light:#fff0ce; --edge-dark:#a88c5f; --rim:#ddc393;
}
[data-tiles="ice"] {
  --tile-face:linear-gradient(117deg,#ffffffd9 3%,#ffffff20 19%,transparent 49%,#d0f4ffac 82%,#fff9 90%),radial-gradient(ellipse at 45% 40%,#eff9f8 29%,#e0f3f4 72%,#9acbda);
  --tile-polish:linear-gradient(122deg,#fffd,transparent 22%,transparent 57%,#fff7 59%,transparent 66%,#a7d8ec77);
  --tile-band:linear-gradient(116deg,transparent 20%,#ebffffb8 26%,transparent 32%,transparent 68%,#ddffffd0 72%,transparent 79%),linear-gradient(#c8fbff,#89d1e6 22%,#3d92b7 43%,#22657e 65%,#a6eff8 84%,#3695ae);
  --tile-back:linear-gradient(120deg,#e9ffffcb 0%,#ddfbff29 13%,transparent 34%,#d9faff8a 49%,transparent 64%),linear-gradient(147deg,#83d4e7,#2981a4 60%,#18566e);
  --back-color:#65bdd4; --back-glint:#d9fcff; --edge-light:#f3ffff; --edge-dark:#77a7b6; --rim:#b8e2e4;
}
[data-surface="felt"] {
  --surface-base:#21543e;
  --surface-texture:linear-gradient(125deg,#36664fba,#143a2bc0),linear-gradient(132deg,#528c77,#356e62);
  --surface-grain:190px; --rail-shade:linear-gradient(140deg,#a5784850,#231a1470 50%,#ba8d5448);
  --stitch:#c7c68f52;
}
[data-surface="linen"] {
  --surface-base:#263d55;
  --surface-texture:linear-gradient(130deg,#364f65b8,#182937cb),linear-gradient(132deg,#7295ae,#4e6985);
  --surface-grain:210px; --rail-shade:linear-gradient(140deg,#4b504cc2,#15191ce0 50%,#5a5d55ac);
  --stitch:#afc5c46b;
}
[data-surface="leather"] {
  --surface-base:#67442f;
  --surface-texture:linear-gradient(130deg,#65432dbd,#38261ccf),linear-gradient(132deg,#b28767,#916a51);
  --surface-grain:245px; --rail-shade:linear-gradient(140deg,#9e6c4580,#45241caa 50%,#82512e7a);
  --stitch:#f3d39a82;
}

html .tile, html .hand .tile, html .river-cell .tile, html .meldgroup .tile {
  position:relative; isolation:isolate; background:var(--tile-face);
  border:1px solid var(--edge-dark); border-top-color:var(--edge-light); border-left-color:var(--edge-light);
  padding:1px 1px var(--depth,4px); box-shadow:inset 1px 2px 1px #fff9,inset -1px -2px 2px #4a391b29,0 1px 0 #293b3280,1px 3px 4px #08100d63;
}
html .tile::before {
  content:""; position:absolute; z-index:1; pointer-events:none; left:0; right:0; bottom:0; height:var(--depth,4px);
  border-radius:0 0 3px 3px; background:var(--tile-band); box-shadow:inset 0 1px 0 #f6edcb4a;
}
html .tile::after {
  content:""; position:absolute; pointer-events:none; inset:1px 1px calc(var(--depth,4px) + 1px);
  background:var(--tile-polish); opacity:.48; border-radius:inherit; z-index:0;
}
html .tile.facedown {background:var(--tile-back);box-shadow:inset 0 0 0 1px var(--back-glint),0 3px 4px #06181180}
html .tile.facedown::before {background:linear-gradient(var(--rim),var(--edge-light) 42%,var(--edge-dark))}
.tile-art {position:relative; z-index:1; filter:drop-shadow(0 .8px .25px #fffbe0)}
.table-frame {
  background:var(--rail-shade),var(--wood),#553b28;
}
.playmat,.material-stage,.cloth-chip {
  background-color:var(--surface-base); background-image:radial-gradient(ellipse at 45% 37%,#c5d4a412,transparent 57%,#080e0a69 111%),var(--surface-texture);
  background-size:cover,cover,var(--surface-grain); background-position:center;
}
.playmat {
  height:clamp(400px,53vh,565px); isolation:isolate;
  --wall-width:clamp(270px,54%,540px); --wall-top:88px; --wall-bottom:45px; --wall-depth:clamp(14px,1.8vw,24px);
  --face:clamp(17px,1.58vw,26px); --dial:clamp(65px,6vw,88px);
  box-shadow:inset 0 3px 12px #07120ecc,inset 0 0 0 4px #101b142b,inset 0 0 0 5px #cfbd8d3a;
}
.playmat:before {border:1px solid var(--stitch)}
[data-surface="leather"] .playmat:before,[data-surface="leather"] .material-stage:before {border:1px dashed var(--stitch)}
.rack {background:linear-gradient(0deg,#19201aca,#2d382dc9),var(--wood)}
.rack .hand {--size:clamp(39px,4.3vw,59px); height:auto; min-height:calc(var(--size)*1.40 + 28px); padding:16px 0 9px; gap:clamp(2px,.26vw,5px)}
html .hand .tile {--depth:9px; flex:0 1 var(--size); width:var(--size); max-width:var(--size); height:auto; aspect-ratio: .72; border-radius:7px 7px 5px 5px;
  box-shadow:inset 2px 2px 1px #fffc,inset -2px -2px 2px #6b52262e,0 1px 0 #2a3129,1px 4px 2px #0c1817b5,2px 8px 7px #0a0f0c80;
}
html .hand .tile:hover:not(:disabled),html .hand .tile.selected {box-shadow:inset 1px 1px 1px #fffc,1px 3px 0 #3d4134,2px 9px 8px #080c0b99}
html .hand .tile:disabled {filter:none}
.hand .tile.claim-glow .draw-label {display:none}
.hand .tile .draw-label,.hand .tile .claim-tag {z-index:3}
.rack .youline {gap:8px}
.rack-top .melds {margin-left:auto}
.arena {
  left:50%; right:auto; width:calc(var(--wall-width) - 2 * var(--wall-depth) - 12px); transform:translateX(-50%);
  top:calc(var(--wall-top) + var(--wall-depth) + 3px); bottom:calc(var(--wall-bottom) + var(--wall-depth) + 5px);
  --dial:inherit; --face:inherit; --h:calc(var(--face)*1.30);
}
.lane {gap:2px; padding:1px 2px 3px; scrollbar-width:none}
.lane::-webkit-scrollbar {display:none}
.lane-north,.lane-south {grid-template-columns:repeat(6,var(--face));max-height:calc(50% - var(--dial)/2 - 7px)}
.lane-north {bottom:calc(50% + var(--dial)/2 + 4px)}
.lane-south {top:calc(50% + var(--dial)/2 + 4px)}
.lane-east,.lane-west {grid-template-columns:repeat(3,var(--face));max-height:calc(100% - 4px)}
.lane-east {left:calc(50% + var(--dial)/2 + 6px)}
.lane-west {right:calc(50% + var(--dial)/2 + 6px)}
.lane:empty {visibility:hidden}
.river-cell .tile {--depth:3px}
.river-cell.last-drop .tile {outline:2px solid #ffd488; outline-offset:0}
.cut-info {position:absolute;top:20px;left:25px;display:flex;align-items:center;gap:8px;color:#ddd8bf;font-size:10px}
.dice {display:flex;align-items:center;gap:4px}
.die {width:18px;height:18px;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);padding:3px;gap:1px;background:linear-gradient(125deg,#fff6df,#d9c9a7);border-radius:4px;box-shadow:inset 1px 1px 0 #ffffe9,0 2px 0 #a19479,1px 4px 3px #201e1980;transform:rotate(-9deg)}
.die+.die {transform:rotate(12deg)}
.die b {border-radius:50%;background:#354139;box-shadow:inset 0 .6px 1px #171911}
.die.d1 b,.die.d4 b {background:#a13a2b}
#opening {position:absolute;right:24px;top:18px;z-index:5;display:flex;align-items:center;gap:9px;color:#e4d6ae;font-size:11px}
#opening[hidden] {display:none}
#skipDeal {padding:4px 8px;font-size:10px;color:#ede4cd;background:#17271d91;border:1px solid #c8b98c77;border-radius:4px}
.wall-ring {position:absolute;left:50%;transform:translateX(-50%);top:var(--wall-top);bottom:var(--wall-bottom);width:var(--wall-width);pointer-events:none}
.wall-side {position:absolute;display:flex;gap:1px;--rise:4px}
.wall-south,.wall-north {height:var(--wall-depth);left:var(--wall-depth);right:var(--wall-depth)}
.wall-west,.wall-east {width:var(--wall-depth);top:var(--wall-depth);bottom:var(--wall-depth)}
.wall-south {bottom:0;flex-direction:row-reverse;--slide-x:2px;--slide-y:22px}
.wall-north {top:0;--slide-x:-2px;--slide-y:-22px}
.wall-west {left:0;flex-direction:column-reverse;--slide-x:-28px;--slide-y:2px}
.wall-east {right:0;flex-direction:column;--slide-x:28px;--slide-y:-2px}
.wall-stack {position:relative;display:block;flex:1 1 0;min-width:0;min-height:0}
.wall-tile,.deal-packet i,.tile-chip i,.tile-chip b {background:var(--tile-back);border:1px solid var(--back-glint);border-radius:3px;
  box-shadow:inset 0 0 0 1px #14291d25,0 1px 0 var(--rim),0 2px 0 var(--edge-light),0 3px 0 var(--edge-dark),1px 4px 2px #19241888}
.wall-tile {position:absolute;inset:0;display:block}
.wall-tile.upper {top:calc(0px - var(--rise));bottom:var(--rise);z-index:1}
.wall-stack[data-height="0"] .wall-tile,.wall-stack[data-height="1"] .upper {visibility:hidden}
.wall-side .wall-stack .wall-tile.gripped {visibility:visible}
.wall-stack.wall-head .wall-tile {outline:1px solid #f0ce89;outline-offset:0}
.building-wall .wall-tile {animation:wall-build .32s cubic-bezier(.16,.72,.26,1.12) backwards;animation-delay:calc(var(--order)*7ms)}
.building-wall .wall-tile.upper {animation-delay:calc(100ms + var(--order)*7ms)}
@keyframes wall-build {0%{transform:translate(var(--slide-x),var(--slide-y)) rotate(-5deg);opacity:0} 65%{opacity:1} 100%{transform:none;opacity:1}}
.building-wall .die {animation:dice-clatter .47s ease-out both}
@keyframes dice-clatter {from{opacity:0;transform:translate(24px,-9px) rotate(-135deg)}to{opacity:1}}
.opening-hand .hand .tile,.opening-hand .hidden-hand i {visibility:hidden}
.opening-hand .hand .tile.dealt,.opening-hand .hidden-hand i.dealt {visibility:visible}
.opening-hand .hand .tile {background:var(--tile-back)}
.opening-hand .hand .tile-art,.opening-hand .draw-label,.opening-hand #status,.opening-hand .seat .idplate small,.opening-hand #handStatus {visibility:hidden}
.hidden-hand i {background:var(--tile-back);border-color:var(--back-glint);box-shadow:0 2px 0 var(--rim),1px 3px 2px #18291dcc}
.deal-packet {position:absolute;left:0;top:0;pointer-events:none;filter:drop-shadow(1px 4px 3px #101a1480)}
.deal-packet i {position:absolute;width:11px;height:16px;left:-9px;top:-8px}
.deal-packet i:nth-child(even){left:3px}.deal-packet i:nth-child(n+3){top:-12px}
.rack.receiving .fresh,.seat.receiving .hidden-hand i:last-child,.river-cell.landing>.tile {opacity:0}
.travel-tile {transform-style:preserve-3d;transform-origin:0 0}
.travel-tile>.tile {position:absolute;top:0;left:0;transform:translate(-50%,-50%);width:100%;height:100%;backface-visibility:hidden}
.travel-tile>.flying-back {transform:translate(-50%,-50%) rotateY(180deg)}

#appearance {width:min(540px,93vw);padding:22px 24px 18px;color:#26382f;background:linear-gradient(135deg,#faf6e9,#e7e1cf);border:1px solid #bdac88;border-radius:15px}
#appearance .dialoghead {margin-bottom:13px}
#appearance .dialoghead h2 {font:700 25px var(--serif);letter-spacing:1px}
#appearance .dialoghead button {width:29px;height:29px;padding:0;border-radius:50%;color:#5a6557;background:#dcd8c7}
.material-stage {height:141px;position:relative;isolation:isolate;display:grid;place-items:center;border:1px solid #877653;border-radius:7px;box-shadow:inset 0 2px 9px #10180ecc}
.material-stage:before {content:"";position:absolute;inset:8px;border:1px solid var(--stitch);border-radius:3px;pointer-events:none}
.sample-rack {display:flex;align-items:center;gap:5px;perspective:600px;transform:rotate(-3deg)}
.sample-rack .tile {--depth:10px;width:51px;height:72px;max-width:none;transform:rotateX(15deg) rotateY(-8deg);box-shadow:2px 4px 0 #383d2c99,5px 10px 5px #0b140c7a}
.sample-rack .sample-back {margin-left:8px;transform:rotate(13deg) rotateX(30deg);--depth:8px}
.material-options {padding:0;border:0;margin:14px 0}
.material-options legend {padding:0;margin-bottom:6px;font:600 14px "Microsoft YaHei",sans-serif}
.choice-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.material-choice {position:relative;cursor:pointer}
.material-choice input {position:absolute;opacity:0;width:1px;height:1px}
.choice-card {position:relative;display:grid;grid-template-columns:32px 1fr;align-content:center;column-gap:7px;min-height:57px;padding:7px;border:1px solid #c8c3af;border-radius:6px;background:#fffdf53d}
.choice-name {font-size:12px;font-weight:650}.choice-card small {font-size:9px;color:#657060;margin-top:3px}
.swatch {grid-row:span 2;align-self:center;display:grid;place-items:center}
.tile-chip {position:relative;width:25px;height:30px;transform:rotate(-10deg)}
.tile-chip i,.tile-chip b {position:absolute;width:18px;height:25px;top:0;left:1px}
.tile-chip b {top:4px;left:7px;background:var(--tile-face);border-color:var(--edge-dark);border-bottom:4px solid var(--back-color)}
.cloth-chip {width:27px;height:28px;border-radius:4px;border:1px solid #11221838;background-size:cover,cover,90px;box-shadow:inset 0 0 0 1px #fff2}
.material-choice input:checked+.choice-card {border-color:#668169;background:#dce5d5;box-shadow:inset 0 0 0 1px #718671}
.material-choice input:focus-visible+.choice-card {outline:3px solid #ab7c32;outline-offset:2px}
.material-footer {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:15px}
#materialStatus {font-size:11px;color:#65745e}
.material-footer button {padding:7px 16px}
#appearanceBtn {color:#efd8a2;border-color:#b99c6059}

@media (min-width:621px) {
 .seat-north {top:14px;display:grid;grid-template-columns:auto auto;column-gap:10px;align-items:center;max-width:none}
 .seat-north .hidden-hand,.seat-north .public-hand {grid-column:span 2}
 .seat-north .exposed {position:absolute;left:calc(100% + 9px);top:0;width:max-content;max-width:105px}
}
@media (min-width:891px) and (max-height:800px) {
 .club-header {height:60px}
 .sessionline {min-height:38px}
 .playmat {height:clamp(332px,calc(100vh - 305px),405px);--wall-top:78px}
 .rack .hand {--size:clamp(36px,3.9vw,52px);padding-top:12px}
}
@media (max-width:1100px) { .playmat{--wall-width:60%;--wall-depth:15px;--face:17px;--dial:64px}.seat-west{left:12px}.seat-east{right:12px} }
@media (max-width:890px) { .playmat{height:clamp(358px,47vh,470px);--wall-width:62%;--wall-top:85px;--wall-bottom:37px}.rack .hand{--size:clamp(32px,5.9vw,52px)} }
@media (max-width:620px) {
 .playmat{height:377px;--wall-width:88%;--wall-top:132px;--wall-bottom:29px;--wall-depth:13px;--face:15px;--dial:57px}
 .seat-east,.seat-west{top:41px}.seat-north{top:16px}.cut-info{top:13px;left:14px;gap:3px}.die{width:13px;height:13px;padding:2px}
 #cutLabel{display:none}#opening{top:auto;bottom:4px;right:12px}#opening button{padding:1px 5px}
 .rack .hand{--size:clamp(18px,5.6vw,31px);min-height:61px;padding:11px 0 7px}
 html .hand .tile{--depth:5px;border-radius:4px}
 .arena{left:50%;right:auto}.lane-east,.lane-west{grid-template-columns:repeat(3,var(--face))}
 .cut-info .dice{gap:2px}.wall-side{--rise:3px}
 .choice-card{display:flex;flex-direction:column;align-items:flex-start;min-height:60px;padding:7px}.choice-card .swatch{display:none}
 #appearance{padding:16px}.material-stage{height:107px}
 .material-options{margin:11px 0}.choice-card small{font-size:9px}.material-choice .choice-name{font-size:11px}
}

