/* User profile shared styles */

/* Tabs */
.profile-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 20px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
}
.profile-tab {
  flex: 1;
  text-align: center;
  padding: 10px 15px;
  color: #666;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.2s;
}
.profile-tab:hover {
  background: rgba(0,0,0,0.05);
  color: #333;
}
.profile-tab.active {
  background: #fff;
  color: #009fdd;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Avatar */
.profile-avatar-sm {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

/* Current rating */
.current-rating-value {
  font-size: 24px;
  font-weight: bold;
  color: #28a745;
  margin-left: 10px;
}

/* Chart */
.rating-chart {
  margin-bottom: 20px;
  padding: 20px;
}

/* Tables */
.skill-matches-table,
.rating-history-table {
  width: 100%;
}
.skill-matches-table th,
.rating-history-table th {
  cursor: pointer;
  user-select: none;
  background: #f8f9fa;
  padding: 12px;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
}
.skill-matches-table th:hover {
  background: #e9ecef;
}
.skill-matches-table td,
.rating-history-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
}
.match-row.win {
  background: rgba(40, 167, 69, 0.05);
}
.match-row.loss {
  background: rgba(220, 53, 69, 0.05);
}
.result-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.result-badge.win {
  background: #d4edda;
  color: #155724;
}
.result-badge.loss {
  background: #f8d7da;
  color: #721c24;
}
.rating-history-table .positive {
  color: #28a745;
  font-weight: 500;
}
.rating-history-table .negative {
  color: #dc3545;
  font-weight: 500;
}

/* Cards */
.rin-card {
  margin-bottom: 20px;
  border-radius: 8px;
}
.rin-card-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}
.rin-card-header h5 {
  margin: 0;
  font-weight: 600;
}
.rin-card-body {
  padding: 20px;
}

/* ========================================
   EVENTS BLOCK STYLES (from rankedin)
   ======================================== */

.events-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.events-limit-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.events-limit-selector label {
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.events-select {
  padding: 8px 32px 8px 14px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23555' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: all .2s ease;
}

.events-select:hover {
  border-color: #bbb;
}

.events-select:focus {
  outline: none;
  border-color: #111827;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
}

/* Tabs */
.events-tabs {
  display: flex;
  gap: 8px;
}

.events-tab {
  padding: 10px 18px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #555;
  cursor: pointer;
  transition: all .2s ease;
  font-weight: 500;
  font-size: 14px;
  border: 1px solid transparent;
}

.events-tab:hover {
  background: #e5e7eb;
  color: #333;
}

.events-tab.active {
  background: #111827;
  color: white;
  border-color: #111827;
}

.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

.events-tab:not(.active) .tab-count {
  background: rgba(0, 0, 0, 0.08);
}

.events-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.2);
}

/* Events List */
.events-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Event Card */
.event-card {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border: 1px solid #eee;
  border-radius: 14px;
  transition: all .2s ease;
  gap: 16px;
}

.event-card:hover {
  border-color: #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}

.event-card-main {
  flex: 1;
  min-width: 0;
}

.event-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-card-title a {
  color: inherit;
  text-decoration: none;
}

.event-card-title a:hover {
  color: #009fdd;
}

.event-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: #666;
}

