/* =====================================================
   PROFILE PAGE - ROYALE PROGRESS
   ===================================================== */

/* ===== PAGE LAYOUT ===== */
.profile-page {
  min-height: 100vh;
  padding-top: 96px;
  background: transparent;
}

@media (max-width: 768px) {
  .profile-page {
    padding-top: 52px;
  }
}

.profile-container {
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 16px;
  box-sizing: border-box;
  width: 100%;
}

/* ===== LOADING STATE ===== */
.profile-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #0b1a2b;
  font-family: ClashBold, sans-serif;
  font-size: 1.5rem;
}

.profile-loading-spinner {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(11, 26, 43, 0.18);
  border-top-color: #0b1a2b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== ERROR STATE ===== */
.profile-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: #ff6b6b;
  font-family: ClashBold, sans-serif;
  text-align: center;
  padding: 20px;
}

.profile-error-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.profile-error-title {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.profile-error-message {
  color: #aaa;
  font-family: ClashRegular, sans-serif;
  font-size: 1rem;
  margin-bottom: 20px;
}

.profile-error-btn {
  background: linear-gradient(180deg, #5cb85c 0%, #449d44 100%);
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
}

.profile-error-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(92, 184, 92, 0.4);
}

/* ===== HEADER SECTION ===== */
.profile-header {
  background: linear-gradient(160deg,#eef5ff 0%,#d2e1f3 100%);
  border-radius: 16px;
  padding: 30px;
  margin-bottom: 20px;
  display: flex;
  gap: 30px;
  align-items: flex-start;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
  border: 2px solid #b6c9dd;
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 15px;
    gap: 20px;
  }
}

/* Player Avatar/Level Badge */
.profile-avatar {
  position: relative;
  flex-shrink: 0;
}

.profile-level-badge {
  width: 110px;
  height: 110px;
  background: url('/assets/images/experience.webp') center/contain no-repeat;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border: none;
  position: relative;
}

.profile-level-badge::before {
  content: none;
}

.profile-level-text {
  font-family: ClashBold, sans-serif;
  font-size: 2.2rem;
  color: #fff;
  line-height: 1;
  margin-top: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.55);
}

/* Player Info */
.profile-info {
  flex: 1;
  min-width: 0;
}

.profile-name {
  font-family: ClashBold, sans-serif;
  font-size: 2.2rem;
  color: #0b1a2b;
  margin: 0 0 5px 0;
  text-shadow: none;
}

@media (max-width: 768px) {
  .profile-name {
    font-size: 1.6rem;
  }
}

.profile-tag {
  font-family: ClashRegular, sans-serif;
  font-size: 1rem;
  color: #475569;
  margin-bottom: 15px;
}

.profile-clan {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(182, 201, 221, 0.9);
  padding: 8px 16px;
  border-radius: 20px;
  margin-bottom: 15px;
  text-decoration: none;
  transition: background 0.2s;
}

.profile-clan:hover {
  background: rgba(255, 255, 255, 0.9);
}

.profile-clan-badge {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
}

.profile-clan-name {
  font-family: ClashBold, sans-serif;
  font-size: 0.95rem;
  color: #0b1a2b;
}

.profile-clan-role {
  font-family: ClashRegular, sans-serif;
  font-size: 0.8rem;
  color: #334155;
  background: rgba(255, 255, 255, 0.55);
  padding: 2px 8px;
  border-radius: 10px;
}

.profile-no-clan {
  display: inline-block;
  font-family: ClashRegular, sans-serif;
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 15px;
}

/* Arena Section */
.profile-arena {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.profile-arena-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.profile-arena-info {
  display: flex;
  flex-direction: column;
}

.profile-arena-name {
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #0b1a2b;
}

.profile-arena-trophies {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: ClashRegular, sans-serif;
  color: #334155;
}

.profile-arena-trophies img {
  width: 18px;
  height: 18px;
}

/* Quick Actions */
.profile-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .profile-actions {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}

.profile-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  font-family: ClashBold, sans-serif;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  min-width: 260px;
  justify-content: center;
}

@media (max-width: 768px) {
  .profile-action-btn {
    min-width: 180px;
    flex: 1 1 180px;
  }
}

