/* ソリティア — styles (solitaire/app.css) */
:root{
  --bg:#141517; --bg2:#191a1d; --panel:#1d1e21; --panel2:#26282c; --line:rgba(255,255,255,.1);
  --text:#eee8d9; --muted:#a7a9ad; --accent:#dcbb6c; --accent2:#a8873f; --ok:#8fe3b8; --ng:#ff9b90;
  --red:#c51f30; --black:#1b1c22; --blue:#1f5fbf; --green:#1c7a3c;
  --felt1:#1f6a45; --felt2:#0f3d27; --felt-line:rgba(236,210,146,.34); --felt-ink:rgba(236,210,146,.17); --rail:22px;
  --mt:.32s;
  font-family:'Zen Kaku Gothic New','Noto Sans Devanagari','Noto Sans Arabic',system-ui,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:radial-gradient(1200px 700px at 30% -10%,#2a2c30 0%,transparent 60%),var(--bg);color:var(--text);min-height:100%}
body{overflow-x:hidden;-webkit-tap-highlight-color:transparent}
button{font-family:inherit}
svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.hidden{display:none!important}

/* ---------- felt (table designs) ---------- */
html[data-felt=green]{--felt1:#1d7a4c;--felt2:#073020}
html[data-felt=blue]{--felt1:#235c97;--felt2:#0f2a4d}
html[data-felt=wine]{--felt1:#7a2434;--felt2:#3b0e18}
html[data-felt=charcoal]{--felt1:#3a3f45;--felt2:#16191c}
html[data-felt=teal]{--felt1:#1d7474;--felt2:#0b3535}
html[data-felt=purple]{--felt1:#56357f;--felt2:#24123d}
html[data-felt=mocha]{--felt1:#6e4a2f;--felt2:#2e1b0f}
html[data-felt=linen]{--felt1:#efe6d2;--felt2:#d6c7a6;--felt-line:rgba(70,50,20,.3);--felt-ink:rgba(90,60,20,.16)}
.felt-bg{background:
  radial-gradient(70% 60% at 50% 38%, rgba(255,255,255,.10), rgba(255,255,255,0) 70%),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M0 0L6 6M6 0L0 6' stroke='%23000' stroke-opacity='.10' stroke-width='.6'/%3E%3C/svg%3E"),
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .11 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
  radial-gradient(120% 95% at 50% 30%, var(--felt1), var(--felt2))}

/* ---------- layout ---------- */
.app{display:flex;flex-direction:column;min-height:100vh}
.brand{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px max(12px,env(safe-area-inset-left)) 4px}
.brand-l{display:flex;flex-direction:column;min-width:0}
.brand-l .series{font-size:11px;color:var(--muted);text-decoration:none;letter-spacing:.06em}
.brand h1{margin:0;font-family:'Shippori Mincho B1','Cormorant Garamond',serif;font-weight:800;font-size:22px;line-height:1.1;letter-spacing:.04em;color:var(--text);display:flex;align-items:baseline;gap:8px;white-space:nowrap}
.brand h1 small{font-family:'Cormorant Garamond',serif;font-style:italic;font-weight:600;font-size:14px;color:var(--accent);letter-spacing:.06em}
.brand-r{display:flex;align-items:center;gap:6px;flex:none}
.snd{width:34px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:9px;border:1px solid var(--line);background:rgba(0,0,0,.22);color:var(--muted);cursor:pointer;padding:0}
.snd:hover{color:var(--text)}
.snd svg{width:18px;height:18px}
#btnSound .off-x{display:none}#btnSound:not(.on) .off-x{display:block}#btnSound:not(.on) .on-w{display:none}
#langSel{background:rgba(0,0,0,.25);color:var(--muted);border:1px solid var(--line);border-radius:9px;font:inherit;font-size:12px;height:32px;padding:0 6px;cursor:pointer}
.controls{display:flex;gap:6px;padding:4px max(10px,env(safe-area-inset-left)) 8px}
.btn{flex:1 1 0;min-width:0;display:inline-flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;height:50px;border-radius:12px;border:1px solid var(--line);background:linear-gradient(180deg,#27292d,#1c1d20);color:var(--text);cursor:pointer;font-size:11.5px;padding:0 4px}
.btn svg{width:19px;height:19px}
.btn span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.btn:hover{border-color:rgba(220,187,108,.45)}
.btn:disabled{opacity:.4;cursor:default}
.btn.primary{background:linear-gradient(180deg,#e2c477,#a8873f);color:#1d1606;border-color:transparent;font-weight:700}
.stage{flex:1;display:flex;flex-direction:column;gap:8px;padding:0 max(8px,env(safe-area-inset-left)) 16px}
.board-wrap{position:relative;height:calc(100svh - var(--top-h, 120px) - 64px);min-height:240px;border-radius:calc(var(--rail) + 16px);overflow:hidden;
  background:radial-gradient(140% 120% at 50% 0%,#4a2a1c 0%,#2a150d 45%,#140906 100%);
  box-shadow:inset 0 1px 0 rgba(255,220,180,.25),inset 0 -2px 6px rgba(0,0,0,.6),0 18px 40px rgba(0,0,0,.55),0 2px 0 #0a0503}
.board-wrap::before{content:'';position:absolute;inset:4px;border-radius:calc(var(--rail) + 12px);pointer-events:none;
  background:repeating-linear-gradient(90deg,rgba(255,240,220,.025) 0 2px,transparent 2px 5px);
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.35)}
.board-wrap::after{content:'';position:absolute;inset:calc(var(--rail) * .5 - 2px);border-radius:calc(var(--rail) * .5 + 16px);pointer-events:none;border:1.5px dashed rgba(230,196,128,.35)}
.board-wrap > .felt{position:absolute;inset:var(--rail);border-radius:16px;overflow:hidden;
  box-shadow:inset 0 0 0 2px #c9a24e,inset 0 0 0 3px rgba(0,0,0,.45),inset 0 0 0 5px rgba(201,162,78,.35),inset 0 14px 40px rgba(0,0,0,.45),inset 0 0 120px rgba(0,0,0,.45)}
.felt-print{position:absolute;left:50%;bottom:4%;width:min(56%,620px);transform:translateX(-50%);color:var(--felt-ink);pointer-events:none}
.board-wrap > .table{inset:var(--rail);border-radius:16px}
.table{position:absolute;inset:0}
.infobar{display:flex;gap:6px 14px;justify-content:center;align-items:center;flex-wrap:wrap;color:var(--muted)}
.sg{display:inline-flex;align-items:baseline;gap:2px;white-space:nowrap}
.sg b{font-family:'Shippori Mincho B1',serif;font-size:14px;font-weight:600;color:var(--accent);letter-spacing:.08em}
.sg em{font-style:normal;font-size:11px;color:var(--muted);letter-spacing:.06em}
.sg em::before{content:'・'}
.ss{display:inline-flex;align-items:baseline;gap:6px;white-space:nowrap}
.ss small{font-size:11.5px;color:var(--muted);letter-spacing:.06em}
.ss b{font-family:'JetBrains Mono',monospace;font-weight:700;font-size:20px;color:var(--text);font-variant-numeric:tabular-nums}
.ss.tm b{min-width:3.4em}
.sx{font-size:12px;color:var(--muted);white-space:nowrap}
.sd{border:1px solid var(--line);background:rgba(255,255,255,.05);color:var(--muted);border-radius:8px;padding:4px 9px;font:500 12px 'JetBrains Mono',monospace;cursor:pointer;white-space:nowrap}
.sd:hover{color:var(--text);border-color:rgba(220,187,108,.5)}
.sdiv{width:1px;align-self:stretch;margin:8px 4px;background:var(--line)}
.hb .hb-info{gap:16px!important;overflow:visible}
.hb .hb-info .sg b{font-size:14.5px;color:var(--accent)}
.hb .hb-info .ss b{font-size:22px}
.h3s{font-weight:400;color:var(--muted);letter-spacing:.02em;margin-inline-start:10px}
.side{display:flex;flex-direction:column;gap:10px}
.card{background:linear-gradient(180deg,var(--panel2),var(--panel));border:1px solid var(--line);border-radius:14px;padding:12px 14px}
.card h3{margin:0 0 8px;font-size:12px;letter-spacing:.12em;color:var(--accent);font-weight:700}
.g-title{display:flex;align-items:center;gap:10px}
.g-title b{font-family:'Shippori Mincho B1',serif;font-size:20px;letter-spacing:.04em}
.badge{display:inline-block;font-size:11px;padding:2px 9px;border-radius:99px;border:1px solid rgba(220,187,108,.5);color:var(--accent);white-space:nowrap}
.chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:8px}
.chips span{font-size:11.5px;padding:3px 8px;border-radius:7px;background:rgba(255,255,255,.05);color:var(--muted);border:1px solid var(--line)}
.deal-row{display:flex;align-items:center;gap:8px;margin-top:10px;font-size:12.5px;color:var(--muted)}
.deal-row code{font-family:'JetBrains Mono',monospace;color:var(--text);font-size:13px}
.deal-row .sp{flex:1}
.sbtn{border:1px solid var(--line);background:rgba(255,255,255,.05);color:var(--text);border-radius:8px;padding:5px 10px;font-size:12px;cursor:pointer;white-space:nowrap}
.sbtn:hover{border-color:rgba(220,187,108,.5)}
.sbtn.go{background:linear-gradient(180deg,#e2c477,#a8873f);color:#1d1606;border-color:transparent;font-weight:700}
.nums{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.nums div{background:rgba(0,0,0,.18);border:1px solid var(--line);border-radius:11px;padding:8px 10px;display:flex;flex-direction:column;gap:2px}
.nums small{font-size:11px;color:var(--muted)}
.nums b{font-family:'JetBrains Mono',monospace;font-size:19px;font-weight:700}
.nums .sub{grid-column:1/-1;font-size:12px;color:var(--muted);background:none;border:0;padding:0 2px;flex-direction:row;gap:12px}
.srow{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;text-align:center}
.srow div{display:flex;flex-direction:column;gap:2px}
.srow small{font-size:10.5px;color:var(--muted)}
.srow b{font-family:'JetBrains Mono',monospace;font-size:22px;font-weight:700}
.srow small{font-size:11.5px}
.daily-list{display:flex;flex-direction:column;gap:6px}
.dl-item{display:flex;align-items:center;gap:10px;padding:7px 9px;border-radius:10px;background:rgba(0,0,0,.16);border:1px solid var(--line)}
.dl-item .nm{flex:1;font-size:13.5px}
.dl-item .ok{color:var(--ok);font-size:12px;white-space:nowrap}
.dl-ico{width:26px;height:26px;flex:none}
.keys{font-size:13px;color:var(--muted);line-height:2}
.keys kbd{font-family:'JetBrains Mono',monospace;font-size:10.5px;padding:1px 5px;border-radius:5px;border:1px solid var(--line);background:rgba(255,255,255,.05);color:var(--text)}

/* auto complete / stuck */
.auto-btn{position:absolute;right:calc(var(--rail) + 14px);bottom:calc(var(--rail) + 14px);z-index:3000;display:flex;align-items:center;gap:8px;padding:11px 18px;border-radius:99px;border:0;background:linear-gradient(180deg,#e9cd84,#b08f45);color:#1d1606;font-weight:700;font-size:14px;cursor:pointer;box-shadow:0 8px 24px rgba(0,0,0,.4);animation:pulse 1.6s ease-in-out infinite}
.auto-btn svg{width:16px;height:16px;fill:currentColor;stroke:none}
@keyframes pulse{50%{transform:scale(1.05)}}
.stuck{position:absolute;left:50%;bottom:calc(var(--rail) + 16px);transform:translateX(-50%);z-index:3000;background:rgba(20,21,24,.95);border:1px solid rgba(220,187,108,.45);border-radius:14px;padding:12px 14px;text-align:center;width:min(440px,calc(100% - 24px));box-shadow:0 10px 30px rgba(0,0,0,.5)}
.stuck p{margin:0 0 10px;font-size:14px}
.stuck div{display:flex;gap:8px}

/* ---------- PC: board across the full width, the record / today's solitaire / shortcuts below it ---------- */
@media (hover:hover) and (pointer:fine) and (min-width:1040px) and (min-aspect-ratio:3/4){
  .app{min-height:0}
  .stage{gap:18px;padding:16px max(20px,env(safe-area-inset-right)) 28px max(20px,env(safe-area-inset-left))}
  .stage{--info-h:196px}
  .board-wrap{height:calc(100vh - var(--hb-h, 56px) - var(--info-h) - 46px);min-height:260px;--rail:26px}
  .infobar{display:none}
  .side{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;height:var(--info-h);align-items:stretch}
  .side .card{height:100%;min-height:0;overflow:hidden;padding:11px 14px}
  .side .card h3{margin-bottom:6px}
  .side .daily-list{gap:4px}.side .dl-item{padding:4px 8px}.side .dl-ico{width:22px;height:22px}
  .side .daily-list + .deal-row{margin-top:6px}
  .side .keys{line-height:1.85}
}
@media not all and (hover:hover) and (pointer:fine) and (min-width:1040px) and (min-aspect-ratio:3/4){
  .brand{order:-5}.controls{order:-4}
  .side .keys-card{display:none}
  :root{--rail:12px}
  .infobar{gap:4px 12px}.infobar .sg b{font-size:16px}.infobar .ss b{font-size:17px}.infobar .ss small{font-size:10.5px}
  .felt-print{width:78%}
}

/* ---------- cards ---------- */
.tbl{position:absolute;inset:0;user-select:none;-webkit-user-select:none;touch-action:none;overflow:hidden}
.tbl.main{background:none}
.tl{position:absolute;inset:0;pointer-events:none}
.tl .cd{pointer-events:auto}
.slot{position:absolute;left:0;top:0;width:var(--cw);height:var(--chh);border-radius:calc(var(--cw)*.09);border:1.5px dashed var(--felt-line);display:flex;align-items:center;justify-content:center;color:var(--felt-line);transition:box-shadow .2s}
.slot span{font-family:'Cormorant Garamond',serif;font-weight:700;font-size:calc(var(--cw)*.42)}
.slot svg{width:42%;height:42%;stroke-width:2.2}
.slot.k-stock{cursor:pointer;border-style:solid}
.slot.k-stock.dead svg{opacity:.25}
.slot.k-tab span{display:none}
.slot.k-found.stack{border-style:dashed}
.slot.ghost{border-color:transparent}
.slot.k-cell{background:rgba(0,0,0,.12)}
.cd{position:absolute;left:0;top:0;width:var(--cw);height:var(--chh);transition:transform var(--mt) cubic-bezier(.2,.8,.25,1),box-shadow .2s;will-change:transform;perspective:600px;cursor:grab}
.noanim .cd,.noanim .cd .in{transition:none!important}
.cd .in{position:absolute;inset:0;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;transition:transform .34s ease}
.cd.dn .in{transform:rotateY(180deg)}
.cd.dn{cursor:default}
.cd .fr,.cd .bk{position:absolute;inset:0;border-radius:calc(var(--cw)*.085);backface-visibility:hidden;-webkit-backface-visibility:hidden;overflow:hidden}
/* ink: deep lacquer red and soft black, like a printed casino deck */
.cd .fr.s1,.cd .fr.s2{color:#b0121f!important}
.cd .fr.s0,.cd .fr.s3{color:#15151a}
.cd .fr{background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .15 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),linear-gradient(165deg,#ffffff 0%,#fdfcf8 60%,#f6f2ea 100%);box-shadow:0 0 0 1px rgba(70,50,20,.32),inset 0 0 0 1px rgba(255,255,255,.9),0 1px 1px rgba(0,0,0,.22),0 3px 8px rgba(0,0,0,.18);color:var(--black)}
.cd .fr::before{content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(115deg,rgba(255,255,255,.55),rgba(255,255,255,0) 38%);pointer-events:none}
.cd .bk{transform:rotateY(180deg);box-shadow:0 0 0 1px rgba(0,0,0,.4),0 1px 3px rgba(0,0,0,.35)}
.cd .fr.s1,.cd .fr.s2{color:var(--red)}
.face-four .cd .fr.s2{color:var(--blue)}
.face-four .cd .fr.s3{color:var(--green)}
.cd svg{fill:currentColor;stroke:none}
.ix{position:absolute;left:2.6%;top:3%;display:flex;flex-direction:column;align-items:center;width:12.4%;line-height:1}
.ix b{font-family:'Bodoni Moda','Playfair Display','Didot',serif;font-optical-sizing:auto;font-variant-numeric:lining-nums;font-weight:600;font-size:calc(var(--cw)*.205);letter-spacing:-.05em;white-space:nowrap;transform:scaleX(.88);transform-origin:center top;text-shadow:0 .5px 0 rgba(255,255,255,.6)}
.ix svg{width:calc(var(--cw)*.115);height:calc(var(--cw)*.115);margin-top:1px}
.ix2{left:auto;top:auto;right:2.6%;bottom:3%;transform:rotate(180deg)}
.pp{position:absolute;left:32%;right:32%;top:17%;bottom:17%}
.pp i{position:absolute;width:calc(var(--cw)*.18);height:calc(var(--cw)*.18);transform:translate(-50%,-50%)}
.pp i.rv{transform:translate(-50%,-50%) rotate(180deg)}
.pp svg{width:100%;height:100%;display:block}
.ace{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
.ace svg{width:34%;height:34%}
.fr.s0 .ace svg{width:52%;height:52%;filter:drop-shadow(0 0 0 #000)}
.fc{position:absolute;left:15.3%;right:15.8%;top:11.5%;bottom:11.8%}
.fc img{display:block;width:100%;height:100%;object-fit:fill;-webkit-user-drag:none;user-select:none;pointer-events:none}
.ace.a0 .orn{position:absolute;width:74%;height:auto;aspect-ratio:1}
.ace.a0 > svg:not(.orn){width:46%;height:46%}
.big{display:none;position:absolute;inset:0;align-items:center;justify-content:center}
.big svg{width:50%;height:50%;margin-top:18%}
/* large-index face, and every face when cards are small */
.face-large .ix b,.tbl.tiny .ix b,.tbl.small .ix b{font-size:calc(var(--cw)*.36);font-family:'Bodoni Moda','Playfair Display',serif;font-weight:700;letter-spacing:-.06em;transform:scaleX(.9);transform-origin:left center}
.face-large .ix,.tbl.tiny .ix,.tbl.small .ix{flex-direction:row;align-items:center;gap:2%;width:auto;left:6%;top:4%}
.face-large .ix svg,.tbl.tiny .ix svg,.tbl.small .ix svg{width:calc(var(--cw)*.27);height:calc(var(--cw)*.27);margin:0}
.face-large .ix2,.tbl.tiny .ix2,.tbl.small .ix2{display:none}
.face-large .pp,.face-large .ace,.face-large .fc,.tbl.tiny .pp,.tbl.tiny .ace,.tbl.tiny .fc,.tbl.small .pp,.tbl.small .ace{display:none}
.tbl.small .fr.face .big{display:none}
.tbl.small .fc{left:26%;right:5%;top:22%;bottom:5%}
.face-large .big,.tbl.tiny .big,.tbl.small .big{display:flex}
.face-large .fr.face .big svg,.tbl.tiny .fr.face .big svg,.tbl.small .fr.face .big svg{opacity:.9}
.face-large .fr.face,.tbl.tiny .fr.face,.tbl.small .fr.face{background:linear-gradient(160deg,#fffaf0,#f1e2bd)}
/* states */
.cd.lift{transition:none!important;box-shadow:none;cursor:grabbing}
.cd.lift .fr{box-shadow:0 0 0 1px rgba(0,0,0,.3),0 10px 22px rgba(0,0,0,.45)}
.cd.sel .fr{box-shadow:0 0 0 2px var(--accent),0 0 14px rgba(220,187,108,.8)}
.cd.can .fr,.slot.can{box-shadow:0 0 0 2px rgba(143,227,184,.75),0 0 12px rgba(143,227,184,.45)}
.cd.over .fr,.slot.over{box-shadow:0 0 0 3px #fff2c4,0 0 18px rgba(255,230,160,.9)}
.cd.hint .fr,.cd.hint .bk,.slot.hint{animation:hintGlow 1s ease-in-out infinite}
@keyframes hintGlow{0%,100%{box-shadow:0 0 0 2px rgba(255,214,110,.95),0 0 6px rgba(255,214,110,.6)}50%{box-shadow:0 0 0 3px rgba(255,236,170,1),0 0 22px rgba(255,214,110,.95)}}
.cd.shake .in{animation:shake .4s}
@keyframes shake{20%{transform:translateX(-5%)}40%{transform:translateX(5%)}60%{transform:translateX(-3%)}80%{transform:translateX(2%)}}

/* ---------- card backs ---------- */
.cd .bk::after{content:'';position:absolute;inset:calc(var(--cw)*.055);border-radius:calc(var(--cw)*.05);box-shadow:inset 0 0 0 1px rgba(255,255,255,.55)}
html[data-back=crimson] .bk{background:repeating-linear-gradient(45deg,rgba(255,255,255,.16) 0 1.5px,transparent 1.5px 7px),repeating-linear-gradient(-45deg,rgba(255,255,255,.16) 0 1.5px,transparent 1.5px 7px),linear-gradient(160deg,#c3283a,#7b1220);box-shadow:inset 0 0 0 calc(var(--cw)*.045) #fbf5ea,0 0 0 1px rgba(0,0,0,.4)}
html[data-back=navy] .bk{background:radial-gradient(circle at 50% 50%,rgba(220,187,108,.5) 0 8%,transparent 9%),repeating-radial-gradient(circle at 50% 50%,transparent 0 6px,rgba(220,187,108,.22) 6px 7px),linear-gradient(160deg,#20335f,#0d1a36);box-shadow:inset 0 0 0 calc(var(--cw)*.045) #e9d9b0,0 0 0 1px rgba(0,0,0,.4)}
html[data-back=forest] .bk{background:radial-gradient(circle,rgba(255,255,255,.22) 1.2px,transparent 1.6px) 0 0/8px 8px,linear-gradient(160deg,#2b7a4f,#11402a);box-shadow:inset 0 0 0 calc(var(--cw)*.045) #f4efe0,0 0 0 1px rgba(0,0,0,.4)}
html[data-back=wave] .bk{background:radial-gradient(circle at 50% 100%,transparent 0 3px,#cfe3f5 3px 4px,transparent 4px 6px,#cfe3f5 6px 7px,transparent 7px 9px,#cfe3f5 9px 10px,#1d4f8f 10px) 0 0/20px 10px,radial-gradient(circle at 0 50%,transparent 0 3px,#cfe3f5 3px 4px,transparent 4px 6px,#cfe3f5 6px 7px,transparent 7px 9px,#cfe3f5 9px 10px,#1d4f8f 10px) 10px 5px/20px 10px,#1d4f8f;box-shadow:inset 0 0 0 calc(var(--cw)*.045) #fff,0 0 0 1px rgba(0,0,0,.4)}
html[data-back=red] .bk{background:#fff url(img/back-red.webp) center/90.5% 93.5% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.32),0 1px 3px rgba(0,0,0,.3)}
html[data-back=blue] .bk{background:#fff url(img/back-blue.webp) center/90.5% 93.5% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.32),0 1px 3px rgba(0,0,0,.3)}
html[data-back=ornate] .bk{background:#fff url(img/back-ornate.webp) center/91% 93.5% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.32),0 1px 3px rgba(0,0,0,.3)}
html[data-back=ornateBlack] .bk{background:#1c1c1c url(img/back-ornate-black.webp?v=2) center/91% 93.5% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.5),0 1px 3px rgba(0,0,0,.3)}
html[data-back=gangsta] .bk{background:#3a3a3a url(img/back-gangsta.webp) center/86% 90% no-repeat;box-shadow:inset 0 0 0 calc(var(--cw)*.04) #f4f4f2,0 0 0 1px rgba(0,0,0,.45),0 1px 3px rgba(0,0,0,.3)}
html[data-back=gangsta] .cd .bk::after{display:none}
html[data-back=floral] .bk{background:#fff url(img/back-floral.webp) center/91% 93.5% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=azure] .bk{background:#fff url(img/back-azure.webp) center/91% 93.5% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=floralBlack] .bk{background:#1c1c1c url(img/back-floral-black.webp) center/90% 92% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=azureBlack] .bk{background:#1c1c1c url(img/back-azure-black.webp) center/90% 92% no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=skull] .bk{background:#fff url(img/back-skull.webp) center/cover no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=hex] .bk{background:#1b2a4a url(img/back-hex.webp) center/cover no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=cube] .bk{background:#4a2f6b url(img/back-cube.webp) center/cover no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=skullBlack] .bk{background:#333 url(img/back-skull-black.webp) center/cover no-repeat;box-shadow:0 0 0 1px rgba(0,0,0,.35),0 1px 3px rgba(0,0,0,.3)}
html[data-back=floral] .cd .bk::after,html[data-back=azure] .cd .bk::after,html[data-back=floralBlack] .cd .bk::after,html[data-back=azureBlack] .cd .bk::after,html[data-back=skull] .cd .bk::after,html[data-back=skullBlack] .cd .bk::after,html[data-back=hex] .cd .bk::after,html[data-back=cube] .cd .bk::after{display:none}
html[data-back=red] .cd .bk::after,html[data-back=blue] .cd .bk::after,html[data-back=ornate] .cd .bk::after,html[data-back=ornateBlack] .cd .bk::after,html[data-back=mosaic] .cd .bk::after{display:none}
/* court art sets: the flat set is a whole card face (its own corner indices) */
.tile .ct-pv{width:24px;height:36px;object-fit:fill;border:1px solid rgba(0,0,0,.35);background:#fff;padding:2px;border-radius:3px}
.tile .ct-pv.full{padding:0;object-fit:cover}
html[data-back=check] .bk{background:conic-gradient(#3a1018 25%,#7a1f2c 0 50%,#3a1018 0 75%,#7a1f2c 0) 0 0/10px 10px;box-shadow:inset 0 0 0 calc(var(--cw)*.045) #e8d4a2,0 0 0 1px rgba(0,0,0,.4)}
html[data-back=deco] .bk{background:radial-gradient(circle at 50% 100%,transparent 0 5px,rgba(220,187,108,.85) 5px 6px,transparent 6px 9px,rgba(220,187,108,.6) 9px 10px,transparent 10px) 0 0/20px 12px,#111316;box-shadow:inset 0 0 0 calc(var(--cw)*.045) #c9a85c,0 0 0 1px rgba(0,0,0,.5)}
html[data-back=tartan] .bk{background:repeating-linear-gradient(0deg,rgba(20,60,30,.55) 0 4px,transparent 4px 10px,rgba(255,220,120,.35) 10px 11px,transparent 11px 16px),repeating-linear-gradient(90deg,rgba(20,60,30,.55) 0 4px,transparent 4px 10px,rgba(255,220,120,.35) 10px 11px,transparent 11px 16px),#a5222f;box-shadow:inset 0 0 0 calc(var(--cw)*.045) #f6efe0,0 0 0 1px rgba(0,0,0,.4)}

/* ---------- dialogs ---------- */
.overlay{position:fixed;inset:0;z-index:5000;display:none;align-items:center;justify-content:center;background:rgba(6,6,8,.62);padding:12px}
.overlay.show{display:flex}
.modal{position:relative;background:linear-gradient(180deg,#222327,#17181b);border:1px solid rgba(220,187,108,.25);border-radius:18px;padding:20px 22px;width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;box-shadow:0 24px 60px rgba(0,0,0,.55);color:var(--text)}
.modal.wide{width:min(980px,calc(100vw - 24px))}
.modal.small{width:min(400px,calc(100vw - 24px));text-align:center}
.modal h2{margin:0 0 14px;font-family:'Shippori Mincho B1',serif;font-size:21px;letter-spacing:.06em;text-align:center}
.modal-actions{display:flex;gap:10px;margin-top:16px}
.modal-actions .mbtn{flex:1}
.mbtn{padding:11px 14px;border-radius:12px;border:1px solid var(--line);background:rgba(255,255,255,.06);color:var(--text);font-size:14px;cursor:pointer;font-family:inherit;white-space:nowrap}
.mbtn:hover{border-color:rgba(220,187,108,.5)}
.mbtn.go{background:linear-gradient(180deg,#e2c477,#a8873f);color:#1d1606;border-color:transparent;font-weight:700}
.mbtn:disabled{opacity:.45;cursor:default}
.cf-msg{font-size:15px;line-height:1.7;margin:4px 0 6px}
.ng-games{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.gtile{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:14px;border:1.5px solid var(--line);background:rgba(0,0,0,.18);color:var(--text);cursor:pointer;text-align:start;font-family:inherit}
.gtile.sel{border-color:var(--accent);background:linear-gradient(180deg,rgba(220,187,108,.16),rgba(0,0,0,.1));box-shadow:0 0 0 1px rgba(220,187,108,.4)}
.gtile svg{width:54px;height:44px;flex:none;stroke:none}
.gtile b{display:block;font-size:15.5px;font-family:'Shippori Mincho B1',serif}
.gtile small{display:block;font-size:11.5px;color:var(--muted);line-height:1.4;margin-top:2px}
.ng-cols{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.sec{margin-bottom:12px}
.sec > label,.sec > .lab{display:block;font-size:12px;color:var(--accent);letter-spacing:.08em;margin-bottom:6px;font-weight:700}
.seg{display:flex;flex-wrap:wrap;gap:5px}
.seg button{flex:1 1 auto;min-width:0;padding:7px 9px;border-radius:9px;border:1px solid var(--line);background:rgba(255,255,255,.04);color:var(--text);font-size:12.5px;cursor:pointer;white-space:nowrap}
.seg button.sel{background:linear-gradient(180deg,rgba(220,187,108,.3),rgba(220,187,108,.12));border-color:rgba(220,187,108,.8);color:#fff4d4}
.seg button:disabled{opacity:.35;cursor:default}
.opt{display:grid;grid-template-columns:minmax(0,42%) 1fr;gap:8px;align-items:center;margin-bottom:6px}
.opt > span{font-size:12.5px;color:var(--muted)}
.opt .seg button{padding:5px 7px;font-size:12px}
.rules-box{border:1px solid var(--line);border-radius:12px;padding:10px 10px 4px;background:rgba(0,0,0,.14)}
.diff-desc{font-size:12px;color:var(--muted);margin:6px 2px 0;line-height:1.6}
.dno{display:flex;gap:6px;margin-top:6px}
.dno input{flex:1;min-width:0;background:rgba(0,0,0,.3);border:1px solid var(--line);border-radius:9px;color:var(--text);font:600 14px 'JetBrains Mono',monospace;padding:7px 10px}
.tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.tile{position:relative;padding:0;border:1.5px solid var(--line);border-radius:10px;background:none;cursor:pointer;overflow:hidden;color:var(--text);display:flex;flex-direction:column}
.tile.sel{border-color:var(--accent);box-shadow:0 0 0 1px rgba(220,187,108,.6)}
.tile .pv{height:40px;display:flex;align-items:center;justify-content:center;gap:4px}
.tile small{font-size:10.5px;padding:3px 2px 4px;color:var(--muted);text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tile.sel small{color:var(--accent)}
.tile .mini-card{width:26px;height:36px;border-radius:3px;position:relative;--cw:26px}
.tile .mini-card .bk,.tile .mini-card .fr{position:absolute;inset:0;border-radius:3px}
.tiles.faces{grid-template-columns:repeat(4,1fr)}
.tile .fpv{position:relative;width:32px;height:45px;--cw:32px;--chh:45px}
.tiles.faces .pv{height:52px}
.tile .fpv .cd{transform:none!important;cursor:pointer}
.chk{display:flex;align-items:center;gap:8px;font-size:13px;margin:6px 0;cursor:pointer}
.chk input{width:16px;height:16px;accent-color:#c9a85c}
.res-ico{font-size:44px;text-align:center;margin-top:-4px}
.res-modal{text-align:center}
.res-body .nums{margin:6px 0 10px}
.res-body .rec{display:inline-block;margin-top:4px;padding:3px 10px;border-radius:99px;background:linear-gradient(180deg,#e2c477,#a8873f);color:#1d1606;font-size:12px;font-weight:700}
.res-body p{color:var(--muted);font-size:13px;margin:8px 0 0}
.rv-tabs{display:flex;gap:6px;margin:-4px 0 12px;justify-content:center;flex-wrap:wrap}
.rv-tabs button{padding:7px 14px;border-radius:99px;border:1px solid var(--line);background:rgba(255,255,255,.04);color:var(--muted);font-size:13px;cursor:pointer}
.rv-tabs button.sel{color:#fff4d4;border-color:rgba(220,187,108,.8);background:rgba(220,187,108,.18)}
.rules-modal{width:min(980px,calc(100vw - 24px))}
.stats-modal{width:min(720px,calc(100vw - 24px))}
.stats-body table{width:100%;border-collapse:collapse;font-size:13px}
.stats-body th,.stats-body td{padding:7px 6px;border-bottom:1px solid var(--line);text-align:center;white-space:nowrap}
.stats-body th{color:var(--accent);font-weight:700;font-size:11.5px}
.stats-body td:first-child,.stats-body th:first-child{text-align:start}
.stats-body .tot td{font-weight:700;border-top:1px solid rgba(220,187,108,.4)}
.stats-wrap{overflow-x:auto}
.busy .modal{display:flex;flex-direction:column;align-items:center;gap:12px}
.spin{width:36px;height:36px;border-radius:50%;border:3px solid rgba(220,187,108,.25);border-top-color:var(--accent);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.toast{position:fixed;left:50%;bottom:28px;transform:translate(-50%,20px);opacity:0;pointer-events:none;z-index:6000;background:rgba(24,25,28,.96);border:1px solid rgba(220,187,108,.4);border-radius:12px;padding:10px 16px;font-size:14px;transition:.25s;max-width:calc(100vw - 32px);text-align:center}
.toast.show{opacity:1;transform:translate(-50%,0)}
.win-cv{position:fixed;inset:0;z-index:4500;width:100vw;height:100vh;cursor:pointer}
/* rules tutorial mini boards */
.rt-board .tbl{border-radius:12px}
.rt-board{position:relative;border-radius:12px;overflow:hidden}
.rt-board.felt-bg{box-shadow:inset 0 0 0 1px rgba(255,255,255,.08)}

@media (max-width:760px){
  .ng-games{grid-template-columns:1fr;gap:6px}
  .gtile{padding:8px 10px}.gtile svg{width:44px;height:36px}
  .ng-cols{grid-template-columns:1fr;gap:4px}
  .opt{grid-template-columns:1fr;gap:4px;margin-bottom:9px}
  .modal{padding:16px 14px}
  .tiles .pv{height:40px}
}
@media (max-width:420px){
  .brand h1{font-size:19px}.brand h1 small{display:none}
  .btn{font-size:10.5px;height:46px;padding:0 2px}.btn span{letter-spacing:-.04em}
  .snd{width:31px}
  #langSel{max-width:76px}
}
html[lang=ar] body{direction:rtl}
html[lang=ar] .tbl,html[lang=ar] .board-wrap{direction:ltr}

.credit{font-size:11px;color:var(--muted);margin-top:12px;line-height:1.6}
.credit a{color:var(--accent)}

.card .srow{margin-top:6px}
.card .deal-row{flex-wrap:wrap}
@media (max-width:1366px){.hb .hb-info{gap:10px!important}.hb .hb-info .ss b{font-size:18px}.hb .hb-info .ss small{font-size:10px}.hb .hb-info .sg em,.hb .hb-info .sx{display:none}.ss.tm b{min-width:2.9em}}
@media (max-width:1180px){.hb .hb-info .sg{display:none}}
html[data-court=antique] .fr.face .fc img{box-shadow:0 0 0 1px #222}
.modal.wide .sec{margin-bottom:9px}

/* ---------- new-game dialog: tabs ---------- */
.ng-tabs{display:flex;gap:4px;border-bottom:1px solid var(--line);margin:0 -2px 14px;padding:0 2px}
.ng-tabs button{flex:1;display:flex;flex-direction:column;align-items:center;gap:1px;padding:9px 8px 10px;border:0;background:none;color:var(--muted);font:600 14px 'Zen Kaku Gothic New',sans-serif;letter-spacing:.08em;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px}
.ng-tabs button small{font-size:10.5px;font-weight:400;letter-spacing:.02em;color:var(--muted);opacity:.8}
.ng-tabs button.sel{color:#fff4d4;border-bottom-color:var(--accent)}
.ng-tabs button:hover{color:var(--text)}
.ng-body{height:min(540px, calc(100dvh - 290px));overflow-y:auto;overscroll-behavior:contain;padding:2px}
.ng-games{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;height:100%}
.gcard{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:8px;padding:18px 18px 16px;border-radius:16px;border:1.5px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.04),rgba(0,0,0,.18));color:var(--text);text-align:start;cursor:pointer;font-family:inherit;transition:border-color .15s,transform .15s}
.gcard:hover{border-color:rgba(220,187,108,.5);transform:translateY(-2px)}
.gcard.sel{border-color:var(--accent);background:linear-gradient(180deg,rgba(220,187,108,.14),rgba(0,0,0,.15));box-shadow:0 0 0 1px rgba(220,187,108,.45),0 10px 26px rgba(0,0,0,.35)}
.gcard .gart{align-self:stretch;display:flex;justify-content:center;padding:18px 0 14px;border-radius:12px;background:radial-gradient(90% 90% at 50% 40%,#1d7474,#0b3535);box-shadow:inset 0 0 0 1px rgba(201,162,78,.5)}
.gcard .gart > svg{width:150px;height:122px}
.gcard b{font-family:'Shippori Mincho B1',serif;font-size:23px;letter-spacing:.06em}
.gcard p{margin:0;font-size:13px;line-height:1.75;color:var(--muted)}
.gcard ul{margin:auto 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;width:100%}
.gcard li{font-size:12px;color:var(--text);padding:5px 10px;border-radius:8px;background:rgba(255,255,255,.04);border:1px solid var(--line)}
.gcard li::before{content:'♦';color:var(--accent);margin-inline-end:8px;font-size:10px}
.gcard .gpick{position:absolute;top:12px;right:12px;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:14px;font-weight:700;color:#1d1606;background:linear-gradient(180deg,#e2c477,#a8873f);opacity:0}
.gcard.sel .gpick{opacity:1}
.rl-top{display:grid;grid-template-columns:1fr 1.3fr;gap:14px;margin-bottom:16px}
.rl-box{padding:12px 14px;border-radius:12px;border:1px solid var(--line);background:rgba(0,0,0,.16)}
.rl-box .lab,.lab.rl-h{display:block;font-size:12px;color:var(--accent);letter-spacing:.08em;margin-bottom:8px;font-weight:700}
.nsel{width:100%;padding:9px 12px;border-radius:10px;border:1px solid rgba(220,187,108,.5);background:#191a1d;color:var(--text);font:600 14px 'Zen Kaku Gothic New',sans-serif;cursor:pointer}
.rl-list{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.rl{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:14px;align-items:center;padding:10px 14px;border-top:1px solid var(--line);background:rgba(0,0,0,.12)}
.rl:first-child{border-top:0}
.rl-t{display:flex;flex-direction:column;gap:2px;min-width:0}
.rl-t b{font-size:13.5px;font-weight:700}
.rl-t small{font-size:11.5px;color:var(--muted);line-height:1.5}
.rl .seg button{padding:6px 8px;font-size:12px}
@media (max-width:760px){
  .ng-games{grid-template-columns:1fr;height:auto}
  .gcard{flex-direction:row;flex-wrap:wrap;align-items:center;padding:12px}
  .gcard .gart{align-self:auto;padding:6px 8px}.gcard .gart > svg{width:72px;height:58px}
  .gcard b{font-size:19px}.gcard p{flex-basis:100%}.gcard ul{display:none}
  .rl-top{grid-template-columns:1fr}
  .rl{grid-template-columns:1fr;gap:6px}
  .ng-body{height:calc(100dvh - 250px)}
}
.garts{position:relative;display:block;width:calc(var(--cw)*3.25);height:calc(var(--cw)*2.75);--cw:66px;--chh:92px}
.garts .cd .in{transform:none!important}.garts .cd:not(.dn) .bk{display:none}.garts .cd.dn .fr{display:none}.garts .cd.dn .bk{transform:none}
.garts .cd .fr,.garts .cd .bk{box-shadow:0 0 0 1px rgba(0,0,0,.3),0 3px 8px rgba(0,0,0,.35)}
.garts .cd{position:absolute;cursor:inherit;transition:none}
.garts .gslot{position:absolute;width:var(--cw);height:var(--chh);border-radius:5px;border:1.5px dashed rgba(236,210,146,.5)}
@media (max-width:760px){.garts{--cw:30px;--chh:42px}}
.fr .fimg{position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none;-webkit-user-drag:none;background:#fff}
.tbl.tiny .fr .fimg{display:none}
.ng-body .tile .pv{height:62px}
.ng-body .tile .mini-card{width:36px;height:50px;--cw:36px}
.ng-body .tile .ct-pv{width:30px;height:44px}
.ng-body .sec{margin-bottom:14px}
/* design tab: small felt swatches, big card previews */
.ng-body .tiles.felts{grid-template-columns:repeat(8,1fr)}
.ng-body .tiles.felts .pv{height:34px}
.ng-body .tiles.backs{grid-template-columns:repeat(7,1fr)}
.ng-body .tiles.backs .pv{height:96px}
.ng-body .tiles.backs .mini-card{width:58px;height:82px;--cw:58px;border-radius:5px}
.ng-body .tiles.backs .mini-card .bk{border-radius:5px}
.ng-body .tiles.faces .pv{height:104px;gap:6px}
.ng-body .tiles.faces .ct-pv{width:46px;height:68px}
@media (max-width:760px){.ng-body .tiles.felts{grid-template-columns:repeat(4,1fr)}.ng-body .tiles.backs{grid-template-columns:repeat(4,1fr)}.ng-body .tiles.faces{grid-template-columns:repeat(2,1fr)}}

/* difficulty picker (custom, not the system select) */
.dsel{position:relative}
.dsel-btn{width:100%;display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:10px;border:1px solid rgba(220,187,108,.55);background:linear-gradient(180deg,#26282c,#1b1c1f);color:var(--text);cursor:pointer;font-family:inherit;text-align:start}
.dsel-btn b{font-size:15px;letter-spacing:.06em}
.dsel-btn svg{width:18px;height:18px;flex:none;stroke-width:2.2;margin-inline-start:auto;color:var(--accent);transition:transform .2s}
.dsel.open .dsel-btn svg{transform:rotate(180deg)}
.dsel-pips{font-style:normal;color:var(--accent);font-size:12px;letter-spacing:2px}
.dsel-pips s{text-decoration:none;opacity:.25}
.dsel-list{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 6px);display:none;flex-direction:column;padding:6px;border-radius:12px;border:1px solid rgba(220,187,108,.45);background:#1d1e21;box-shadow:0 16px 36px rgba(0,0,0,.55)}
.dsel.open .dsel-list{display:flex}
.dsel-list button{display:flex;flex-direction:column;gap:2px;padding:9px 12px;border:0;border-radius:8px;background:none;color:var(--text);text-align:start;cursor:pointer;font-family:inherit}
.dsel-list button span{display:flex;align-items:center;gap:10px}
.dsel-list button b{font-size:14px}
.dsel-list button small{font-size:11.5px;color:var(--muted);line-height:1.5}
.dsel-list button:hover{background:rgba(220,187,108,.1)}
.dsel-list button.sel{background:rgba(220,187,108,.18)}
/* design tab: two columns */
.dz{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px}
.ng-body .dz .tiles.faces{grid-template-columns:repeat(2,1fr)}
.ng-body .dz .tiles.felts{grid-template-columns:repeat(4,1fr)}
.ng-body .dz .tiles.felts .pv{height:22px}
.ng-body .dz .tiles.backs{grid-template-columns:repeat(5,1fr)}
.ng-body .dz .tiles.backs .pv{height:84px}
.ng-body .dz .tiles.backs .mini-card{width:52px;height:74px;--cw:52px}
.ng-body .dz .tiles.faces .pv{height:92px}
.ng-body .dz .tiles.faces .ct-pv{width:42px;height:62px}
/* settings */
.set-cols{display:grid;grid-template-columns:1fr 1.25fr;gap:16px;align-items:start}
.set-cols .rl{grid-template-columns:minmax(0,1fr) auto}
.set-cols .rl .seg{min-width:250px}
.tgl{position:relative;display:inline-block;width:44px;height:24px;cursor:pointer}
.tgl input{position:absolute;opacity:0;inset:0;margin:0;cursor:pointer}
.tgl i{position:absolute;inset:0;border-radius:99px;background:rgba(255,255,255,.12);border:1px solid var(--line);transition:.2s}
.tgl i::after{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#d6d7da;transition:.2s}
.tgl input:checked + i{background:linear-gradient(180deg,#e2c477,#a8873f);border-color:transparent}
.tgl input:checked + i::after{left:23px;background:#1d1606}
.tgl input:focus-visible + i{outline:2px solid var(--accent);outline-offset:2px}
#setOverlay .credit{margin-top:16px}
@media (max-width:760px){.dz,.set-cols{grid-template-columns:1fr}.set-cols .rl .seg{min-width:0}.ng-body .dz .tiles.backs{grid-template-columns:repeat(4,1fr)}}

/* ---------- 6 game types: compact game cards (2 rows) / today's solitaire in 2 columns ---------- */
.slot.k-pk{display:none}
.slot.k-found[data-discard]{border-style:solid}
@media (min-width:761px){
  .ng-games{grid-template-rows:repeat(2,minmax(0,1fr));gap:12px}
  .gcard{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto 1fr;column-gap:14px;row-gap:4px;padding:12px 14px;align-content:start}
  .gcard .gart{grid-row:1/4;align-self:start;padding:10px 8px}
  .gcard .garts{--cw:36px;--chh:50.4px}
  .gcard b{font-size:19px;align-self:end}
  .gcard p{font-size:12px;line-height:1.6}
  .gcard ul{flex-direction:row;flex-wrap:wrap;gap:4px;margin:4px 0 0;align-self:start}
  .gcard li{font-size:11px;padding:2px 8px}
  .gcard .gpick{top:10px;right:10px;width:22px;height:22px;font-size:12px}
}
.side .daily-list{display:grid;grid-template-columns:1fr 1fr;gap:4px}
.side .dl-item{gap:6px;padding:4px 6px;min-width:0}
.side .dl-item .nm{font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.side .dl-item .ok{font-size:0}.side .dl-item .ok::first-letter{font-size:12px}
.side .dl-item .sbtn{padding:3px 8px;font-size:11.5px}
.dz-felt{margin-top:14px}
.ng-body .dz-felt .tiles.felts{grid-template-columns:repeat(8,minmax(0,1fr))}
.ng-body .dz-felt .tiles.felts .pv{height:26px}
@media (max-width:760px){.ng-body .dz-felt .tiles.felts{grid-template-columns:repeat(4,minmax(0,1fr))}}
/* statistics: larger text */
.stats-modal{width:min(880px,calc(100vw - 24px))}
.stats-body table{font-size:16px}
.stats-body th{font-size:13.5px}
.stats-body th,.stats-body td{padding:11px 8px}
.stats-body td{font-family:'JetBrains Mono','Zen Kaku Gothic New',monospace}
.stats-body td:first-child{font-family:inherit;font-weight:700}
#statsTabs button{font-size:15px;padding:8px 16px}
.stats-body .diff-desc{font-size:14px}
@media (min-width:761px){
  .gcard{display:flex;flex-direction:column;align-items:stretch;gap:6px;padding:12px 14px;overflow:hidden}
  .gcard .gart{flex:1 1 auto;min-height:0;padding:8px 0;align-self:stretch;align-items:center}
  .gcard .garts{--cw:38px;--chh:53.2px}
  .gcard b{font-size:19px;align-self:flex-start}
  .gcard p{font-size:12.5px;line-height:1.65;color:var(--text);opacity:.82;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:calc(12.5px*1.65*3)}
}

/* rules tutorial: overview of the game on the intro page */
.rt-ov{display:flex;gap:16px;align-items:center;padding:12px 14px;margin:0 0 12px;border-radius:14px;border:1px solid rgba(220,187,108,.3);background:linear-gradient(180deg,rgba(220,187,108,.08),rgba(0,0,0,.12))}
.rt-ov-art{flex:none;display:flex;align-items:center;justify-content:center;padding:10px;border-radius:12px;background:radial-gradient(90% 90% at 50% 40%,#1d7474,#0b3535);box-shadow:inset 0 0 0 1px rgba(201,162,78,.5)}
.rt-ov-art .garts{--cw:40px;--chh:56px}
.rt-ov-t{min-width:0}
.rt-ov-t p{margin:0 0 8px;font-size:14px;line-height:1.7}
.rt-ov-t ul{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;gap:5px}
.rt-ov-t li{font-size:12.5px;padding:3px 10px;border-radius:99px;background:rgba(255,255,255,.05);border:1px solid var(--line)}
.rt-ov-t li::before{content:'♦';color:var(--accent);margin-inline-end:6px;font-size:10px}
@media (max-width:760px){.rt-ov{flex-direction:column;align-items:stretch}.rt-ov-art{align-self:center}.rt-ov-art .garts{--cw:32px;--chh:44.8px}}

/* ---------- phone: the new-game dialog fills the screen, Game / Rules / Design tabs at the bottom, little scrolling ---------- */
@media (max-width:760px){
  #newOverlay{padding:0}
  #newOverlay .modal.wide{width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0;display:flex;flex-direction:column;padding:10px 12px 0;overflow:hidden!important}
  #newOverlay h2{margin:0 0 6px;font-size:17px}
  #newOverlay .rules-offer{margin:0 0 8px;padding:6px 8px 6px 10px;font-size:11.5px;line-height:1.45}
  #newOverlay .rules-offer button{padding:6px 10px;font-size:11.5px}
  #ngBody{order:1;flex:1 1 auto;min-height:0;height:auto;overflow-y:auto;padding:2px 0 4px}
  #newOverlay .modal-actions{order:2;margin-top:8px}
  #newOverlay .modal-actions .mbtn{padding:10px 12px}
  #ngTabs{order:3;margin:8px -12px 0;padding:0 6px env(safe-area-inset-bottom);border-bottom:0;border-top:1px solid var(--line);background:rgba(0,0,0,.25)}
  #ngTabs button{padding:9px 6px 10px;border-bottom:0;border-top:2px solid transparent;font-size:13.5px}
  #ngTabs button.sel{border-top-color:var(--accent);border-bottom-color:transparent}
  /* game: 2 × 3 cards */
  .ng-games{grid-template-columns:1fr 1fr;grid-template-rows:repeat(3,minmax(0,1fr));gap:6px;height:100%;margin:0}
  .gcard{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;gap:4px;padding:8px;border-radius:12px;min-height:0;overflow:hidden}
  .gcard .gart{flex:1 1 auto;min-height:0;padding:4px 0;align-self:stretch;display:flex;align-items:center;justify-content:center}
  .gcard .garts{--cw:24px;--chh:33.6px}
  .gcard b{font-size:15px;letter-spacing:.04em}
  .gcard p{flex:none;font-size:10.5px;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .gcard .gpick{top:6px;right:6px;width:20px;height:20px;font-size:11px}
  /* rules: compact rows, no help lines */
  .rl-top{gap:8px;margin-bottom:8px}
  .rl-box{padding:10px 12px}
  .rl-box .diff-desc{font-size:11px;margin-top:6px}
  .rl-h{margin:6px 0 4px}
  .rl{padding:7px 10px;gap:5px}
  .rl-t small{display:none}
  .rl .seg button{padding:6px 6px;font-size:11.5px}
  /* design: smaller tiles so everything fits */
  .ng-body .dz{gap:8px}
  .modal.wide .ng-body .sec{margin-bottom:6px}
  .ng-body .dz .tiles.backs{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
  .ng-body .dz .tiles.backs .pv{height:52px}
  .ng-body .dz .tiles.backs .mini-card{width:34px;height:48px;--cw:34px}
  .ng-body .dz .tiles.faces{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .ng-body .dz .tiles.faces .pv{height:44px}
  .ng-body .dz .tiles.faces .ct-pv{width:20px;height:30px}
  .ng-body .tiles small{font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
  .ng-body .dz-felt{margin-top:4px}
  .ng-body .dz-felt .tiles.felts{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .ng-body .dz-felt .tiles.felts .pv{height:16px}
}
/* design tab (PC): the card-design box is as tall as the card-back box, the table row sits at the bottom */
@media (min-width:761px){
  .ng-body:has(> .dz){display:flex;flex-direction:column}
  .ng-body .dz{align-items:stretch}
  /* each card-design tile is exactly as tall as one card-back tile (rows line up; room for more designs) */
  .ng-body .dz .tiles.faces .pv{height:84px}
  .ng-body .dz .tiles.faces .ct-pv{width:46px;height:66px}
  .ng-body .dz-felt{margin-top:auto;padding-top:14px}
}
@media (max-width:760px){
  .ng-body .dz .tiles.faces{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ng-body .dz .tiles.faces .pv{height:52px}
  .ng-body .dz .tiles.faces .ct-pv{width:33px;height:48px}
}
/* small-card display mode: only matters on phones */
.cmode{display:none}
@media (max-width:760px){.cmode{display:flex;align-items:center;gap:10px;margin-top:6px}.cmode span{font-size:11.5px;color:var(--muted);white-space:nowrap}.cmode .seg{flex:1}.cmode .seg button{padding:6px 8px;font-size:12px}}
/* phone: no truncated text in the new-game dialog */
@media (max-width:760px){
  .gcard p{display:block;-webkit-line-clamp:unset;overflow:visible;font-size:10.5px;line-height:1.5}
  .gcard .gart{flex:1 1 40px;min-height:40px}
  .gcard .garts{--cw:20px;--chh:28px}
  .gcard b{font-size:14.5px}
  .ng-body .tiles small{font-size:9px;letter-spacing:0;white-space:normal;overflow:visible;text-overflow:clip;line-height:1.25;text-align:center;word-break:keep-all;overflow-wrap:anywhere}
}
/* phone: no "all statistics" button in the record card (the Stats button in the toolbar opens the same) */
@media not all and (hover:hover) and (pointer:fine) and (min-width:1040px) and (min-aspect-ratio:3/4){ #sStats{display:none} }
/* ---------- PC with a wide screen: game field on the left, the record / shortcuts / today's solitaire in a column on the right ---------- */
@media (hover:hover) and (pointer:fine) and (min-width:1040px) and (min-aspect-ratio:16/10){
  .stage{display:grid;grid-template-columns:minmax(0,1fr) clamp(290px,22vw,360px);align-items:start;gap:18px}
  .board-wrap{grid-column:1;grid-row:1;height:calc(100vh - var(--hb-h, 56px) - 46px)}
  .side{grid-column:2;grid-row:1;display:flex;flex-direction:column;gap:14px;height:calc(100vh - var(--hb-h, 56px) - 46px);overflow-y:auto}
  .side .card{height:auto;flex:none;overflow:visible}
  .side .daily-list{grid-template-columns:1fr}
  .side .dl-item{padding:5px 8px}
  .side .dl-item .ok{font-size:12px}
}
