:root {
  --bg: #0d0d1a;
  --surface: #161628;
  --surface2: #1e1e35;
  --card: #181830;
  --hover: rgba(255,255,255,0.05);
  --border: #2a2a4a;
  --accent: #3d8bff;
  --accent-glow: rgba(61, 139, 255, 0.2);
  --green: #22c55e;
  --gold: #f5c518;
  --red: #ef4444;
  --text: #e8e8f0;
  --muted: #7070a0;
  --rank1: #f5c518;
  --rank2: #c0c0c0;
  --rank3: #cd7f32;
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Header */
header {
  background: linear-gradient(135deg, #0d1033 0%, #1a0d33 100%);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 16px;
}

.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trophy {
  font-size: 32px;
}

h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.last-updated { display: none; }

/* Gear menu button */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 18px;
  transition: background 0.15s;
  line-height: 1;
}
.menu-btn:hover, .menu-btn:active { background: rgba(255,255,255,0.15); }

.back-btn { font-size: 20px; padding-bottom: 1px; }

.header-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  background: var(--surface2);
  background-size: cover;
  background-position: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.1s;
}
.header-avatar-btn:hover { border-color: var(--accent); }
.header-avatar-btn:active { transform: scale(0.93); }

/* Menu list — compact iOS-style */
.menu-list {
  display: flex;
  flex-direction: column;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s;
}
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--border); }
.menu-item-icon { font-size: 16px; width: 24px; text-align: center; opacity: 0.85; }
.menu-item-label { flex: 1; }
.menu-item-arrow { color: var(--muted); font-size: 16px; font-weight: 400; }

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
}
.btn-primary:hover { background: #5b9fff; transform: translateY(-1px); }

.btn-ghost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--border); }

.btn-danger {
  background: var(--red);
  color: white;
}
.btn-danger:hover { background: #f87171; }

.btn:active { transform: scale(0.97); }

/* Tab bar */
.tab-bar {
  display: flex;
  border-top: 1px solid var(--border);
  margin: 0 -24px;
}
.tab {
  flex: 1;
  padding: 10px 4px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.2px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Tab panels */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Main */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.section {}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-header h2 {
  font-size: 18px;
  font-weight: 700;
}

/* Filter */
.filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#scheduleFilterRow {
  margin-bottom: 16px;
}

/* View toggle (e.g. List/Bracket) */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  flex-shrink: 0;
}
.view-toggle-btn {
  padding: 4px 12px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.view-toggle-btn.active {
  background: var(--accent);
  color: white;
}

.filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Leaderboard */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 36px 44px 1fr auto;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
}

/* Player avatar */
.player-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: border-color 0.15s;
  display: block;
  flex-shrink: 0;
}
.player-avatar:hover { border-color: var(--accent); }
.player-avatar-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.player-avatar-placeholder:hover { border-color: var(--accent); color: var(--accent); }

/* Photo picker in add player modal */
.photo-picker-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
}
.avatar-pick {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px dashed var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  transition: border-color 0.15s;
}
.avatar-pick:hover { border-color: var(--accent); }
.avatar-pick-icon { font-size: 22px; }
.avatar-pick-label { font-size: 9px; color: var(--muted); font-weight: 700; text-transform: uppercase; margin-top: 2px; }
.player-card:hover { border-color: var(--accent); }

.player-card.rank-1 { border-color: var(--rank1); background: linear-gradient(135deg, rgba(245,197,24,0.08) 0%, var(--surface) 60%); }
.player-card.rank-2 { border-color: var(--rank2); background: linear-gradient(135deg, rgba(192,192,192,0.06) 0%, var(--surface) 60%); }
.player-card.rank-3 { border-color: var(--rank3); background: linear-gradient(135deg, rgba(205,127,50,0.08) 0%, var(--surface) 60%); }

.player-rank {
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  color: var(--muted);
}
.rank-1 .player-rank { color: var(--rank1); }
.rank-2 .player-rank { color: var(--rank2); }
.rank-3 .player-rank { color: var(--rank3); }

.player-info {}

.player-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 6px;
}

.player-teams {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.team-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}
.team-chip:hover { border-color: var(--red); color: var(--red); }
.team-chip .chip-pts {
  color: var(--green);
  font-size: 11px;
}
.team-chip.stage-WINNER { border-color: var(--gold); background: rgba(245,197,24,0.1); }
.team-chip.stage-FINAL  { border-color: #a78bfa; background: rgba(167,139,250,0.1); }
.team-chip.stage-THIRD  { border-color: #cd7f32; background: rgba(205,127,50,0.12); }
.team-chip.stage-SF     { border-color: var(--accent); background: var(--accent-glow); }
.team-chip.stage-QF     { border-color: var(--green); background: rgba(34,197,94,0.1); }
.team-chip.eliminated {
  opacity: 0.5;
  filter: grayscale(1);
  border-color: var(--border);
  background: var(--surface2);
  text-decoration: line-through;
}
.team-chip.eliminated .chip-pts { text-decoration: none; }

.add-team-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.add-team-chip:hover { border-color: var(--accent); color: var(--accent); }

.player-points {
  font-size: 28px;
  font-weight: 900;
  color: var(--text);
  text-align: right;
  min-width: 60px;
}
.rank-1 .player-points { color: var(--rank1); }

.player-pts-label {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  font-weight: 600;
  text-transform: uppercase;
}

.player-actions {
  display: flex;
  gap: 6px;
}

.icon-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  opacity: 0.4;
  transition: opacity 0.15s;
  border-radius: 4px;
}
.icon-btn:hover { opacity: 1; }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.empty-state .big-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* Teams Grid */
.teams-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.group-section {}

.group-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}

.group-teams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.team-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.team-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.team-card.claimed { border-color: var(--border); opacity: 0.7; }
.team-card.claimed:hover { border-color: var(--red); opacity: 1; }
.team-card.pickable { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(61,139,255,0.25); cursor: pointer; }
.team-card.pickable:hover { transform: translateY(-2px); box-shadow: 0 0 0 3px rgba(61,139,255,0.4); }

