/* Spades: a deep blue card table over the Handeware kit. */
:root{--felt:#1c4a73;--felt-deep:#0d2440;--gold:#ffd166;--card:#fffdf7;--red:#c4213a;--blk:#1b1d21;--sel:#4da3ff;--new:#7bd389}
body{background:var(--felt-deep)}
.felt-bg{background:radial-gradient(ellipse 120% 90% at 50% 42%,#2a6491 0%,var(--felt) 45%,var(--felt-deep) 100%)}

/* home */
.home{gap:.9em}
.home .logo svg{width:4.2em;height:4.2em;fill:#f7f3e8;filter:drop-shadow(0 6px 14px rgba(0,0,0,.35))}
.home .title{color:#fff8e6;text-shadow:0 2px 0 rgba(0,0,0,.35),0 8px 22px rgba(0,0,0,.4)}
.tagline{color:#f3efe3}
.opts{display:flex;flex-direction:column;gap:.6em;align-items:center}
.opts .choices{justify-content:center}
.choice{min-height:44px;min-width:5.2em;font-weight:600;background:rgba(0,0,0,.22);border-color:rgba(255,255,255,.22);color:#fff}
.choice[aria-pressed=true]{background:var(--gold);color:#3a2706;border-color:#fff3c4}
.links{flex-wrap:wrap}
.link{min-height:44px;color:#ffe7a8}
.lock{color:#fff}
.lock a{color:var(--gold)}
@media (max-height:520px) and (min-width:560px){
  .home{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto auto auto auto;align-content:center;column-gap:2em;row-gap:.5em}
  .home .logo{grid-column:1;grid-row:1}
  .home .title{grid-column:1;grid-row:2;font-size:3.2em}
  .home .tagline{grid-column:1;grid-row:3;justify-self:center}
  .home .opts{grid-column:2;grid-row:1/3}
  .home #playBtn{grid-column:2;grid-row:3;justify-self:center}
  .home #newBtn{grid-column:1;grid-row:4;justify-self:center}
  .home .links{grid-column:2;grid-row:4}
  .home .logo svg{width:2.8em;height:2.8em}
}
@media (max-height:420px){html:not(.hw-embed) body:has(#home:not([hidden])) #home{padding-top:58px!important}}

/* bar */
#game .bar{padding-bottom:.2em}
.bar .jewel{background:rgba(0,0,0,.25);border-color:rgba(255,255,255,.5);box-shadow:none}
.bar .jewel svg{stroke:#fff}
.status{flex:1;text-align:center;font-weight:700;font-size:1.05em;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.5);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.me{display:flex;align-items:center;gap:.25em;background:rgba(0,0,0,.28);border:1px solid rgba(255,255,255,.14);border-radius:999px;padding:.35em .8em;color:#fff;white-space:nowrap;min-height:2.4em}
.me b{font-size:1.1em}
#me{gap:.6em;padding:.3em .8em}
.tm{display:flex;align-items:baseline;gap:.25em}
.tm.us{color:#bcd3ff}
.tm.them{color:#ffd2a6}
.tm b{color:#fff;font-size:1.1em}

/* the cards: drawn in code, moved by transform alone */
.felt{overflow:hidden;touch-action:manipulation}
.pc{position:absolute;left:0;top:0;width:var(--cw);height:calc(var(--cw)*1.4);padding:0;border:0;background:none;transform-origin:50% 50%;
  transition:transform .34s cubic-bezier(.2,.8,.25,1),opacity .3s,filter .2s;will-change:transform;opacity:0;cursor:default}
.pc.mine{cursor:pointer}
.pc .in{position:absolute;inset:0;border-radius:calc(var(--cw)*.09);background:linear-gradient(170deg,#fff,var(--card) 55%,#f2ede0);
  border:1px solid rgba(0,0,0,.2);box-shadow:0 2px 6px rgba(0,0,0,.35);overflow:hidden;transition:box-shadow .2s,transform .15s}
.pc.red{color:var(--red)}
.pc.black{color:var(--blk)}
.pc svg{fill:currentColor;display:block}
.ix{position:absolute;left:3%;top:3%;width:30%;display:flex;flex-direction:column;align-items:center;line-height:1}
.ix b{font:800 calc(var(--cw)*.3)/1 var(--sans);letter-spacing:-.04em}
.ix b.ten{font-size:calc(var(--cw)*.25);letter-spacing:-.08em}
.ix svg{width:calc(var(--cw)*.21);height:calc(var(--cw)*.21);margin-top:calc(var(--cw)*.02)}
.ix.br{left:auto;top:auto;right:3%;bottom:3%;transform:rotate(180deg)}
.mid{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.mid svg{width:calc(var(--cw)*.46);height:calc(var(--cw)*.46)}
.mid.ace svg{width:calc(var(--cw)*.6);height:calc(var(--cw)*.6)}
.mid.face b{font:900 calc(var(--cw)*.42)/1 var(--serif)}
.mid.face svg{width:calc(var(--cw)*.24);height:calc(var(--cw)*.24);margin-top:calc(var(--cw)*.04)}
.pc.legal .in{box-shadow:0 0 0 2px var(--gold),0 4px 14px rgba(0,0,0,.4)}
.pc.dim{filter:brightness(.68) saturate(.6)}
.pc:focus-visible{outline:none}
.pc:focus-visible .in{box-shadow:0 0 0 4px #fff,0 0 0 7px #1b6cff}
@media (hover:hover){.pc.legal:hover .in,.home .pc:hover .in{transform:translateY(-5%)}}
.in.nudge{animation:nudge .34s}
@keyframes nudge{20%{transform:translateX(-7%)}40%{transform:translateX(6%)}60%{transform:translateX(-4%)}80%{transform:translateX(2%)}}
.felt.instant .pc{transition:none!important}
html.fast .pc{transition-duration:.12s}

/* the other three players */
.seat{position:absolute;z-index:40;transition:opacity .25s,box-shadow .25s,background .25s;transform:translate(-50%,-50%);width:var(--bw);display:flex;flex-direction:column;align-items:center;gap:.15em;padding:.35em .3em;
  border-radius:1em;background:rgba(0,0,0,.26);border:1px solid rgba(255,255,255,.14);color:#fff;font-size:.9em;line-height:1.15}
.seat .av{width:2.2em;height:2.2em;border-radius:50%;display:grid;place-items:center;font-weight:800;background:var(--avc);border:2px solid rgba(255,255,255,.8)}
.seat .who{display:flex;flex-direction:column;align-items:center}
.seat .nm{font-weight:700}
.seat .sc b{font-size:1.05em}
.seat.on{background:rgba(0,0,0,.4);box-shadow:0 0 0 3px var(--gold),0 0 18px rgba(255,209,102,.55)}
.seat.won{animation:won .6s}
@keyframes won{40%{transform:translate(-50%,-50%) scale(1.1)}}
.felt.land .seat{flex-direction:row;gap:.5em;padding:.3em .6em}
.felt.land .seat .who{align-items:flex-start}
.seat .bd{font-size:.85em;color:#e8eefc;min-height:1.15em;white-space:nowrap}
.seat.pard{border-color:rgba(140,180,255,.55)}

/* the bid picker: above the hand, over the empty table */
.bidbox{position:absolute;z-index:90;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;pointer-events:none}
.bidbox>*{pointer-events:auto}
.bidtitle{font-weight:700;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,.5);text-align:center}
.bidnums{display:grid;grid-template-columns:repeat(var(--cols),44px);gap:5px;padding:8px;border-radius:16px;background:rgba(5,16,32,.55);border:1px solid rgba(255,255,255,.16)}
.bn{width:44px;height:44px;border-radius:12px;border:1px solid rgba(255,255,255,.3);background:rgba(255,255,255,.1);color:#fff;font-weight:800;font-size:1.05em;padding:0}
.bn#bid0{font-size:.85em}
.bn[aria-pressed=true]{background:var(--gold);color:#3a2706;border-color:#fff3c4;box-shadow:0 0 12px rgba(255,209,102,.6)}
.bn:focus-visible{outline:3px solid #fff;outline-offset:2px}
@media (hover:hover){.bn:hover{background:rgba(255,255,255,.22)}.bn[aria-pressed=true]:hover{background:var(--gold)}}
.bidgo{min-height:48px;padding:.5em 2em}
.bidbox.tight{gap:6px;justify-content:flex-start}
.sofar{font-size:.92em;color:#e8eefc;text-shadow:0 1px 4px rgba(0,0,0,.5);text-align:center;white-space:nowrap}
.felt.land .bidtitle{display:none}
.felt.bidding .seat{opacity:0;pointer-events:none}
.seat .tag{font-size:.68em;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:#bcd3ff}
.bidbox.tight .bidtitle{display:none}
.felt.land .bidbox{justify-content:flex-start}

/* cards over the table */
.card{background:linear-gradient(180deg,#1e3f63,#132b47 60%);border-color:rgba(255,255,255,.18)}
.card h2{color:#ffe3a0}
.row{min-height:48px;color:#fff}
.how{margin:0;padding-left:1.1em;display:flex;flex-direction:column;gap:.35em}
.scores{display:flex;flex-direction:column;gap:.35em}
.srow{display:grid;grid-template-columns:1.6em 1fr auto auto;align-items:center;gap:.6em;padding:.45em .7em;border-radius:.7em;background:rgba(255,255,255,.06)}
.srow.you{background:rgba(255,209,102,.16)}
.srow .dot{width:.9em;height:.9em;border-radius:50%}
.srow .add{color:#9be7a8;font-weight:700}
.srow .neg{color:#ff9fb0;font-weight:700}
.scores.sp .srow{grid-template-columns:3.2em 1fr 1fr 1fr 1fr;text-align:center}
.scores.sp .srow .nm{text-align:left;font-weight:700}
.scores.sp .hd{background:none;padding-top:0;padding-bottom:0;color:var(--ink-soft);font-size:.8em}
.hnote{margin:.35em 0 0;text-align:center;font-size:.92em;color:#f3efe3}
.hnote:last-child{color:var(--ink-soft);font-size:.82em}
.srow b{font:800 1.2em/1 var(--serif);min-width:2em;text-align:right}
.results .srow{grid-template-columns:1.6em 1fr auto}
.results .place{font-weight:800;color:var(--gold)}
.results.won h2{font-size:2em;color:var(--gold)}
.kicker{margin:-.4em 0 .2em;text-align:center;font-size:.78em;letter-spacing:.16em;text-transform:uppercase;color:#bcd3ff}
.lvs{display:flex;justify-content:center;gap:.8em;color:var(--ink-soft)}
.lv.done{color:var(--new);font-weight:700}
.toast{top:max(4.2em,calc(env(safe-area-inset-top) + 3.6em));bottom:auto;background:#0f2540;z-index:95;border-color:rgba(255,255,255,.25);color:#fff;white-space:nowrap;font-weight:600}
.confetti{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:60}
@media (max-height:420px){.card{padding:1em 1.2em .9em}.card h2{margin-bottom:.4em}.srow{padding:.25em .6em}.card .actions{margin-top:.6em}}
@media (max-height:420px){
  .card h2{font-size:1.3em}
  .results.won h2{font-size:1.5em}
  .card .note{margin:.1em 0 .4em}
  .card .stats{margin:.3em 0 0;gap:1.2em;font-size:.85em}
  .card .stats b{font-size:1.25em}
  .card .actions{flex-direction:row;justify-content:center;gap:1em;margin-top:.5em}
  .card .pill{padding:.5em 1.6em}
  .hnote{margin-top:.2em}
}
