/* Manifold Tournaments — styling per product brief (manifold.markets-inspired) */

:root {
  /* Color palette from product brief */
  --bg-primary: #FCFDFF;
  --text-primary: #111111;
  --divider-light: #E1E6F7;
  --text-secondary: #6D6E80;
  --brand-indigo: #5E63EF;
  --brand-gradient: linear-gradient(90deg, #5E63EF 0%, #875AEF 50%, #C94AEF 100%);
  --positive: #249B90;
  --negative: #F04127;
  --selected-highlight: #F4F4FA;
  --card-shadow: 0 1px 3px rgba(17, 17, 17, 0.07);

  /* Typography */
  --font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* ---------- Layout: sidebar + main column ---------- */

.tournaments-app {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-primary);
  border-right: 1px solid var(--divider-light);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.2;
}

.tourney-logo {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.15s ease, color 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--selected-highlight);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--selected-highlight);
  color: var(--text-primary);
  font-weight: 600;
}

.nav-item-cta {
  color: var(--brand-indigo);
  font-weight: 500;
}

.sidebar-footer {
  margin-top: auto;
  font-size: 12px;
  color: var(--text-secondary);
}

.sidebar-footer a {
  color: var(--brand-indigo);
  text-decoration: none;
}

.sidebar-footer a:hover {
  text-decoration: underline;
}

.main-content {
  padding: 32px 40px 64px;
  max-width: 1100px;
  min-width: 0;
}

/* ---------- Page headers ---------- */

.page-header {
  margin-bottom: 28px;
}

.page-title {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

.page-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin: 0;
}

.description-text {
  white-space: pre-wrap;
  max-width: 720px;
}

/* ---------- Top nav pills + search ---------- */

.top-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--divider-light);
  padding-bottom: 12px;
}

.nav-pill {
  padding: 8px 16px;
  border-radius: 12px;
  background: none;
  border: none;
  font-family: inherit;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease;
  position: relative;
}

.nav-pill:hover {
  color: var(--text-primary);
}

.nav-pill.active {
  color: var(--text-primary);
  font-weight: 500;
}

.nav-pill.active::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 2px;
  background: var(--brand-gradient);
}

.search-container {
  margin-bottom: 20px;
}

.search-bar {
  width: 100%;
  max-width: 420px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--divider-light);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  transition: border-color 0.15s ease;
}

.search-bar:focus {
  outline: none;
  border-color: var(--brand-indigo);
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.list-count {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ---------- Buttons ---------- */

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-size: 15px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  touch-action: manipulation;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--brand-gradient);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.9;
}

.btn-secondary {
  background: white;
  color: var(--text-primary);
  border: 1px solid var(--divider-light);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--selected-highlight);
}

.btn-danger {
  background: white;
  color: var(--negative);
  border: 1px solid var(--negative);
}

.btn-danger:hover:not(:disabled) {
  background: #FEF0EE;
}

/* ---------- Tournament table ---------- */

.tournaments-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}

.tournaments-table th {
  background: var(--selected-highlight);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--divider-light);
}

.tournaments-table td {
  padding: 16px;
  border-bottom: 1px solid var(--divider-light);
  vertical-align: top;
}

.tournaments-table tbody tr {
  cursor: pointer;
  transition: background 0.1s ease;
}

.tournaments-table tbody tr:hover {
  background: var(--selected-highlight);
}

.tournaments-table tr:last-child td {
  border-bottom: none;
}

.col-prizes,
.col-status {
  white-space: nowrap;
  width: 1%;
}

.row-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.row-description {
  color: var(--text-secondary);
  font-size: 14px;
}

.row-tags {
  margin-top: 8px;
}

.prize-pool {
  font-weight: 600;
  color: var(--positive);
}

.muted {
  color: var(--text-secondary);
}

.error-text {
  color: var(--negative);
}

/* ---------- Status pills ---------- */

.status-pill {
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  display: inline-block;
  white-space: nowrap;
}

.status-coming-up {
  background: #EEEFFE;
  color: #4348C6;
}

.status-active {
  background: #DDF3F0;
  color: #17695F;
}

.status-finished {
  background: #ECEDF1;
  color: #4B4D5C;
}

.invitational-pill {
  background: #F6ECFE;
  color: #8A3BC4;
}

/* ---------- Tags / chips ---------- */

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--divider-light);
  background: white;
  color: var(--text-secondary);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.tag-chip-link:hover {
  border-color: var(--brand-indigo);
  color: var(--brand-indigo);
}

.tag-chip-manual {
  background: var(--selected-highlight);
  border-style: dashed;
}

/* Legacy chip class kept for shared selectors */
.filter-chip {
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
}

.filter-chip.small {
  font-size: 12px;
}

.filter-chip.active {
  border-color: var(--brand-indigo);
  color: var(--text-primary);
}

/* ---------- Cards ---------- */

.card {
  background: white;
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--divider-light);
  margin-bottom: 24px;
}

.card-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--divider-light);
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 6px 0 0 0;
}

/* ---------- Tournament page ---------- */

.tournament-actions,
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.tournament-title-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tournament-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 24px;
  align-items: start;
}

