/* Shared look for the Spider family (Spider 1/2 suits, Scorpion).
   Each game's own game.css only sets --cw/--ch. Loaded via game_deps in games.json. */

.game-app {
  /* ten columns + nine 4px gaps must fit inside the board's card area */
  --cw: min(72px, calc((100vw - 132px) / 10));
  --ch: calc(var(--cw) * 1.42);
  margin: 22px 0 8px;
}

.g-hud {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}
.g-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.g-btn {
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 7px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid #cfd6dd; background: #ffffff; color: #155e4a;
}
.g-btn:hover { background: #eef4f1; }
.g-btn-acc { background: #1e7a5f; border-color: #1e7a5f; color: #fff; }
.g-btn-acc:hover { background: #155e4a; }
.g-stats { display: flex; gap: 16px; flex-wrap: wrap; }
.g-stat { font-size: 13.5px; color: #52606d; }
.g-stat b { color: #1f2933; }

.g-board {
  position: relative;
  background: #1e7a5f;
  background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
  border-radius: 14px;
  padding: 14px;
  min-height: 360px;
  overflow: visible;
}
.g-row { display: flex; gap: 4px; align-items: flex-start; }
.g-top { margin-bottom: calc(var(--ch) * 0.24); }
.g-hint {
  flex: 1; align-self: center; text-align: center;
  font-size: 13px; color: #ffe3a8; min-height: 18px; padding: 0 8px;
}
.pile {
  width: var(--cw); height: var(--ch); flex: none; position: relative;
  border-radius: calc(var(--cw) * 0.09);
  border: 2px dashed rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.13);
}
.pile[data-pile="stock"] { cursor: pointer; }
.pile[data-pile="done"] { border-style: solid; border-color: rgba(255, 214, 130, 0.55); background: rgba(0, 0, 0, 0.08); }

.card {
  position: absolute; left: 0; top: 0;
  width: var(--cw); height: var(--ch);
  margin: 0; /* override placeholder .card margins in site style.css */
  border-radius: calc(var(--cw) * 0.09);
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  font-size: calc(var(--cw) * 0.28);
  user-select: none; -webkit-user-select: none;
  touch-action: none;
  transition: left 0.18s ease, top 0.18s ease;
}
.card.no-anim { transition: none; }
.card.drag { box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5); }
.card.red { color: #c0392b; }
.card.black { color: #23272e; }
.card .corner {
  position: absolute; top: 3%; left: 7%;
  display: flex; flex-direction: column; align-items: center;
  line-height: 1.05; font-weight: 700;
}
.card .corner .cr { display: block; font-size: 0.92em; letter-spacing: -0.02em; }
.card .corner .cs { display: block; font-size: 0.85em; }
.card .corner-br { top: auto; left: auto; bottom: 3%; right: 7%; transform: rotate(180deg); }
.card .pip {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.1em;
}
.card.back {
  border: 2px solid #f4f7fa;
  background-color: #2c5f9e;
  background-image: repeating-linear-gradient(45deg, #2c5f9e 0, #2c5f9e 5px, #3b74ba 5px, #3b74ba 10px);
}

.g-overlay {
  position: absolute; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(21, 51, 41, 0.72);
  border-radius: 14px;
}
.g-overlay[hidden] { display: none; }
.g-panel {
  background: #ffffff; border-radius: 14px; padding: 30px 40px;
  text-align: center; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
}
.g-win-title { font-size: 26px; font-weight: 700; color: #155e4a; margin-bottom: 8px; }
.g-win-stats { font-size: 14.5px; color: #52606d; margin-bottom: 18px; }

@media (max-width: 640px) {
  /* ten columns + nine 2px gaps. The card area is 100vw - 71px here, so this
     slack still leaves ~13px spare on a 320px phone. */
  .game-app { --cw: calc((100vw - 102px) / 10); }
  .g-board { padding: 8px; }
  .g-row { gap: 2px; }
  .g-hud { flex-direction: column; align-items: flex-start; gap: 8px; }
  .g-stats { width: 100%; justify-content: space-between; gap: 8px; }
  .g-hint { font-size: 12px; }
  .card { font-size: calc(var(--cw) * 0.26); }
  .g-panel { padding: 22px 26px; }
}