.team-card-flag { font-size: 24px; margin-bottom: 4px; }
.team-card-name { font-size: 13px; font-weight: 700; }
.team-card-code { font-size: 11px; color: var(--muted); font-weight: 600; }
.team-card-claimed { font-size: 11px; color: var(--accent); margin-top: 4px; font-weight: 600; }
.team-card-stage {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}

.stage-GROUP  { background: rgba(100,100,100,0.2); color: #888; }
.stage-R32    { background: rgba(34,197,94,0.15);  color: var(--green); }
.stage-R16    { background: rgba(61,139,255,0.15); color: var(--accent); }
.stage-QF     { background: rgba(167,139,250,0.15);color: #a78bfa; }
.stage-SF     { background: rgba(251,146,60,0.15); color: #fb923c; }
.stage-THIRD  { background: rgba(205,127,50,0.2);  color: #cd7f32; }
.stage-FINAL  { background: rgba(167,139,250,0.25);color: #c084fc; }
.stage-WINNER { background: rgba(245,197,24,0.2);  color: var(--gold); }

.team-card[data-hidden="true"] { display: none; }

.team-card.eliminated { opacity: 0.5; filter: grayscale(1); }
.team-card-out {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.2s ease;
}

.modal > .modal-scroll-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.modal-wide { max-width: 520px; }

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal h3 { font-size: 18px; font-weight: 800; margin-bottom: 16px; }
.modal h4 { font-size: 14px; font-weight: 700; margin: 16px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.modal-sub { font-size: 14px; color: var(--muted); margin-bottom: 14px; }

.modal-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  margin-bottom: 16px;
}
.modal-input:focus { border-color: var(--accent); }
select.modal-input { cursor: pointer; }
select.modal-input option { background: var(--surface); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Rules */
.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}
.rules-list li {
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.rules-list li::before { content: '•  '; color: var(--accent); font-weight: 900; }

.scoring-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 6px;
  font-size: 13px;
  gap: 12px;
}
.score-row.highlight { background: rgba(245,197,24,0.1); border: 1px solid rgba(245,197,24,0.3); }
.score-row-pts { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.pts-bonus { font-weight: 800; color: var(--accent); min-width: 28px; text-align: right; }
.pts-total { font-weight: 700; color: var(--green); font-size: 12px; }
.pts-total.muted { color: var(--muted); }
.pts-total.gold  { color: var(--gold); }
.pts { font-weight: 700; color: var(--green); }
.pts.muted { color: var(--muted); }
.gold { color: var(--gold) !important; }
.muted { color: var(--muted); }

/* Settings modal */
.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface2);
  border-radius: 8px;
  gap: 16px;
}
.settings-row.highlight-row { background: rgba(245,197,24,0.08); border: 1px solid rgba(245,197,24,0.2); }
.settings-row label { font-size: 13px; flex: 1; }
.settings-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
}
.settings-input-wrap:focus-within { border-color: var(--accent); }
.pts-prefix, .pts-suffix { font-size: 12px; color: var(--muted); font-weight: 600; }
.pts-input {
  width: 50px;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  outline: none;
}
.pts-input::-webkit-inner-spin-button { opacity: 0.4; }
.settings-max-note {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-bottom: 4px;
}
.settings-max-note strong { color: var(--green); }

/* Manage players modal */
.manage-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface2);
  margin-bottom: 6px;
}
.manage-player-row:last-child { margin-bottom: 0; }
.manage-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.manage-avatar-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}
.manage-player-name { flex: 1; font-size: 14px; font-weight: 600; }
.manage-delete-btn {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
  flex-shrink: 0;
}

.settings-static-row { opacity: 0.5; }
.settings-lock-row {
  margin-top: 10px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.teams-locked-badge {
  font-size: 12px;
  opacity: 0.6;
  margin-left: 4px;
  position: relative;
  top: -1px;
}
.settings-static-val {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}

/* ─── Trade Deadline Banner ─────────────────────────────────────────────── */

/* Announcement Banner */
#announcementBanner {
  background: linear-gradient(135deg, #1e1e35, #252545);
  border: 1px solid var(--accent);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
}
.announcement-inner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
}
.announcement-text {
  flex: 1;
  min-width: 0;
}
.announcement-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
}
.announcement-body {
  font-size: 13px;
  color: var(--muted);
  margin-top: 1.4em;
  line-height: 1.5;
  white-space: pre-wrap;
}
.announcement-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: -2px;
}
.announcement-counter {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.announcement-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: color 0.15s;
}
.announcement-dismiss:hover {
  color: var(--text);
}
.modal-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
}
.modal-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.trade-deadline-banner {
  background: linear-gradient(135deg, rgba(249,115,22,0.15) 0%, rgba(251,146,60,0.08) 100%);
  border: 1px solid rgba(249,115,22,0.4);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.trade-deadline-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.trade-deadline-timer {
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fb923c;
  letter-spacing: 2px;
}
.settings-section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.settings-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

/* ─── Draft ──────────────────────────────────────────────────────────────── */

/* Draft banner */
.draft-banner {
  background: linear-gradient(135deg, rgba(167,139,250,0.15) 0%, rgba(61,139,255,0.1) 100%);
  border: 1px solid rgba(167,139,250,0.4);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.draft-banner-top {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 6px;
}
.draft-banner-middle {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.draft-on-clock {
  color: #a78bfa;
  font-size: 20px;
  font-weight: 900;
}
.draft-clock-label { color: var(--muted); margin-left: 6px; }
.draft-banner-timer {
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  letter-spacing: 2px;
  margin-top: 4px;
}

/* Player card draft states */
.player-card.on-the-clock {
  border-color: #a78bfa;
  background: linear-gradient(135deg, rgba(167,139,250,0.12) 0%, var(--surface) 60%);
  box-shadow: 0 0 0 2px rgba(167,139,250,0.25);
}
.player-card.draft-waiting { opacity: 0.6; }

/* On the clock badge + timer next to name */
.draft-clock-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #a78bfa;
  color: #0d0d1a;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.draft-live-timer {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
  margin-left: 6px;
  letter-spacing: 1px;
}

/* Draft direction toggle */
.draft-dir-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}
.draft-dir-btn {
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.draft-dir-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.draft-dir-btn:active { transform: scale(0.97); }

/* Draft modal sections */
.draft-config-section {
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.draft-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.draft-section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.draft-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.draft-sm-btn {
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}

/* Order badge */
.draft-order-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.draft-order-badge.randomized { color: var(--accent); }

/* Order preview flow */
.draft-order-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.draft-order-pip {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.draft-order-name { font-size: 12px; font-weight: 600; }
.draft-order-arrow { font-size: 11px; color: var(--muted); margin: 0 1px; }

/* Shuffle lock-in animations */
@keyframes shuffleLock {
  0%   { transform: scale(1.03); }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); }
}
@keyframes shuffleMeActiveIn {
  0%   { box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent); }
  100% { box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent); }
}
@keyframes shuffleMeActiveOut {
  0%   { box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent); }
  100% { box-shadow: none; }
}
.player-card.shuffle-locked { animation: shuffleLock 0.7s ease forwards; }
.player-card.shuffle-me-active {
  box-shadow: 0 0 0 2px var(--accent), 0 0 14px var(--accent);
  transition: box-shadow 0.6s ease;
}
.player-card.shuffle-me-active.removing {
  box-shadow: none;
}