.center-message {
  color: var(--text-secondary);
  text-align: center;
  padding: 32px 16px;
}

/* Markets */

.markets-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.market-item {
  padding: 14px 16px;
  background: var(--selected-highlight);
  border-radius: 8px;
}

.market-item-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.market-error {
  font-weight: 500;
  color: var(--text-secondary);
}

.market-link {
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  min-width: 200px;
}

.market-link:hover {
  text-decoration: underline;
}

.market-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.market-stat {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.prob-pill {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  background: #EEEFFE;
  color: var(--brand-indigo);
}

.outcome-pill {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: white;
}

.outcome-yes { background: var(--positive); }
.outcome-no { background: var(--negative); }
.outcome-other { background: var(--text-secondary); }

.market-item-tags {
  margin-top: 8px;
}

.market-item-tags:empty {
  display: none;
}

/* Info sidebar */

.info-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-label {
  font-weight: 500;
  margin-bottom: 6px;
}

.hosts-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.host-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.host-link {
  color: var(--text-primary);
  text-decoration: none;
}

.host-link:hover {
  text-decoration: underline;
  color: var(--brand-indigo);
}

/* Avatars */

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.avatar-sm {
  width: 22px;
  height: 22px;
}

.avatar-lg {
  width: 56px;
  height: 56px;
}

/* Prizes & winners */

.prizes-list,
.winners-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prize-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.prize-amount {
  font-weight: 600;
}

.winner-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--selected-highlight);
}