.profile-action-btn.primary {
  background: linear-gradient(180deg, #4da8ff 0%, #2d7ed8 100%);
  color: #fff;
}

.profile-action-btn.secondary {
  background: linear-gradient(180deg, #7c4dff 0%, #5c35d8 100%);
  color: #fff;
}

.profile-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.profile-action-btn svg {
  width: 18px;
  height: 18px;
}

.profile-action-icon-img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.28));
}

/* ===== STATS GRID ===== */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

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

.profile-stat-card {
  background: linear-gradient(160deg,#eef5ff 0%,#d2e1f3 100%);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid #b6c9dd;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.16);
}

.profile-stat-card-title {
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #0b1a2b;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-stat-card-title svg {
  width: 20px;
  height: 20px;
}

.profile-stat-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(182, 201, 221, 0.8);
  border-radius: 8px;
}

.profile-stat-label {
  font-family: ClashRegular, sans-serif;
  font-size: 0.9rem;
  color: #334155;
}

.profile-stat-value {
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #0b1a2b;
}

.profile-stat-value.green { color: #4ade80; }
.profile-stat-value.red { color: #f87171; }
.profile-stat-value.gold { color: #f0d78c; }
.profile-stat-value.blue { color: #60a5fa; }
.profile-stat-value.purple { color: #a78bfa; }

/* Win Rate Bar */
.profile-winrate-bar {
  width: 100%;
  height: 12px;
  background: rgba(248, 113, 113, 0.3);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 5px;
}

.profile-winrate-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ===== CURRENT DECK SECTION ===== */
.profile-deck-section {
  background: linear-gradient(160deg,#eef5ff 0%,#d2e1f3 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  border: 2px solid #b6c9dd;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.profile-deck-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .profile-deck-header {
    flex-direction: column;
    gap: 10px;
  }
}

.profile-deck-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.3rem;
  color: #0b1a2b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-deck-title svg {
  width: 24px;
  height: 24px;
}

.profile-deck-elixir {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #d946ef;
}

.profile-deck-elixir-label {
  font-size: 0.8rem;
  color: #c084fc;
  font-family: ClashBold, sans-serif;
}

.profile-deck-elixir img {
  width: 22px;
  height: 22px;
}

.profile-deck-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1.5px solid #b6c9dd;
  border-radius: 8px;
  background: rgba(255,255,255,0.7);
  color: #1e3a5f;
  font-family: ClashBold, sans-serif;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.profile-deck-copy-btn:hover {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}
.profile-deck-copy-btn--done {
  background: #22c55e;
  color: #fff;
  border-color: #22c55e;
}
.profile-deck-copy-btn--done:hover {
  background: #22c55e;
  color: #fff;
}

.profile-deck-cards {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 10px;
}

@media (max-width: 768px) {
  .profile-deck-cards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.profile-deck-card {
  position: relative;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 3/4;
  border: 2px solid transparent;
  transition: transform 0.2s, border-color 0.2s;
}

.profile-deck-card:hover {
  transform: scale(1.05);
  border-color: #f0d78c;
}

.profile-deck-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-deck-card-level {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-family: ClashBold, sans-serif;
  font-size: 0.95rem;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.profile-deck-card.evo-slot {
  border-color: #a855f7;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.5);
}

.profile-deck-card.hero-slot {
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.5);
}

.profile-deck-card-evo-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 13px;
  line-height: 1;
  filter: drop-shadow(0 0 3px rgba(168, 85, 247, 0.9));
}

.profile-deck-card-hero-icon {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 12px;
  line-height: 1;
  filter: drop-shadow(0 0 3px rgba(245, 158, 11, 0.9));
}

/* ===== TOWER CARD ROW ===== */
.profile-tower-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(182, 201, 221, 0.7);
  border-radius: 10px;
}

.profile-tower-label {
  font-family: ClashBold, sans-serif;
  font-size: 0.78rem;
  color: #475569;
  white-space: nowrap;
}

.profile-tower-card-img {
  width: 42px;
  height: 50px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid #c084fc;
  flex-shrink: 0;
}

.profile-tower-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-tower-name {
  font-family: ClashBold, sans-serif;
  font-size: 0.9rem;
  color: #0b1a2b;
}

/* ===== FAVOURITE CARD ===== */
.profile-favourite-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(182, 201, 221, 0.8);
  padding: 15px;
  border-radius: 12px;
  margin-top: 15px;
}

.profile-favourite-image {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid #f0d78c;
}

.profile-favourite-info {
  flex: 1;
}

.profile-favourite-label {
  font-family: ClashRegular, sans-serif;
  font-size: 0.8rem;
  color: #475569;
  margin-bottom: 4px;
}

.profile-favourite-name {
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #0b1a2b;
}

/* ===== BADGES SECTION ===== */
.profile-badges-section {
  background: linear-gradient(160deg,#eef5ff 0%,#d2e1f3 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  border: 2px solid #b6c9dd;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.profile-badges-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-badges-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.3rem;
  color: #0b1a2b;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-badges-title svg {
  width: 24px;
  height: 24px;
}

.profile-badges-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-badge-filter-btn {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(182, 201, 221, 0.9);
  color: #334155;
  padding: 6px 14px;
  border-radius: 20px;
  font-family: ClashRegular, sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-badge-filter-btn:hover,
.profile-badge-filter-btn.active {
  background: rgba(238, 243, 255, 0.95);
  border-color: #8fb1d8;
  color: #0b1a2b;
}

.profile-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 15px;
}

@media (max-width: 480px) {
  .profile-badges-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
  }
}

.profile-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 5px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(182, 201, 221, 0.75);
  border-radius: 10px;
  transition: transform 0.2s, background 0.2s;
  cursor: pointer;
}

.profile-badge:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.95);
}

