/* ── Paarefinden-spezifisch ── */

/* Hero-Gradient (sky blue) */
.hero {
  background: linear-gradient(145deg, #79b9e9, #4c8fc4);
}

/* Spieler-Namen 2-Spalten-Raster */
.playerGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.playerGrid .label {
  margin-bottom: 4px;
}

.playerGrid input {
  width: 100%;
}

/* ── Game-Layout ── */
.game {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  gap: 12px;
  overflow: hidden;
}

.scorecol {
  width: 190px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 0;
}

.scoreboard {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 0;
}

.scoreboard h2 {
  margin: 0 0 8px;
  font-size: clamp(18px, 2.4vw, 24px);
  letter-spacing: 0.2px;
  font-family: var(--brand-font);
  font-weight: 400;
}

.score {
  margin: 0;
  font-size: clamp(44px, 5.8vw, 62px);
  line-height: 1;
  font-family: var(--brand-font);
  font-weight: 400;
}

.active   { color: #111827; font-weight: 950; }
.inactive { color: #9ca3af; font-weight: 900; }

/* Spieler-Anzahl-Varianten */
.twoPlayers #sb3,
.twoPlayers #sb4   { display: none; }
.twoPlayers .scorecol .scoreboard { flex: 1 1 auto; }

.threePlayers #sb4 { display: none; }
.threePlayers #sb3 { display: flex; }
.threePlayers .scorecol#leftCol  .scoreboard { flex: 1 1 0; }
.threePlayers .scorecol#rightCol .scoreboard { flex: 1 1 auto; }

.fourPlayers .scorecol .scoreboard { flex: 1 1 0; }

/* Spielfeld-Karte */
.boardCard {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.boardMeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  flex: 0 0 auto;
}

.boardMeta p { margin: 0; }

.metaStrong { color: var(--text); font-weight: 950; }

.boardFill {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #f4f7ff;
}

/* Karten-Grid */
.grid {
  --cardSize: 72px;
  display: grid;
  gap: 10px;
  justify-content: center;
  align-content: center;
  grid-template-columns: repeat(6, var(--cardSize));
  grid-auto-rows: var(--cardSize);
  user-select: none;
  padding: 10px;
}

.card {
  width: var(--cardSize);
  height: var(--cardSize);
  perspective: 900px;
  cursor: pointer;
}

.card.matched { cursor: default; }

.inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s ease;
}

.card.flip .inner { transform: rotateY(180deg); }

.face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -14px 26px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}

.front {
  transform: rotateY(180deg);
  background: #fff;
}

.cardIcon {
  width: 78%;
  height: 78%;
  object-fit: contain;
  display: block;
}

.back {
  background:
    radial-gradient(560px 300px at 24% 16%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 62%),
    linear-gradient(145deg, #6d7380, #4c5563);
  box-shadow:
    inset 0 -14px 24px rgba(16, 21, 30, 0.34),
    inset 0 8px 16px rgba(255, 255, 255, 0.18);
}

/* ── Responsive ── */
@media (max-width: 980px) {
  .row2        { grid-template-columns: 1fr; }
  .game        { flex-direction: column; }
  .scorecol    { width: 100%; flex-direction: row; }
  .scoreboard  { flex: 1 1 0; padding: 10px 12px; }
  .scoreboard h2 { margin: 0 0 6px; font-size: 14px; }
  .score       { font-size: 28px; }
}