.event-card-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.event-card-meta-item svg,
.event-card-meta-item .icon {
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.event-card-status {
  flex-shrink: 0;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-primary {
  background: #dbeafe;
  color: #1e40af;
}

/* Load More Button */
.load-more-btn {
  margin: 24px auto 0;
  display: block;
  padding: 12px 28px;
  border: none;
  border-radius: 12px;
  background: #111827;
  color: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s ease;
}

.load-more-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.load-more-btn:active {
  transform: translateY(0);
}

/* Empty State */
.events-empty {
  text-align: center;
  padding: 48px 24px;
  color: #666;
}

.events-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.events-empty-text {
  font-size: 16px;
}

/* Tab Content */
.events-tab-content {
  display: none;
}

.events-tab-content.active {
  display: block;
}

/* Responsive */
@media (max-width: 640px) {
  .events-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .events-tabs {
    justify-content: center;
  }

  .events-tab {
    flex: 1;
    text-align: center;
    padding: 12px 14px;
    font-size: 13px;
  }

  .event-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .event-card-status {
    align-self: flex-start;
  }
}

/* ========================================
   LAST EVENTS PLAYED (main profile page)
   ======================================== */

.last-events-played-carousel-wrapper {
  width: 100%;
  overflow: hidden;
}

.desktop-no-carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
}

.desktop-no-carousel::-webkit-scrollbar {
  height: 6px;
}

.desktop-no-carousel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.desktop-no-carousel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Match card - main wrapper */
.desktop-no-carousel .rin-card {
  min-width: 320px;
  max-width: 350px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  scroll-snap-align: start;
}

.desktop-no-carousel .rin-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

/* Tablet: slightly smaller cards, still swipeable */
@media (max-width: 1024px) {
  .desktop-no-carousel .rin-card {
    min-width: 280px;
    max-width: 300px;
  }
}

/* Phones: one card nearly fills the screen, swipe between them */
@media (max-width: 600px) {
  .desktop-no-carousel {
    gap: 12px;
    padding: 8px 0 16px;
  }

  .desktop-no-carousel .rin-card {
    min-width: calc(100vw - 48px);
    max-width: calc(100vw - 48px);
  }

  .last-events-played-card-body {
    padding: 12px;
    gap: 6px;
  }

  .last-events-played-card-body .rin-card {
    padding: 10px 6px;
  }

  .last-events-played-card-body .rin-card .rin-card-title img {
    width: 48px;
    height: 48px;
  }
}

/* Title with tournament type */
.desktop-no-carousel .rin-card .rin-card-title {
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.rin-type-label.tournament {
  display: inline-block;
  padding: 3px 8px;
  background: #009fdd;
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  border-radius: 4px;
  font-weight: 600;
}

/* Players row container */
.desktop-no-carousel .rin-card .rin-card-body {
  padding: 0;
}

.last-events-played-card-body {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 16px;
  gap: 8px;
}

/* Player card */
.last-events-played-card-body .rin-card {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fafafa;
  box-shadow: none;
  min-width: auto;
  max-width: none;
}

.last-events-played-card-body .rin-card:hover {
  transform: none;
  box-shadow: none;
}

.last-events-played-card-body .rin-card.winner {
  border-color: #28a745;
  background: #f0fff4;
}

.last-events-played-card-body .rin-card.loser {
  border-color: #dc3545;
  background: #fff5f5;
}

.last-events-played-card-body .rin-card .rin-card-title {
  padding: 0;
  background: transparent;
  border: none;
  margin-bottom: 8px;
}

.last-events-played-card-body .rin-card .rin-card-title img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.last-events-played-card-body .rin-card .rin-card-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  background: transparent;
  border: none;
}

.last-events-played-card-body .rin-card .rin-card-header .flag-icon {
  font-size: 16px;
  margin-bottom: 2px;
}

.last-events-played-card-body .rin-card .rin-card-header a {
  text-decoration: none;
}

.last-events-played-card-body .rin-card .rin-card-header .first-name {
  font-size: 12px;
  color: #666;
}

.last-events-played-card-body .rin-card .rin-card-header .last-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

/* Footer with score */
.desktop-no-carousel .rin-card .rin-card-footer {
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  text-align: center;
}

.desktop-no-carousel .rin-card .rin-card-footer .result-label {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.desktop-no-carousel .rin-card .rin-card-footer .detailed-results {
  display: flex;
  justify-content: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.desktop-no-carousel .rin-card .rin-card-footer .detailed-results span {
  display: inline-block;
  padding: 2px 6px;
  background: #e9ecef;
  border-radius: 4px;
  font-size: 11px;
  color: #666;
}

.desktop-no-carousel .rin-card .rin-card-footer .d-flex {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
}

.desktop-no-carousel .rin-card .rin-card-footer .d-flex .icon-rin-squash,
.desktop-no-carousel .rin-card .rin-card-footer .d-flex .icon-rin-sports-squash {
  color: #999;
  font-size: 14px;
}

.desktop-no-carousel .rin-card .rin-card-footer .d-flex a {
  color: #009fdd;
  text-decoration: none;
  font-weight: 500;
}

.desktop-no-carousel .rin-card .rin-card-footer .d-flex a:hover {
  text-decoration: underline;
}

.event-link-ellipsis {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}

/* Responsive */
@media (max-width: 640px) {
  .desktop-no-carousel {
    flex-wrap: wrap;
  }
  
  .desktop-no-carousel .rin-card {
    min-width: 100%;
    max-width: 100%;
  }
}

/* ========================================
   OPPONENTS BLOCK (user profile)
   ======================================== */

.opponents-info-cards-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 8px 0;
}

/* Opponent card item - from profile.php */
.opponent-card-item {
  flex: 0 0 auto;
  width: 140px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s ease;
  overflow: hidden;
  text-align: center;
}

.opponent-card-item:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
  border-color: #009fdd;
}

.opponent-card-item a {
  display: block;
  text-decoration: none;
  padding: 20px 12px 16px;
}

.opponent-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #f0f0f0;
  transition: border-color 0.2s ease;
  margin-bottom: 12px;
}

