/* Shared look for the Klondike family (Klondike Draw 1 / Draw 3, Yukon).
   Each game's own game.css only sets --cw/--ch. Loaded via game_deps in games.json. */

.game-app {
  /* default: 7 columns + six 6px gaps must fit inside the board's card area.
     Card area = 100vw - 83px (page gutters + scrollbar gutter + board padding),
     so the slack below leaves ~13px of breathing room at every width. */
  --cw: min(76px, calc((100vw - 132px) / 7));
  --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: 320px;
  overflow: visible;
}
.g-row { display: flex; gap: 6px; }
.g-top { margin-bottom: calc(var(--ch) * 0.22); }
.g-gap { flex: 1; }
.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);
}

.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; }

.noscript-note {
  background: #ffffff; border-radius: 10px; padding: 14px 18px; margin: 18px 0;
  color: #52606d; font-size: 14.5px;
}

@media (max-width: 640px) {
  .g-board { padding: 8px; }
  .g-hud { flex-direction: column; align-items: flex-start; gap: 8px; }
  .g-stats { width: 100%; justify-content: space-between; gap: 8px; }
  .card { font-size: calc(var(--cw) * 0.26); }
  .g-panel { padding: 22px 26px; }
}
