/* tournament.css — Styles for Events / Tournament pages */

/* ── Events grid ──────────────────────────────────────────────────────────── */

.ev-active-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--color-accent-dim, rgba(41, 182, 246, 0.15));
  border: 1px solid var(--color-accent, #29b6f6);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  margin: 0.75rem 1rem 0;
}
.ev-active-banner__icon  { font-size: 1.8rem; }
.ev-active-banner__title { font-weight: 700; font-size: 0.85rem; opacity: 0.7; }
.ev-active-banner__code  { font-size: 0.95rem; }
.ev-active-banner__btn   { margin-left: auto; white-space: nowrap; }

.ev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1rem;
}

.ev-card {
  border-radius: 1rem;
  padding: 1.25rem 1rem;
  background: var(--color-surface, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.ev-card:hover { transform: translateY(-2px); border-color: var(--color-accent, #29b6f6); }

.ev-card--shark  { border-color: #29b6f6; background: rgba(41,182,246,0.07); }
.ev-card--join   { border-color: var(--color-success, #4caf50); background: rgba(76,175,80,0.07); }
.ev-card--disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.ev-card__icon    { font-size: 2rem; }
.ev-card__title   { font-weight: 700; font-size: 1rem; }
.ev-card__desc    { font-size: 0.8rem; opacity: 0.7; line-height: 1.4; }
.ev-card__cta     { margin-top: 0.5rem; font-size: 0.85rem; color: var(--color-accent, #29b6f6); font-weight: 600; }
.ev-card__coming  { margin-top: 0.5rem; font-size: 0.75rem; opacity: 0.5; font-style: italic; }

/* ── Create / Join forms ──────────────────────────────────────────────────── */

.sc-wrap {
  padding: 1rem;
  max-width: 480px;
  margin: 0 auto;
}

.sc-hint {
  font-size: 0.9rem;
  opacity: 0.7;
  margin-bottom: 1.25rem;
}

.sc-rules {
  background: var(--color-surface, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}
.sc-rules__title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  opacity: 0.8;
}
.sc-rules__list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.7;
}

.sc-form { display: flex; flex-direction: column; gap: 1rem; }

.sc-form__group  { display: flex; flex-direction: column; gap: 0.35rem; }
.sc-form__label  { font-size: 0.8rem; opacity: 0.7; font-weight: 600; }
.sc-form__input  {
  background: var(--color-surface, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255,255,255,0.15));
  border-radius: 0.5rem;
  color: inherit;
  font-size: 1rem;
  padding: 0.65rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
}
.sc-form__input:focus { outline: none; border-color: var(--color-accent, #29b6f6); }
.sc-form__input--code { font-size: 1.4rem; letter-spacing: 0.2em; text-align: center; text-transform: uppercase; }

.sc-form__error {
  background: rgba(220, 53, 69, 0.15);
  border: 1px solid #dc3545;
  border-radius: 0.5rem;
  color: #ff6b6b;
  font-size: 0.85rem;
  padding: 0.6rem 0.75rem;
}

.sc-code-reveal {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.sc-code-reveal__label { font-size: 0.85rem; opacity: 0.7; }
.sc-code-reveal__code  {
  font-size: 2.5rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: var(--color-accent, #29b6f6);
  font-family: 'Courier New', monospace;
}

/* ── Lobby page ───────────────────────────────────────────────────────────── */

.lb-info-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.6rem 1rem;
  background: var(--color-surface, #1e1e2e);
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
  align-items: center;
}
.lb-info-bar__item  { display: flex; align-items: center; gap: 0.35rem; font-size: 0.8rem; }
.lb-info-bar__label { opacity: 0.55; }
.lb-info-bar__val   { font-weight: 600; }
.lb-info-bar__copy  {
  background: none; border: none; cursor: pointer; color: var(--color-accent, #29b6f6);
  font-size: 1rem; padding: 0 0.15rem;
}

.lb-status               { border-radius: 0.3rem; padding: 0.1em 0.4em; font-size: 0.75rem; font-weight: 700; }
.lb-status--pending,
[class*="lb-status--pending"] { background: rgba(255,193,7,0.15); color: #ffc107; }
.lb-status--active,
[class*="lb-status--active"]  { background: rgba(76,175,80,0.15);  color: #4caf50; }
.lb-status--ended,
[class*="lb-status--ended"]   { background: rgba(158,158,158,0.15); color: #9e9e9e; }

.lb-my-bounty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
}
.lb-my-bounty__label { opacity: 0.6; font-size: 0.85rem; }
.lb-my-bounty__val   { font-size: 1.8rem; font-weight: 900; color: var(--color-accent, #29b6f6); }
.lb-my-bounty__icon  { font-size: 1.5rem; }

.lb-active-match {
  margin: 0 1rem 0.75rem;
  background: rgba(76,175,80,0.12);
  border: 1px solid #4caf50;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}
.lb-active-match__title  { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.35rem; color: #4caf50; }
.lb-active-match__detail { font-size: 0.85rem; margin-bottom: 0.6rem; line-height: 1.5; }
.lb-active-match__btn    { font-size: 0.85rem; }

.lb-incoming {
  margin: 0 1rem 0.75rem;
  background: rgba(255,152,0,0.08);
  border: 1px solid #ff9800;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}
.lb-incoming__title { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.5rem; color: #ff9800; }

.lb-challenge-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0;
  font-size: 0.85rem;
}
.lb-challenge-item__name  { flex: 1; font-weight: 600; }
.lb-challenge-item__btns  { display: flex; gap: 0.4rem; }

/* Player list */
.lb-players { padding: 0 1rem; }
.lb-players__header {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  font-size: 0.75rem;
  opacity: 0.5;
  font-weight: 700;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lb-players__loading { text-align: center; padding: 1.5rem; opacity: 0.5; font-size: 0.9rem; }

.lb-player-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
  font-size: 0.9rem;
}
.lb-player-row--me   { background: rgba(41,182,246,0.06); border-radius: 0.4rem; padding: 0.55rem 0.4rem; }
.lb-player-row__name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-player-row__bounty {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-accent, #29b6f6);
  text-align: right;
  min-width: 2.5rem;
}
.lb-player-row__action { text-align: right; min-width: 5rem; }

.btn--challenge {
  background: rgba(41,182,246,0.15);
  border: 1px solid var(--color-accent, #29b6f6);
  color: var(--color-accent, #29b6f6);
  border-radius: 0.4rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn--challenge:hover:not(:disabled) { background: rgba(41,182,246,0.3); }
.btn--challenge:disabled { opacity: 0.4; cursor: default; border-color: currentColor; color: inherit; background: none; }

.btn--accept  { background: rgba(76,175,80,0.15);  border: 1px solid #4caf50; color: #4caf50;  border-radius: 0.4rem; padding: 0.3rem 0.6rem; font-size: 0.75rem; cursor: pointer; }
.btn--decline { background: rgba(220,53,69,0.15);  border: 1px solid #dc3545; color: #ff6b6b; border-radius: 0.4rem; padding: 0.3rem 0.6rem; font-size: 0.75rem; cursor: pointer; }
.btn--accept:hover  { background: rgba(76,175,80,0.3); }
.btn--decline:hover { background: rgba(220,53,69,0.3); }

.lb-admin {
  padding: 1rem;
  text-align: center;
  margin-top: 0.5rem;
}

.lb-pending-sent {
  font-size: 0.72rem;
  opacity: 0.55;
  font-style: italic;
}

/* ── Lobby rules collapsible ──────────────────────────────────────────────── */

.lb-rules {
  margin: 0 1rem 0.75rem;
  background: var(--color-surface, #1e1e2e);
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
  border-radius: 0.75rem;
  overflow: hidden;
}
.lb-rules__toggle {
  cursor: pointer;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  list-style: none;
  user-select: none;
  opacity: 0.75;
}
.lb-rules__toggle:hover { opacity: 1; }
.lb-rules__toggle::-webkit-details-marker { display: none; }
.lb-rules[open] .lb-rules__toggle { border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.08)); opacity: 1; }
.lb-rules__list {
  margin: 0;
  padding: 0.75rem 1rem 0.75rem 1.75rem;
  font-size: 0.8rem;
  line-height: 1.75;
  opacity: 0.8;
}

/* ── Leaderboard page ─────────────────────────────────────────────────────── */

.lb-board-wrap { padding: 1rem; }

.lb-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.lb-board-empty { text-align: center; padding: 2rem; opacity: 0.5; }

.lb-board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.lb-board-table th {
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-size: 0.75rem;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.1));
}
.lb-board-row td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--color-border, rgba(255,255,255,0.05));
  vertical-align: middle;
}
.lb-board-row:hover td { background: rgba(255,255,255,0.03); }

.lb-board-row__rank        { font-weight: 700; font-size: 1rem; color: var(--color-muted, #888); text-align: center; }
.lb-board-row__rank--gold   { color: #ffd700; }
.lb-board-row__rank--silver { color: #c0c0c0; }
.lb-board-row__rank--bronze { color: #cd7f32; }
.lb-board-row__name        { font-weight: 600; }
.lb-board-row__bounty      { font-weight: 700; color: var(--color-accent, #29b6f6); text-align: right; }
.lb-board-row__peak        { opacity: 0.55; text-align: right; }
.lb-board-row__games       { opacity: 0.55; text-align: right; }
.lb-board-row__title       { font-weight: 600; }

/* Titles */
.t-bigshark  { color: #29b6f6; }
.t-shark     { color: #66bb6a; }
.t-barracuda { color: #ffa726; }
.t-smallfry  { color: #ef5350; }
.t-babyfish  { color: #ab47bc; }

.lb-board-legend {
  margin-top: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface, #1e1e2e);
  border-radius: 0.75rem;
  border: 1px solid var(--color-border, rgba(255,255,255,0.08));
}
.lb-board-legend__title { font-size: 0.75rem; font-weight: 700; opacity: 0.6; margin-bottom: 0.5rem; text-transform: uppercase; }
.lb-board-legend__grid  { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.8rem; }

/* ── Drawer tournament banner ─────────────────────────────────────────────── */
.drawer__tournament-banner {
  background: rgba(41,182,246,0.1);
  border-top: 1px solid rgba(41,182,246,0.3);
  border-bottom: 1px solid rgba(41,182,246,0.3);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.drawer__tournament-banner-icon  { font-size: 1.2rem; }
.drawer__tournament-banner-text  { flex: 1; font-size: 0.82rem; line-height: 1.4; }
.drawer__tournament-banner-title { font-weight: 700; }
.drawer__tournament-banner-code  { opacity: 0.65; }
.drawer__tournament-banner-btn   {
  font-size: 0.75rem;
  color: var(--color-accent, #29b6f6);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

/* Challenge badge on Events nav link */
.drawer__challenge-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ff9800;
  color: #000;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.1em;
  height: 1.1em;
  padding: 0 0.2em;
  margin-left: 0.35rem;
  animation: badge-pulse 1.2s infinite;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* topbar action button */
.topbar__action-btn {
  position: absolute;
  right: 0.75rem;
  font-size: 1.2rem;
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.topbar__action-btn:hover { opacity: 1; }

/* responsive */
@media (max-width: 360px) {
  .ev-grid { grid-template-columns: 1fr; }
}
