/* ============================================================
   Citroniņš — spēles galda re-tēma Spēļotavas dizainā
   Pārraksta TIKAI krāsas, fontus un virsmas. Izkārtojums,
   izmēri un visa spēles loģika paliek citronins-game.css/js.
   Oriģināls saglabāts: citronins-game.css.backup
   ============================================================ */

/* ===== Galds ===== */

.game-table {
  background:
    radial-gradient(46rem 26rem at 50% -10%, rgba(200, 245, 66, 0.07), transparent 62%),
    radial-gradient(36rem 22rem at 90% 110%, rgba(77, 148, 255, 0.08), transparent 66%),
    linear-gradient(165deg, #101d33, #0b1526 70%);
  border: 1px solid rgba(158, 182, 214, 0.16);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(2, 6, 14, 0.55), inset 0 0 60px rgba(3, 8, 16, 0.5);
}

.game-top-bar {
  color: rgba(147, 163, 186, 0.85);
  font-family: "Inter", "Segoe UI", sans-serif;
}

.history-link { color: #c8f542; }

.game-phase-title {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.game-phase-sub { color: rgba(147, 163, 186, 0.9); }

/* ===== Zonu virsmas ===== */

.opponents-area,
.table-area {
  background: rgba(148, 176, 215, 0.05);
  border: 1px solid rgba(158, 182, 214, 0.1);
  border-radius: 16px;
}

.my-area {
  background: rgba(200, 245, 66, 0.05);
  border: 1px solid rgba(200, 245, 66, 0.14);
  border-radius: 16px;
}

.my-label,
.card-label,
.must-beat-label {
  color: rgba(147, 163, 186, 0.9);
  letter-spacing: 1px;
}

.opp-name { color: #b9c6d8; }

.opp-active .opp-name {
  color: #c8f542;
  text-shadow: 0 0 14px rgba(200, 245, 66, 0.4);
}

.hand-count-badge {
  background: rgba(9, 14, 26, 0.8);
  border: 1px solid rgba(158, 182, 214, 0.22);
  color: #b9c6d8;
}

.hand-count-badge.active-badge {
  background: rgba(200, 245, 66, 0.16);
  border-color: rgba(200, 245, 66, 0.5);
  color: #c8f542;
}

/* ===== Kavas un kaudzes akcenti ===== */

.kava-badge {
  background: rgba(9, 14, 26, 0.85);
  border: 1px solid rgba(158, 182, 214, 0.25);
  color: #eef3fa;
}

.empty-pile {
  border-color: rgba(158, 182, 214, 0.3);
  color: rgba(147, 163, 186, 0.7);
  background: rgba(9, 14, 26, 0.35);
}

.must-beat {
  background: rgba(9, 14, 26, 0.65);
  border: 1px solid rgba(255, 184, 77, 0.35);
  border-radius: 12px;
}

.must-beat-value { color: #ffb84d; }

/* ===== Spēlējamo kāršu izcēlums (limes gredzens) ===== */

.hand-card.playable { box-shadow: 0 0 0 2.5px #c8f542, 0 8px 18px rgba(3, 7, 14, 0.4); }
.hand-card.playable:hover { box-shadow: 0 0 0 3px #c8f542, 0 0 22px rgba(200, 245, 66, 0.5); }
.hand-card.playable.spec-2 { box-shadow: 0 0 0 2.5px #f7d046, 0 0 0 5px #c8f542; }
.hand-card.playable.spec-10 { box-shadow: 0 0 0 2.5px #4a9eff, 0 0 0 5px #c8f542; }
.hand-card.playable.spec-7 { box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.7), 0 0 0 5px #c8f542; opacity: 1; }
.hand-card.playable.spec-joker { box-shadow: 0 0 0 2.5px #c084fc, 0 0 0 5px #c8f542; }

.hand-card.selected { box-shadow: 0 0 0 3px #ffb84d, 0 0 20px rgba(255, 184, 77, 0.45); }

/* ===== Kāršu mugura ===== */

.card-back {
  background:
    radial-gradient(8rem 6rem at 50% 0%, rgba(200, 245, 66, 0.25), transparent 70%),
    linear-gradient(150deg, #1b2a45, #101b30);
  border-color: rgba(158, 182, 214, 0.3);
}

/* ===== Pogas ===== */

.btn-action {
  background: rgba(148, 176, 215, 0.09);
  border: 1px solid rgba(158, 182, 214, 0.26);
  color: #eef3fa;
  border-radius: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.btn-action:hover:not(:disabled) {
  border-color: rgba(200, 245, 66, 0.5);
  background: rgba(200, 245, 66, 0.1);
}

.btn-primary-game,
#confirm-faceup-btn {
  background: linear-gradient(120deg, #c8f542, #a5e32c);
  color: #131f05;
  border: 0;
  border-radius: 11px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(200, 245, 66, 0.2);
}

.btn-primary-game:hover:not(:disabled),
#confirm-faceup-btn:hover:not(:disabled) {
  background: linear-gradient(120deg, #d3f95e, #b2ec39);
  box-shadow: 0 12px 26px rgba(200, 245, 66, 0.3);
}

.btn-primary-game:disabled,
#confirm-faceup-btn:disabled,
.btn-action:disabled {
  opacity: 0.45;
  box-shadow: none;
}

/* ===== Izvēles kartītes (faceup fāze) ===== */

.choice-card.selected {
  outline-color: #c8f542;
  box-shadow: 0 0 0 3px #c8f542, 0 0 18px rgba(200, 245, 66, 0.4);
}

/* ===== Beigu baneri ===== */

.finished-banner {
  background: rgba(11, 18, 32, 0.92);
  border: 1px solid rgba(158, 182, 214, 0.2);
  border-radius: 18px;
}

.finished-banner.win {
  border-color: rgba(200, 245, 66, 0.45);
  background:
    radial-gradient(20rem 12rem at 50% -30%, rgba(200, 245, 66, 0.14), transparent 70%),
    rgba(11, 18, 32, 0.94);
}

.finished-banner.win .finished-title { color: #c8f542; }

.finished-banner.lose {
  border-color: rgba(255, 100, 116, 0.4);
  background:
    radial-gradient(20rem 12rem at 50% -30%, rgba(255, 100, 116, 0.12), transparent 70%),
    rgba(11, 18, 32, 0.94);
}

.finished-banner.lose .finished-title { color: #ff6474; }

.place-row {
  background: rgba(148, 176, 215, 0.06);
  border: 1px solid rgba(158, 182, 214, 0.12);
  border-radius: 12px;
  color: #eef3fa;
}

.place-row.place-me {
  border-color: rgba(200, 245, 66, 0.45);
  background: rgba(200, 245, 66, 0.08);
}

.place-row.place-loser { background: rgba(255, 100, 116, 0.07); border-color: rgba(255, 100, 116, 0.25); }

.spectator-banner {
  background: rgba(148, 176, 215, 0.07);
  border: 1px solid rgba(158, 182, 214, 0.18);
  border-radius: 12px;
  color: #b9c6d8;
}

/* ===== Modālie logi ===== */

.modal-overlay { background: rgba(3, 6, 12, 0.78); backdrop-filter: blur(6px); }

.modal-box {
  background: #0d1526;
  border: 1px solid rgba(158, 182, 214, 0.22);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(2, 6, 14, 0.7);
  color: #eef3fa;
}

.modal-title {
  font-family: "Sora", "Segoe UI", sans-serif;
  font-weight: 800;
  color: #eef3fa;
}

.modal-message { color: #93a3ba; }

.modal-btn {
  border-radius: 11px;
  font-weight: 700;
}

.modal-btn-primary {
  background: linear-gradient(120deg, #c8f542, #a5e32c);
  color: #131f05;
  border: 0;
}

.modal-btn-primary:hover { background: linear-gradient(120deg, #d3f95e, #b2ec39); }

.modal-btn-secondary {
  background: rgba(148, 176, 215, 0.09);
  border: 1px solid rgba(158, 182, 214, 0.26);
  color: #eef3fa;
}

.modal-btn-secondary:hover { border-color: rgba(200, 245, 66, 0.4); }

.modal-btn-danger {
  background: rgba(255, 100, 116, 0.14);
  border: 1px solid rgba(255, 100, 116, 0.4);
  color: #ff8b98;
}

.modal-btn-danger:hover { background: rgba(255, 100, 116, 0.22); }

/* ===== Slēptās kārtis (gamble) ===== */

.hidden-gamble { border-color: rgba(200, 245, 66, 0.4); }
.hidden-gamble:hover { box-shadow: 0 0 18px rgba(200, 245, 66, 0.4); }

/* ===== Drošība pret kāršu iziešanu ārpus galda =====
   Rokas rinda un atklātās kārtis aptinas jaunā rindā, nevis
   izlien ārā no galda šaurākos ekrānos. */

.my-hand-row {
  flex-wrap: wrap;
  row-gap: 10px;
}

.my-faceup-cards {
  flex-wrap: wrap;
  row-gap: 6px;
}

.opponents-area {
  flex-wrap: wrap;
  row-gap: 8px;
}

.opponents-area,
.table-area {
  padding: 0.75rem;
}

.my-area { padding: 0.85rem; }

/* ===== Raunda izvēle ===== */

.round-mode-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.round-mode-btn {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(158, 182, 214, 0.18);
  border-radius: 8px;
  background: rgba(5, 10, 19, 0.54);
  color: #eef3fa;
  text-align: left;
  cursor: pointer;
}

.round-mode-btn strong,
.round-mode-btn span {
  display: block;
}

.round-mode-btn strong {
  font-size: 0.78rem;
}

.round-mode-btn span {
  margin-top: 3px;
  color: #8291a8;
  font-size: 0.64rem;
  line-height: 1.35;
}

.round-mode-btn.active {
  border-color: rgba(200, 245, 66, 0.58);
  background: rgba(200, 245, 66, 0.09);
  box-shadow: inset 0 0 0 1px rgba(200, 245, 66, 0.08);
}

.round-mode-btn.active span {
  color: #b9c6d8;
}

.deck-btn:disabled,
.kg-toggle-row.is-disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.room-mode-label {
  margin: 8px 0 0;
  color: #c8f542;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ===== Gājienu vēsture ===== */

.game-mode-chip {
  color: #b9c6d8;
  font-size: 0.7rem;
  font-weight: 700;
}

.action-feed {
  margin: 10px 0 14px;
  padding: 10px;
  height: 174px;
  box-sizing: border-box;
  border: 1px solid rgba(158, 182, 214, 0.16);
  border-radius: 8px;
  background: rgba(5, 10, 19, 0.62);
}

.action-feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.action-feed-head strong {
  color: #eef3fa;
  font-size: 0.76rem;
}

.action-feed-head > span {
  color: #6f7f96;
  font-size: 0.68rem;
}

.history-link {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.action-feed-list {
  display: grid;
  gap: 5px;
  max-height: 122px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(200, 245, 66, 0.42) rgba(5, 10, 19, 0.45);
  scrollbar-width: thin;
}

.action-feed-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-left: 2px solid transparent;
  color: #93a3ba;
  font-size: 0.72rem;
}

.action-feed-item.latest {
  border-left-color: #73e7da;
  background: rgba(115, 231, 218, 0.06);
  color: #dce7f5;
}

.action-feed-item.is-kill.latest {
  border-left-color: #ffb347;
  background: rgba(255, 179, 71, 0.08);
}

.action-index {
  color: #6f7f96;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.action-feed-empty {
  display: grid;
  place-items: center;
  min-height: 92px;
  color: #6f7f96;
  font-size: 0.7rem;
  text-align: center;
}

.action-cards {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.action-card {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  height: 30px;
  padding: 0 4px;
  border: 1px solid #cbd5e2;
  border-radius: 4px;
  background: #f8fafc;
  color: #111827;
  font-size: 0.68rem;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

.action-card.red {
  color: #d83b4f;
}

@media (max-width: 640px) {
  .round-mode-picker {
    grid-template-columns: 1fr;
  }

  .action-feed-head {
    align-items: flex-start;
  }

  .action-feed-item {
    grid-template-columns: 38px minmax(0, 1fr);
    font-size: 0.68rem;
  }
}
