/* Base Styles */
:root {
  --primary-color: #c9a227;
  --primary-dark: #a68520;
  --secondary-color: #2c3e50;
  --bg-dark: #1a1a2e;
  --bg-darker: #0f0f1a;
  --bg-card: #16213e;
  --text-light: #e8e8e8;
  --text-muted: #a0a0a0;
  --success: #27ae60;
  --warning: #f39c12;
  --danger: #e74c3c;
  --info: #3498db;

  /* Rarity colors */
  --common: #9d9d9d;
  --uncommon: #1eff00;
  --rare: #0070dd;
  --heroic: #a335ee;
  --epic: #ff8000;
  --legendary: #ff8000;
}

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

body {
  font-family: 'Open Sans', sans-serif;
  background: var(--bg-dark);
  color: var(--text-light);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at top, rgba(201, 162, 39, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(44, 62, 80, 0.2) 0%, transparent 50%);
}

h1, h2, h3 {
  font-family: 'Cinzel', serif;
}

/* Header */
header {
  background: var(--bg-darker);
  border-bottom: 2px solid var(--primary-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  gap: 2rem;
}

.logo {
  flex-shrink: 0;
}

.logo h1 {
  color: var(--primary-color);
  font-size: 1.8rem;
  letter-spacing: 2px;
}

.logo .tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
  flex: 1;
  justify-content: center;
}

.nav-links a {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.1);
}

/* User Info in Header */
.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.user-menu {
  position: relative;
  cursor: pointer;
}

.user-details {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  transition: background 0.2s ease;
}

.user-details:hover {
  background: rgba(255, 255, 255, 0.1);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
}

.user-name {
  color: var(--text-light);
  font-weight: 600;
  font-size: 0.9rem;
}

.dropdown-arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.user-menu:hover .dropdown-arrow,
.user-dropdown.active ~ .user-details .dropdown-arrow {
  transform: rotate(180deg);
}

/* User Dropdown Menu */
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  margin-top: 0.5rem;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.9rem;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-icon {
  font-size: 1rem;
  width: 20px;
  text-align: center;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0.25rem 0;
}

.logout-item {
  color: var(--danger);
}

