body {
  margin: 0;
  background: #000;
  color: white;
  font-family: sans-serif;
}

/* HUB */
.hub {
  height: 100vh;
  overflow-y: auto;
  padding: 20px;
  position: relative;
  z-index: 2;
}

/* TOP BAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.logo {
  font-size: 28px;
  font-weight: bold;
  color: gold;
}

.stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  opacity: 0.8;
}

/* GRID */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

/* CARD */
.card {
  background: rgba(20,20,20,0.9);
  padding: 20px;
  border-radius: 14px;
  cursor: pointer;

  border: 1px solid rgba(255,215,0,0.2);

  box-shadow:
    0 0 10px rgba(255,215,0,0.2),
    inset 0 0 20px rgba(255,215,0,0.05);

  transition: 0.3s;
}

.card:hover {
  transform: translateY(-6px);

  box-shadow:
    0 0 25px rgba(255,215,0,0.7),
    0 0 60px rgba(255,215,0,0.3);
}

.card.active {
  animation: redPulse 0.4s ease;
}

@keyframes redPulse {
  0% { box-shadow: 0 0 0 rgba(255,0,0,0); }
  50% { box-shadow: 0 0 30px rgba(255,0,0,1); }
  100% { box-shadow: 0 0 0 rgba(255,0,0,0); }
}

.card h3 {
  color: gold;
  margin-bottom: 10px;
}

.card p {
  font-size: 13px;
  opacity: 0.7;
}/* ✅ BackgammonBoard.css — Wooden board with pockets, dice ON board */

/* ─── Base ─── */
body {
  margin: 0;
  background: #1a0a00;
  color: #fff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.game-container {
  min-height: 100dvh;
  background: linear-gradient(180deg, #1a0a00 0%, #0d0400 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 8px 24px;
  gap: 8px;
  box-sizing: border-box;
}

/* ─── Modals ─── */
.modal-opening, .modal-finished {
  width: 100%;
  max-width: 400px;
  padding: 24px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(60, 35, 15, 0.95), rgba(30, 15, 5, 0.98));
  border: 1px solid rgba(205, 140, 60, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  margin-top: 40px;
}

.modal-opening h2, .fin-title {
  margin: 0;
  font-size: 24px;
  color: #f5a623;
  text-shadow: 0 2px 8px rgba(245, 166, 35, 0.3);
}

.opening-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.opening-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
}

.opening-die-val {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fffdf5, #e8d5a0);
  border: 2px solid #c09040;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 900;
  color: #1a0a00;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.vs {
  font-size: 16px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.3);
}

.fin-winner {
  font-size: 20px;
  font-weight: 700;
}

.btn-main {
  width: 100%;
  padding: 14px 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #c47c1a, #8b5210);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196, 124, 26, 0.4);
  transition: all 0.15s;
}

.btn-main:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 124, 26, 0.5);
}