/* Toggle switch */
.toggle-wrap { display: flex; align-items: center; cursor: pointer; }
.toggle-track {
  width: 44px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}
input[type=checkbox]:checked + .toggle-track { background: var(--accent); }
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
input[type=checkbox]:checked + .toggle-track .toggle-thumb { transform: translateX(20px); }
.toggle-wrap input[type=checkbox] { display: none; }

/* Activity collapsible header */
.collapsible-header { user-select: none; }
.collapsible-header:active { opacity: 0.7; }
.activity-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.activity-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--red);
  color: white;
  font-size: 11px;
  font-weight: 800;
  border-radius: 10px;
}
.collapse-arrow {
  font-size: 20px;
  color: var(--muted);
  font-weight: 300;
  transition: transform 0.2s ease;
  line-height: 1;
  display: block;
}

/* Activity log */
.activity-log {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 420px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.activity-empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.activity-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.activity-flag { font-size: 18px; flex-shrink: 0; }
.activity-text { flex: 1; font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.activity-team { font-weight: 700; }
.activity-action { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.activity-action.assigned { color: var(--green); background: rgba(34,197,94,0.12); }
.activity-action.removed  { color: var(--red);   background: rgba(239,68,68,0.12); }
.activity-action.stage    { color: var(--gold);  background: rgba(245,197,24,0.12); }
.activity-action.trade-pending { color: #fb923c; background: rgba(249,115,22,0.12); }
.activity-trade-teams { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.activity-trade-response { display: block; font-size: 11px; font-weight: 700; margin-top: 2px; }
.activity-trade-response.accepted { color: #4ade80; }
.activity-trade-response.declined { color: #f87171; }
.activity-delete-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 8px;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.15s, color 0.15s;
}
.activity-delete-btn:hover { opacity: 1; color: var(--red); }
.activity-player { font-weight: 700; color: var(--accent); }
.activity-pts {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  background: rgba(34,197,94,0.12);
  padding: 1px 6px;
  border-radius: 8px;
}
.activity-score { font-weight: 800; color: var(--text); }
.activity-stage { border-color: rgba(245,197,24,0.2); }
.activity-time { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; }

/* Team card points */
.team-card-pts {
  font-size: 12px;
  font-weight: 800;
  color: var(--green);
  margin-top: 2px;
}

/* Match Schedule */
.match-day { margin-bottom: 24px; }
.match-day-header {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

/* Clean card layout */
.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 6px;
  transition: border-color 0.15s;
}
.match-card:hover { border-color: var(--accent); }
.match-card.match-live { border-color: var(--green); background: rgba(34,197,94,0.05); }

/* Top row: time + stage */
.match-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.match-time {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent);
}
.match-time.live { color: var(--green); animation: live-pulse 1.6s ease-in-out infinite; }
@keyframes live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.match-meta-dot { color: var(--border); font-size: 12px; }
.match-stage {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Bottom row: home vs away */
.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.match-team-left {
  display: flex;
  align-items: center;
  gap: 7px;
}
.match-team-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}
.match-flag { font-size: 18px; flex-shrink: 0; }
.match-name { font-size: 13px; font-weight: 700; line-height: 1.2; }
.match-vs {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
}
.match-score {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0 6px;
}
.match-score-val {
  font-size: 22px;
  font-weight: 900;
  color: var(--text);
  text-align: center;
  letter-spacing: 2px;
  white-space: nowrap;
}

/* Match winner points badge */
.match-pts {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  color: var(--green);
  white-space: nowrap;
  margin-top: 3px;
  margin-left: 6px;
}

/* Pool owner tag */
.match-owner {
  display: inline-block;
  font-size: 10px;
  color: var(--accent);
  font-weight: 700;
  background: var(--accent-glow);
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  margin-top: 3px;
  width: fit-content;
}

/* ─── Knockout Bracket ─────────────────────────────────────────────────── */
.bracket-wrap {
  display: flex;
  gap: 32px;
  overflow-x: auto;
  padding: 16px 8px 32px;
}
.bracket-round {
  position: relative;
  flex-shrink: 0;
}
.bracket-round-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-align: center;
  margin-bottom: 12px;
}
.bracket-slots { position: relative; }
.bracket-card {
  position: absolute;
  left: 0;
  right: 0;
}
.bracket-card:not(.last):not(.third)::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--border);
}
.bracket-card:not(.first):not(.third)::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  width: 16px;
  height: 1px;
  background: var(--border);
}
.bracket-connector {
  position: absolute;
  left: -16px;
  width: 1px;
  background: var(--border);
}
.bracket-match {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.bracket-match.live { border-color: var(--green); background: rgba(34,197,94,0.05); }
.bracket-side {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  flex: 1;
  min-width: 0;
}
.bracket-side.winner { background: rgba(245,197,24,0.1); }
.bracket-side.winner .bracket-team-name { color: var(--gold); }
.bracket-side + .bracket-side { border-top: 1px solid var(--border); }
.bracket-tbd-side {
  justify-content: center;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 2px 6px;
}
.bracket-flag { font-size: 13px; flex-shrink: 0; }
.bracket-team-name {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.bracket-owner {
  font-size: 9px;
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}
.bracket-score {
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}
.bracket-third {
  max-width: 200px;
  margin: 0 auto 24px;
}
.bracket-third .bracket-card.third {
  position: relative;
  height: 56px;
}

/* ─── Group standings ─── */
.standings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.standings-table th, .standings-table td {
  padding: 6px 4px;
  text-align: center;
}
.standings-table th {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.standings-table td.standings-pos {
  color: var(--muted);
  font-weight: 700;
}
.standings-table td.standings-team {
  display: flex;
  align-items: center;
  gap: 6px;
  text-align: left;
}
.standings-team-name {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.standings-table td.standings-pts {
  font-weight: 900;
}
.standings-table tr.qualify {
  background: rgba(34,197,94,0.08);
}
.standings-table tr.qualify td.standings-pos {
  color: var(--green);
}

/* match filter reuses filter-btn style */
.match-filter-btn {
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.match-filter-btn:hover, .match-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 999;
  transition: transform 0.25s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error { border-color: var(--red); color: var(--red); }

/* ─── Mobile ─────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {

  /* ── Header ── */
  header { padding: 0 16px; }
  .header-inner {
    height: 56px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }
  .header-title { gap: 8px; }
  .trophy { font-size: 22px; }
  h1 { font-size: 17px; }
  .subtitle { display: block; font-size: 10px; letter-spacing: 0.6px; margin-top: 1px; }
  .menu-btn { width: 36px; height: 36px; }
  .tab-bar { margin: 0 -16px; }
  .tab { font-size: 13px; padding: 10px 4px; }

  /* ── Main ── */
  main { padding: 12px 14px 32px; gap: 20px; }
  .section-header { padding: 0 2px; }
  .section-header h2 { font-size: 15px; }
  .section-header .btn { padding: 8px 14px; font-size: 12px; border-radius: 20px; }

  /* ── Player cards ── */
  .player-card {
    grid-template-columns: 28px 38px 1fr 44px;
    padding: 12px;
    gap: 8px;
  }
  .player-avatar, .player-avatar-placeholder { width: 38px; height: 38px; font-size: 14px; }
  .player-rank { font-size: 17px; }
  .player-name { font-size: 15px; }
  .player-points { font-size: 20px; min-width: unset; text-align: center; }
  .player-pts-label { font-size: 9px; text-align: center; }
  .team-chip { font-size: 11px; padding: 3px 8px; }
  .add-team-chip { font-size: 11px; padding: 3px 8px; }

  /* ── Teams grid ── */
  .group-teams { grid-template-columns: 1fr 1fr; gap: 8px; }
  .team-card { padding: 10px; }
  .team-card-flag { font-size: 20px; }
  .team-card-name { font-size: 12px; }
  .team-card-code { font-size: 10px; }
  .team-card-claimed { font-size: 10px; }

  /* ── Modals: full-width bottom sheet ── */
  .modal-overlay { align-items: flex-end; }

  .modal {
    border-radius: 22px 22px 0 0;
    max-width: 100%;
    width: 100%;
    padding: 0;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    animation: slideUpSheet 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  }
  .modal-wide { max-width: 100%; }

  @keyframes slideUpSheet {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }

  /* Drag handle */
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 12px auto 0;
    flex-shrink: 0;
  }

  /* Scrollable inner content — modals without modal-scroll-body fallback */
  .modal > *:not(.modal-actions):not(h3):not(.modal-scroll-body):not(.trade-modal-inner) { flex: 1; overflow-y: auto; }
  .modal h3 {
    font-size: 17px;
    padding: 16px 20px 0;
    flex-shrink: 0;
    margin-bottom: 0;
  }
  .modal-sub { padding: 5px 20px 0; margin-bottom: 0; font-size: 12px; }
  .modal .modal-label { padding: 14px 20px 4px; margin: 0; display: block; }
  .modal-input { margin: 4px 20px 0; width: calc(100% - 40px); }
  select.modal-input { width: calc(100% - 40px); }

  /* Single scrollable wrapper used by Rules + Settings */
  .modal-scroll-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 20px 4px;
  }
  /* Reset elements inside wrapper — they no longer need their own side padding */
  .modal-scroll-body .modal-label { padding: 0; margin-top: 16px; margin-bottom: 6px; }
  .modal-scroll-body .modal-label:first-child { margin-top: 0; }
  .modal-scroll-body .modal-sub { padding: 0; margin-bottom: 8px; margin-top: 4px; }
  .modal-scroll-body .rules-list,
  .modal-scroll-body .scoring-table,
  .modal-scroll-body .settings-grid { padding: 0; margin-top: 0; }
  .modal-scroll-body .settings-max-note { padding: 0; }
  .modal-scroll-body .settings-lock-row { padding-top: 12px; }
  .modal-scroll-body h4 { padding: 0; margin-top: 16px; }
  /* datetime input inside scroll body */
  .modal-scroll-body .modal-input { margin: 8px 0 0; width: 100%; }

  .modal h4 { padding: 0 20px; margin-top: 14px; }
  .settings-max-note { padding: 0 20px; }

  /* Sticky modal footer */
  .modal-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
    padding: 14px 20px 28px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
    background: var(--surface);
  }
  .modal-actions .btn {
    flex: 1;
    padding: 13px;
    font-size: 14px;
    text-align: center;
  }

  /* ── Rules list ── */
  .rules-list { gap: 6px; }
  .rules-list li { font-size: 13px; padding: 9px 12px; line-height: 1.4; }

  /* ── Scoring table ── */
  .score-row { padding: 8px 10px; gap: 8px; }
  .score-row span:first-child { font-size: 12px; }
  .score-row-pts { gap: 8px; }
  .pts-bonus { font-size: 13px; min-width: 24px; }
  .pts-total { font-size: 11px; }

  /* ── Settings rows ── */
  .settings-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    gap: 8px;
  }
  .settings-row label { font-size: 12px; flex: 1; min-width: 0; }
  .settings-input-wrap { flex-shrink: 0; }
  .pts-input { width: 40px; font-size: 14px; }
  .settings-static-val { font-size: 11px; flex-shrink: 0; }

  /* ── Match cards ── */
  .match-card { padding: 10px 12px; }
  .match-name { font-size: 12px; }
  .match-flag { font-size: 16px; }

  /* ── Toast ── */
  .toast { bottom: 16px; font-size: 13px; padding: 8px 16px; width: 85%; text-align: center; }

  /* ── Propose Trade modal ── */
  .trade-modal-inner { padding: 12px 16px 8px; flex: 1; overflow-y: auto; overflow-x: hidden; }
  .trade-extras { padding: 12px; }
  .trade-wager-row { flex-direction: column; gap: 14px; }
}

/* ─── Trade Market ──────────────────────────────────────────────────────────── */

.trade-market-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 4px 0 0;
}
.trade-market-title {
  font-size: 16px;
  font-weight: 700;
}
#tradeMarket {
  margin-bottom: 16px;
}
.trade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trade-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.trade-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.trade-players {
  font-weight: 700;
  font-size: 14px;
}
.trade-status-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 20px;
}
.trade-status-badge.pending {
  background: rgba(249,115,22,0.15);
  color: #fb923c;
}
.trade-status-badge.approved {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}
.trade-status-badge.rejected {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}
.trade-sides {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  margin-bottom: 10px;
}
.trade-side { flex: 1; }
.trade-side-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 4px;
}
.trade-teams { line-height: 1.6; }
.team-flag-name { white-space: nowrap; }
.trade-arrow {
  font-size: 18px;
  color: var(--muted);
  padding-top: 14px;
}
.trade-response-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  margin-bottom: 2px;
  flex-wrap: wrap;
}
.trade-respond-btns {
  display: flex;
  gap: 6px;
}
.trade-response-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}
.trade-response-badge.accepted {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}
.trade-response-badge.declined {
  background: rgba(239,68,68,0.12);
  color: #f87171;
}
.trade-response-badge.waiting {
  background: rgba(112,112,160,0.12);
  color: var(--muted);
}
.trade-card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.trade-undo-timer {
  font-size: 12px;
  color: var(--muted);
  margin-right: auto;
}
.trade-empty {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  padding: 20px 0;
}
.trade-hidden-placeholder {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.trade-lock-icon { font-size: 12px; }

.trade-history-list { display: flex; flex-direction: column; gap: 0; }
.trade-history-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.trade-history-item:last-child { border-bottom: none; }
.trade-history-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: 13px; }
.trade-history-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.trade-history-badge.approved { background: rgba(34,197,94,0.15); color: #4ade80; }
.trade-history-badge.withdrawn { background: rgba(239,68,68,0.12); color: #f87171; }
.trade-history-badge.countered { background: rgba(112,112,160,0.12); color: var(--muted); }
.trade-history-teams { font-size: 12px; color: var(--muted); width: 100%; margin-top: 2px; }

/* Propose trade modal */
.trade-modal-inner {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 28px 8px;
}
.trade-modal-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.trade-card-section-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.trade-modal-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  outline: none;
  cursor: pointer;
}
.trade-modal-select:focus { border-color: var(--accent); }
.trade-modal-select option { background: var(--surface); }
.trade-for-divider {
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
  padding: 10px 0;
  letter-spacing: 0.5px;
}
.trade-extras {
  margin-top: 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.trade-wager-row {
  display: flex;
  gap: 12px;
}
.trade-wager-side { flex: 1; }
.trade-wager-inputs {
  display: flex;
  gap: 6px;
}
.trade-wager-inputs input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 8px 10px;
}
.trade-visibility {
  padding: 14px 0 0;
  margin-top: 14px;
  border-top: 1px solid var(--border);
}
.trade-visibility-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.trade-visibility-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: color 0.15s;
}
.trade-visibility-label.active {
  color: var(--text);
}
.trade-visibility-desc {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}
.trade-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 30px;
  align-items: center;
}
.trade-select-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
  -webkit-user-select: none;
}
.trade-select-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.trade-chip-hint {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
}