.profile-badge-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

@media (max-width: 480px) {
  .profile-badge-icon {
    width: 40px;
    height: 40px;
  }
}

.profile-badge-level {
  font-family: ClashBold, sans-serif;
  font-size: 0.75rem;
  color: #0b1a2b;
  background: rgba(238, 243, 255, 0.95);
  border: 1px solid rgba(143, 177, 216, 0.9);
  padding: 2px 8px;
  border-radius: 10px;
}

.profile-badge.max-level .profile-badge-icon {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.6));
}

.profile-badge.max-level .profile-badge-level {
  background: linear-gradient(135deg, #ffd700 0%, #ff8c00 100%);
  color: #1a1a2e;
}

/* Badge Progress Tooltip */
.profile-badge-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #f2f6fb;
  border: 1px solid #b6c9dd;
  border-radius: 8px;
  padding: 10px;
  min-width: 150px;
  text-align: center;
  z-index: 100;
  margin-bottom: 8px;
}

.profile-badge:hover .profile-badge-tooltip {
  display: block;
}

.profile-badge-tooltip-name {
  font-family: ClashBold, sans-serif;
  font-size: 0.85rem;
  color: #0b1a2b;
  margin-bottom: 5px;
}

.profile-badge-tooltip-progress {
  font-family: ClashRegular, sans-serif;
  font-size: 0.75rem;
  color: #475569;
}

/* ===== ACHIEVEMENTS SECTION ===== */
.profile-achievements-section {
  background: linear-gradient(160deg,#eef5ff 0%,#d2e1f3 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  border: 2px solid #b6c9dd;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
}

.profile-achievements-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.3rem;
  color: #0b1a2b;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-achievements-title svg {
  width: 24px;
  height: 24px;
}

.profile-achievements-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-achievement {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(182, 201, 221, 0.75);
  border-radius: 10px;
  transition: background 0.2s;
}

.profile-achievement:hover {
  background: rgba(255, 255, 255, 0.95);
}

.profile-achievement-stars {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.profile-achievement-star {
  width: 18px;
  height: 18px;
  color: #444;
}

.profile-achievement-star.filled {
  color: #ffd700;
}

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

.profile-achievement-name {
  font-family: ClashBold, sans-serif;
  font-size: 0.95rem;
  color: #fff;
  margin-bottom: 4px;
}

.profile-achievement-desc {
  font-family: ClashRegular, sans-serif;
  font-size: 0.8rem;
  color: #888;
}

.profile-achievement-progress {
  flex-shrink: 0;
  text-align: right;
}

.profile-achievement-value {
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #4ade80;
}

.profile-achievement-target {
  font-family: ClashRegular, sans-serif;
  font-size: 0.75rem;
  color: #888;
}

/* Completed achievements */
.profile-achievement.completed {
  border-left: 3px solid #4ade80;
}

/* ===== PATH OF LEGEND SECTION ===== */
.profile-pol-section {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 248, 255, 0.88) 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(20, 25, 40, 0.10);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.profile-pol-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.3rem;
  color: #111827;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-pol-title svg {
  width: 22px;
  height: 22px;
  color: #3b82f6;
}