.btn-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ─── Game Header ─── */
.game-header {
  width: 100%;
  max-width: 540px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.turn-info {
  font-size: 14px;
  font-weight: 700;
}

.score-badges {
  display: flex;
  gap: 8px;
}

.badge {
  font-size: 12px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.badge.white {
  color: #e8c878;
  border-color: rgba(232, 200, 120, 0.3);
}

.badge.black {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

/* ─── Wooden Board ─── */
.wooden-board {
  width: 100%;
  max-width: 540px;
  position: relative;
}

.board-outer-frame {
  background: linear-gradient(145deg, #8B5E3C, #6B4226, #5A3A1F);
  padding: 8px;
  border-radius: 16px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 1px 2px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.4);
  border: 2px solid rgba(139, 94, 60, 0.6);
}

.board-inner {
  background: linear-gradient(145deg, #D4A574, #C49A6C, #B8905A);
  border-radius: 10px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ─── Board Half ─── */
.board-half {
  display: flex;
  gap: 2px;
  height: 140px;
}

/* ─── Pockets Row ─── */
.pockets-row {
  display: flex;
  flex: 1;
  gap: 1px;
}

/* ─── Pocket (checker slot) ─── */
.pocket {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(180deg,
    rgba(160, 120, 80, 0.3) 0%,
    rgba(180, 140, 100, 0.2) 30%,
    rgba(200, 160, 120, 0.15) 50%,
    rgba(180, 140, 100, 0.2) 70%,
    rgba(160, 120, 80, 0.3) 100%
  );
  border-radius: 0 0 14px 14px;
  cursor: default;
  transition: all 0.2s ease;
  overflow: visible;
}

.pocket.top {
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg,
    rgba(160, 120, 80, 0.3) 0%,
    rgba(180, 140, 100, 0.2) 30%,
    rgba(200, 160, 120, 0.15) 50%,
    rgba(180, 140, 100, 0.2) 70%,
    rgba(160, 120, 80, 0.3) 100%
  );
}

.pocket.bottom {
  border-radius: 0 0 14px 14px;
  background: linear-gradient(180deg,
    rgba(160, 120, 80, 0.3) 0%,
    rgba(180, 140, 100, 0.2) 30%,
    rgba(200, 160, 120, 0.15) 50%,
    rgba(180, 140, 100, 0.2) 70%,
    rgba(160, 120, 80, 0.3) 100%
  );
}

/* Pocket inner — the actual indentation */
.pocket-inner {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(180deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.02) 40%,
    rgba(0, 0, 0, 0.02) 60%,
    rgba(0, 0, 0, 0.08) 100%
  );
  border-radius: inherit;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 -1px 2px rgba(255, 255, 255, 0.1);
}

.pocket.selectable .pocket-inner {
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 -1px 2px rgba(255, 255, 255, 0.1),
    0 0 8px rgba(255, 210, 40, 0.3);
}

.pocket.target .pocket-inner {
  background: rgba(105, 240, 174, 0.12);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.1),
    0 0 12px rgba(105, 240, 174, 0.3);
}

.pocket-num {
  position: absolute;
  font-size: 7px;
  font-weight: 800;
  color: rgba(60, 30, 10, 0.5);
  z-index: 5;
}

.pocket.top .pocket-num {
  bottom: 3px;
}

.pocket.bottom .pocket-num {
  top: 3px;
}

/* ─── Checker Pile ─── */
.checker-pile {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0px;
  padding: 2px 0;
  z-index: 2;
}

.pile-top {
  top: 0;
  bottom: auto;
}

.pile-bottom {
  bottom: 0;
  top: auto;
  flex-direction: column-reverse;
}

/* ─── Piece (checker) ─── */
.piece {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
  transition: all 0.15s ease;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 -2px 3px rgba(0, 0, 0, 0.2),
    inset 0 2px 3px rgba(255, 255, 255, 0.3);
}

.piece.top {
  width: 30px;
  height: 30px;
  z-index: 3;
}

.piece.white {
  background: radial-gradient(circle at 35% 35%, #fff, #f5e6c8, #d4a840);
  border: 1.5px solid #c8a030;
}

.piece.black {
  background: radial-gradient(circle at 35% 35%, #666, #333, #1a1a1a);
  border: 1.5px solid #555;
}

.piece.selected {
  box-shadow:
    0 0 14px rgba(255, 228, 77, 0.8),
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 -2px 3px rgba(0, 0, 0, 0.2);
  border-color: #ffe44d;
  animation: glow 1.2s ease infinite;
  transform: scale(1.08);
}

.piece.small {
  width: 20px;
  height: 20px;
}

.pile-count {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: 900;
  color: #3a2000;
  background: rgba(255, 255, 255, 0.7);
  padding: 1px 4px;
  border-radius: 5px;
  pointer-events: none;
  z-index: 4;
}

/* Ghost piece (target hint) */
.ghost-piece {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(105, 240, 174, 0.15);
  border: 2px dashed rgba(105, 240, 174, 0.6);
  box-shadow: 0 0 8px rgba(105, 240, 174, 0.2);
  animation: pulse 1.5s ease infinite;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* ─── Bar Center ─── */
.bar-center {
  width: 44px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.4), rgba(0,0,0,0.5));
  border: 1px solid rgba(100, 60, 20, 0.4);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  position: relative;
}

.bar-half {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-height: 20px;
}

.bar-divider-line {
  width: 70%;
  height: 1px;
  background: rgba(139, 94, 60, 0.4);
}

.bar-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.bar-pile-count {
  font-size: 8px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.5);
  padding: 1px 3px;
  border-radius: 4px;
}

/* ─── Board Hinge (center with text) ─── */
.board-hinge {
  height: 24px;
  background: linear-gradient(90deg,
    rgba(100, 60, 20, 0.3),
    rgba(139, 94, 60, 0.2),
    rgba(100, 60, 20, 0.3)
  );
  border-top: 1px solid rgba(100, 60, 20, 0.3);
  border-bottom: 1px solid rgba(100, 60, 20, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hinge-text {
  font-size: 9px;
  font-weight: 800;
  color: rgba(60, 30, 10, 0.4);
  letter-spacing: 2px;
}

/* ─── Home Tray ─── */
.home-tray {
  width: 32px;
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.4));
  border: 1px solid rgba(100, 60, 20, 0.3);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  gap: 2px;
  cursor: default;
  transition: all 0.3s ease;
  position: relative;
}

.home-tray.active {
  background: rgba(105, 240, 174, 0.12);
  border: 2px solid rgba(105, 240, 174, 0.5);
  cursor: pointer;
  animation: pulse 1.2s ease infinite;
  box-shadow: 0 0 12px rgba(105, 240, 174, 0.15);
}

.home-icon {
  font-size: 12px;
  margin-bottom: 2px;
}

.home-out {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 8px;
  font-weight: 900;
  color: #69f0ae;
  pointer-events: none;
  text-shadow: 0 0 4px rgba(105, 240, 174, 0.4);
}

.home-slots {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  width: 100%;
}

.home-slot {
  width: 18px;
  height: 6px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.home-slot.white {
  background: linear-gradient(90deg, #e8c878, #c09040);
  border: 1px solid #a07828;
}

.home-slot.black {
  background: linear-gradient(90deg, #666, #444);
  border: 1px solid #555;
}

.home-count {
  font-size: 9px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.8);
  margin-top: 2px;
}

/* ─── Dice on Board ─── */
.board-dice-zone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 80px;
  z-index: 50;
  pointer-events: none;
}

/* 3D Die on board surface */
.die-on-board {
  position: absolute;
  width: 40px;
  height: 40px;
  z-index: 100;
}

.die-body {
  width: 40px;
  height: 40px;
  position: relative;
  transform-style: preserve-3d;
}

.die-face {
  position: absolute;
  width: 40px;
  height: 40px;
  background: linear-gradient(145deg, #fffdf5, #e8d5a0);
  border: 1px solid #c09040;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.08);
}

/* Face positions for 3D cube */
.die-f1 { transform: rotateY(0deg) translateZ(20px); }
.die-f2 { transform: rotateY(90deg) translateZ(20px); }
.die-f3 { transform: rotateX(-90deg) translateZ(20px); }
.die-f4 { transform: rotateX(90deg) translateZ(20px); }
.die-f5 { transform: rotateY(-90deg) translateZ(20px); }
.die-f6 { transform: rotateY(180deg) translateZ(20px); }

.dot {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2a1a0a;
  transform: translate(-50%, -50%);
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.3);
}

/* Shadow under die on board */
.die-shadow-board {
  position: absolute;
  width: 32px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0,0,0,0.35) 0%, transparent 70%);
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  filter: blur(2px);
  z-index: -1;
}

/* ─── Game Controls ─── */
.game-controls {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.btn-roll {
  width: 100%;
  padding: 15px 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #c47c1a, #8b5210);
  color: #fff;
  font-weight: 900;
  font-size: 17px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(196, 124, 26, 0.4);
  transition: all 0.15s;
}

.btn-roll:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(196, 124, 26, 0.5);
}

.hint {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 6px 0;
}

.hint.active {
  color: #69f0ae;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(105, 240, 174, 0.2);
}

.moves-remain {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-weight: 700;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
  padding: 12px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  z-index: 200;
  border: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  animation: slideUp 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

/* ─── Animations ─── */
@keyframes glow {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 228, 77, 0.6); }
  50% { box-shadow: 0 0 24px rgba(255, 228, 77, 0.9); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(0.95); }
}

