/* ── Windows Classics card tables (site 1.71.0) ───────────────────────────────
   Shared by game/freecell.php, game/spider.php and game/hearts.php. The card
   faces and backs come from te-arcade.css / te-future.css (the same .pcard
   look as Solitaire, including the table themes and holiday skins); this file
   only lays the tables out. Cards are absolutely placed inside their pile so
   long columns can squeeze to fit the screen.
   ───────────────────────────────────────────────────────────────────────── */
:root{
  --gold:#C9A84C; --gold-dim:#8B6914; --navy:#0F1B2D; --surface:#161F2E;
  --card:#1E2A3D; --border:#2A3A52; --text:#E8ECF0; --muted:#9FB0C6;
  --green:#22c55e; --red:#ef4444;
}
*{box-sizing:border-box}
body{margin:0;background:var(--navy);color:var(--text);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;min-height:100vh;min-height:100dvh}
.game-crumb{display:flex;align-items:center;gap:.75rem;padding:.7rem 1.25rem;border-bottom:1px solid var(--border);background:var(--surface);flex-wrap:wrap}
.game-crumb a.back{color:var(--muted);text-decoration:none;font-size:.9rem}
.game-crumb a.back:hover{color:var(--gold)}
.game-crumb h1{margin:0;font-size:1.15rem;color:var(--gold)}
main{max-width:980px;margin:0 auto;padding:1rem .75rem 2.5rem}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* the felt (te-arcade.css / te-future.css style .panel on te-solitaire pages) */
.tk-felt.panel{border-radius:10px;padding:.7rem;position:relative;min-height:320px;touch-action:none}
body.tc-on:not([data-te-theme]) .tc-window .tk-felt.panel{background-image:none !important;border-radius:0 !important;background:#008000 !important;box-shadow:inset 1px 1px #004000,inset -1px -1px #40c040 !important;border:0 !important}

body.tc-on .tc-status > :empty{display:none}

/* card size: one knob per table, set by the page (--cols) */
.tk-table{--gap:clamp(3px,1vw,10px);
  --cw:clamp(28px, calc((min(100vw, 980px) - 4.6rem - 18px - (var(--cols) - 1) * var(--gap)) / var(--cols)), 86px);
  --ch:calc(var(--cw) * 80 / 58)}
.tk-row{max-width:calc(var(--cols) * var(--cw) + (var(--cols) - 1) * var(--gap));margin-left:auto;margin-right:auto;display:flex;gap:var(--gap);justify-content:space-between;align-items:flex-start;margin-bottom:calc(var(--gap) * 2)}
.tk-group{display:flex;gap:var(--gap)}
.tk-cols{display:grid;grid-template-columns:repeat(var(--cols), var(--cw));gap:var(--gap);justify-content:center}

.tk-slot{position:relative;width:var(--cw);height:var(--ch);border-radius:8px;border:2px dashed var(--border);
  display:flex;align-items:center;justify-content:center;color:rgba(255,255,255,.22);font-size:calc(var(--cw) * .42);user-select:none}
.tk-table .tk-slot .pcard{position:absolute;left:-2px;top:-2px}
.tk-col{position:relative;width:var(--cw);min-height:var(--ch)}
.tk-col::before{content:"";position:absolute;left:0;top:0;width:var(--cw);height:var(--ch);border-radius:8px;border:2px dashed var(--border);pointer-events:none}
.tk-table .tk-col .pcard{position:absolute;left:0}
.tk-drop{outline:2px solid var(--tf-accent,#3fd0ff);outline-offset:3px;border-radius:8px}

.pcard{width:var(--cw);height:var(--ch);border-radius:8px;display:flex;align-items:center;justify-content:center;flex-direction:column;
  font-weight:800;line-height:1.1;user-select:none;-webkit-user-select:none;border:2px solid var(--border);
  font-size:clamp(.62rem, calc(var(--cw) * .3), 1.15rem);cursor:grab;touch-action:none}
.pcard.facedown{cursor:default}
.pcard.red{color:#c0182c}.pcard.black{color:#1a1a1a}
.pcard.tk-hint{animation:tkHint 1.1s ease-in-out 2}
@keyframes tkHint{0%,100%{box-shadow:0 0 0 0 rgba(255,214,0,0)}50%{box-shadow:0 0 0 4px #ffd600,0 0 22px #ffd600}}
.pcard.tk-sel{box-shadow:0 0 0 3px var(--tf-accent,#ffd600),0 0 16px var(--tf-accent,#ffd600) !important}
.pcard:focus-visible{outline:3px solid #ffd600;outline-offset:2px;z-index:50}
.tk-ghost{position:fixed;left:0;top:0;z-index:200;pointer-events:none;will-change:transform}
.tk-table .tk-ghost .pcard{position:absolute;left:0;box-shadow:0 14px 28px rgba(0,0,0,.55) !important;cursor:grabbing}
.tk-hidden{visibility:hidden}

/* tool buttons in the menu bar */
.tk-menu .tc-menu[disabled]{opacity:.45;cursor:default}
.tk-lcds{display:flex;gap:.5rem;align-items:center}

/* dialogs */
.tk-dlg{border:1px solid var(--tf-accent,#3fd0ff);border-radius:12px;background:#0d1626;color:var(--text);padding:0;max-width:min(420px,calc(100vw - 32px));width:100%}
.tk-dlg::backdrop{background:rgba(0,0,0,.55)}
.tk-dlg .tk-dh{display:flex;align-items:center;gap:.5rem;padding:.6rem .8rem;border-bottom:1px solid rgba(255,255,255,.08);font-weight:700}
.tk-dlg .tk-dh span{flex:1}
.tk-dlg .tk-db{padding:.9rem 1rem}
.tk-dlg .tk-df{display:flex;flex-wrap:wrap;gap:.5rem;justify-content:flex-end;padding:.6rem 1rem .9rem}
.tk-dlg table{width:100%;border-collapse:collapse;font-size:.9rem}
.tk-dlg td,.tk-dlg th{padding:.3rem .2rem;border-bottom:1px solid rgba(255,255,255,.07);text-align:left}
.tk-dlg td:last-child,.tk-dlg th:last-child{text-align:right;font-variant-numeric:tabular-nums}
.tk-dlg label{display:block;margin:.4rem 0}
.tk-dlg input[type=number]{width:8em;background:#05070c;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:.4rem .5rem;font:inherit}
.tk-btn{display:inline-flex;align-items:center;justify-content:center;min-height:38px;padding:.45rem 1rem;border-radius:8px;border:1px solid var(--gold-dim);background:transparent;color:var(--text);font:inherit;font-weight:700;cursor:pointer}
.tk-btn.pri{background:var(--gold);color:#1a1305;border-color:var(--gold)}
.tk-lb{margin-top:.7rem}
.tk-lb h3{margin:.2rem 0 .3rem;font-size:.78rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.tk-lb ol{list-style:none;margin:0;padding:0;max-height:180px;overflow:auto}
.tk-lb li{display:flex;gap:.5rem;padding:.25rem .2rem;border-bottom:1px solid rgba(255,255,255,.06);font-size:.86rem}
.tk-lb li b{margin-left:auto;font-variant-numeric:tabular-nums}
body.tc-on .tk-dlg{border-radius:0;background:#c0c0c0;color:#000;border:0;font-family:Tahoma,Verdana,sans-serif;
  box-shadow:inset -1px -1px #0a0a0a,inset 1px 1px #dfdfdf,inset -2px -2px #808080,inset 2px 2px #fff}
body.tc-on .tk-dlg .tk-dh{background:linear-gradient(90deg,#000080,#1084d0);color:#fff;margin:3px;padding:.25rem .45rem;font-size:.85rem}
body.tc-on .tk-dlg td,body.tc-on .tk-dlg th,body.tc-on .tk-lb li{border-color:#808080}
body.tc-on .tk-lb h3{color:#000}
body.tc-on .tk-btn{border-radius:0;background:#c0c0c0;color:#000;border:0;min-width:84px;
  box-shadow:inset -1px -1px #0a0a0a,inset 1px 1px #fff,inset -2px -2px #808080,inset 2px 2px #dfdfdf}
body.tc-on .tk-dlg input[type=number]{border-radius:0;background:#fff;color:#000;border:0;box-shadow:inset 1px 1px #808080,inset -1px -1px #fff}

/* the win cascade */
.tk-cascade{position:fixed;inset:0;z-index:150;cursor:pointer}
.tk-help{color:var(--muted);font-size:.8rem;text-align:center;margin:.6rem 0 0}
body.tc-on .tk-help{color:#000}
body.tc-on .tk-dlg td,body.tc-on .tk-dlg th,body.tc-on .tk-dlg p,body.tc-on .tk-dlg label,body.tc-on .tk-dlg li{color:#000}
body.tc-on .tk-dlg code{color:#000080}
@media (prefers-reduced-motion:reduce){.pcard.tk-hint{animation:none;box-shadow:0 0 0 4px #ffd600 !important}}
@media (max-width:560px){
  main{padding:.6rem .4rem 2rem}
  .tc-body{padding:.4rem !important}
  .tk-felt.panel{padding:.45rem}
  .tk-table{--gap:3px;--cw:clamp(26px, calc((100vw - 2.6rem - 8px - (var(--cols) - 1) * 3px) / var(--cols)), 86px)}
  .pcard,.tk-slot,.tk-col::before{border-radius:5px}
}

/* Spider: the completed runs and the stock */
.sp-done,.sp-stock{border-style:solid;border-color:transparent;background:none;padding:0;font:inherit;color:inherit}
.sp-stock{cursor:pointer}
.sp-stock[disabled]{cursor:default;border:2px dashed var(--border)}
.sp-stock .pcard{cursor:pointer}
.sp-stock.tk-hint{animation:tkHint 1.1s ease-in-out 2}
.tk-table .sp-done .pcard,.tk-table .sp-stock .pcard{top:-2px}

/* Hearts: three computer seats around the trick, your hand along the bottom */
.hx-grid{display:grid;grid-template-columns:1fr auto 1fr;grid-template-areas:". n ." "w t e" "me me me";gap:calc(var(--gap) * 2) var(--gap);align-items:center}
.hx-n{grid-area:n;justify-self:center;text-align:center}
.hx-w{grid-area:w;justify-self:start}
.hx-e{grid-area:e;justify-self:end;text-align:right}
.hx-name{font-size:.82rem;font-weight:700;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.6);margin-bottom:.3rem;white-space:nowrap}
.hx-name b{font-variant-numeric:tabular-nums;color:var(--tf-accent,#ffd600)}
.hx-turn > .hx-name{color:var(--tf-accent,#ffd600)}
.hx-turn > .hx-name::after{content:" ◀";font-size:.7em}
.hx-mini{display:flex;justify-content:inherit;min-height:calc(var(--ch) * .4)}
.hx-e .hx-mini{justify-content:flex-end}.hx-n .hx-mini{justify-content:center}
.tk-table .hx-mini .pcard{width:calc(var(--cw) * .4);height:calc(var(--ch) * .4);border-radius:3px;flex:none;box-shadow:none !important}
.tk-table .hx-mini .pcard + .pcard{margin-left:calc(var(--cw) * -.29)}
.hx-trick{grid-area:t;position:relative;width:calc(var(--cw) * 3.1);height:calc(var(--ch) * 2.45);margin-bottom:2.6em}
.hx-spot{position:absolute;width:var(--cw);height:var(--ch)}
.hx-spot-n{left:50%;top:0;transform:translateX(-50%)}
.hx-spot-s{left:50%;bottom:0;transform:translateX(-50%)}
.hx-spot-w{left:0;top:50%;transform:translateY(-50%)}
.hx-spot-e{right:0;top:50%;transform:translateY(-50%)}
.tk-table .hx-spot .pcard{position:absolute;left:0;top:0;transition:transform .35s ease-in,opacity .35s ease-in}
.tk-table .hx-spot .pcard.hx-take{opacity:0}
.hx-to-n{transform:translateY(-140%) scale(.6)}.hx-to-s{transform:translateY(140%) scale(.6)}
.hx-to-w{transform:translateX(-160%) scale(.6)}.hx-to-e{transform:translateX(160%) scale(.6)}
.hx-msg{position:absolute;left:50%;top:calc(100% + .5em);transform:translateX(-50%);width:max(100%, 16em);max-width:calc(100vw - 3rem);text-align:center;font-size:.84rem;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.7)}
.hx-go{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);white-space:nowrap}
.hx-go[disabled]{opacity:.6;cursor:default}
.hx-me{grid-area:me;text-align:center}
.hx-hand{position:relative;height:calc(var(--ch) + 16px);margin:0 auto;max-width:100%}
.tk-table .hx-hand .pcard{position:absolute;top:14px;transition:top .15s ease}
.tk-table .hx-hand .pcard:not(.hx-off){cursor:pointer}
.tk-table .hx-hand .pcard.hx-up{top:0}
.tk-table .hx-hand .pcard:not(.hx-off):hover{top:6px}
.tk-table .hx-hand .pcard.hx-up:hover{top:0}
.tk-table .hx-hand .pcard.hx-off{filter:brightness(.78);cursor:not-allowed}
.tk-table .hx-hand .pcard.hx-new{box-shadow:0 0 0 2px var(--tf-accent,#ffd600),0 0 12px var(--tf-accent,#ffd600) !important}
.hx-sheet td,.hx-sheet th{text-align:right !important}
.hx-sheet td:first-child,.hx-sheet th:first-child{text-align:left !important}
body.tc-on .hx-name b{color:#ff0}
@media (max-width:560px){.hx-name{font-size:.72rem}.hx-trick{margin-bottom:3.4em}}
.hx-go[hidden]{display:none !important}
/* the shared hover lift must not pop a buried card over the ones on top of it */
.tk-table .tk-col .pcard:hover,.tk-table .hx-hand .pcard:hover,.tk-table .tk-slot .pcard:hover{z-index:auto}