.winner-rank-1 {
  background: linear-gradient(90deg, #FDF6E3, #FCFDFF);
  border: 1px solid #F0E3B4;
}

.winner-medal {
  font-size: 18px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.winner-name {
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.winner-name:hover {
  text-decoration: underline;
}

.winner-prize {
  font-weight: 600;
  color: var(--positive);
  white-space: nowrap;
}

/* ---------- Leaderboard ---------- */

.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--selected-highlight);
  border-radius: 8px;
}

.leaderboard-row.expandable {
  cursor: pointer;
}

.leaderboard-row.expanded {
  border-radius: 8px 8px 0 0;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.leaderboard-rank {
  min-width: 30px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  flex-shrink: 0;
}

.leaderboard-rank.top-rank {
  font-size: 17px;
}

.leaderboard-name {
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-name:hover {
  text-decoration: underline;
}

.leaderboard-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.leaderboard-profit {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.profit-positive { color: var(--positive); }
.profit-negative { color: var(--negative); }
.profit-neutral { color: var(--text-secondary); }

.expand-caret {
  font-size: 12px;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.expand-caret.open {
  transform: rotate(180deg);
}

.leaderboard-breakdown {
  background: white;
  border: 1px solid var(--divider-light);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 8px 14px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  font-size: 14px;
}

.breakdown-row + .breakdown-row {
  border-top: 1px solid var(--divider-light);
}

.breakdown-market {
  flex: 1;
  min-width: 0;
}

.breakdown-profit {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- Forms (admin page) ---------- */

.form-group {
  margin-bottom: 24px;
}

.required-asterisk {
  color: var(--negative);
  margin-left: 4px;
}

.form-group-columns {
  display: flex;
  gap: 24px;
}

.form-column {
  flex: 1;
  min-width: 0;
}

.prizes-columns {
  max-width: 560px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-sub-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 400;
  font-size: 14px;
  color: var(--text-secondary);
}

.form-label-subtext {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  margin: 4px 0 0 0;
  line-height: 1.4;
}

.form-error-message {
  background: #FEE9E5;
  color: #B3301C;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 24px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--divider-light);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: white;
  transition: border-color 0.15s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand-indigo);
}

.form-input:disabled {
  background: var(--selected-highlight);
  color: var(--text-secondary);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.tournament-status-select {
  max-width: 240px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
}

.form-actions-left {
  margin-right: auto;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
}

.checkbox-row input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-indigo);
  cursor: pointer;
}

/* Admin unlock card */

.unlock-card {
  border: 2px solid var(--divider-light);
}

.unlock-card.unlocked {
  border-color: #BEE3CE;
  background: #F0FAF4;
}

.unlock-title {
  font-weight: 600;
}

.unlock-card.unlocked .unlock-title {
  color: #17695F;
}

.unlock-controls {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  max-width: 480px;
}

/* ---------- Join form ---------- */

.join-code-field {
  margin-top: 12px;
  max-width: 480px;
}

.join-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.join-success {
  font-weight: 500;
  color: var(--positive);
}

/* ---------- Hall of Fame ---------- */

.hof-list {
  max-width: 720px;
}

.hof-stats {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hof-stat {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- User page ---------- */

.user-search-row {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.user-profile-card {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-profile-name {
  font-size: 20px;
  font-weight: 600;
}

.user-profile-handle {
  font-size: 14px;
  color: var(--text-secondary);
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.achievement-tile {
  padding: 20px;
  background: white;
  border: 1px solid var(--divider-light);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  text-align: center;
}

.achievement-icon {
  font-size: 28px;
  margin-bottom: 6px;
}

.achievement-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.achievement-value {
  font-size: 22px;
  font-weight: 600;
}

.user-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.user-tournament-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-tournament-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--selected-highlight);
  text-decoration: none;
  color: var(--text-primary);
  transition: background 0.1s ease;
}

.user-tournament-row:hover {
  background: #ECEDFA;
}

.user-row-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.podium-detail {
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- About page ---------- */

.about-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 760px;
}

.about-section-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  color: var(--text-primary);
}

.about-subsection-title {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 16px;
}

.about-list {
  margin: 0 0 12px 0;
  padding-left: 20px;
}

.about-container a {
  color: var(--brand-indigo);
}

/* ---------- Loading ---------- */

.loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 48px;
  color: var(--text-secondary);
}

/* ---------- Tooltip ---------- */

.tooltip-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.tooltip-icon {
  cursor: help;
  margin-left: 4px;
  color: var(--text-secondary);
}

.tooltip-text {
  position: absolute;
  bottom: 125%;
  left: 50%;
  transform: translateX(-5%);
  background-color: #1f2937;
  color: #f9fafb;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .tournament-grid {
    /* minmax(0,...) so non-wrapping leaderboard names can't inflate the column */
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 768px) {
  .tournaments-app {
    /* minmax(0,...) so the non-wrapping nav strip can't inflate the column;
       auto/1fr rows so min-height:100vh stretches the content, not the header */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
  }

  /* Sidebar becomes a compact header with a horizontally scrolling nav strip */
  .sidebar {
    position: static;
    height: auto;
    min-width: 0;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px 0;
    border-right: none;
    border-bottom: 1px solid var(--divider-light);
  }

  .sidebar-logo {
    font-size: 16px;
    gap: 8px;
  }

  .tourney-logo {
    width: 32px;
    height: 32px;
  }

  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    /* bleed to the screen edges so the strip scrolls edge-to-edge */
    margin: 0 -16px;
    padding: 2px 12px 10px;
  }

  .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-item {
    padding: 9px 11px;
    font-size: 14px;
    flex-shrink: 0;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 20px 16px 48px;
  }

  .page-header {
    margin-bottom: 20px;
  }

  .page-title {
    font-size: 24px;
  }

  .page-subtitle {
    font-size: 15px;
  }

  /* Keep form controls at 16px so iOS doesn't auto-zoom on focus */
  .form-input,
  .form-textarea,
  .form-select,
  .search-bar {
    font-size: 16px;
  }

  .search-bar {
    max-width: none;
  }

  /* Landing filter pills scroll instead of wrapping */
  .top-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .top-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-pill {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Tournament list becomes tappable cards (prizes stay visible) */
  .tournaments-table {
    display: block;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .tournaments-table thead {
    display: none;
  }

  .tournaments-table tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .tournaments-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    background: white;
    border: 1px solid var(--divider-light);
    border-radius: 10px;
    padding: 14px;
    box-shadow: var(--card-shadow);
  }

  .tournaments-table td {
    display: block;
    padding: 0;
    border-bottom: none;
  }

  .tournaments-table td:first-child {
    flex: 1 1 100%;
    margin-bottom: 6px;
  }

  .tournaments-table .col-prizes,
  .tournaments-table .col-status {
    width: auto;
  }

  /* An empty "—" prize placeholder is just noise on a card */
  .tournaments-table .col-prizes .muted {
    display: none;
  }

  .tournaments-table .col-status {
    margin-left: auto;
  }

  /* Cards & grids */
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }

  .tournament-grid {
    gap: 16px;
  }

  .tournament-actions,
  .admin-header-actions {
    margin-bottom: 16px;
  }

  .market-item-main {
    flex-direction: column;
    gap: 8px;
  }

  .market-meta {
    flex-wrap: wrap;
  }

  /* Leaderboard / Hall of Fame */
  .leaderboard-row {
    padding: 10px 12px;
  }

  .leaderboard-name {
    min-width: 0;
  }

  .user-tournament-row .row-title {
    min-width: 0;
  }

  .user-profile-card {
    min-width: 0;
  }

  .user-profile-name {
    overflow-wrap: anywhere;
  }

  .hof-stats {
    gap: 8px;
  }

  .hof-stat {
    font-size: 13px;
  }

  .breakdown-row {
    font-size: 13px;
  }

  /* User page: compact 3-across stat tiles */
  .user-search-row {
    flex-direction: column;
  }

  .achievements-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
  }

  .achievement-tile {
    padding: 12px 8px;
  }

  .achievement-icon {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .achievement-label {
    font-size: 11px;
  }

  .achievement-value {
    font-size: 17px;
  }

  .user-page-grid {
    gap: 16px;
  }

  /* Admin form */
  .form-group-columns {
    flex-direction: column;
    gap: 16px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-actions {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .form-actions-left {
    margin-right: 0;
  }

  .tournament-status-select {
    max-width: none;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 16px 12px 40px;
  }

  .page-title {
    font-size: 22px;
  }

  .card {
    padding: 14px;
  }

  .tournaments-table tbody tr {
    padding: 12px;
  }

  .leaderboard-row {
    padding: 9px 10px;
  }

  .winner-row {
    padding: 9px 10px;
  }
}