@keyframes slideUp {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ─── Responsive ─── */
@media (max-width: 480px) {
  .board-half {
    height: 120px;
  }

  .piece {
    width: 22px;
    height: 22px;
  }

  .piece.top {
    width: 26px;
    height: 26px;
  }

  .pocket {
    border-radius: 0 0 10px 10px;
  }

  .pocket.top {
    border-radius: 10px 10px 0 0;
  }

  .bar-center {
    width: 36px;
  }

  .home-tray {
    width: 26px;
  }

  .die-on-board {
    width: 34px;
    height: 34px;
  }

  .die-body, .die-face {
    width: 34px;
    height: 34px;
  }

  .die-f1 { transform: rotateY(0deg) translateZ(17px); }
  .die-f2 { transform: rotateY(90deg) translateZ(17px); }
  .die-f3 { transform: rotateX(-90deg) translateZ(17px); }
  .die-f4 { transform: rotateX(90deg) translateZ(17px); }
  .die-f5 { transform: rotateY(-90deg) translateZ(17px); }
  .die-f6 { transform: rotateY(180deg) translateZ(17px); }
}
/* Durak Game — Card Styles & Animations */

/* ============================================================
   BASE CARD
   ============================================================ */

.durak-card {
  position: relative;
  width: 68px;
  height: 98px;
  border-radius: 12px;
  background: linear-gradient(155deg, #ffffff 0%, #f2f0eb 100%);
  border: 2px solid rgba(0, 0, 0, 0.12);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  cursor: pointer;
  user-select: none;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease;
  transform-origin: center bottom;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Hover — simple lift only, NO "which card beats which" hint */
.durak-card:hover:not(.disabled) {
  transform: translateY(-10px);
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.38),
    0 6px 12px rgba(0, 0, 0, 0.22);
}

/* Selected card (defender chose a card from hand) */
.durak-card.selected {
  transform: translateY(-22px) scale(1.07) !important;
  background: linear-gradient(145deg, #fffbe8 0%, #ffe080 100%);
  border-color: #f5c000;
  box-shadow:
    0 18px 36px rgba(245, 192, 0, 0.55),
    0 8px 16px rgba(245, 192, 0, 0.35),
    0 0 32px rgba(245, 192, 0, 0.4);
  z-index: 100 !important;
}

/* Highlighted (attack card ready to receive defense) */
.durak-card.highlighted {
  background: linear-gradient(145deg, #e8fff0 0%, #8effc0 100%);
  border-color: #00cc55;
  box-shadow:
    0 8px 20px rgba(0, 204, 85, 0.4),
    0 4px 10px rgba(0, 204, 85, 0.3),
    0 0 28px rgba(0, 204, 85, 0.3);
  animation: pulse-green 1.6s ease-in-out infinite;
}

/* Faded (card already defended) */
.durak-card.faded {
  opacity: 0.45;
  filter: grayscale(25%);
  pointer-events: none;
}

/* Disabled */
.durak-card.disabled {
  cursor: default;
  opacity: 0.72;
}

/* ============================================================
   TRUMP CARD — distinct gold frame + glow
   ============================================================ */

.durak-card.trump {
  background: linear-gradient(155deg, #fff9ed 0%, #ffedb3 60%, #ffd966 100%);
  border: 2px solid #d4960a;
  box-shadow:
    0 4px 14px rgba(200, 130, 10, 0.45),
    0 2px 6px rgba(200, 130, 10, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    0 0 0 1px rgba(212, 150, 10, 0.25);
}

.durak-card.trump:hover:not(.disabled) {
  transform: translateY(-10px);
  box-shadow:
    0 16px 32px rgba(200, 130, 10, 0.5),
    0 6px 12px rgba(200, 130, 10, 0.3),
    0 0 24px rgba(220, 160, 20, 0.35);
}

.durak-card.trump.selected {
  background: linear-gradient(145deg, #fff4c2 0%, #ffd020 100%);
  border-color: #c8820a;
  box-shadow:
    0 20px 40px rgba(200, 130, 10, 0.6),
    0 8px 18px rgba(200, 130, 10, 0.4),
    0 0 40px rgba(220, 160, 20, 0.5);
}

/* Small crown badge in top-right corner of trump cards */
.durak-trump-badge {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  color: #c8820a;
  line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(200, 130, 10, 0.5));
  z-index: 2;
}

/* Trump suit symbol — golden tint */
.trump-center {
  color: #b8720a !important;
  text-shadow:
    0 1px 3px rgba(180, 110, 10, 0.4),
    0 0 8px rgba(220, 160, 20, 0.25);
}

/* ============================================================
   CARD CORNERS
   ============================================================ */

.durak-card-corner {
  position: absolute;
  top: 5px;
  left: 7px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: left;
}

.durak-card-corner-bottom {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  transform: rotate(180deg);
}

/* Center suit symbol */
.durak-card-center {
  font-size: 30px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.18));
}

/* ============================================================
   CARD BACK
   ============================================================ */

.durak-card-back {
  width: 68px;
  height: 98px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1a4a8c 0%, #0d2555 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.4),
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.durak-card-back::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(255, 255, 255, 0.03) 5px,
    rgba(255, 255, 255, 0.03) 10px
  );
}

.durak-card-back-symbol {
  font-size: 26px;
  opacity: 0.55;
  z-index: 1;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* ============================================================
   HAND FAN — cards spread out, readable at a glance
   ============================================================ */

.durak-hand-fan {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  /* height set dynamically via inline style */
  padding: 24px 10px 8px;
  position: relative;
}

.durak-hand-fan .durak-card {
  position: absolute;
  bottom: 8px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s ease,
              border-color 0.3s ease;
}

/* ============================================================
   SUIT COLORS
   ============================================================ */

.suit-spades  { color: #1a1a1a; }
.suit-clubs   { color: #2d5a27; }
.suit-hearts  { color: #e63946; text-shadow: 0 1px 2px rgba(230, 57, 70, 0.25); }
.suit-diamonds{ color: #e63946; text-shadow: 0 1px 2px rgba(230, 57, 70, 0.25); }

/* ============================================================
   TABLE CARD PAIR
   ============================================================ */

.durak-table-pair {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  animation: card-deal 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

@keyframes card-deal {
  0%   { transform: translateX(60px) rotate(15deg) scale(0.6); opacity: 0; }
  100% { transform: translateX(0) rotate(0) scale(1); opacity: 1; }
}

@keyframes card-play {
  0%   { transform: translateY(0) scale(1); }
  50%  { transform: translateY(-40px) scale(1.1); }
  100% { transform: translateY(-80px) scale(0.9); opacity: 0; }
}

@keyframes pulse-green {
  0%, 100% {
    box-shadow:
      0 8px 20px rgba(0, 204, 85, 0.4),
      0 4px 10px rgba(0, 204, 85, 0.3),
      0 0 28px rgba(0, 204, 85, 0.3);
  }
  50% {
    box-shadow:
      0 12px 28px rgba(0, 204, 85, 0.6),
      0 6px 14px rgba(0, 204, 85, 0.45),
      0 0 40px rgba(0, 204, 85, 0.5);
  }
}

@keyframes card-shake {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-8px); }
  75%       { transform: translateX(8px); }
}

.durak-card.deal  { animation: card-deal 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.durak-card.play  { animation: card-play 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.durak-card.shake { animation: card-shake 0.3s ease-in-out; }

/* ============================================================
   TRUMP INDICATOR (info strip at bottom of screen)
   ============================================================ */

.durak-trump-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 10px;
  background: rgba(212, 150, 10, 0.15);
  border: 1px solid rgba(212, 150, 10, 0.45);
  font-size: 14px;
  font-weight: 700;
  color: #f0c040;
}

.durak-trump-indicator .trump-symbol {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* ============================================================
   STATUS BAR
   ============================================================ */

.durak-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  margin-bottom: 12px;
}

.durak-status-text { font-size: 14px; font-weight: 600; }
.durak-status-info  { display: flex; gap: 12px; font-size: 13px; opacity: 0.7; }

/* ============================================================
   ACTION BUTTONS
   ============================================================ */

.durak-btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
}

.durak-btn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.durak-btn:active { transform: translateY(0); }

.durak-btn-primary  { background: linear-gradient(135deg,#3db825 0%,#256614 100%); color:#fff; box-shadow:0 4px 14px rgba(61,184,37,.3); }
.durak-btn-danger   { background: rgba(255,80,80,.2); color:#ff8888; border:1px solid rgba(255,80,80,.3); }
.durak-btn-secondary{ background: rgba(255,255,255,.1); color:#fff; border:1px solid rgba(255,255,255,.2); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 480px) {
  .durak-card { width: 58px; height: 82px; border-radius: 10px; }
  .durak-card-corner, .durak-card-corner-bottom { font-size: 11px; }
  .durak-card-center { font-size: 24px; }
  .durak-card-back  { width: 58px; height: 82px; }
  .durak-trump-badge { font-size: 9px; }
}
/* ── Покер — CSS ─────────────────────────────────────────────────────────── */

.poker-room {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: radial-gradient(ellipse at 50% 0%, #1a0f02 0%, #0c0602 70%);
  color: #fff;
  font-family: "Georgia", serif;
  overflow: hidden;
}

/* Загрузка */
.poker-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  gap: 16px;
  background: #0c0602;
  color: rgba(255,255,255,.5);
  font-size: 15px;
}
.poker-loading__spinner {
  font-size: 48px;
  animation: pokerSpin 2s linear infinite;
}
@keyframes pokerSpin { to { transform: rotate(360deg); } }

/* Шапка */
.poker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(240,192,64,.15);
  background: rgba(0,0,0,.3);
  flex-shrink: 0;
}
.poker-back-btn {
  background: none;
  border: 1px solid rgba(240,192,64,.3);
  color: #f0c040;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 16px;
  cursor: pointer;
}
.poker-stage {
  font-size: 15px;
  font-weight: 600;
  color: #f0c040;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.poker-pot {
  font-size: 13px;
  color: rgba(255,255,255,.5);
}
.poker-pot span { color: #f0c040; font-weight: 700; }

/* Стол */
.poker-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 12px 10px;
  position: relative;
  overflow: hidden;
}

/* Зелёное сукно-фон */
.poker-table::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  background: radial-gradient(ellipse, #0d4a1a 0%, #083612 60%, transparent 100%);
  border: 2px solid rgba(240,192,64,.2);
  pointer-events: none;
}

/* Соперники */
.poker-opponents {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  z-index: 1;
}

/* Борд */
.poker-board {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  z-index: 1;
  min-height: 72px;
}
.poker-board__empty {
  font-size: 12px;
  color: rgba(255,255,255,.25);
  font-style: italic;
}

/* Моя зона */
.poker-me-area {
  z-index: 1;
}

/* Место игрока */
.poker-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.3);
  transition: border-color .2s, box-shadow .2s;
  min-width: 100px;
}
.poker-seat--me {
  border-color: rgba(240,192,64,.3);
  background: rgba(240,192,64,.05);
}
.poker-seat--active {
  border-color: #f0c040;
  box-shadow: 0 0 16px rgba(240,192,64,.35);
}
.poker-seat--folded { opacity: .4; }

.poker-seat__cards {
  display: flex;
  gap: 6px;
}
.poker-seat__info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.poker-seat__name {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,.8);
}
.poker-seat__stack {
  font-size: 11px;
  color: rgba(255,255,255,.45);
}
.poker-seat__bet {
  font-size: 11px;
  color: #f0c040;
  font-weight: 700;
}
.poker-seat__fold {
  font-size: 10px;
  color: #e63946;
  font-weight: 700;
  letter-spacing: .05em;
}
.poker-seat__turn-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #f0c040;
  box-shadow: 0 0 8px #f0c040;
  animation: pulseDot 1s ease-in-out infinite;
}
@keyframes pulseDot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}

/* Карта */
.poker-card {
  position: relative;
  border-radius: 6px;
  background: #f8f4ec;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.poker-card--back {
  background: linear-gradient(135deg, #1a3a6e 25%, #0f2047 75%);
  overflow: hidden;
}
.poker-card__pattern {
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 4px;
  background: repeating-linear-gradient(
    45deg, transparent, transparent 4px,
    rgba(255,255,255,.05) 4px, rgba(255,255,255,.05) 5px
  );
}
.poker-card__corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  font-weight: 700;
}
.poker-card__corner--tl { top: 3px; left: 4px; }
.poker-card__corner--br { bottom: 3px; right: 4px; transform: rotate(180deg); }
.poker-card__center { font-size: 22px; }

/* Действия */
.poker-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px 12px 20px;
  border-top: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.4);
  flex-shrink: 0;
  flex-wrap: wrap;
  transition: opacity .2s;
}
.poker-actions:not(.poker-actions--active) { opacity: .5; pointer-events: none; }

.poker-btn {
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform .1s, opacity .15s;
  font-family: inherit;
}
.poker-btn:active { transform: scale(.96); }
.poker-btn--fold   { background: rgba(230,57,70,.15); color: #e63946; border: 1px solid rgba(230,57,70,.35); }
.poker-btn--check  { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.2); }
.poker-btn--call   { background: rgba(64,208,100,.12); color: #40d064; border: 1px solid rgba(64,208,100,.3); }
.poker-btn--raise  { background: linear-gradient(135deg,#f0c040,#c8891a); color: #1a0d00; min-width: 100px; }

.poker-raise-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.poker-raise-wrap input[type="range"] {
  width: 120px;
  accent-color: #f0c040;
}

.poker-wait {
  color: rgba(255,255,255,.35);
  font-size: 14px;
  font-style: italic;
  padding: 10px 0;
}

/* Тост */
.poker-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,12,2,.92);
  border: 1px solid rgba(240,192,64,.4);
  color: #f0c040;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  z-index: 50;
  animation: toastIn .25s ease;
}
@keyframes toastIn { from { opacity:0; transform:translateX(-50%) translateY(10px); } }
/* ── Duck Hunt — CSS ─────────────────────────────────────────────────────── */

.dh-page {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: #0a1628;
  overflow: hidden;
  position: relative;
  font-family: "Segoe UI", sans-serif;
}

/* ── Idle / Result экраны ─── */
.dh-idle,
.dh-result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  color: #fff;
  text-align: center;
  padding-bottom: 80px;
}

.dh-idle__title {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -.02em;
  background: linear-gradient(135deg, #87ceeb, #ffffff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.dh-idle__desc {
  font-size: 15px;
  color: rgba(255,255,255,.65);
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.dh-idle__hint {
  font-size: 13px;
  color: rgba(255,200,0,.7);
  background: rgba(255,200,0,.08);
  border: 1px solid rgba(255,200,0,.2);
  padding: 8px 16px;
  border-radius: 20px;
}

.dh-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  margin: 0 4px;
}
.dh-tag--green { background: rgba(76,175,80,.2); color: #81c784; border: 1px solid rgba(76,175,80,.3); }
.dh-tag--blue  { background: rgba(33,150,243,.2); color: #64b5f6; border: 1px solid rgba(33,150,243,.3); }
.dh-tag--gold  { background: rgba(255,215,0,.2); color: #ffd700; border: 1px solid rgba(255,215,0,.3); }

.dh-start-btn {
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  padding: 14px 36px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(76,175,80,.4);
  transition: transform .1s, box-shadow .1s;
}
.dh-start-btn:active { transform: scale(.96); box-shadow: 0 2px 8px rgba(76,175,80,.3); }

.dh-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 10px;
  color: rgba(255,255,255,.5);
  font-size: 14px;
  padding: 8px 20px;
  cursor: pointer;
}

/* Result */
.dh-result__emoji { font-size: 60px; }
.dh-result__label { font-size: 22px; font-weight: 800; color: #fff; }
.dh-result__score {
  font-size: 48px;
  font-weight: 900;
  background: linear-gradient(135deg, #ffd700, #ff9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.dh-result__stats {
  display: flex;
  gap: 20px;
  font-size: 14px;
  color: rgba(255,255,255,.5);
}
.dh-result__stats span {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

/* ── HUD ─── */
.dh-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(0,0,0,.5);
  border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  z-index: 10;
}
.dh-hud__score  { color: #ffd700; }
.dh-hud__hits   { color: #81c784; }
.dh-hud__timer  { color: rgba(255,255,255,.8); }
.dh-hud__timer--danger { color: #e63946; animation: dangerPulse .5s ease-in-out infinite; }
@keyframes dangerPulse { 0%,100% { opacity:1; } 50% { opacity:.4; } }

/* ── Комбо ─── */
.dh-combo {
  position: absolute;
  top: 56px;
  right: 14px;
  background: rgba(255,100,0,.15);
  border: 1px solid rgba(255,150,0,.4);
  color: #ff9800;
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 10;
}
.dh-combo-label {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 20px;
  font-weight: 900;
  color: #ff9800;
  text-shadow: 0 0 20px rgba(255,150,0,.8);
  z-index: 10;
  animation: comboAnim .8s ease-out forwards;
  white-space: nowrap;
}
@keyframes comboAnim {
  0%   { opacity:1; transform:translateX(-50%) scale(1.2); }
  100% { opacity:0; transform:translateX(-50%) scale(1) translateY(-20px); }
}

/* ── Игровое поле ─── */
.dh-field {
  flex: 1;
  position: relative;
  overflow: hidden;
  cursor: none;
  background: linear-gradient(180deg,
    #87ceeb 0%, #b0e0e6 45%,
    #c8e6c9 45%, #a5d6a7 60%,
    #81c784 60%, #66bb6a 100%
  );
  margin-bottom: 56px; /* BottomNav */
}

/* Облака */
.dh-cloud {
  position: absolute;
  width: 90px;
  height: 36px;
  background: rgba(255,255,255,.82);
  border-radius: 50px;
  box-shadow: 30px -12px 0 16px rgba(255,255,255,.7), -20px -8px 0 10px rgba(255,255,255,.7);
  animation: cloudDrift 28s linear infinite;
}
.dh-cloud--sm {
  width: 60px;
  height: 24px;
  box-shadow: 20px -8px 0 10px rgba(255,255,255,.7), -14px -5px 0 7px rgba(255,255,255,.7);
  animation-duration: 35s;
}
@keyframes cloudDrift { 0% { transform: translateX(0); } 100% { transform: translateX(20px); } }

/* Трава */
.dh-grass {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55px;
  background: linear-gradient(180deg, #388e3c 0%, #2e7d32 100%);
  border-top: 3px solid #43a047;
}
.dh-grass::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 0; right: 0;
  height: 14px;
  background: radial-gradient(ellipse 12px 10px at 50% 100%, #43a047 45%, transparent 46%)
    0 0 / 18px 100% repeat-x;
}

/* ── Утка ─── */
.dh-duck {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: crosshair;
  transition: opacity .15s;
  z-index: 5;
  user-select: none;
}
.dh-duck--hit {
  animation: duckFall .3s ease-in forwards;
}
@keyframes duckFall {
  0%   { opacity: 1; transform: translate(-50%, -50%) rotate(0deg); }
  100% { opacity: 0; transform: translate(-50%, 60px) rotate(90deg); }
}
.dh-duck__badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  padding: 1px 5px;
  border-radius: 6px;
  white-space: nowrap;
}

/* ── Выстрел ─── */
.dh-shot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,100,.9) 10%, rgba(255,150,0,.5) 50%, transparent 70%);
  animation: shotAnim .35s ease-out forwards;
  pointer-events: none;
  z-index: 8;
}
@keyframes shotAnim {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

/* Надпись попадания */
.dh-hit-label {
  position: absolute;
  transform: translate(-50%, -120%);
  font-size: 16px;
  font-weight: 900;
  color: #ffd700;
  text-shadow: 0 2px 6px rgba(0,0,0,.5);
  pointer-events: none;
  z-index: 9;
  animation: hitLabelAnim .8s ease-out forwards;
  white-space: nowrap;
}
@keyframes hitLabelAnim {
  0%   { opacity: 1; transform: translate(-50%, -120%); }
  100% { opacity: 0; transform: translate(-50%, -220%); }
}

/* ── Прицел ─── */
.dh-crosshair {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 20;
}