.profile-pol-seasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
}

.profile-pol-season {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(20, 25, 40, 0.10);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.profile-pol-season-label {
  font-family: ClashRegular, sans-serif;
  font-size: 0.85rem;
  color: rgba(17, 24, 39, 0.70);
  margin-bottom: 10px;
}

.profile-pol-league {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-pol-league-icon {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.profile-pol-league-name {
  font-family: ClashBold, sans-serif;
  font-size: 1rem;
  color: #111827;
}

.profile-pol-trophies {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: ClashRegular, sans-serif;
  font-size: 0.9rem;
  color: rgba(17, 24, 39, 0.70);
}

.profile-pol-trophies img {
  width: 16px;
  height: 16px;
}

/* ===== LEAGUE STATISTICS ===== */
.profile-league-section {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 248, 255, 0.88) 100%);
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(20, 25, 40, 0.10);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.profile-league-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.3rem;
  color: #111827;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-league-seasons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
}

.profile-league-season {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(20, 25, 40, 0.10);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}

.profile-league-season-label {
  font-family: ClashRegular, sans-serif;
  font-size: 0.8rem;
  color: rgba(17, 24, 39, 0.70);
  margin-bottom: 8px;
}

.profile-league-season-id {
  font-family: ClashBold, sans-serif;
  font-size: 0.75rem;
  color: rgba(17, 24, 39, 0.55);
  margin-bottom: 10px;
}

.profile-league-trophies {
  font-family: ClashBold, sans-serif;
  font-size: 1.4rem;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.profile-league-trophies img {
  width: 24px;
  height: 24px;
}

.profile-league-best {
  font-family: ClashRegular, sans-serif;
  font-size: 0.8rem;
  color: #16a34a;
  margin-top: 5px;
}

/* ===== SHOW MORE BUTTON ===== */
.profile-show-more {
  display: flex;
  justify-content: center;
  margin-top: 15px;
}

.profile-show-more-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #aaa;
  padding: 10px 25px;
  border-radius: 25px;
  font-family: ClashRegular, sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-show-more-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 480px) {
  .profile-container {
    padding: 10px;
  }
  
  .profile-header,
  .profile-account-section,
  .profile-match-section,
  .profile-deck-section,
  .profile-badges-section,
  .profile-achievements-section,
  .profile-pol-section,
  .profile-league-section {
    padding: 15px;
    border-radius: 12px;
  }
  
  .profile-stat-card {
    padding: 15px;
  }
  
  .profile-name {
    font-size: 1.4rem;
  }
  
  .profile-level-badge {
    width: 80px;
    height: 80px;
  }
  
  .profile-level-text {
    font-size: 1.5rem;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.profile-header,
.profile-stat-card,
.profile-deck-section,
.profile-badges-section,
.profile-achievements-section,
.profile-account-section,
.profile-match-section,
.profile-pol-section,
.profile-league-section {
  animation: fadeIn 0.5s ease forwards;
}

/* ===== ACCOUNT INFO (YearsPlayed estimate) ===== */
.profile-account-section {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 248, 255, 0.88) 100%);
  border-radius: 16px;
  padding: 22px 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(20, 25, 40, 0.10);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.profile-account-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.2rem;
  color: #111827;
  margin-bottom: 14px;
}

.profile-account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(20, 25, 40, 0.10);
  border-radius: 12px;
  padding: 14px;
}

.profile-account-badge {
  width: 54px;
  height: 54px;
  object-fit: contain;
  flex-shrink: 0;
}

.profile-account-created,
.profile-account-years {
  font-family: ClashRegular, sans-serif;
  color: rgba(17, 24, 39, 0.80);
  line-height: 1.25;
}

