/* ============ Карточные игры — общие стили ============ */
:root {
  --felt: #1e5c3a;
  --felt-dark: #17492e;
  --felt-light: #26714a;
  --gold: #e8c872;
  --card-w: clamp(52px, 11vw, 84px);
  --card-h: calc(var(--card-w) * 1.42);
  --radius: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--felt);
  background-image:
    radial-gradient(ellipse at 50% 0%, var(--felt-light) 0%, var(--felt) 55%, var(--felt-dark) 100%);
  color: #f2f2f2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--gold); }

.container {
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ---------- Шапка ---------- */
.site-header {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.logo span { color: var(--gold); }
.site-nav { display: flex; gap: 14px; flex-wrap: wrap; }
.site-nav a {
  color: #d9e7dd;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 10px;
  border-radius: 6px;
}
.site-nav a:hover, .site-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ---------- Главная ---------- */
main { flex: 1; }
.hero {
  text-align: center;
  padding: 42px 14px 26px;
}
.hero h1 {
  font-size: clamp(1.6rem, 5vw, 2.6rem);
  margin-bottom: 12px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.hero p {
  max-width: 640px;
  margin: 0 auto 8px;
  color: #cfe3d5;
  font-size: 1.05rem;
  line-height: 1.55;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  padding: 26px 0 40px;
}
.game-card {
  background: rgba(255, 255, 255,  0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s;
}
.game-card:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold);
}
.game-card .suits { font-size: 2rem; letter-spacing: 6px; }
.game-card .suits .red { color: #ff6b6b; }
.game-card h2 { font-size: 1.3rem; color: #fff; }
.game-card p { color: #cfe3d5; font-size: 0.95rem; line-height: 1.5; flex: 1; }
.game-card .play {
  align-self: flex-start;
  background: var(--gold);
  color: #21301f;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.95rem;
}
.game-card.soon { opacity: 0.55; cursor: default; }
.game-card.soon:hover { transform: none; border-color: rgba(255,255,255,0.1); }
.game-card.soon .play { background: #8a9a8d; color: #26332a; }

.home-seo {
  padding: 10px 0 46px;
  color: #cfe3d5;
  line-height: 1.65;
  font-size: 0.97rem;
}
.home-seo h2 { color: #fff; margin: 22px 0 10px; font-size: 1.25rem; }
.home-seo ul { margin: 8px 0 8px 22px; }

/* ---------- Страница игры ---------- */
.game-page main { padding-bottom: 30px; }
.game-title-row {
  text-align: center;
  padding: 16px 14px 4px;
}
.game-title-row h1 {
  font-size: clamp(1.3rem, 4vw, 1.9rem);
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
.scoreboard {
  display: flex;
  justify-content: center;
  gap: 22px;
  padding: 8px 0 2px;
  color: #cfe3d5;
  font-size: 0.92rem;
}
.scoreboard b { color: var(--gold); }

.statusbar {
  text-align: center;
  min-height: 28px;
  padding: 6px 10px;
  font-size: 1.02rem;
  font-weight: 600;
  color: #ffe9ad;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.table {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 14px 18px;
  min-height: calc(var(--card-h) * 1.55);
  padding: 14px 10px 20px;
  margin: 6px auto 4px;
  max-width: 900px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

.pair { position: relative; width: var(--card-w); height: var(--card-h); }
.pair .card.defense {
  position: absolute;
  top: 16%;
  left: 26%;
  transform: rotate(12deg);
}

.deck-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 8px;
}
.deck-count, .discard-count {
  font-size: 0.85rem;
  color: #cfe3d5;
  text-align: center;
  line-height: 1.3;
}
.deck-stack { position: relative; width: var(--card-w); height: var(--card-h); }
.deck-stack .card.back + .card.back {
  position: absolute;
  top: 3px;
  left: 3px;
}
.trump-mini {
  position: absolute;
  top: 8px;
  left: 14px;
  transform: rotate(90deg);
  transform-origin: bottom left;
}
.discard-stack {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  border: 2px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfe3d5;
  font-size: 0.85rem;
  text-align: center;
}

.hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 6px 4px;
  min-height: calc(var(--card-h) + 12px);
}
.hand .card { cursor: pointer; transition: margin-top 0.12s ease, box-shadow 0.12s ease; }
.hand .card:hover { margin-top: -10px; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.5); }
.hand-label {
  text-align: center;
  color: #cfe3d5;
  font-size: 0.88rem;
  padding-top: 2px;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 10px 6px;
}
.btn {
  background: var(--gold);
  color: #21301f;
  border: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 11px 26px;
  border-radius: 9px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.1s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.97); }
.btn.secondary { background: rgba(255, 255, 255, 0.14); color: #fff; }
.btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- Карта ---------- */
.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: var(--radius);
  background: linear-gradient(160deg, #ffffff 0%, #f1f1f1 100%);
  color: #1a1a1a;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  position: relative;
  user-select: none;
  display: inline-block;
  flex: none;
}
.card .corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
  font-weight: 700;
}
.card .corner.tl { top: 5px; left: 6px; }
.card .corner.br { bottom: 5px; right: 6px; transform: rotate(180deg); }
.card .corner .r { font-size: calc(var(--card-w) * 0.24); }
.card .corner .s { font-size: calc(var(--card-w) * 0.2); }
.card .pip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--card-w) * 0.5);
}
.card.red { color: #c62828; }
.card.trump { box-shadow: 0 0 0 2px var(--gold), 0 2px 5px rgba(0, 0, 0, 0.4); }
.card.back {
  background:
    repeating-linear-gradient(45deg, #274b8f 0 6px, #1d3a73 6px 12px);
  border: 3px solid #e9edf5;
}
.card.back::after {
  content: "♠";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: calc(var(--card-w) * 0.4);
}
.card.attacking { animation: pulse 1.1s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--gold), 0 2px 5px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 14px 3px rgba(255, 224, 138, 0.9); }
}

/* ---------- Правила / FAQ ---------- */
.rules-section {
  max-width: 760px;
  margin: 26px auto 10px;
  padding: 0 14px 30px;
  color: #d7e8dc;
  line-height: 1.65;
  font-size: 0.97rem;
}
.rules-section h2 { color: #fff; margin: 20px 0 10px; font-size: 1.25rem; }
.rules-section h3 { color: #fff; margin: 16px 0 8px; font-size: 1.08rem; }
.rules-section p { margin-bottom: 10px; }
.rules-section ul, .rules-section ol { margin: 6px 0 12px 22px; }
.rules-section li { margin-bottom: 5px; }
.rules-section details {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.rules-section summary {
  cursor: pointer;
  font-weight: 700;
  color: #fff;
}
.rules-section details[open] summary { margin-bottom: 8px; color: var(--gold); }

/* ---------- Футер ---------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  padding: 18px 0;
  text-align: center;
  color: #b9cec0;
  font-size: 0.88rem;
  line-height: 1.6;
}
.site-footer a { color: #d9e7dd; }

/* ---------- Мелкие экраны ---------- */
@media (max-width: 640px) {
  .table { gap: 10px; }
  .hand { gap: 4px; }
  .hero { padding-top: 28px; }
  .btn { padding: 10px 18px; font-size: 0.95rem; }
}