.opponent-card-item:hover .opponent-avatar-img {
  border-color: #009fdd;
}

.opponent-name {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.opponent-matches {
  font-size: 12px;
  color: #666;
}

/* Responsive */
@media (max-width: 640px) {
  .opponents-info-cards-wrapper {
    gap: 12px;
  }
  
  .opponent-card-item {
    width: calc(50% - 6px);
  }
  
  .opponent-avatar-img {
    width: 52px;
    height: 52px;
  }
}

.desktop-no-carousel {
  display: flex;
  flex-wrap: nowrap;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.desktop-no-carousel::-webkit-scrollbar {
  height: 6px;
}

.desktop-no-carousel::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.desktop-no-carousel::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}

/* Match card */
.last-events-played-card .rin-card-border {
  min-width: 300px;
  max-width: 350px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  flex-shrink: 0;
}

.last-events-played-card .rin-card-border .rin-card-title {
  padding: 12px 16px;
  background: #f8f9fa;
  border-bottom: 1px solid #eee;
}

.rin-type-label.tournament {
  display: inline-block;
  padding: 3px 8px;
  background: #009fdd;
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  border-radius: 4px;
  font-weight: 600;
  margin-bottom: 6px;
}

.last-events-played-card .tournament-name {
  font-size: 13px;
  color: #666;
  display: block;
  margin-top: 4px;
}

/* Players row */
.last-events-played-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  gap: 12px;
}

.last-events-played-card-body .player-side {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-radius: 8px;
  border: 1px solid #eee;
  background: #fafafa;
}

.last-events-played-card-body .player-side.winner {
  border-color: #28a745;
  background: #f0fff4;
}

.last-events-played-card-body .player-side.loser {
  border-color: #dc3545;
  background: #fff5f5;
}

.last-events-played-card-body .player-side img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.last-events-played-card-body .player-side .player-name {
  font-size: 13px;
  color: #666;
  margin-bottom: 2px;
}

