/* domino.css – Əyləncə / Domino üçün stil */

#eylence {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 1rem;
}

#eylence h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.domino-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 1rem;
}

/* Kartlar */
.domino-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.domino-card h3 {
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
}

/* Sol panel */
.domino-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* Sağ tərəf əsas konteyner */
.domino-main {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

/* Online list */
#dominoOnlineList {
  list-style: none;
  padding-left: 0;
  margin: 0 0 0.4rem 0;
  font-size: 0.86rem;
}

#dominoOnlineList li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}

#dominoOnlineList li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
}

/* Inputs */
.domino-label {
  font-size: 0.8rem;
  margin-top: 0.45rem;
  display: block;
}

.domino-select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  border-radius: 6px;
  border: 1px solid #d1d5db;
}

/* Buttons */
.domino-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.45rem 0.6rem;
  border-radius: 7px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.domino-btn.primary {
  background: #3b82f6;
  color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.35);
}

.domino-btn.primary:hover:not(:disabled) {
  background: #2563eb;
  transform: translateY(-1px);
}

.domino-btn.ghost {
  background: #f3f4f6;
  color: #111827;
}

.domino-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Qaydalar listi */
.domino-rules {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  color: #4b5563;
}

.domino-muted {
  font-size: 0.75rem;
  color: #9ca3af;
}

/* Masa kartı (köhnə table-card) – indi minimum hündürlük üçün */
.table-card {
  min-height: 120px;
}

/* ARENA: masa + oyunçular */
.domino-arena {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% -20%, rgba(37, 99, 235, 0.55) 0, transparent 55%),
    radial-gradient(circle at 110% 120%, rgba(34, 197, 94, 0.55) 0, transparent 60%),
    #020617;
  color: #e5e7eb;
}

.domino-arena-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas:
    "top top top"
    "left center right"
    "bottom bottom bottom";
  gap: 0.5rem 1rem;
  align-items: center;
  justify-items: center;
  min-height: 260px;
}

/* Zonalar */
.zone-top {
  grid-area: top;
}
.zone-left {
  grid-area: left;
}
.zone-right {
  grid-area: right;
}
.zone-bottom {
  grid-area: bottom;
}

.domino-table-center {
  grid-area: center;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.domino-table-center h3 {
  color: #e5e7eb;
  margin-bottom: 0.25rem;
}

.domino-center-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.domino-turn-box h3 {
  margin: 0 0 0.25rem 0;
  font-size: 0.9rem;
}

.domino-center-actions {
  min-width: 160px;
}

.domino-center-actions .domino-btn {
  width: 100%;
  font-size: 0.8rem;
}

/* Masa (real stol hissəsi) */
.domino-table {
  min-height: 90px;
  border-radius: 14px;
  border: 1px solid rgba(16, 185, 129, 0.55);
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 0%, rgba(34, 197, 94, 0.4), transparent 60%),
    radial-gradient(circle at 80% 100%, rgba(6, 95, 70, 0.9), rgba(5, 46, 22, 0.9));
}

/* Oyunçuların zonası */
.domino-player-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-height: 40px;
}

.domino-player-header {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
  color: #e5e7eb;
  opacity: 0.9;
}

.domino-player-header.vertical {
  flex-direction: column;
  text-align: center;
}

.domino-player-name {
  font-weight: 500;
}

.domino-player-count {
  font-size: 0.74rem;
  opacity: 0.85;
}

.domino-player-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
  justify-content: center;
}

.domino-player-hand.vertical {
  flex-direction: column;
  align-items: center;
}

/* Daş – real domino görünüşü */
.domino-tile {
  width: 46px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid #020617;
  background: linear-gradient(145deg, #f9fafb, #e5e7eb);
  display: flex;
  font-size: 0.8rem;
  overflow: hidden;
  cursor: pointer;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(15, 23, 42, 0.15);
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.domino-tile.on-board {
  transform: scale(1.02);
}

.domino-tile.current-player {
  box-shadow:
    0 0 0 2px #22c55e,
    0 0 10px rgba(34, 197, 94, 0.7);
  animation: domino-playable-pulse 1s ease-in-out infinite;
}

@keyframes domino-playable-pulse {
  0% {
    transform: translateY(0);
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.9),
      0 0 6px rgba(34, 197, 94, 0.6);
  }
  50% {
    transform: translateY(-1px);
    box-shadow:
      0 0 0 4px rgba(34, 197, 94, 0),
      0 0 14px rgba(34, 197, 94, 0.9);
  }
  100% {
    transform: translateY(0);
    box-shadow:
      0 0 0 1px rgba(34, 197, 94, 0.9),
      0 0 6px rgba(34, 197, 94, 0.6);
  }
}

/* Masadakı daşlar üçün kiçik böyüdülmə */
.domino-tile.on-board {
  transform: scale(1.02);
}

/* Son qoyulan daş üçün “düşmə” animasiyası */
.domino-tile.play-anim {
  animation: domino-drop 0.18s ease-out;
}

@keyframes domino-drop {
  0% {
    transform: translateY(-8px) scale(0.9);
    opacity: 0;
  }
  60% {
    transform: translateY(1px) scale(1.03);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1.02);
    opacity: 1;
  }
}