.logout-item:hover {
  background: rgba(231, 76, 60, 0.1);
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-logout:hover {
  background: var(--danger);
  color: white;
}

/* Main Content */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 2rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
  padding-bottom: 0.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-card.bank-card {
  border-color: var(--primary-color);
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-info h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-family: 'Open Sans', sans-serif;
  font-weight: 400;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Dashboard Widgets Container */
.dashboard-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

@media (max-width: 900px) {
  .dashboard-widgets {
    grid-template-columns: 1fr;
  }
}

/* Recent Activity */
.recent-activity {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.recent-activity.compact {
  max-height: 450px;
}

.recent-activity.compact .activity-list {
  max-height: 350px;
}

.recent-activity h3 {
  margin-bottom: 1rem;
  color: var(--text-light);
}

.activity-list {
  max-height: 400px;
  overflow-y: auto;
}

/* Distribution Widget */
.distribution-widget {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.distribution-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.dist-tab {
  padding: 0.5rem 1rem;
  background: var(--bg-light);
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dist-tab:hover {
  background: var(--bg-dark);
  color: var(--text-light);
}

.dist-tab.active {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.view-all-link {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--primary-color);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
}

.view-all-link:hover {
  text-decoration: underline;
}

.distribution-content {
  max-height: 350px;
  overflow-y: auto;
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dist-item .color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dist-item .dist-info {
  flex: 1;
}

.dist-item .dist-name {
  color: var(--text-light);
  font-size: 0.9rem;
  font-weight: 500;
}

.dist-item .dist-bar-container {
  width: 100%;
  height: 6px;
  background: var(--bg-dark);
  border-radius: 3px;
  margin-top: 0.25rem;
  overflow: hidden;
}

.dist-item .dist-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.dist-item .dist-percentage {
  color: var(--text-muted);
  font-size: 0.85rem;
  min-width: 40px;
  text-align: right;
}

/* Distribution Modal */
.distribution-modal-content {
  padding: 1rem 0;
}

.distribution-tabs.modal-tabs {
  margin-bottom: 1.5rem;
  justify-content: center;
}

.modal-dist-content {
  max-height: 500px;
  overflow-y: auto;
}

.dist-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dist-detail-category {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1rem;
}

.dist-detail-category h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem 0;
  color: var(--text-light);
  font-size: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.dist-detail-category h4 .cat-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.dist-detail-category h4 .cat-count {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.9rem;
  margin-left: auto;
}

.dist-members-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}

.dist-member-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
}

.dist-member-item img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.dist-member-item .member-name {
  color: var(--text-light);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-item {
  padding: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item.deposit {
  border-left: 3px solid var(--success);
}

.activity-item.withdraw {
  border-left: 3px solid var(--danger);
}

.activity-item.income {
  border-left: 3px solid #ffd700;
}

.activity-item.expense {
  border-left: 3px solid #ff6b6b;
}

.activity-type {
  font-weight: 600;
  margin-right: 0.5rem;
}

.activity-type.deposit {
  color: var(--success);
}

.activity-type.withdraw {
  color: var(--danger);
}

.activity-type.income {
  color: #ffd700;
}

.activity-type.expense {
  color: #ff6b6b;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

/* Stockpile Grid */
.stockpile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.item-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.item-card:hover {
  transform: scale(1.02);
}

.item-name {
  font-weight: 600;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
}

.item-rarity {
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 0.5rem;
}

.item-rarity.common { background: var(--common); color: #000; }
.item-rarity.uncommon { background: var(--uncommon); color: #000; }
.item-rarity.rare { background: var(--rare); color: #fff; }
.item-rarity.heroic { background: var(--heroic); color: #fff; }
.item-rarity.epic { background: var(--epic); color: #fff; }
.item-rarity.legendary { background: linear-gradient(45deg, #ff8000, #ffd700); color: #000; }

.item-quantity {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Bank Display */
.bank-display {
  display: flex;
  justify-content: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 3rem;
  background: var(--bg-card);
  border-radius: 12px;
  border: 2px solid var(--primary-color);
}

.currency {
  text-align: center;
  padding: 2rem;
}

.currency-icon {
  font-size: 4rem;
  display: block;
  margin-bottom: 1rem;
}

.currency-value {
  font-size: 3rem;
  font-weight: 700;
  display: block;
}

.currency.gold .currency-value { color: #ffd700; }
.currency.silver .currency-value { color: #c0c0c0; }
.currency.copper .currency-value { color: #b87333; }

.currency-label {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Requests List */
.requests-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.request-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: start;
  transition: all 0.3s ease;
}

.request-card:hover {
  border-color: rgba(201, 162, 39, 0.3);
}

.request-id {
  background: var(--primary-color);
  color: var(--bg-dark);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-weight: 700;
}

.request-info h4 {
  margin-bottom: 0.5rem;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.request-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.request-info .request-desc {
  color: var(--text-light);
  font-style: italic;
}

.request-info .request-time {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.rarity-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.rarity-badge.common { background: #9d9d9d; color: #000; }
.rarity-badge.uncommon { background: #1eff00; color: #000; }
.rarity-badge.rare { background: #0070dd; color: #fff; }
.rarity-badge.heroic { background: #a335ee; color: #fff; }
.rarity-badge.epic { background: #ff8000; color: #fff; }
.rarity-badge.legendary { background: #e6cc80; color: #000; }

.request-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

.request-status {
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.request-status.open { background: var(--success); color: #fff; }
.request-status.claimed { background: var(--warning); color: #000; }
.request-status.completed { background: var(--info); color: #fff; }

.request-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.request-actions button {
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
}

.btn-claim {
  background: var(--success);
  color: #fff;
}

.btn-claim:hover {
  background: #218838;
}

.btn-complete {
  background: var(--info);
  color: #fff;
}

.btn-complete:hover {
  background: #138496;
}

.btn-unclaim {
  background: var(--warning);
  color: #000;
}

.btn-unclaim:hover {
  background: #e0a800;
}

.btn-delete-small {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger) !important;
}

.btn-delete-small:hover {
  background: var(--danger);
  color: #fff;
}

/* Rosters Grid */
.rosters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.roster-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.roster-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.roster-name {
  color: var(--primary-color);
}

.roster-type {
  background: var(--secondary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.8rem;
  text-transform: uppercase;
}

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

.member-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.member-tag {
  background: rgba(201, 162, 39, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

/* Members Section */
.members-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.members-search input {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 1rem;
  width: 300px;
  max-width: 100%;
  transition: border-color 0.3s ease;
}

.members-search input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.members-search input::placeholder {
  color: var(--text-muted);
}

.members-stats {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1rem;
}

.member-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.member-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.member-avatar {
  position: relative;
  flex-shrink: 0;
}

.member-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.owner-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 1.2rem;
  background: var(--bg-card);
  border-radius: 50%;
  padding: 2px;
}

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

.member-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-username {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.member-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.role-tag {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  border: 1px solid;
  white-space: nowrap;
}

.role-tag.more-roles {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
}

.member-joined {
  text-align: right;
  flex-shrink: 0;
}

.joined-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.joined-date {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* Spreadsheet Section */
.spreadsheet-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.spreadsheet-tab {
  padding: 0.75rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.spreadsheet-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.spreadsheet-tab.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
}

.spreadsheet-content {
  display: block;
}

.spreadsheet-content.hidden {
  display: none;
}

.spreadsheet-container {
  width: 100%;
  height: 70vh;
  min-height: 500px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-card);
}

.spreadsheet-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.spreadsheet-actions {
  margin-top: 1rem;
  text-align: center;
}

.btn-open-new {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-open-new:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Section Header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-header h2 {
  margin-bottom: 0;
}

.btn-create {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-create:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Stockpile Actions */
.stockpile-actions,
.bank-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-deposit {
  padding: 0.6rem 1.2rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-deposit:hover {
  background: #219a52;
  transform: translateY(-2px);
}

.btn-withdraw {
  padding: 0.6rem 1.2rem;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.2s ease;
}

.btn-withdraw:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 12px;
  width: 100%;
  max-width: 550px;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-content-wide {
  max-width: 650px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-light);
}

/* Form Styles */
.form-group {
  padding: 0 1.5rem;
  margin-bottom: 1rem;
}

.form-group:first-of-type {
  margin-top: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-light);
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  padding: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1rem;
}

.btn-cancel {
  padding: 0.75rem 1.5rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.btn-submit {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-submit:hover {
  background: var(--primary-hover);
}

/* Roster Card Actions */
.roster-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.roster-actions button {
  flex: 1;
  padding: 0.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.btn-edit {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
}

.btn-edit:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-delete {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.btn-delete:hover {
  background: rgba(239, 68, 68, 0.3);
}

/* Roster Member Management in Modal */
.roster-members-list {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-darker);
  border-radius: 8px;
  margin-bottom: 1rem;
}

.roster-member-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.roster-member-item:last-child {
  border-bottom: none;
}

.roster-member-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.roster-member-name {
  font-weight: 500;
  color: var(--text-light);
}

.roster-member-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.btn-remove-member {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-remove-member:hover {
  opacity: 1;
}

.add-member-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.add-member-row select {
  flex: 2;
  padding: 0.6rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.add-member-row input {
  flex: 1;
  padding: 0.6rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.add-member-row select:focus,
.add-member-row input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn-add-member {
  padding: 0.6rem 1rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.9rem;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.btn-add-member:hover {
  background: #219a52;
}

.empty-members {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==================== TOURNAMENT STYLES ==================== */

/* Tournament List */
.tournaments-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.tournament-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.tournament-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.tournament-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.tournament-card-header h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.tournament-type-badge {
  background: var(--secondary-color);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.tournament-card-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.tournament-winner {
  color: var(--primary-color) !important;
}

.tournament-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tournament-status-badge {
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.tournament-status-badge.active,
.tournament-status.active {
  background: var(--success);
  color: #fff;
}

.tournament-status-badge.completed,
.tournament-status.completed {
  background: var(--info);
  color: #fff;
}

.tournament-status-badge.registration {
  background: #3498db;
  color: #fff;
}

.tournament-status-badge.draft {
  background: #95a5a6;
  color: #fff;
}

.registration-progress {
  color: #3498db;
}

/* Tournament Bracket Container */
.tournament-bracket-container {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tournament-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tournament-header h3 {
  flex: 1;
  color: var(--primary-color);
  font-size: 1.5rem;
}

.btn-back {
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-back:hover {
  border-color: var(--text-light);
  color: var(--text-light);
}

/* Tournament Registration Panel */
.tournament-registration-panel {
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.registration-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.registration-status {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.registration-count {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
}

.registration-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.registration-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-apply {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-apply:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-withdraw {
  padding: 0.5rem 1rem;
  background: transparent;
  color: #e74c3c;
  border: 1px solid #e74c3c;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-withdraw:hover {
  background: rgba(231, 76, 60, 0.1);
}

.application-status {
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
}

.application-status.pending {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.application-status.accepted {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.application-status.rejected {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

/* Applicants Section (Admin) */
.applicants-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.applicants-section h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.applicants-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.applicant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.applicant-item.accepted {
  border-color: rgba(46, 204, 113, 0.3);
  background: rgba(46, 204, 113, 0.1);
}

.applicant-item.rejected {
  border-color: rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.1);
  opacity: 0.6;
}

.applicant-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.applicant-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.applicant-name {
  font-weight: 500;
  color: var(--text-light);
}

.applicant-status-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.applicant-status-badge.pending {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.applicant-status-badge.accepted {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.applicant-status-badge.rejected {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.applicant-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-accept-applicant,
.btn-reject-applicant {
  padding: 0.4rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-accept-applicant {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
}

.btn-accept-applicant:hover:not(:disabled) {
  background: rgba(46, 204, 113, 0.4);
}

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

.btn-reject-applicant {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.btn-reject-applicant:hover {
  background: rgba(231, 76, 60, 0.4);
}

.registration-admin-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-accept-all,
.btn-shuffle-start {
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
}

.btn-accept-all {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.4);
}

.btn-accept-all:hover {
  background: rgba(46, 204, 113, 0.3);
}

.btn-shuffle-start {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.btn-shuffle-start:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-shuffle-start:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Tournament status badge styles */
.tournament-status.registration {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

/* Bracket Display - Traditional Tournament Style */
.bracket-wrapper {
  overflow-x: auto;
  padding: 2rem 1rem;
}

.bracket {
  display: flex;
  gap: 4rem;
  min-width: fit-content;
  align-items: center;
  position: relative;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
}

.round-title {
  text-align: center;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1.5rem;
  padding: 0.5rem 1rem;
  background: rgba(201, 162, 39, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(201, 162, 39, 0.3);
}

.round-matches {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  justify-content: space-around;
  flex: 1;
}

/* Scale gaps based on round for pyramid effect */
.bracket-round:nth-child(2) .round-matches { gap: 4rem; }
.bracket-round:nth-child(3) .round-matches { gap: 9rem; }
.bracket-round:nth-child(4) .round-matches { gap: 18rem; }
.bracket-round:nth-child(5) .round-matches { gap: 36rem; }

.bracket-match {
  background: var(--bg-darker);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0;
  min-width: 200px;
  transition: all 0.3s ease;
  position: relative;
}

/* Connector lines */
.bracket-match::after {
  content: '';
  position: absolute;
  right: -2rem;
  top: 50%;
  width: 2rem;
  height: 2px;
  background: rgba(201, 162, 39, 0.4);
}

.bracket-round:last-child .bracket-match::after {
  display: none;
}

.bracket-match.clickable {
  cursor: pointer;
  border-color: var(--success);
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.bracket-match.clickable:hover {
  border-color: var(--primary-color);
  transform: scale(1.02);
  box-shadow: 0 0 15px rgba(201, 162, 39, 0.3);
}

.bracket-match.completed {
  border-color: rgba(255, 255, 255, 0.1);
}

.match-slot {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-slot:last-of-type {
  border-bottom: none;
}

.match-slot:first-of-type {
  border-radius: 6px 6px 0 0;
}

.match-slot:last-of-type:not(:first-of-type) {
  border-radius: 0 0 6px 6px;
}

.match-slot.winner {
  background: rgba(46, 204, 113, 0.15);
  border-left: 3px solid var(--success);
}

.match-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.match-player-name {
  font-size: 0.85rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.match-tbd {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.match-vs-line {
  display: none;
}

/* Team Match Styles */
.bracket-match.team-match {
  min-width: 220px;
  border-color: rgba(155, 89, 182, 0.4);
}

.bracket-match.team-match .match-slot {
  padding: 0.6rem 0.75rem;
}

.bracket-match.team-match .match-tbd {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #9b59b6;
  padding: 0.5rem 0;
}

.bracket-match.team-match .match-tbd::before {
  content: '👥';
}

/* Team Compact View in Bracket */
.team-compact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.team-name {
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.85rem;
  white-space: nowrap;
}

.team-avatars {
  display: flex;
  align-items: center;
}

.team-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-darker);
  margin-left: -8px;
}

.team-mini-avatar:first-child {
  margin-left: 0;
}

.team-more {
  background: rgba(155, 89, 182, 0.3);
  color: #9b59b6;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.25rem;
}

/* Team Player List (for modal) */
.team-player {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15rem 0.35rem;
  border-radius: 3px;
  font-size: 0.65rem;
}

.team-player-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

.team-player span {
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* VS Text */
.vs-text {
  background: var(--bg-darker);
  padding: 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
}

/* Tournament Header Right */
.tournament-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tournament-type-badge {
  padding: 0.35rem 0.75rem;
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-edit-tournament,
.btn-delete-tournament {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.btn-edit-tournament {
  background: rgba(52, 152, 219, 0.2);
}

.btn-edit-tournament:hover {
  background: rgba(52, 152, 219, 0.4);
  transform: scale(1.05);
}

.btn-delete-tournament {
  background: rgba(231, 76, 60, 0.2);
}

.btn-delete-tournament:hover {
  background: rgba(231, 76, 60, 0.4);
  transform: scale(1.05);
}

/* Winner Display */
.bracket-winner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.winner-trophy {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: trophy-bounce 1s ease-in-out infinite;
}

@keyframes trophy-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.winner-title {
  color: var(--primary-color);
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.winner-name {
  color: var(--text-light);
  font-size: 1.5rem;
  font-weight: 700;
}

/* Participants Selector */
.participants-selector {
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.5rem;
}

.participant-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.participant-checkbox:hover {
  background: rgba(255, 255, 255, 0.05);
}

.participant-checkbox input {
  accent-color: var(--primary-color);
}

.participant-checkbox input:checked + .participant-name {
  color: var(--primary-color);
}

.participant-name {
  font-size: 0.85rem;
  color: var(--text-light);
}

.participants-hint {
  margin: 0.25rem 0 0.5rem 0;
  font-size: 0.8rem;
  color: var(--accent);
  font-style: italic;
}

.participants-count {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Match Modal */
.modal-match {
  max-width: 700px;
}

.match-selection {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0;
  align-items: stretch;
}

.match-option {
  flex: 1;
  background: var(--bg-darker);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.match-option:hover {
  border-color: var(--primary-color);
}

.match-option.selected {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.1);
}

.match-option-header {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-color);
  text-align: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 0.75rem;
}

.match-option-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  max-height: 150px;
  overflow-y: auto;
}

.match-player-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.match-player-item img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
}

.match-player-item span {
  color: var(--text-light);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-vs-divider {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.btn-select-winner {
  margin-top: auto;
  padding: 0.6rem 1rem;
  background: transparent;
  border: 2px solid var(--success);
  color: var(--success);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-select-winner:hover {
  background: rgba(46, 204, 113, 0.2);
}

.match-option.selected .btn-select-winner {
  background: var(--success);
  color: #fff;
}

/* Winner highlight in modal */
.match-option.winner-highlight {
  border-color: var(--success);
  background: rgba(46, 204, 113, 0.15);
}

.match-option.winner-highlight .match-option-header::after {
  content: ' 🏆 Winner';
  color: var(--success);
  font-size: 0.8rem;
}

.empty-team {
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem;
}

/* ==================== END TOURNAMENT STYLES ==================== */

/* ==================== GOALS STYLES ==================== */

.goals-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.goal-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.goal-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.goal-card.completed {
  opacity: 0.7;
  border-color: var(--success);
}

.goal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.goal-title-section {
  flex: 1;
}

.goal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.goal-status-icon {
  font-size: 1rem;
}

.goal-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.goal-type-badge {
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}

.goal-type-badge.gold {
  background: rgba(241, 196, 15, 0.2);
  color: #f1c40f;
}

.goal-type-badge.item {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

.goal-type-badge.custom {
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
}

.goal-actions {
  display: flex;
  gap: 0.5rem;
}

.goal-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Progress Bar */
.goal-progress {
  margin-bottom: 0.75rem;
}

.progress-bar-container {
  width: 100%;
  height: 24px;
  background: var(--bg-darker);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), #f39c12);
  border-radius: 12px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.progress-bar-fill.completed {
  background: linear-gradient(90deg, var(--success), #27ae60);
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.progress-current {
  color: var(--primary-color);
  font-weight: 600;
}

/* Goal Footer */
.goal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.goal-creator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Goal Action Buttons */
.btn-contribute {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-contribute:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-complete-goal {
  padding: 0.5rem 1rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-complete-goal:hover {
  background: #27ae60;
}

.btn-delete-goal {
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-delete-goal:hover {
  background: var(--danger);
  color: white;
}

/* Celebration animation for completed goals */
.goal-card.just-completed {
  animation: celebrate 0.5s ease;
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

/* ==================== END GOALS STYLES ==================== */

/* ==================== GLOBAL SEARCH STYLES ==================== */

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.dashboard-header h2 {
  margin: 0;
}

.global-search {
  position: relative;
  margin-left: 1rem;
}

.global-search input {
  width: 280px;
  padding: 0.6rem 1rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  color: var(--text-light);
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.global-search input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.global-search input::placeholder {
  color: var(--text-muted);
}

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.search-results.active {
  display: block;
}

.search-category {
  padding: 0.5rem 1rem;
  background: var(--bg-darker);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.search-result-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.search-no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

/* ==================== END GLOBAL SEARCH STYLES ==================== */

/* ==================== AUDIT LOGS STYLES ==================== */

.logs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select,
.filter-group input[type="date"] {
  padding: 0.5rem 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  min-width: 150px;
}

.filter-group select:focus,
.filter-group input[type="date"]:focus {
  outline: none;
  border-color: var(--primary-color);
}

.btn-apply-filters {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-apply-filters:hover {
  background: var(--primary-hover);
}

.btn-clear-filters {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-clear-filters:hover {
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-export {
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-export:hover {
  background: var(--primary-color);
  color: var(--bg-dark);
}

.logs-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.log-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.log-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

.log-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.log-icon.deposit { background: rgba(46, 204, 113, 0.2); }
.log-icon.withdrawal { background: rgba(231, 76, 60, 0.2); }
.log-icon.income { background: rgba(241, 196, 15, 0.2); }
.log-icon.expense { background: rgba(231, 76, 60, 0.2); }
.log-icon.request { background: rgba(52, 152, 219, 0.2); }
.log-icon.roster { background: rgba(155, 89, 182, 0.2); }
.log-icon.goal { background: rgba(241, 196, 15, 0.2); }

.log-content {
  flex: 1;
}

.log-title {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.log-description {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.log-meta {
  text-align: right;
  flex-shrink: 0;
}

.log-member {
  font-size: 0.85rem;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.log-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.logs-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-page {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  color: var(--text-light);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-page:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

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

.page-info {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==================== END AUDIT LOGS STYLES ==================== */

/* ==================== PERMISSIONS STYLES ==================== */

.section-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

.permissions-container {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

/* Roles List */
.permissions-roles {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  height: fit-content;
}

.permissions-roles h3 {
  margin-bottom: 1rem;
  font-size: 1rem;
  color: var(--text-light);
}

.roles-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.role-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg-darker);
  border-radius: 8px;
}

.role-name {
  font-weight: 600;
  color: var(--text-light);
}

.role-level {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Permissions Matrix */
.permissions-matrix {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.permissions-matrix h3 {
  margin-bottom: 0.5rem;
  font-size: 1rem;
  color: var(--text-light);
}

.matrix-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.matrix-scroll {
  overflow-x: auto;
}

.permissions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.permissions-table th,
.permissions-table td {
  padding: 0.75rem 0.5rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.permissions-table th {
  background: var(--bg-darker);
  color: var(--primary-color);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
}

.permissions-table th.feature-col,
.permissions-table th.action-col {
  text-align: left;
}

.permissions-table th.role-col {
  min-width: 100px;
}

.feature-cell {
  text-align: left;
  font-weight: 600;
  color: var(--text-light);
  background: rgba(212, 175, 55, 0.1);
  vertical-align: top;
}

.action-cell {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.checkbox-cell {
  padding: 0.5rem;
}

.checkbox-cell input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.checkbox-cell input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.permissions-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.no-permission {
  text-align: center;
  padding: 3rem;
  color: var(--danger);
}

/* Responsive permissions */
@media (max-width: 1024px) {
  .permissions-container {
    grid-template-columns: 1fr;
  }

  .permissions-roles {
    order: 2;
  }

  .permissions-matrix {
    order: 1;
  }
}

/* Save Permissions Button */
.btn-save-permissions {
  padding: 0.75rem 1.5rem;
  background: var(--success);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.btn-save-permissions:hover {
  background: #27ae60;
  transform: translateY(-1px);
}

.btn-save-permissions:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* ==================== END PERMISSIONS STYLES ==================== */

/* ==================== BOT SETTINGS STYLES ==================== */

.bot-settings-container {
  margin-top: 1.5rem;
}

.bot-settings-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bot-settings-card h3 {
  color: var(--primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.bot-settings-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.bot-features-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bot-feature-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.bot-feature-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bot-feature-icon {
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 68, 173, 0.2);
  border-radius: 8px;
}

.bot-feature-details h4 {
  margin: 0 0 0.25rem 0;
  color: var(--text);
  font-size: 1rem;
}

.bot-feature-details p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.bot-feature-toggle {
  position: relative;
  width: 50px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.bot-feature-toggle.active {
  background: var(--success);
}

.bot-feature-toggle::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.3s ease;
}

.bot-feature-toggle.active::after {
  transform: translateX(24px);
}

.bot-feature-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-configure {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-configure:hover {
  background: var(--secondary);
}

/* Bot Settings Cards Layout */
.bot-settings-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.bot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.bot-card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.bot-card-icon {
  font-size: 1.5rem;
}

.bot-card-title h3 {
  margin: 0;
  color: var(--text);
}

.bot-settings-card-disabled {
  opacity: 0.6;
}

.coming-soon-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.btn-add-reaction-role {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-reaction-role:hover {
  background: var(--secondary);
  transform: translateY(-1px);
}

/* Channel Purge Button */
.btn-purge-channel {
  padding: 0.5rem 1rem;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-purge-channel:hover {
  background: #c0392b;
  transform: translateY(-1px);
}

/* Time Input Group */
.time-input-group {
  display: flex;
  gap: 0.5rem;
}

.time-value-input {
  flex: 1;
  max-width: 100px;
}

.time-unit-select {
  flex: 2;
}

/* Purge Warning */
.purge-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  margin: 1rem 0;
}

.purge-warning .warning-icon {
  font-size: 1.25rem;
}

.purge-warning p {
  margin: 0;
  color: #e74c3c;
  font-size: 0.9rem;
}

/* Danger Button */
.btn-danger {
  background: #e74c3c !important;
}

.btn-danger:hover {
  background: #c0392b !important;
}

/* Reaction Roles List */
.reaction-roles-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.reaction-role-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.reaction-role-item:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
}

.reaction-role-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.reaction-role-emoji {
  font-size: 1.75rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(142, 68, 173, 0.15);
  border-radius: 10px;
}

.reaction-role-details {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.reaction-role-name {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.reaction-role-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.reaction-role-channel {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.reaction-role-channel::before {
  content: '#';
  opacity: 0.7;
}

.reaction-role-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit-rr,
.btn-delete-rr {
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-edit-rr {
  background: rgba(52, 152, 219, 0.2);
  color: #3498db;
}

.btn-edit-rr:hover {
  background: rgba(52, 152, 219, 0.3);
}

.btn-delete-rr {
  background: rgba(231, 76, 60, 0.2);
  color: #e74c3c;
}

.btn-delete-rr:hover {
  background: rgba(231, 76, 60, 0.3);
}

/* Reaction Roles Empty State */
.reaction-roles-empty {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

.reaction-roles-empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Form hint */
.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Checkbox Group */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.75rem 1rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.checkbox-label:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.checkbox-text {
  color: var(--text);
  font-size: 0.9rem;
}

/* Toggle Group for Mode Selection */
.toggle-group {
  display: flex;
  gap: 0.5rem;
}

.toggle-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.toggle-btn.active {
  background: var(--primary-color);
  color: var(--bg-dark);
  border-color: var(--primary-color);
  font-weight: 600;
}

/* Emoji-Role Pairs Container */
#emoji-role-pairs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.emoji-role-pair {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.emoji-role-pair .pair-emoji,
.emoji-role-pair .pair-role,
.emoji-role-pair .pair-remove-role {
  flex: 1;
}

.emoji-role-pair .pair-remove-role input {
  border-color: rgba(231, 76, 60, 0.3);
}

.emoji-role-pair .pair-remove-role input::placeholder {
  color: rgba(231, 76, 60, 0.5);
}

.emoji-role-pair .pair-arrow {
  display: flex;
  align-items: center;
  color: var(--text-muted);
  padding-top: 0.75rem;
}

.emoji-role-pair .btn-remove-pair {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem;
  margin-top: 0.25rem;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.emoji-role-pair .btn-remove-pair:hover {
  opacity: 1;
  color: #e74c3c;
}

.btn-add-pair {
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
}

.btn-add-pair:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

/* Autocomplete Wrapper */
.autocomplete-wrapper {
  position: relative;
}

.autocomplete-wrapper input {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
}

.autocomplete-wrapper input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Autocomplete Dropdown for Reaction Roles */
.rr-autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1001;
  margin-top: 4px;
  display: none;
}

.rr-autocomplete-dropdown.active {
  display: block;
}

.rr-autocomplete-item {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.2s ease;
}

.rr-autocomplete-item:hover,
.rr-autocomplete-item.selected {
  background: rgba(255, 255, 255, 0.1);
}

.rr-autocomplete-item .channel-icon {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.rr-autocomplete-item .channel-name {
  flex: 1;
}

.rr-autocomplete-item .channel-category {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rr-autocomplete-item .emoji-preview {
  font-size: 1.2rem;
}

.rr-autocomplete-item .emoji-img {
  width: 22px;
  height: 22px;
  object-fit: contain;
  vertical-align: middle;
}

.rr-autocomplete-item .role-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.rr-autocomplete-no-results {
  padding: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  font-size: 0.9rem;
}

/* Textarea for Message Content */
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 1rem;
  resize: vertical;
  min-height: 100px;
  font-family: inherit;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Hidden class for toggle */
.form-group.hidden {
  display: none;
}

/* Role badge in reaction roles */
.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Grouped reaction roles by message */
.reaction-role-group {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.reaction-role-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reaction-role-group-title {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.reaction-role-group-title strong {
  color: var(--text);
}

.reaction-role-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.reaction-role-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.reaction-role-chip-emoji {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
}

.rr-emoji-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.rr-emoji-unicode {
  font-size: 1.25rem;
}

.rr-channel-icon {
  font-size: 1rem;
}

.rr-channel-name {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.rr-group-title {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.reaction-role-group-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.rr-exclusive-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  background: rgba(155, 89, 182, 0.2);
  color: #9b59b6;
  border-radius: 4px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.rr-remove-role {
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  border-radius: 4px;
  margin-left: 0.25rem;
}

.reaction-role-chip-role {
  color: #2ecc71;
  font-weight: 500;
}

.btn-edit-rr-group {
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.5;
  transition: all 0.2s ease;
  margin-left: auto;
  font-size: 0.9rem;
}

.btn-edit-rr-group:hover {
  opacity: 1;
  color: var(--primary-color);
}

.reaction-role-chip-role {
  font-weight: 500;
}

.reaction-role-chip-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  margin-left: 0.25rem;
  opacity: 0.5;
  transition: all 0.2s ease;
}

.reaction-role-chip-delete:hover {
  opacity: 1;
  color: #e74c3c;
}

/* Auto-Purge List */
.auto-purge-list {
  margin-top: 1rem;
}

.auto-purge-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 0.5rem;
}

.auto-purge-item:last-child {
  margin-bottom: 0;
}

.auto-purge-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.auto-purge-channel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
}

.auto-purge-channel-icon {
  color: var(--text-muted);
}

.auto-purge-details {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auto-purge-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-edit-auto-purge,
.btn-delete-auto-purge {
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  border-radius: 4px;
}

.btn-edit-auto-purge:hover {
  color: var(--primary-color);
  background: rgba(201, 162, 39, 0.1);
}

.btn-delete-auto-purge:hover {
  color: #e74c3c;
  background: rgba(231, 76, 60, 0.1);
}

.btn-add-auto-purge {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-add-auto-purge:hover {
  background: var(--primary-light);
}

.auto-purge-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.auto-purge-status.active {
  color: #2ecc71;
  background: rgba(46, 204, 113, 0.1);
}

.auto-purge-status.paused {
  color: #f39c12;
  background: rgba(243, 156, 18, 0.1);
}

/* ==================== END BOT SETTINGS STYLES ==================== */

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 3rem;
}

/* Loading */
.loading {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1rem;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
  }

  .nav-links {
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
  }

  main {
    padding: 1rem;
  }

  .bank-display {
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .currency-icon {
    font-size: 2.5rem;
  }

  .currency-value {
    font-size: 2rem;
  }

  .request-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }

  .member-card {
    flex-wrap: wrap;
  }

  .member-joined {
    width: 100%;
    text-align: left;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .members-search input {
    width: 100%;
  }
}

/* ==================== PROFILE STYLES ==================== */

.profile-layout,
.profile-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin-top: 1rem;
}

/* Profile Sidebar */
.profile-sidebar {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  height: fit-content;
  position: sticky;
  top: 100px;
}

.profile-avatar-section {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-avatar,
.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  margin-bottom: 1rem;
  object-fit: cover;
}

.profile-display-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.profile-username {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Profile Navigation */
.profile-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profile-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  width: 100%;
}

.profile-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-light);
}

.profile-nav-item.active {
  background: rgba(201, 162, 39, 0.15);
  color: var(--primary-color);
}

.profile-nav-item i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
}

.profile-nav-item.danger {
  color: var(--danger);
}

.profile-nav-item.danger:hover {
  background: rgba(231, 76, 60, 0.1);
}

/* Profile Content */
.profile-content {
  min-height: 500px;
}

.profile-tab {
  display: none;
  animation: fadeIn 0.3s ease;
}

.profile-tab.active {
  display: block;
}

.profile-section-title {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.3);
}

/* Profile Cards */
.profile-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 1.5rem;
}

.profile-card h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

/* Character Form */
.character-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.character-form .form-group {
  padding: 0;
  margin-bottom: 0;
}

.character-form .form-group.full-width {
  grid-column: 1 / -1;
}

.character-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.character-form .form-group input,
.character-form .form-group select,
.character-form .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.character-form .form-group input:focus,
.character-form .form-group select:focus,
.character-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.character-form .form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.profile-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 0.5rem;
}

.btn-save-profile,
.btn-save,
.profile-form .btn-save,
#save-professions {
  padding: 0.875rem 2.5rem;
  background: linear-gradient(135deg, var(--success) 0%, #27ae60 100%);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1.5rem;
  box-shadow: 0 2px 8px rgba(46, 204, 113, 0.3);
  letter-spacing: 0.3px;
}

.btn-save-profile:hover,
.btn-save:hover,
.profile-form .btn-save:hover,
#save-professions:hover {
  background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.btn-save-profile:active,
.btn-save:active,
.profile-form .btn-save:active,
#save-professions:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

/* Profile form rows */
.profile-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.profile-form .form-group {
  margin-bottom: 1rem;
}

.profile-form .form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.profile-form .form-group input,
.profile-form .form-group select,
.profile-form .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-darker);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text-light);
  font-size: 0.95rem;
}

.profile-form .form-group input:focus,
.profile-form .form-group select:focus,
.profile-form .form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Character Stats Section */
.stats-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.stats-section h4 {
  margin: 0 0 1rem 0;
  color: var(--primary-color);
  font-size: 1rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.stat-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-input-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-input-group input {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
}

.stat-input-group input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.stat-input-group input::placeholder {
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tab-description {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.tab-description.danger-text {
  color: var(--danger);
}

/* Wipe buttons */
.btn-danger {
  padding: 0.75rem 1.5rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 1rem;
  margin-bottom: 0.5rem;
}

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

/* Professions Grid */
.professions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.profession-category {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.profession-category h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.profession-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profession-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-darker);
  border-radius: 8px;
}

.profession-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.profession-name {
  flex: 1;
  color: var(--text-light);
  font-size: 0.9rem;
}

.profession-level {
  width: 60px;
  padding: 0.4rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: var(--text-light);
  font-size: 0.85rem;
  text-align: center;
}

.profession-level:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Absences */
.absences-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.btn-add-absence {
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-add-absence:hover {
  background: var(--primary-dark);
}

.absences-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.absence-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-darker);
  border-radius: 8px;
  border-left: 3px solid var(--warning);
}

.absence-dates {
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.absence-reason {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.btn-remove-absence {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.btn-remove-absence:hover {
  opacity: 1;
}

.empty-absences {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
}

/* Attendance Stats */
.attendance-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.attendance-stat {
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.attendance-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.attendance-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.attendance-history {
  max-height: 300px;
  overflow-y: auto;
}

.attendance-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.attendance-item:last-child {
  border-bottom: none;
}

.attendance-event {
  font-weight: 500;
  color: var(--text-light);
}

.attendance-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.attendance-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.attendance-status.present {
  background: rgba(46, 204, 113, 0.2);
  color: var(--success);
}

.attendance-status.absent {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.attendance-status.excused {
  background: rgba(241, 196, 15, 0.2);
  color: var(--warning);
}

/* Commissions */
.commissions-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.commission-stat {
  background: var(--bg-darker);
  border-radius: 8px;
  padding: 1.25rem;
  text-align: center;
}

.commission-stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.commission-stat-value.earnings {
  color: #ffd700;
}

.commission-stat-value.completed {
  color: var(--success);
}

.commission-stat-value.pending {
  color: var(--warning);
}

.commission-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.commissions-list {
  max-height: 300px;
  overflow-y: auto;
}

.commission-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-darker);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.commission-info h5 {
  color: var(--text-light);
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.commission-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.commission-amount {
  font-weight: 700;
  color: #ffd700;
}

/* Points */
.points-display {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.points-card {
  background: var(--bg-darker);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
}

.points-value {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.points-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.points-history {
  max-height: 250px;
  overflow-y: auto;
}

.points-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.points-item:last-child {
  border-bottom: none;
}

.points-reason {
  color: var(--text-light);
}

.points-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.points-change {
  font-weight: 600;
}

.points-change.positive {
  color: var(--success);
}

.points-change.negative {
  color: var(--danger);
}

/* Roles Display */
.roles-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-role-tag {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--bg-darker);
  border-radius: 20px;
  border: 1px solid;
}

.role-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.profile-role-name {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* Wipe Data */
.wipe-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wipe-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  background: var(--bg-darker);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wipe-option-info h5 {
  color: var(--text-light);
  margin-bottom: 0.25rem;
}

.wipe-option-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-wipe {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-wipe:hover {
  background: var(--danger);
  color: white;
}

.wipe-warning {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(231, 76, 60, 0.1);
  border: 1px solid rgba(231, 76, 60, 0.3);
  border-radius: 8px;
  margin-top: 1.5rem;
}

.wipe-warning i {
  color: var(--danger);
  font-size: 1.25rem;
}

.wipe-warning p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Responsive Profile */
@media (max-width: 1024px) {
  .profile-layout,
  .profile-container {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .profile-nav-item {
    flex: 1;
    min-width: 120px;
    justify-content: center;
  }

  .professions-grid {
    grid-template-columns: 1fr;
  }

  .attendance-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .commissions-summary {
    grid-template-columns: 1fr;
  }

  .points-display {
    grid-template-columns: 1fr;
  }

  .profile-form .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .character-form {
    grid-template-columns: 1fr;
  }

  .attendance-stats {
    grid-template-columns: 1fr;
  }
}

/* ==================== END PROFILE STYLES ==================== */

/* ==================== MEMBER PROFILE VIEW MODAL ==================== */

/* Clickable member cards */
.member-card.clickable {
  cursor: pointer;
  transition: all 0.2s ease;
}

.member-card.clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border-color: var(--primary-color);
}

/* Large modal for profile view */
.modal-large {
  max-width: 700px;
  width: 95%;
}

/* Member profile view layout */
.member-profile-view {
  padding: 0.5rem 0;
}

.view-profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.view-profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid var(--primary-color);
  object-fit: cover;
}

.view-profile-info h2 {
  margin: 0 0 0.25rem 0;
  font-size: 1.5rem;
  color: var(--text-light);
}

.view-profile-info .view-profile-username {
  color: var(--text-muted);
  margin: 0 0 0.5rem 0;
  font-size: 0.95rem;
}

.view-profile-info .view-profile-joined {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

.view-profile-info .view-profile-joined span {
  color: var(--primary-color);
}

/* Profile sections */
.view-profile-sections {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.view-profile-section {
  background: var(--bg-darker);
  border-radius: 10px;
  padding: 1.25rem;
}

.view-profile-section h4 {
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  font-size: 1rem;
  font-weight: 600;
}

/* Character details grid */
.view-character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.view-char-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.view-char-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-char-value {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 500;
}

.view-char-bio {
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.view-bio-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0.5rem 0 0 0;
  font-style: italic;
}

/* Stats display in view modal */
.view-char-stats {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.view-char-stats .stats-title {
  margin: 0 0 0.75rem 0;
  color: var(--primary-color);
  font-size: 0.85rem;
  font-weight: 600;
}

.view-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.view-stat-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.5rem;
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 0.8rem;
}

.view-stat-item .stat-icon {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.view-stat-item .stat-label {
  color: var(--text-muted);
  flex: 1;
  font-size: 0.75rem;
}

.view-stat-item .stat-value {
  color: var(--primary-color);
  font-weight: 600;
}

@media (max-width: 600px) {
  .view-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Roles display in view modal */
.view-roles-display {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Professions in view modal */
.view-professions-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.view-profession-category {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 1rem;
}

.view-profession-category h5 {
  margin: 0 0 0.75rem 0;
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.view-profession-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.5rem;
}

.view-profession-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-card);
  border-radius: 6px;
}

.view-profession-item .profession-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.view-profession-item .profession-name {
  color: var(--text-light);
  font-size: 0.85rem;
  flex: 1;
}

.view-profession-item .profession-cert {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
}

.view-profession-item .profession-cert.cert-novice {
  color: #95a5a6;
}

.view-profession-item .profession-cert.cert-apprentice {
  color: #3498db;
}

.view-profession-item .profession-cert.cert-journeyman {
  color: #2ecc71;
}

.view-profession-item .profession-cert.cert-master {
  color: #9b59b6;
}

.view-profession-item .profession-cert.cert-grandmaster {
  color: #f1c40f;
}

/* Responsive */
@media (max-width: 600px) {
  .view-profile-header {
    flex-direction: column;
    text-align: center;
  }

  .view-character-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .view-profession-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== END MEMBER PROFILE VIEW MODAL ==================== */

/* ==================== PROFESSIONS WIZARD ==================== */

/* Edit professions button */
.btn-edit-professions {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 1.5rem;
}

.btn-edit-professions:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Wizard Modal */
.modal-wizard {
  max-width: 900px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
}

/* Wizard Progress Bar */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 2rem;
  background: var(--bg-darker);
  border-radius: 8px;
  margin-bottom: 1.5rem;
  position: relative;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 2.5rem;
  left: 4rem;
  right: 4rem;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  z-index: 1;
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
  flex: 1;
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 3px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  transition: all 0.3s ease;
}

.wizard-step.active .step-circle,
.wizard-step.completed .step-circle {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--bg-dark);
}

.wizard-step.completed .step-circle::after {
  content: '✓';
  font-size: 1rem;
}

.wizard-step.completed .step-circle {
  font-size: 0;
}

.wizard-step span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.wizard-step.active span,
.wizard-step.completed span {
  color: var(--text-light);
}

/* Wizard Content */
.wizard-content {
  display: none;
  padding: 0.5rem 0;
}

.wizard-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

.wizard-content h4 {
  color: var(--text-light);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.wizard-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

/* Professions Wizard Grid */
.professions-wizard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* Profession Wizard Item */
.profession-wizard-item {
  background: var(--bg-darker);
  border-radius: 10px;
  padding: 1rem;
}

.profession-wizard-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.profession-wizard-icon {
  font-size: 1.25rem;
}

.profession-wizard-name {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.95rem;
}

.profession-wizard-fields {
  display: grid;
  grid-template-columns: 70px 1fr 70px;
  gap: 0.75rem;
  align-items: end;
}

.profession-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.profession-field label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profession-field input,
.profession-field select {
  padding: 0.5rem;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--text-light);
  font-size: 0.9rem;
}

.profession-field input:focus,
.profession-field select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.profession-field input[type="number"] {
  text-align: center;
}

.profession-field select {
  cursor: pointer;
}

/* Certification colors */
.profession-field select option[value="novice"] { color: #aaa; }
.profession-field select option[value="apprentice"] { color: #2ecc71; }
.profession-field select option[value="journeyman"] { color: #3498db; }
.profession-field select option[value="master"] { color: #9b59b6; }
.profession-field select option[value="grandmaster"] { color: #f1c40f; }

/* Wizard Summary */
.wizard-summary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.summary-category {
  background: var(--bg-darker);
  border-radius: 10px;
  padding: 1.25rem;
}

.summary-category h5 {
  color: var(--text-light);
  font-size: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.summary-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summary-item .summary-icon {
  font-size: 1rem;
}

.summary-item .summary-name {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.summary-item .summary-cert {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.summary-item .cert-icon {
  font-size: 0.8rem;
}

.summary-item .cert-name {
  font-size: 0.85rem;
  font-weight: 500;
}

/* Certification colors in summary */
.cert-novice { color: #888; }
.cert-apprentice { color: #2ecc71; }
.cert-journeyman { color: #3498db; }
.cert-master { color: #9b59b6; }
.cert-grandmaster { color: #f1c40f; }

.wizard-summary-note {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(201, 162, 39, 0.1);
  border-radius: 8px;
  border-left: 3px solid var(--primary-color);
}

/* Wizard Actions */
.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 1.5rem;
}

.wizard-nav {
  display: flex;
  gap: 1rem;
}

.btn-wizard-save {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--success) 0%, #27ae60 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-wizard-save:hover {
  background: linear-gradient(135deg, #27ae60 0%, #219a52 100%);
  transform: translateY(-1px);
}

.btn-wizard-next {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: var(--bg-dark);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-wizard-next:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-wizard-next::after {
  content: '→';
}

.btn-wizard-prev {
  padding: 0.75rem 1.5rem;
  background: var(--bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-wizard-prev:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-wizard-prev::before {
  content: '←';
}

/* Professions Summary on Profile Tab */
.professions-summary {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.professions-summary .summary-category {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Wizard */
@media (max-width: 768px) {
  .professions-wizard-grid {
    grid-template-columns: 1fr;
  }

  .wizard-progress {
    padding: 1rem;
  }

  .wizard-progress::before {
    left: 2rem;
    right: 2rem;
  }

  .wizard-step span {
    font-size: 0.65rem;
  }

  .step-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .profession-wizard-fields {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== END PROFESSIONS WIZARD ==================== */

/* ==================== TOURNAMENT RANKINGS ==================== */

/* Rankings button in tournaments header */
.btn-rankings {
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: var(--bg-darker);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-rankings:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);
}

/* Rankings tabs */
.rankings-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rankings-tab {
  padding: 0.6rem 1.2rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rankings-tab:hover {
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.2);
}

.rankings-tab.active {
  background: var(--primary-color);
  color: var(--bg-darker);
  border-color: var(--primary-color);
}

/* Rankings content */
.rankings-content {
  padding: 1rem 1.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

/* Rankings table */
.rankings-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rankings-header {
  display: grid;
  grid-template-columns: 50px 1fr 50px 50px 60px 50px;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.rankings-row {
  display: grid;
  grid-template-columns: 50px 1fr 50px 50px 60px 50px;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  align-items: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.rankings-row:hover {
  border-color: var(--primary-color);
  transform: translateX(4px);
}

.rankings-row.top-1 {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
  border-color: rgba(255, 215, 0, 0.3);
}

.rankings-row.top-2 {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(192, 192, 192, 0.05));
  border-color: rgba(192, 192, 192, 0.3);
}

.rankings-row.top-3 {
  background: linear-gradient(135deg, rgba(205, 127, 50, 0.15), rgba(205, 127, 50, 0.05));
  border-color: rgba(205, 127, 50, 0.3);
}

.rank-col {
  text-align: center;
  font-weight: 600;
  font-size: 1.1rem;
}

.player-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ranking-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-name {
  font-weight: 500;
}

.stat-col {
  text-align: center;
  font-weight: 500;
}

.stat-col.wins {
  color: var(--success);
}

.stat-col.losses {
  color: var(--danger);
}

.stat-col.winrate {
  color: var(--primary-color);
}

.trophy-col {
  text-align: center;
  font-weight: 600;
}

.trophy-col.tournament-wins {
  color: var(--primary-color);
}

/* ==================== PROFILE TOURNAMENT STATS ==================== */

.tournament-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.tournament-stat-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.tournament-stat-card h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-align: center;
}

.stat-row {
  display: flex;
  justify-content: space-around;
  margin-bottom: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: 'Cinzel', serif;
}

.stat-number.wins {
  color: var(--success);
}

.stat-number.losses {
  color: var(--danger);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.tournament-wins-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: rgba(201, 162, 39, 0.1);
  border-radius: 8px;
  color: var(--primary-color);
  font-weight: 600;
}

.trophy-icon {
  font-size: 1.5rem;
}

/* Match history */
.match-history {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
}

.match-history h4 {
  color: var(--text-light);
  margin-bottom: 1rem;
  font-size: 1rem;
}

.match-history-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}

.match-history-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.match-history-item.win {
  border-left-color: var(--success);
}

.match-history-item.loss {
  border-left-color: var(--danger);
}

.match-result {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

.match-result.win {
  background: rgba(39, 174, 96, 0.2);
  color: var(--success);
}

.match-result.loss {
  background: rgba(231, 76, 60, 0.2);
  color: var(--danger);
}

.match-tournament-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match-round {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.match-date {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* Responsive rankings */
@media (max-width: 768px) {
  .rankings-header,
  .rankings-row {
    grid-template-columns: 40px 1fr 40px 40px 50px 40px;
    font-size: 0.85rem;
  }

  .ranking-avatar {
    width: 28px;
    height: 28px;
  }

  .tournament-stats-grid {
    grid-template-columns: 1fr;
  }

  .match-history-item {
    grid-template-columns: auto 1fr auto;
    gap: 0.5rem;
  }

  .match-date {
    display: none;
  }
}

/* ==================== END TOURNAMENT RANKINGS ====================*/

/* ==================== AUTOCOMPLETE DROPDOWN ==================== */

.autocomplete-dropdown {
  position: fixed;
  background: #1a1a2e;
  border: 2px solid var(--accent-color);
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 999999;
  display: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.autocomplete-dropdown.active {
  display: block;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.15s ease;
  font-size: 0.9rem;
  color: #e0e0e0;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
  background: var(--accent-color);
  color: white;
}

.autocomplete-item strong {
  color: var(--secondary-color);
  font-weight: 700;
}

.autocomplete-item:hover strong,
.autocomplete-item.selected strong {
  color: #fff;
}

.autocomplete-item.no-results {
  color: var(--text-muted);
  font-style: italic;
  cursor: default;
}

.autocomplete-item.no-results:hover {
  background: transparent;
  color: var(--text-muted);
}

/* Ensure form groups have proper positioning for dropdown */
.form-group {
  position: relative;
}

/* Scrollbar styling for autocomplete */
.autocomplete-dropdown::-webkit-scrollbar {
  width: 6px;
}

.autocomplete-dropdown::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.autocomplete-dropdown::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 3px;
}

/* ==================== END AUTOCOMPLETE ====================*/