.last-events-played-card-body .player-side .player-lastname {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.last-events-played-card-body .player-side a {
  text-decoration: none;
}

.last-events-played-card-body .score-divider {
  font-size: 20px;
  font-weight: bold;
  color: #999;
  padding: 0 8px;
}

/* Footer */
.last-events-played-card .rin-card-border .rin-card-footer {
  padding: 12px 16px;
  background: #f8f9fa;
  border-top: 1px solid #eee;
  text-align: center;
  font-size: 12px;
  color: #666;
}

.last-events-played-card .rin-card-border .rin-card-footer .event-date {
  display: block;
  margin-bottom: 4px;
}

.last-events-played-card .rin-card-border .rin-card-footer a {
  color: #009fdd;
  text-decoration: none;
  font-weight: 500;
}

.last-events-played-card .rin-card-border .rin-card-footer a:hover {
  text-decoration: underline;
}

/* Mobile responsive - last events played */
@media (max-width: 480px) {
  .last-events-played-carousel-wrapper {
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
  }
  
  .desktop-no-carousel {
    flex-wrap: nowrap;
    overflow-x: scroll;
    padding: 8px 16px 16px;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  
  .desktop-no-carousel .rin-card {
    min-width: calc(100vw - 48px);
    max-width: calc(100vw - 48px);
    scroll-snap-align: start;
  }
  
  .last-events-played-card-body {
    padding: 12px 8px;
    gap: 4px;
  }
  
  .last-events-played-card-body .rin-card {
    padding: 8px 4px;
  }
  
  .last-events-played-card-body .rin-card .rin-card-title img {
    width: 40px;
    height: 40px;
  }
  
  .last-events-played-card-body .rin-card .rin-card-header .first-name {
    font-size: 10px;
  }
  
  .last-events-played-card-body .rin-card .rin-card-header .last-name {
    font-size: 12px;
  }
  
  .desktop-no-carousel .rin-card .rin-card-footer {
    padding: 10px 12px;
  }
  
  .desktop-no-carousel .rin-card .rin-card-footer .result-label {
    font-size: 16px;
  }
  
  .desktop-no-carousel .rin-card .rin-card-footer .detailed-results {
    gap: 2px;
  }
  
  .desktop-no-carousel .rin-card .rin-card-footer .detailed-results span {
    padding: 1px 4px;
    font-size: 10px;
  }
  
  .event-link-ellipsis {
    max-width: 100px;
  }
}

/* Quick Actions (роль-зависимый блок) */
.quick-actions-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.quick-actions-empty { color: #666; font-size: 14px; padding: 8px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 18px; font-size: 14px; font-weight: 600; font-family: inherit; line-height: 1.2; border-radius: 8px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: #009fdd; color: #fff; border-color: #009fdd; }
.btn-primary:hover { background: #0b8fc4; border-color: #0b8fc4; box-shadow: 0 4px 12px rgba(0, 159, 221, 0.25); }
.btn-secondary { background: #f5f5f5; color: #111827; border-color: #e5e7eb; }
.btn-secondary:hover { border-color: #009fdd; color: #009fdd; background: #fff; }
.btn-ghost { background: transparent; color: #666; border-color: transparent; }
.btn-ghost:hover { background: #f5f5f5; color: #111827; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
/* Выпадающее меню «Администрирование» */
/* Блок быстрых действий поднимаем выше соседних секций, чтобы меню не перекрывалось «Карьерой» */
.section-quick-actions { position: relative; z-index: 50; }
.qa-dropdown { position: relative; display: inline-flex; z-index: 100; }
.qa-dropdown-toggle { font-weight: 600; }
.qa-dropdown-toggle .qa-caret { display: inline-block; margin-left: 4px; transition: transform 0.2s ease; font-size: 11px; opacity: 0.7; }
.qa-dropdown.show .qa-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.qa-dropdown.show .qa-caret { transform: rotate(180deg); }
.qa-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 250px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 12px 32px rgba(17, 24, 39, 0.18); padding: 6px; z-index: 100;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  pointer-events: none;
}
/* маленький «хвостик»-указатель */
.qa-dropdown-menu::before { content: ""; position: absolute; top: -6px; left: 22px; width: 12px; height: 12px; background: #fff; border-left: 1px solid #e5e7eb; border-top: 1px solid #e5e7eb; transform: rotate(45deg); border-radius: 2px; }
@media (max-width: 480px) { .qa-dropdown-menu { left: auto; right: 0; } .qa-dropdown-menu::before { left: auto; right: 22px; } }
.qa-dropdown-menu a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: 13px; font-weight: 500; color: #111827; text-decoration: none; border-radius: 7px; transition: background 0.15s ease, color 0.15s ease; }
/* Цветной маркер-точка слева у каждого пункта (без текстовых символов — рендерится везде) */
.qa-dropdown-menu a::before { content: ""; flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: #009fdd; opacity: 0.55; transition: opacity 0.15s ease, background 0.15s ease; }
.qa-dropdown-menu a:hover::before { opacity: 1; background: #009fdd; }
.qa-dropdown-menu a .qa-ico { font-size: 15px; width: 18px; text-align: center; opacity: 0.85; }
.qa-dropdown-menu a:hover { background: #f5f5f5; color: #009fdd; }
.qa-dropdown-menu a:hover .qa-ico { opacity: 1; }
.qa-dropdown-menu .qa-divider { height: 1px; margin: 5px 6px; background: #e5e7eb; }

/* Поля редактирования профиля (в модалке) */
.profile-edit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-avatar-row { padding: 16px 24px 0; border-top: 1px solid var(--surface-border); margin-top: 16px; }
.profile-edit-fields label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #374151; }
.profile-edit-fields label.full { grid-column: 1 / -1; }
.profile-edit-fields input,
.profile-edit-fields textarea { padding: 9px 12px; border: 1px solid #e5e7eb; border-radius: 8px; font-size: 14px; font-family: inherit; color: #111827; background: #fff; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.profile-edit-fields input:focus,
.profile-edit-fields textarea:focus { outline: none; border-color: #009fdd; box-shadow: 0 0 0 3px rgba(0, 159, 221, 0.15); }
.profile-edit-fields textarea { min-height: 90px; resize: vertical; }
@media (max-width: 600px) { .profile-edit-fields { grid-template-columns: 1fr; } }

.profile-edit-btn { margin-left: auto; align-self: flex-start; }
.profile-name-block { display: flex; flex-direction: column; align-items: flex-start; }
.profile-info-main { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex: 1; }
@media (max-width: 600px) { .profile-info-main { flex-direction: column; } .profile-edit-btn { margin-left: 0; align-self: flex-start; } }

/* ═══════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS — User Profile / Personal Account pages
   ═══════════════════════════════════════════════════════════════════ */

/* Issue 2: Data tables — reduced padding on mobile */
@media (max-width: 768px) {
  .skill-matches-table th,
  .skill-matches-table td,
  .rating-history-table th,
  .rating-history-table td,
  .match-history-table th,
  .match-history-table td {
    padding: 8px 6px !important;
    font-size: 12px;
  }
}
@media (max-width: 480px) {
  .skill-matches-table th,
  .skill-matches-table td,
  .rating-history-table th,
  .rating-history-table td,
  .match-history-table th,
  .match-history-table td {
    padding: 4px 4px !important;
    font-size: 11px;
  }
}

/* Issue 3: Last events played cards — prevent cramping on very small screens */
@media (max-width: 400px) {
  .last-events-played-card-body {
    flex-direction: column;
    gap: 8px;
  }
  .last-events-played-card-body .player-side {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .last-events-played-card-body .score-divider {
    width: 100%;
    text-align: center;
  }
  .last-events-played-card-body .result-detailed {
    font-size: 11px;
  }
}

/* Issue 4: Events tabs — stacked on small screens */
@media (max-width: 480px) {
  .events-tabs {
    flex-direction: column;
    gap: 8px;
  }
  .events-tabs .events-tab {
    width: 100%;
    text-align: center;
    padding: 12px 8px;
  }
}

/* Issue 5: Membership cards — responsive breakpoint */
@media (max-width: 640px) {
  .membership-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }
  .membership-card .membership-header {
    width: 100%;
  }
  .membership-card .membership-info {
    width: 100%;
  }
  .membership-card .membership-actions {
    width: 100%;
    text-align: right;
  }
}

/* Issue 6: Opponent detailed cards — reduced padding on mobile */
@media (max-width: 640px) {
  .opponent-detailed-card {
    padding: 16px !important;
  }
  .opponent-detailed-card .opponent-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .opponent-detailed-card .opponent-stats {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
  }
}
@media (max-width: 480px) {
  .opponent-detailed-card .opponent-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Issue 7: Recent events rows — responsive */
@media (max-width: 480px) {
  .recent-event-row {
    flex-direction: column;
    gap: 4px;
    padding: 12px 8px;
  }
  .recent-event-row .recent-event-name {
    white-space: normal;
    word-break: break-word;
  }
  .recent-event-row .recent-event-status {
    align-self: flex-end;
  }
}

/* Issue 8: Stat badges — wrap on small screens */
@media (max-width: 480px) {
  .stat-badges {
    gap: 8px;
    justify-content: center;
  }
  .stat-badge {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Issue 9: Career table — better mobile display */
@media (max-width: 640px) {
  .career-table th,
  .career-table td {
    padding: 8px;
    font-size: 12px;
  }
}

/* Issue 10: Touch target improvements for all user pages */
@media (max-width: 768px) {
  .load-more-btn,
  .profile-tab,
  .events-tab,
  .btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Issue 11: Events string table — defensive overflow handling */
@media (max-width: 768px) {
  .events-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .events-table-wrapper table {
    width: 100%;
    min-width: 500px;
  }
}