/* ─── Polls ────────────────────────────────────────────────────────────────── */
#pollsSection {
  margin-bottom: 4px;
}
.poll-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 10px;
}
.feed-announcement-card {
  background: var(--card-bg);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.feed-announcement-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}
.feed-announcement-body {
  font-size: 14px;
  color: var(--muted);
  white-space: pre-wrap;
  line-height: 1.5;
}
.feed-pool-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: rgba(59,130,246,0.1);
  border-radius: 6px;
  padding: 3px 8px;
  margin-bottom: 8px;
}
.feed-pool-badge:hover { background: rgba(59,130,246,0.2); }
.poll-question {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}
.poll-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.poll-option-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}
.poll-option-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.poll-result-row {
  margin-bottom: 8px;
}
.poll-result-row.poll-my-vote .poll-result-label {
  color: var(--accent);
  font-weight: 600;
}
.poll-result-row.poll-my-vote .poll-result-bar {
  background: var(--accent);
}
.poll-result-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.poll-result-count {
  color: var(--muted);
  font-size: 12px;
}
.poll-result-bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.poll-result-bar {
  height: 100%;
  background: var(--muted);
  border-radius: 4px;
  transition: width 0.4s ease;
}
.poll-option-voters {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}
.poll-card-closed {
  border-color: var(--muted);
  opacity: 0.9;
}
.poll-closed-banner {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.poll-close-btn {
  display: block;
  margin-top: 14px;
  background: none;
  border: 1.5px solid #e74c3c;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #e74c3c;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.poll-close-btn:hover {
  background: #e74c3c;
  color: #fff;
}
.poll-close-btn.poll-reopen {
  border-color: var(--accent);
  color: var(--accent);
}
.poll-close-btn.poll-reopen:hover {
  background: var(--accent);
  color: #fff;
}
.poll-voter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
}
.poll-voter-del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  padding: 0 1px;
  opacity: 0.6;
}
.poll-voter-del:hover {
  color: #e74c3c;
  opacity: 1;
}
.poll-admin-entry {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.poll-admin-entry-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.poll-admin-entry-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.poll-admin-entry-name {
  font-size: 13px;
  font-weight: 600;
  min-width: 60px;
  flex-shrink: 0;
}
.poll-admin-entry-opts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.poll-admin-opt-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.poll-admin-opt-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.poll-admin-opt-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.poll-change-btn {
  margin-top: 12px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.poll-change-btn:hover {
  color: var(--text);
}

/* Admin poll list in settings */
.polls-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.polls-admin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
.polls-admin-question {
  flex: 1;
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.polls-admin-empty {
  font-size: 13px;
  color: var(--muted);
  font-style: italic;
  padding: 4px 0;
}

/* Vote identity picker */
.vote-identity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.vote-identity-btn {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.vote-identity-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ─── Login Page ───────────────────────────────────────────────────────────── */

body.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-container {
  width: 100%;
  max-width: 360px;
  padding: 40px 24px;
  text-align: center;
}

.login-logo {
  font-size: 56px;
  margin-bottom: 12px;
  line-height: 1;
}

.login-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--text);
}

.login-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* Override modal-input responsive margins so login inputs stay full-width */
.login-form .modal-input { margin: 0; width: 100%; }

.login-input {
  font-size: 16px !important;
  padding: 14px 16px !important;
}

.login-btn {
  width: 100%;
  padding: 14px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  margin-top: 4px;
}

.login-error {
  color: var(--red);
  font-size: 13px;
  margin: 0;
  text-align: left;
  padding-left: 4px;
}

/* ─── View-As Banner ───────────────────────────────────────────────────────── */

.view-as-banner {
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 10px;
  color: #f59e0b;
  font-size: 13px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
}

/* ─── Collapsible / draggable dashboard sections ────────────────────────────── */

#sectionsContainer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

#poolSectionsContainer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.dash-section {
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.dash-section-header {
  padding: 14px 16px;
  margin-bottom: 0;
  cursor: default;
  gap: 8px;
}

.dash-section-header h2 {
  flex: 1;
  font-size: 16px;
  cursor: pointer;
  user-select: none;
}

.dash-section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drag-handle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: grab;
  touch-action: none;
  border-radius: 6px;
  opacity: 0.5;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.drag-handle:hover { opacity: 1; background: var(--hover); }
.drag-handle:active { cursor: grabbing; }

.section-toggle {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
}
.section-toggle:hover { background: var(--hover); }

.section-toggle-icon {
  display: inline-block;
  transition: transform 0.22s ease;
}
.dash-section.collapsed .section-toggle-icon {
  transform: rotate(-90deg);
}

/* Grid-row collapse trick — smooth without needing a fixed max-height */
.section-body {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows 0.26s ease;
  overflow: hidden;
}
.dash-section.collapsed .section-body {
  grid-template-rows: 0fr;
}
.dash-section.collapsed .section-body-inner {
  padding: 0;
}
.section-body-inner {
  overflow: hidden;
  padding: 0 16px 14px;
}

/* Ghost: the card you're "holding" — follows the pointer */
.drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  border-radius: 14px;
  transform: scale(1.03) rotate(1deg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
  opacity: 0.92;
  transition: none !important;
}

/* Placeholder: the slot left behind showing where it'll land */
.dash-section.drag-placeholder {
  border: 2px dashed var(--border);
  background: transparent;
  box-shadow: none;
  border-radius: 14px;
}
.dash-section.drag-placeholder > * {
  opacity: 0;
  pointer-events: none;
}

/* ─── Dashboard ─────────────────────────────────────────────────────────────── */

.header-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 4px;
}

.pools-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pool-card-dash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  position: relative;
}
.pool-card-dash:hover { border-color: rgba(61,139,255,0.3); }
.pool-card-dash:active { background: var(--hover); }

