/* ==========================================================================
 * ElAshkef HOTFIX V3 — CSS companion
 * --------------------------------------------------------------------------
 * Loaded LAST. Purely additive — no rules removed.
 * ========================================================================== */

/* ----------------------------------------------------------------
 * Issue 4b — kill the legacy laeib intro popup so only the unified
 * tutorial shows. The JS hotfix also routes the function call, but
 * the CSS is a belt-and-braces guarantee in case any code path
 * still renders the overlay (e.g. a future merge from upstream).
 * ---------------------------------------------------------------- */
#laeib-howto-overlay {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* If both the legacy htp-overlay (already hidden by v1) AND the
 * unified utut overlay try to show, force only one to be visible. */
body.utut-open #laeib-howto-overlay,
body.utut-open .htp-overlay,
body.utut-open #game-info-popup {
  display: none !important;
}

/* ----------------------------------------------------------------
 * Issue 3 — Visual affordance for bot-mention status
 * ---------------------------------------------------------------- */
.hf3-bot-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.15em 0.55em;
  border-radius: 999px;
  background: rgba(232, 183, 48, 0.12);
  color: var(--gold, #e8b730);
  font-size: 0.78em;
  font-weight: 700;
  margin-right: 0.3em;
  border: 1px solid rgba(232, 183, 48, 0.25);
}
.hf3-bot-pill i {
  font-size: 0.85em;
}

/* Inline jawlah chat row sent BY the bot — slight distinction */
.jawlah-chat-msg[data-from="BOT"],
.jawlah-chat-row[data-from="BOT"] {
  background: linear-gradient(
    90deg,
    rgba(232, 183, 48, 0.07) 0%,
    rgba(232, 183, 48, 0.02) 100%
  ) !important;
  border-left: 3px solid var(--gold, #e8b730) !important;
}

/* ----------------------------------------------------------------
 * Issue 1 — Make the join-mode picker friendlier & easier to scan.
 * The four modes are: open | join | teams | whitelist.
 * Add an active-state highlight so streamers visually confirm
 * which mode is currently selected.
 * ---------------------------------------------------------------- */
.pgs-radio-group.joinmode-group {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
}
.pgs-radio-group.joinmode-group .pgs-radio-pill {
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.pgs-radio-group.joinmode-group .pgs-radio-pill:hover {
  background: rgba(232, 183, 48, 0.06) !important;
  border-color: rgba(232, 183, 48, 0.35) !important;
}
.pgs-radio-group.joinmode-group input[type="radio"]:checked + label,
.pgs-radio-group.joinmode-group .pgs-radio-pill.is-active,
.pgs-radio-group.joinmode-group .pgs-radio-pill:has(input:checked) {
  background: linear-gradient(
    135deg,
    rgba(232, 183, 48, 0.22),
    rgba(232, 183, 48, 0.08)
  ) !important;
  border-color: rgba(232, 183, 48, 0.6) !important;
  color: var(--gold, #e8b730) !important;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(232, 183, 48, 0.25) inset;
}

.joinmode-hint {
  margin-top: 6px;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.45;
}
.joinmode-hint::before {
  content: "💡 ";
  margin-right: 4px;
}

/* Joined-players / whitelist pills container */
.joinmode-list-wrap,
.joinmode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 140px;
  overflow-y: auto;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.joinmode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(232, 183, 48, 0.08);
  border: 1px solid rgba(232, 183, 48, 0.25);
  color: var(--gold, #e8b730);
  font-size: 0.85em;
  font-weight: 600;
}
.joinmode-pill button {
  all: unset;
  cursor: pointer;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 80, 80, 0.15);
  color: rgba(255, 120, 120, 0.95);
  font-size: 0.75em;
  transition: background 0.15s;
}
.joinmode-pill button:hover {
  background: rgba(255, 80, 80, 0.4);
  color: #fff;
}

.joinmode-empty {
  width: 100%;
  text-align: center;
  padding: 12px 8px;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.45);
  font-style: italic;
}

/* ----------------------------------------------------------------
 * Issue 2 — Correct-answer credit visualization
 * Highlight the leaderboard row briefly when a chat user gets credited.
 * ---------------------------------------------------------------- */
@keyframes hf3-credit-flash {
  0%   { background: rgba(34, 197, 94, 0.25); }
  100% { background: transparent; }
}
.jawlah-player-row.hf3-credited {
  animation: hf3-credit-flash 1.6s ease-out 1;
}

/* ----------------------------------------------------------------
 * Mobile polish — make the joinmode bar wrap nicely on phones
 * ---------------------------------------------------------------- */
@media (max-width: 640px) {
  .pgs-radio-group.joinmode-group {
    gap: 4px;
  }
  .pgs-radio-group.joinmode-group .pgs-radio-pill {
    font-size: 0.82em;
    padding: 4px 8px;
  }
  .joinmode-list-wrap,
  .joinmode-pills {
    max-height: 110px;
  }
}