.domino-tile:hover:not(.disabled):not(.domino-tile-bot) {
  transform: translateY(-2px);
}

.domino-tile.disabled {
  opacity: 0.5;
  cursor: default;
}

.domino-tile.disabled {
  opacity: 0.4;
  cursor: default;
}

/* Qarşı tərəfin daşı – arxa tərəf (fonla aydın fərqli) */
.domino-tile-bot {
  background: repeating-linear-gradient(
    135deg,
    #0f172a,
    #0f172a 4px,
    #111827 4px,
    #111827 8px
  );
  border-color: #020617;
}

.domino-tile-bot .domino-side {
  opacity: 0; /* pip-ləri gizlət – yalnız arxa tərəf görünsün */
}

/* Daşın iki tərəfi və pip-lər */
.domino-side {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 1px;
}

.domino-side + .domino-side {
  border-left: 1px solid #020617;
}

/* Pip grid */
.domino-pips {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
}

.domino-pip-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.domino-pip {
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #020617;
  box-shadow: 0 0 1px rgba(0, 0, 0, 0.5);
}

/* Status */
.domino-status {
  font-size: 0.85rem;
  color: #e5e7eb;
  min-height: 1.2rem;
}

/* Mobil uyğunlaşdırma */
@media (max-width: 900px) {
  .domino-layout {
    grid-template-columns: 1fr;
  }

  .domino-arena-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas:
      "top"
      "center"
      "bottom"
      "left"
      "right";
  }

  .domino-player-zone {
    align-items: center;
  }
}

/* Növbədə olan oyunçu üçün parlaq highlight */
.domino-player-zone.current-seat {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 6px rgba(34, 197, 94, 0.8));
}

.domino-player-zone.current-seat .domino-player-name {
  color: #bbf7d0;
  text-shadow: 0 0 4px rgba(34, 197, 94, 0.8);
}

.domino-player-zone.current-seat .domino-player-count {
  color: #a7f3d0;
}
/* Bazarda daş sayı */
.domino-stock-info {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #e5e7eb;
  opacity: 0.9;
  text-align: right;
}


/* Online listində "Dəvət et" düyməsi */
.domino-invite-btn {
  margin-left: auto;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #3b82f6;
  color: #fff;
}

.domino-invite-btn:hover {
  background: #2563eb;
}

/* Modal */
.domino-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  align-items: center;
  justify-content: center;
}

.domino-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.domino-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 10px;
  padding: 1rem 1.2rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.35);
  max-width: 320px;
  width: 90%;
  z-index: 1;
}

.domino-modal-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.domino-modal-content p {
  margin: 0 0 0.7rem 0;
  font-size: 0.85rem;
}

.domino-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Gedə bilməyəndə Pass düyməsi üçün pulsasiya effekti */
.domino-btn.pass-pulse {
  animation: kv-pass-pulse 1s ease-in-out infinite;
  box-shadow:
    0 0 0 0 rgba(250, 204, 21, 0.7),
    0 0 0 1px rgba(234, 179, 8, 0.7);
}

@keyframes kv-pass-pulse {
  0% {
    transform: translateY(0);
    box-shadow:
      0 0 0 0 rgba(250, 204, 21, 0.7),
      0 0 0 1px rgba(234, 179, 8, 0.5);
  }
  50% {
    transform: translateY(-1px);
    box-shadow:
      0 0 0 6px rgba(250, 204, 21, 0.0),
      0 0 0 1px rgba(234, 179, 8, 0.9);
  }
  100% {
    transform: translateY(0);
    box-shadow:
      0 0 0 0 rgba(250, 204, 21, 0.0),
      0 0 0 1px rgba(234, 179, 8, 0.5);
  }
}