.pool-card-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
  width: 34px;
  text-align: center;
}

.pool-card-info {
  flex: 1;
  min-width: 0;
}

.pool-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pool-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.pool-card-status-section {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
}

.pool-card-podium {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 4px;
  margin-left: -2px;
}
.podium-entry {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.podium-pts {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  background: rgba(255,255,255,0.07);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 2px;
}

.pool-concluded-badge,
.pool-active-badge,
.pool-locked-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.pool-concluded-badge        { color: var(--gold); }
.pool-active-badge           { color: #4ade80; }
.pool-locked-badge           { color: var(--muted); }
.pool-draft-badge            { color: #a78bfa; }
.pool-test-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fb923c;
  border: 1px solid #fb923c;
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}
.pool-trade-deadline-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fb923c;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pool-coming-soon-badge {
  margin-top: 4px;
}

.coming-soon-label {
  font-size: 10px;
  font-weight: 700;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pool-status-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pool-status-date {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}

.pool-countdown {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #a78bfa;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  margin-top: 4px;
}

.pool-countdown-active { color: #4ade80; }
.pool-countdown-draft  { color: #a78bfa; }
.pool-countdown-trade  { color: #fb923c; }

.pool-card-blocked {
  cursor: default;
  opacity: 0.8;
}

.settings-conclude-row {
  border-top: 1px solid var(--border);
  margin-top: 6px;
  padding-top: 14px;
}

.pool-card-actions-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  align-self: stretch;
  justify-content: space-between;
}

.pool-card-arrow {
  font-size: 18px;
  color: var(--muted);
  opacity: 0.5;
  margin-top: auto;
}

.pool-card-edit-btn {
  background: none;
  border: none;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s, background 0.15s;
  line-height: 1;
}
.pool-card-edit-btn:hover {
  opacity: 1;
  background: var(--hover);
}

.meta-pool-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.meta-pool-chip {
  font-size: 11px;
  color: var(--muted);
  background: var(--hover);
  border-radius: 5px;
  padding: 2px 7px;
}

/* GOAB score column */
.goab-score-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
}
.goab-score-main {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.goab-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.goab-score-proj {
  font-size: 11px;
  font-weight: 600;
  color: #a78bfa;
  white-space: nowrap;
}

/* GOAB breakdown modal */
.goab-breakdown-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.goab-breakdown-row:last-child { border-bottom: none; }
.goab-breakdown-pool {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.goab-breakdown-rank {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.goab-breakdown-pts {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.goab-pts-real { color: var(--green); }
.goab-pts-proj { color: #a78bfa; }
.goab-pts-neg { color: #f87171; }

.goab-breakdown-subheader {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.goab-log-list {
  max-height: 240px;
  overflow-y: auto;
}
.goab-log-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.goab-log-row:last-child { border-bottom: none; }
.goab-log-icon { font-size: 14px; line-height: 1.4; }
.goab-log-main { flex: 1; min-width: 0; }
.goab-log-reason {
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
}
.goab-log-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.goab-log-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

.goab-breakdown-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0 2px;
}
.goab-footer-real { font-size: 15px; font-weight: 700; color: var(--green); }
.goab-footer-sep  { color: var(--muted); }
.goab-footer-proj { font-size: 13px; font-weight: 600; color: #a78bfa; }

/* Poll label in settings */
.modal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ─── Feed ───────────────────────────────────────────────────────────────────── */

.feed-toggle {
  display: flex;
  background: rgba(255,255,255,0.07);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.feed-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.feed-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Feed compose tray */
.feed-compose-toggle {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  padding: 0;
  flex-shrink: 0;
}
.feed-compose-toggle.open { background: var(--accent-dark, #2563eb); box-shadow: inset 0 2px 4px rgba(0,0,0,0.3); }

.feed-filter-select {
  height: 28px;
  width: 80px;
  background: rgba(255,255,255,0.07);
  border: none;
  border-radius: 8px;
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  padding-right: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.feed-filter-select:focus { box-shadow: 0 0 0 2px var(--accent); }

.feed-compose-tray {
  display: none;
  border-bottom: 1px solid var(--border);
}
.feed-compose-tray.open { display: block; }
.feed-compose-tray-inner {
  display: flex;
  gap: 6px;
  align-items: stretch;
  padding: 6px 14px 10px;
}
.feed-compose-tray-inner .social-compose-btn {
  flex: 1;
  font-size: 12px;
  padding: 7px 6px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 34px;
  box-sizing: border-box;
}
.feed-toggle-small {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  height: 28px;
  box-sizing: border-box;
  padding: 2px;
}
.feed-toggle-small .feed-toggle-btn {
  font-size: 11px;
  padding: 0 10px;
  display: flex;
  align-items: center;
}

.goab-toggle {
  display: flex;
  background: rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 2px;
  gap: 1px;
}
.goab-toggle-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.goab-toggle-btn.active {
  background: var(--accent);
  color: #fff;
}
.goab-toggle-btn.active.proj {
  background: #7c3aed;
  color: #fff;
}

.pool-type-toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.pool-type-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pool-type-desc {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  padding-left: 2px;
  min-height: 16px;
}

.pool-type-row {
  display: flex;
  gap: 8px;
}

.pool-type-btn {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1.5px solid rgba(255,255,255,0.1);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  text-align: center;
}

.pool-type-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: calc(4 * 62px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scrollbar-gutter: stable;
  padding-right: 4px;
}

.feed-empty {
  font-size: 13px;
  color: var(--muted);
  padding: 12px 0;
  text-align: center;
}

.feed-item { cursor: default; }

.feed-pool-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 2px 7px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Compact notification item */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
}
.notif-delete-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px;
  opacity: 0.4;
  line-height: 1;
  margin-top: 2px;
  transition: opacity 0.15s;
}
.notif-delete-btn:hover { opacity: 1; color: var(--red); }
.notif-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.notif-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.notif-main {
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  line-height: 1.4;
}
.notif-team   { font-weight: 700; }
.notif-owner  { font-size: 11px; color: var(--muted); }
.notif-sep    { color: var(--muted); font-size: 12px; }
.notif-pts {
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  background: rgba(34,197,94,0.12);
  padding: 1px 6px;
  border-radius: 8px;
}
.notif-verb   { color: var(--muted); font-size: 12px; }
.notif-verb.assigned    { color: var(--green); }
.notif-verb.removed     { color: var(--red); }
.notif-verb.stage       { color: var(--gold); }
.notif-verb.coming-soon { color: #a78bfa; }
.notif-verb.concluded   { color: var(--gold); }
.notif-verb.trade-pending { color: #fb923c; }
.notif-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.notif-meta .activity-time { align-self: center; line-height: 1; position: relative; top: -2px; }

/* ─── Dashboard Settings Modal ─────────────────────────────────────────────── */

.dash-settings-section {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.dash-settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dash-settings-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.account-profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.account-avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.account-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface2);
  border: 2px solid var(--border);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: border-color 0.15s;
}
.account-avatar:hover {
  border-color: var(--accent);
}

.account-photo-label {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  white-space: nowrap;
}
.account-photo-label:hover {
  text-decoration: underline;
}

.account-info {
  flex: 1;
}

.account-username-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

/* ─── The Feed (Social) ────────────────────────────────────────────────────── */

.social-compose-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.social-compose-btn:hover { background: var(--hover); border-color: var(--accent); }

.social-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 450px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scrollbar-gutter: stable;
  padding-right: 12px;
}

.social-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.social-card-pinned {
  border-color: #a78bfa;
  background: rgba(167,139,250,0.05);
}
.social-pin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.social-pin-badge { font-size: 11px; font-weight: 700; color: #a78bfa; text-transform: uppercase; letter-spacing: 0.06em; }
.social-pin-dismiss { background: none; border: none; color: var(--muted); font-size: 12px; cursor: pointer; padding: 0; }
.social-pin-dismiss:hover { color: var(--text); }

.social-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  position: relative;
}
.social-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.social-avatar-placeholder {
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
}
.social-card-meta { flex: 1; min-width: 0; }
.social-username { font-size: 13px; font-weight: 700; display: block; }
.social-time { font-size: 11px; color: var(--muted); }
.social-card-delete {
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 2px 4px; opacity: 0.5;
  flex-shrink: 0;
}
.social-card-delete:hover { opacity: 1; color: var(--red); }

.social-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.social-tag {
  font-size: 11px; font-weight: 600; padding: 2px 7px;
  border-radius: 5px; text-decoration: none;
}
.social-tag-pool { background: rgba(79,140,255,0.15); color: var(--accent); }
.social-tag-user { background: rgba(167,139,250,0.15); color: #a78bfa; }

.social-post-body {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
  margin-bottom: 10px;
}

/* Poll */
.social-poll {}
.poll-options { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 6px; }
.poll-option {
  background: var(--hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  transition: border-color 0.15s;
}
.poll-option:hover:not([style*="cursor:default"]) { border-color: var(--accent); }
.poll-option-voted { border-color: var(--accent); background: rgba(79,140,255,0.08); }
.poll-option-label { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.poll-bar { height: 4px; background: var(--border); border-radius: 2px; margin: 4px 0 2px; }
.poll-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }
.poll-pct { font-size: 11px; color: var(--muted); }
.poll-voters { font-size: 11px; color: var(--muted); margin-top: 3px; font-style: italic; }
.post-lock-badge { font-size: 11px; color: var(--red); font-weight: 600; margin-left: 6px; }
.bet-confirmed-notice { font-size: 12px; color: var(--muted); margin-top: 8px; }
.notif-dot { display: none; width: 8px; height: 8px; background: #ef4444; border-radius: 50%; vertical-align: middle; margin-left: 4px; flex-shrink: 0; }
.social-admin-btn.muted { opacity: 0.5; }
.post-locked-badge { font-size: 12px; color: var(--muted); padding: 4px 0 2px; }
.poll-meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.poll-closed-label { color: var(--red); font-weight: 600; }

/* Bet */
.social-bet {}
.bet-wager { font-size: 12px; color: var(--gold); font-weight: 600; margin: 6px 0 8px; }
.bet-sides { display: flex; align-items: stretch; gap: 8px; margin: 8px 0; }
.bet-side {
  flex: 1; background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px;
}
.bet-side-winner { border-color: var(--gold); background: rgba(245,197,24,0.08); }
.bet-side-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 4px; }
.bet-participant { font-size: 12px; font-weight: 600; display: block; }
.bet-participant.pending { color: var(--muted); }
.bet-participant.accepted { color: var(--green); }
.bet-participant.rejected { color: var(--red); text-decoration: line-through; }
.bet-vs { display: flex; align-items: center; font-size: 11px; font-weight: 700; color: var(--muted); }
.bet-status { font-size: 11px; color: var(--muted); margin-top: 4px; }
.bet-actions { display: flex; gap: 8px; margin-top: 10px; }

/* Reactions */
.reactions-row { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; align-items: center; }
.reaction-pill {
  background: var(--hover); border: 1px solid var(--border);
  border-radius: 12px; padding: 2px 8px; font-size: 13px;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.reaction-pill.reacted { border-color: var(--accent); background: rgba(79,140,255,0.12); }
.reaction-pill:hover { border-color: var(--accent); }
.reaction-add {
  background: none; border: 1px dashed var(--border);
  border-radius: 12px; padding: 2px 7px; font-size: 14px;
  color: var(--muted); cursor: pointer; line-height: 1.4;
  transition: border-color 0.15s, color 0.15s;
  display: none;
}
.reaction-add:hover { border-color: var(--accent); color: var(--text); }
/* Show add button only when card/reply is tapped */
.social-card.reactions-open .reaction-add,
.reply-item.reactions-open .reaction-add { display: inline-block; }
/* Card open must not bleed into un-opened replies */
.social-card.reactions-open .reply-item:not(.reactions-open) .reaction-add { display: none; }

/* Replies */
.replies-section { margin-top: 8px; border-top: 1px solid var(--border); padding-top: 8px; }
.reply-item { margin-bottom: 10px; }
.reply-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.reply-avatar {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.reply-avatar-placeholder {
  background: var(--accent); display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; color: #fff;
}
.reply-meta { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.reply-username { font-size: 12px; font-weight: 700; }
.reply-body { font-size: 13px; line-height: 1.4; padding-left: 30px; word-break: break-word; white-space: pre-wrap; }
.reply-composer { display: flex; gap: 6px; margin-top: 8px; }
.reply-input {
  flex: 1; background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px;
  padding: 6px 10px; outline: none;
}
.reply-input:focus { border-color: var(--accent); }
.reply-send {
  background: var(--accent); border: none; border-radius: var(--radius-sm);
  color: #fff; font-size: 14px; padding: 6px 12px; cursor: pointer;
  transition: background 0.15s;
}
.reply-send:hover { background: #5b9fff; }

/* Admin actions on social cards */
.social-admin-actions {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
  padding-top: 8px; border-top: 1px solid var(--border);
}
.social-admin-btn {
  background: var(--hover); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 4px 8px; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.social-admin-btn:hover { border-color: var(--accent); color: var(--text); }
.social-admin-btn.danger:hover { border-color: var(--red); color: var(--red); }

/* Composer */
.compose-char-count { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.compose-tag-row { display: flex; gap: 6px; margin-top: 6px; align-items: stretch; }
.compose-tag-row .modal-input { margin: 0; height: 44px; box-sizing: border-box; }
.compose-tag-row .btn { height: 44px; box-sizing: border-box; padding: 0 14px; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.compose-tag-list { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.compose-tag-chip {
  background: rgba(167,139,250,0.15); color: #a78bfa;
  border-radius: 5px; font-size: 11px; font-weight: 600;
  padding: 2px 8px; display: flex; align-items: center; gap: 4px;
}
.compose-tag-chip button {
  background: none; border: none; color: #a78bfa; cursor: pointer;
  font-size: 10px; padding: 0; line-height: 1;
}
.bet-challenger-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; font-size: 13px;
}
.bet-challenger-row:last-child { border-bottom: none; }
.bet-challenger-row input { cursor: pointer; }

/* ── Emoji Picker Popup ─────────────────────────────────────────────────────── */
.emoji-picker-popup {
  position: fixed;
  z-index: 9999;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: 220px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
.emoji-option {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  line-height: 1;
  transition: background 0.1s;
}
.emoji-option:hover { background: var(--border); }

/* ── Bet Counter Offer ──────────────────────────────────────────────────────── */
.bet-counter-sent {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 8px;
}
.bet-counter-review {
  margin-top: 10px;
  padding: 10px;
  background: rgba(167,139,250,0.08);
  border: 1px solid rgba(167,139,250,0.25);
  border-radius: 10px;
}
.bet-counter-label {
  font-size: 13px;
  margin-bottom: 6px;
  color: var(--text);
}