.profile-account-created strong,
.profile-account-years strong {
  font-family: ClashBold, sans-serif;
  color: #111827;
}

/* ===== MATCH STATISTICS ===== */
.profile-match-section {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 248, 255, 0.88) 100%);
  border-radius: 16px;
  padding: 22px 25px;
  margin-bottom: 20px;
  border: 1px solid rgba(20, 25, 40, 0.10);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.profile-match-title {
  font-family: ClashBold, sans-serif;
  font-size: 1.2rem;
  color: #111827;
  margin-bottom: 14px;
}

.profile-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.profile-match-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(20, 25, 40, 0.10);
  border-radius: 12px;
  padding: 12px 14px;
}

.profile-match-label {
  font-family: ClashRegular, sans-serif;
  font-size: 0.85rem;
  color: rgba(17, 24, 39, 0.70);
  margin-bottom: 6px;
}

.profile-match-value {
  font-family: ClashBold, sans-serif;
  font-size: 1.05rem;
  color: #111827;
}

/* ===== LEAGUE SUMMARY ===== */
.profile-league-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.profile-league-summary-item {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(20, 25, 40, 0.10);
  border-radius: 12px;
  padding: 12px 14px;
}

.profile-league-summary-label {
  font-family: ClashRegular, sans-serif;
  font-size: 0.85rem;
  color: rgba(17, 24, 39, 0.70);
  margin-bottom: 6px;
}

.profile-league-summary-value {
  font-family: ClashBold, sans-serif;
  font-size: 1.05rem;
  color: #111827;
}

.profile-league-summary-trophy-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-league-trophy-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.profile-stat-card:nth-child(1) { animation-delay: 0.1s; }
.profile-stat-card:nth-child(2) { animation-delay: 0.15s; }
.profile-stat-card:nth-child(3) { animation-delay: 0.2s; }
.profile-stat-card:nth-child(4) { animation-delay: 0.25s; }

/* ===== CLAN BADGE ICONS (using local badge IDs) ===== */
/* Clan badges are loaded from /assets/images/clanwebpicons */

/* ===== PROFILE SEARCH PAGE ===== */
.profile-search-page {
  max-width: 520px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  width: 100%;
  box-sizing: border-box;
}

.profile-search-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  width: 100%;
  max-width: 100%;
}

.profile-search-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #1e88e5, #1565c0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(21, 101, 192, 0.4);
  margin-bottom: 4px;
}
.profile-search-icon svg {
  width: 36px;
  height: 36px;
  fill: #fff;
}

.profile-search-title {
  font-family: ClashBold, Arial, sans-serif;
  font-size: 2rem;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.35);
}

.profile-search-subtitle {
  font-family: ClashRegular, Arial, sans-serif;
  font-size: 1rem;
  color: rgba(255,255,255,0.85);
  margin: 0;
}

/* Saved account shortcut */
.profile-search-saved {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-search-saved-label {
  font-family: ClashBold, Arial, sans-serif;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.8);
  padding: 0 4px;
}

.profile-search-saved-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border: 2px solid #d1e4f7;
  border-radius: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(0,0,0,0.07);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.profile-search-saved-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21, 101, 192, 0.15);
  border-color: #1e88e5;
}

.profile-search-saved-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #1e88e5, #1565c0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-search-saved-avatar svg {
  width: 24px;
  height: 24px;
  fill: #fff;
}

.profile-search-saved-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.profile-search-saved-name {
  font-family: ClashBold, Arial, sans-serif;
  font-size: 1rem;
  color: #0b1a2b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-search-saved-tag {
  font-family: ClashRegular, Arial, sans-serif;
  font-size: 0.8rem;
  color: #778;
}

.profile-search-saved-arrow {
  width: 22px;
  height: 22px;
  fill: #1e88e5;
  flex-shrink: 0;
}

/* Search box */
.profile-search-box-wrap {
  width: 100%;
  position: relative;
}

.profile-search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 2px solid #d1e4f7;
  border-radius: 50px;
  padding: 8px 8px 8px 18px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.09);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.profile-search-box:focus-within {
  border-color: #1e88e5;
  box-shadow: 0 4px 24px rgba(30, 136, 229, 0.2);
}

