/* ==============================================
   РАСПИСНОЙ ПОКЕР — main.css
   v0.3 — локальные шрифты, без CDN
   ============================================== */

/* ── Playfair Display ── */
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0400-04FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic; font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-cyrillic-400-italic.woff2') format('woff2');
  unicode-range: U+0400-04FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic; font-weight: 400;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 700;
  font-display: swap;
  src: url('../fonts/playfair-display-cyrillic-700-normal.woff2') format('woff2');
  unicode-range: U+0400-04FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal; font-weight: 700;
  font-display: swap;
  src: url('../fonts/playfair-display-latin-700-normal.woff2') format('woff2');
}

/* ── Oswald ── */
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 300;
  font-display: swap;
  src: url('../fonts/oswald-cyrillic-300-normal.woff2') format('woff2');
  unicode-range: U+0400-04FF;
}
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 300;
  font-display: swap;
  src: url('../fonts/oswald-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/oswald-cyrillic-400-normal.woff2') format('woff2');
  unicode-range: U+0400-04FF;
}
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/oswald-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 600;
  font-display: swap;
  src: url('../fonts/oswald-cyrillic-600-normal.woff2') format('woff2');
  unicode-range: U+0400-04FF;
}
@font-face {
  font-family: 'Oswald';
  font-style: normal; font-weight: 600;
  font-display: swap;
  src: url('../fonts/oswald-latin-600-normal.woff2') format('woff2');
}

/* ── Merriweather Sans ── */
@font-face {
  font-family: 'Merriweather Sans';
  font-style: normal; font-weight: 300;
  font-display: swap;
  src: url('../fonts/merriweather-sans-latin-300-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Merriweather Sans';
  font-style: normal; font-weight: 400;
  font-display: swap;
  src: url('../fonts/merriweather-sans-latin-400-normal.woff2') format('woff2');
}

:root {
  /* Цветовая палитра — одесский ночной клуб */
  --felt-dark:      #0d2218;
  --felt-mid:       #14331f;
  --felt-light:     #1a3d28;
  --felt-accent:    #1f4a2f;

  --gold:           #c9993a;
  --gold-light:     #e8bc5a;
  --gold-dim:       #7a5c1e;
  --gold-glow:      rgba(201, 153, 58, 0.25);

  --cream:          #f5e9c8;
  --cream-dim:      #b8a880;

  --red-suit:       #cc2222;
  --red-bright:     #e63333;

  --score-pos:      #5dda7e;
  --score-neg:      #e05050;
  --score-neu:      #c9c9c9;

  --ui-bg:          rgba(0,0,0,0.45);
  --ui-border:      rgba(201,153,58,0.3);
  --ui-border-glow: rgba(201,153,58,0.7);

  --shadow-card:    0 4px 18px rgba(0,0,0,0.65);
  --shadow-panel:   0 2px 12px rgba(0,0,0,0.5);

  /* Типографика */
  --font-display:   'Playfair Display', serif;
  --font-ui:        'Oswald', sans-serif;
  --font-body:      'Merriweather Sans', sans-serif;

  /* Размеры карт */
  --card-w:         72px;
  --card-h:         100px;
  --card-w-sm:      54px;
  --card-h-sm:      76px;
  --card-w-xs:      42px;
  --card-h-xs:      59px;

  /* Анимации */
  --ease-card:      cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:    cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  background: var(--felt-dark);
  color: var(--cream);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Фактура сукна */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.04) 2px,
      rgba(0,0,0,0.04) 4px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.04) 2px,
      rgba(0,0,0,0.04) 4px
    );
  pointer-events: none;
  z-index: 0;
}

/* Виньетка по краям */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(0,0,0,0.55) 100%
  );
  pointer-events: none;
  z-index: 0;
}

/* ===================== УТИЛИТЫ ===================== */
.gold-text    { color: var(--gold-light); }
.pos-score    { color: var(--score-pos); }
.neg-score    { color: var(--score-neg); }

.panel {
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  backdrop-filter: blur(4px);
}

/* ===================== КАРТЫ ===================== */
.card {
  width: var(--card-w);
  height: var(--card-h);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  position: relative;
  flex-shrink: 0;
  transition: transform 0.2s var(--ease-card), box-shadow 0.2s;
  cursor: default;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-back {
  background: var(--felt-mid);
  border: 2px solid var(--gold-dim);
}

.card.selectable {
  cursor: pointer;
}

.card.selectable:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.8), 0 0 12px var(--gold-glow);
}

.card.selected {
  transform: translateY(-12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.8), 0 0 18px var(--gold-glow);
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}

/* Стопки карт (рубашки ботов) */
.card-stack {
  position: relative;
  display: inline-block;
}

.card-stack .card-back-layer {
  position: absolute;
  border-radius: 6px;
  border: 1px solid var(--gold-dim);
  background: var(--felt-mid);
}

/* ===================== КНОПКИ ===================== */
.btn-gold {
  background: linear-gradient(135deg, var(--gold-dim), var(--gold));
  color: var(--felt-dark);
  border: none;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 18px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  box-shadow: 0 4px 14px rgba(201,153,58,0.4);
  transform: translateY(-1px);
}

.btn-gold:active {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--cream-dim);
  border: 1px solid var(--ui-border);
  border-radius: 4px;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 4px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--cream);
}

/* ===================== ПОРТРЕТНАЯ БЛОКИРОВКА ===================== */
#rotate-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--felt-dark);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  text-align: center;
}

#rotate-screen .rotate-icon {
  font-size: 64px;
  animation: rotate-hint 1.4s ease-in-out infinite;
  display: block;
}

#rotate-screen p {
  font-family: var(--font-ui);
  font-size: 1.1rem;
  color: var(--cream-dim);
  letter-spacing: 0.08em;
}

@keyframes rotate-hint {
  0%   { transform: rotate(0deg); }
  30%  { transform: rotate(90deg); }
  60%  { transform: rotate(90deg); }
  90%  { transform: rotate(0deg); }
  100% { transform: rotate(0deg); }
}

@media (max-width: 768px) and (orientation: portrait) {
  #rotate-screen { display: flex; }
  #game-root      { display: none; }
}
