/* Spider Solitaire — ten columns on the green felt, the stock at the corner. */

[hidden] { display: none !important; }

.spider-frame {
  width: min(880px, 97vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(10px, 2.2vw, 18px);
}
.deal-line {
  margin: 0;
  text-align: center;
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(14px, 2.1vw, 16.5px);
  color: var(--ink-soft);
  min-height: 1.4em;
}
.deal-line b { color: var(--oxblood); font-weight: 600; }
.deal-line.scold { color: var(--oxblood-bright); }

.upper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(31, 51, 38, .95), rgba(21, 36, 27, .98));
  box-shadow: inset 0 0 0 1px rgba(200, 156, 58, .3);
}

/* ---- swept suits ---- */
.homes { display: flex; gap: clamp(3px, .8vw, 7px); flex-wrap: wrap; }
.home-slot {
  width: clamp(30px, 6vw, 44px);
  aspect-ratio: 5 / 7;
  border-radius: 5px;
  border: 1.5px dashed rgba(241, 230, 200, .25);
  background: rgba(246, 238, 214, .04);
  display: grid;
  place-items: center;
  position: relative;
}
.home-slot .pcard { position: absolute; inset: 0; width: 100%; border-radius: 5px; }
.home-slot .pcard .pc-corner { font-size: clamp(8px, 1.6vw, 11px); }
.home-slot .pcard .pc-glyph { font-size: clamp(11px, 2.2vw, 16px); }
.home-slot .pcard .pc-corner.br { display: none; }

/* ---- the stock ---- */
.stock {
  position: relative;
  border: none;
  background: none;
  padding: 0 0 0 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.stock-pile { position: relative; width: clamp(44px, 8.6vw, 56px); aspect-ratio: 5 / 7; }
.stock-pile .back {
  position: absolute;
  inset: 0;
  border-radius: 6px;
}
.stock-pile.empty {
  border-radius: 6px;
  border: 1.5px dashed rgba(241, 230, 200, .25);
}
.stock-label {
  font-family: var(--hand);
  font-style: italic;
  font-size: clamp(12.5px, 1.9vw, 15px);
  color: rgba(241, 230, 200, .75);
  text-align: left;
  line-height: 1.25;
}
.stock:hover .stock-pile .back:last-child { transform: translateY(-2px); }
.stock.pulse .stock-pile { animation: stock-pulse 1.1s ease 2; }
@keyframes stock-pulse {
  0%, 100% { transform: none; }
  50% { transform: translateY(-3px); }
}

/* ---- the card back (face-down + stock) ---- */
.pcard.down, .stock-pile .back {
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 55%),
    repeating-linear-gradient(45deg, rgba(94, 27, 32, .96) 0 6px, rgba(74, 20, 25, .96) 6px 12px),
    #5e1b20;
  box-shadow: inset 0 0 0 1px rgba(122, 104, 80, .55), inset 0 0 0 3px rgba(241, 230, 200, .16), 0 3px 8px rgba(0, 0, 0, .35);
}
.pcard.down { cursor: default; }
.pcard.down::after, .stock-pile .back::after {
  content: '✦';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(227, 183, 84, .5);
  font-size: clamp(11px, 2vw, 15px);
}

/* ---- tableau ---- */
.tableau {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: clamp(3px, .8vw, 8px);
  padding: clamp(6px, 1.2vw, 10px);
  min-height: 420px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(31, 51, 38, .95), rgba(21, 36, 27, .98));
  box-shadow: inset 0 0 0 1px rgba(200, 156, 58, .3), inset 0 8px 22px rgba(0, 0, 0, .4);
}
.cascade {
  position: relative;
  min-height: 380px;
  border-radius: 6px;
}
.cascade.bare { box-shadow: inset 0 0 0 1.5px rgba(241, 230, 200, .12); }
.cascade.bare.want { box-shadow: inset 0 0 0 2px rgba(227, 183, 84, .55); }
.cascade .pcard {
  position: absolute;
  left: 0;
  top: calc(var(--kd) * clamp(7px, 1.5vw, 11px) + var(--ku) * clamp(16px, 3.4vw, 24px));
  width: 100%;
  cursor: pointer;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease);
}
.cascade .pcard.runnable:hover { transform: translateY(-3px); }
.cascade .pcard.lifted {
  transform: translateY(-8px);
  box-shadow: inset 0 0 0 2px rgba(227, 183, 84, .9), 0 8px 16px rgba(0, 0, 0, .45);
  z-index: 3;
}
.cascade .pcard.hint {
  box-shadow: inset 0 0 0 2px rgba(122, 176, 132, .95), 0 6px 14px rgba(0, 0, 0, .4);
  z-index: 2;
}
.cascade.want-here { box-shadow: inset 0 0 0 2px rgba(122, 176, 132, .7); }

/* spider cards run narrower than the shared clamp expects; scale the faces */
.spider-frame .pc-corner { font-size: clamp(10px, 1.9vw, 14px); }
.spider-frame .pc-glyph { font-size: clamp(13px, 3vw, 24px); }

.frame-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.help-body { text-align: left; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }
.help-body p { margin: 0 0 12px; }
.help-body b { color: var(--oxblood); }

.pick-row { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 0; }
.pick-row .pick {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  padding: 10px 14px;
}
.pick-row .pick b { font-weight: 600; }
.pick-row .pick span {
  font-family: var(--hand);
  font-style: italic;
  font-size: 13.5px;
  opacity: .85;
}

.new-best {
  display: inline-block;
  font-family: var(--caps);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11.5px;
  color: var(--parchment);
  background: var(--oxblood);
  border-radius: 5px;
  padding: 2px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}

@media (max-width: 640px) {
  .cascade .pcard { border-radius: 4px; }
  .tableau { min-height: 320px; }
  .cascade { min-height: 300px; }
  .spider-frame .pc-corner.br { display: none; }
  .spider-frame .pc-corner { font-size: clamp(9px, 2.4vw, 12px); }
  .spider-frame .pc-glyph { font-size: clamp(11px, 3vw, 16px); }
  .stock { padding-left: 8px; }
}