.profile-search-box-icon {
  width: 20px;
  height: 20px;
  color: #aab;
  flex-shrink: 0;
}

.profile-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: ClashRegular, Arial, sans-serif;
  font-size: 1rem;
  color: #0b1a2b;
  background: transparent;
  min-width: 0;
}
.profile-search-input::placeholder { color: #aab; }

.profile-search-go-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1e88e5, #1565c0);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.35);
}
.profile-search-go-btn:hover { transform: scale(1.06); }
.profile-search-go-btn svg { width: 22px; height: 22px; }

/* Autocomplete dropdown */
.profile-suggest-box {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid #d1e4f7;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  z-index: 200;
  max-height: 280px;
  overflow: auto;
}
.profile-suggest-list { list-style: none; margin: 6px 0; padding: 0; }
.profile-suggest-item { margin: 0; padding: 0; }
.profile-suggest-item button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 18px;
  font-family: ClashRegular, Arial, sans-serif;
  font-size: 0.95rem;
  color: #0b1a2b;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.12s;
}
.profile-suggest-item button:hover { background: #f0f7ff; }
.profile-suggest-item.is-active button { background: #e3f0fd; }
.profile-sg-name { font-family: ClashBold, Arial, sans-serif; font-weight: 600; flex: 1; }
.profile-sg-clan { color: #667; font-size: 0.83rem; font-style: italic; }
.profile-sg-tag { color: #99a; font-size: 0.8rem; margin-left: auto; }
.profile-suggest-empty { padding: 14px 18px; color: #aab; font-size: 0.9rem; font-family: ClashRegular, Arial, sans-serif; }

/* ===== PROFILE BACK BUTTON ===== */
.profile-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.85);
  border: 1.5px solid #d1e4f7;
  border-radius: 50px;
  padding: 8px 16px 8px 10px;
  font-family: ClashBold, Arial, sans-serif;
  font-size: 0.9rem;
  color: #1565c0;
  text-decoration: none;
  margin-bottom: 14px;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
  backdrop-filter: blur(4px);
  align-self: flex-start;
}
.profile-back-btn svg { width: 20px; height: 20px; }
.profile-back-btn:hover {
  background: #fff;
  transform: translateX(-2px);
  box-shadow: 0 4px 16px rgba(21, 101, 192, 0.18);
}

/* Mobile adjustments */
@media (max-width: 900px) {
  .profile-container {
    padding: 12px 12px;
  }

  .profile-search-page {
    padding: 24px 12px 40px;
    gap: 20px;
  }
  .profile-search-title { font-size: 1.5rem; }
  .profile-search-icon { width: 58px; height: 58px; }
  .profile-search-icon svg { width: 28px; height: 28px; }
}

/* Quick link cards */
.profile-search-quick-links {
  width: 100%;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.profile-quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #0b1a2b;
  background: #fff;
  border: 1.5px solid #e0eaf5;
  border-radius: 14px;
  padding: 16px 10px 12px;
  flex: 1;
  max-width: 140px;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.profile-quick-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  border-color: #1e88e5;
}

.profile-quick-link-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.profile-quick-link-icon svg {
  width: 22px;
  height: 22px;
}

.profile-quick-link span {
  font-family: ClashBold, Arial, sans-serif;
  font-size: 0.8rem;
  color: #334;
}

/* Tips section */
.profile-search-tips {
  width: 100%;
  background: #f0f7ff;
  border: 1.5px solid #d1e4f7;
  border-radius: 14px;
  padding: 16px 18px;
}

.profile-search-tips-title {
  font-family: ClashBold, Arial, sans-serif;
  font-size: 0.85rem;
  color: #1565c0;
  margin-bottom: 6px;
}

.profile-search-tips p {
  font-family: ClashRegular, Arial, sans-serif;
  font-size: 0.85rem;
  color: #556;
  margin: 0;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .profile-search-quick-links { gap: 8px; }
  .profile-quick-link { padding: 12px 8px 10px; }
  .profile-quick-link-icon { width: 38px; height: 38px; }
  .profile-quick-link-icon svg { width: 18px; height: 18px; }
  .profile-quick-link span { font-size: 0.72rem; }
}
