/* ============================================
         Klondike Solitaire: Style.css
   ============================================ */

/* 3-col layout */
/*.column {
  float: left;
}

.left, .right {
  width: 25%;
}

.middle {
  width: 50%;
  display: flex;
  justify-content: center;
}*/

.column-left{ float: left; width: 25%; }
.column-right{ float: right; width: 25%; }
.column-center{ display: inline-block; width: 50%; }


/* Ad1 */
/*.ad1 {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}*/


/* Score Board */
.score-area {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.score-box {
  background: #f0fff4;
  border: 2px solid #9ae6b4;
  border-radius: 10px;
  padding: 0.4rem 1.1rem;
  text-align: center;
  min-width: 80px;
}

.score-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #276749;
}

.score-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: #2d3748;
}

/* Controls */
.sol-controls {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 0.7rem;
}

.sol-btn {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.45rem 1.4rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, #38a169, #276749);
  color: #fff;
  box-shadow: 0 3px 8px rgba(56, 161, 105, 0.35);
  transition: transform 0.15s;
}

.sol-btn:hover {
  transform: translateY(-1px);
}

.sol-btn-sub {
  background: #718096;
  box-shadow: 0 3px 8px rgba(113, 128, 150, 0.35);
}

/* Solitaire Board */
#sol-board {
  --card-w: clamp(38px, 11.5vw, 66px);
  --card-h: calc(var(--card-w) * 1.4);
  --ov-down: calc(var(--card-h) * 0.16);
  --ov-up: calc(var(--card-h) * 0.34);
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  padding: 10px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 50% 20%, rgba(255, 255, 255, 0.08), transparent 60%),
    linear-gradient(160deg, #2f855a, #276749 60%, #22543d);
  border: 4px solid #22543d;
  user-select: none;
  -webkit-user-select: none;
}

#sol-top-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

#sol-tableau {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  min-height: calc(var(--card-h) + var(--ov-down) * 6 + var(--ov-up) * 12);
}

.sol-pile {
  position: relative;
  height: var(--card-h);
}

.sol-col {
  position: relative;
}

/* Cards */
.sol-card {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  box-sizing: border-box;
  cursor: pointer;
}

.sol-card.up {
  background: #fdfdf8;
  border: 1px solid #cbd5e0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  color: #1a202c;
}

.sol-card.up.red {
  color: #c53030;
}

.sol-corner {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: calc(var(--card-w) * 0.3);
  font-weight: 800;
  line-height: 1.05;
}

.sol-center {
  position: absolute;
  right: 4px;
  bottom: 0;
  font-size: calc(var(--card-w) * 0.52);
  opacity: 0.85;
}

/* Background */
.sol-card.back {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.14) 0 4px, transparent 4px 8px),
    linear-gradient(160deg, #4c7bd9, #2c5aa0);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Empty */
.sol-empty {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--card-w);
  height: var(--card-h);
  border: 2px dashed rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: calc(var(--card-w) * 0.5);
}

.sol-recycle {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 900;
}

/* Count */
.sol-count {
  position: absolute;
  right: -2px;
  bottom: -4px;
  background: #22543d;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  pointer-events: none;
}

/* Shake */
.sol-shake {
  animation: sol-shake 0.25s ease-out;
}

@keyframes sol-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  70% { transform: translateX(4px); }
}

/* Winner Message */
.sol-win {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(26, 32, 44, 0.65);
  border-radius: 10px;
  z-index: 5;
}

.sol-win.active {
  display: flex;
}

.sol-win-inner {
  background: #fff;
  border-radius: 14px;
  padding: 1.6rem 2.2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.sol-win-inner h2 {
  margin: 0 0 0.6rem;
  color: #276749;
}

.sol-win-inner p {
  margin: 0.3rem 0;
  color: #2d3748;
  font-weight: 600;
}

.sol-win-inner .sol-btn {
  margin-top: 0.9rem;
}

.best-result {
  color: #b7791f !important;
  font-weight: 700 !important;
}

/* Media Size */
@media (max-width: 600px) {
  .score-box {
    min-width: 66px;
    padding: 0.3rem 0.8rem;
  }

  .score-value {
    font-size: 1.1rem;
  }

  #sol-board {
    padding: 6px;
  }
}
