.competences-hero {
  padding-bottom: 28px;
}

.competences-hero h1 {
  margin-bottom: 16px;
}

.competences-hero .stats {
  margin-top: 24px;
}

.competences-catalog {
  padding-top: 28px;
}

.competences-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.competences-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(135deg, #14243a, #0d192a);
  color: #a9b8cb;
  font: 800 15px inherit;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.competences-category:hover {
  transform: translateY(-2px);
  border-color: #3b7895;
  color: var(--text);
}

.competences-category.is-active {
  border-color: var(--cyan);
  background: linear-gradient(135deg, #103041, #0c1a2b);
  color: var(--cyan);
  box-shadow: 0 0 0 1px #44d9e855, 0 10px 26px #02091655;
}

.competences-category.is-active .tab-count {
  background: #0b3b47;
  color: var(--cyan);
}

.competences-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  margin-bottom: 18px;
  background: #0a1525;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.competences-tab {
  --accent: var(--cyan);
  display: inline-flex;
  flex: 1 1 160px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #a9b8cb;
  font: 700 13px inherit;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.competences-tab::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.85;
}

.competences-tab:hover {
  color: var(--text);
  background: #102238;
}

.competences-tab.is-active {
  color: #06121e;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 24px #02091655;
}

.competences-tab.is-active::before {
  background: #06121e;
  box-shadow: none;
}

.competences-tab[data-group="ATK"],
.competences-detail[data-group="ATK"] {
  --accent: #ff7a59;
}

.competences-tab[data-group="DEF"],
.competences-detail[data-group="DEF"] {
  --accent: #ffd166;
}

.competences-tab[data-group="MIX"],
.competences-detail[data-group="MIX"] {
  --accent: #5cc8ff;
}

.competences-tab[data-group="OFFRE"],
.competences-detail[data-group="OFFRE"] {
  --accent: #b388ff;
}

.tab-count {
  padding: 2px 7px;
  border-radius: 999px;
  background: #13243a;
  color: #a9b8cb;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
}

.competences-tab.is-active .tab-count {
  background: #06121e2e;
  color: #06121e;
}

.competences-toolbar {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.competences-toolbar .search {
  flex: 1 1 320px;
  max-width: none;
}

.search-glyph {
  position: relative;
  width: 15px;
  height: 15px;
  flex: none;
  border: 2px solid var(--cyan);
  border-radius: 50%;
  opacity: 0.85;
}

.search-glyph::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--cyan);
  transform: rotate(45deg);
}

.competences-sort {
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.competences-sort select {
  min-width: 180px;
  padding: 11px 34px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  font: 600 12px "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}

.competences-sort select:focus {
  outline: 0;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px #44d9e81c;
}

.competences-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 470px);
  gap: 18px;
  align-items: start;
}

.competences-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 10px;
  align-content: start;
}

.skill-card {
  --accent: var(--cyan);
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(135deg, #14243a, #0d192a);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.skill-card[data-group="ATK"] {
  --accent: #ff7a59;
}

.skill-card[data-group="DEF"] {
  --accent: #ffd166;
}

.skill-card[data-group="MIX"] {
  --accent: #5cc8ff;
}

.skill-card[data-group="OFFRE"] {
  --accent: #b388ff;
}

.skill-card:hover {
  transform: translateY(-2px);
  border-color: #3b7895;
  box-shadow: 0 8px 22px #02091666;
}

.skill-card.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, #17314d, #0d192a);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 24px #02091666;
}

.skill-card-visual {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  overflow: hidden;
  border: 1px solid #2b4560;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 22%, #24405d, #0b1524 72%);
}

.skill-card-visual img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.skill-card-name {
  display: -webkit-box;
  overflow: hidden;
  color: #eef5ff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.skill-vip {
  display: inline-block;
  flex: none;
  padding: 1px 6px;
  border: 1px solid #6f5720;
  border-radius: 999px;
  background: #2a2110;
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.competences-detail {
  --accent: var(--cyan);
  position: sticky;
  top: 94px;
  min-height: 340px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, #14243a, #0b1626);
}

.competences-detail.is-empty {
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--muted);
}

.competences-detail.is-empty h2 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 18px;
}

.competences-detail.is-empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.empty-emblem {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
  border: 1px solid #2c4963;
  border-radius: 18px;
  background: #0a1422;
  color: var(--cyan);
  font-size: 20px;
}

.skill-detail-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.skill-detail-icon-wrap {
  display: grid;
  place-items: center;
  flex: none;
  width: 92px;
  height: 92px;
  border: 1px solid var(--accent);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 24%, #264765, #0a1422 72%);
  box-shadow: inset 0 0 28px #44d9e81a, 0 0 24px #44d9e80f;
}

.skill-detail-icon {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.skill-detail-heading {
  min-width: 0;
}

.skill-group-chip {
  display: inline-flex;
  padding: 3px 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.skill-detail-heading h2 {
  margin: 8px 0 8px;
  color: var(--text);
  font-size: 23px;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.skill-detail-officer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #a9b8cb;
  font-size: 12px;
}

.skill-detail-officer img {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid #2c4963;
  border-radius: 9px;
  object-fit: cover;
  background: #26354a;
}

.skill-detail-officer span:not(.skill-vip) {
  min-width: 0;
}

.skill-detail-officer strong {
  display: block;
  overflow: hidden;
  color: #eef5ff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-detail-officer small {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.skill-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.skill-facts div {
  padding: 9px 10px;
  border: 1px solid #20334b;
  border-radius: 9px;
  background: #0a1422;
}

.skill-facts span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.skill-facts strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.skill-detail-section {
  margin-top: 16px;
}

.skill-detail-section h3 {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.skill-detail-section p {
  margin: 0;
  color: #c3cede;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
}

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

.level-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  padding: 8px 10px;
  border: 1px solid #243752;
  border-radius: 8px;
  background: #0a1422;
  color: #c3cede;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.level-title {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-values {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.level-value {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.level-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.25;
  white-space: normal;
}

.level-value strong {
  flex: none;
  color: var(--text);
  font-size: 12px;
}

.level-chip:hover,
.level-chip.is-active {
  border-color: var(--accent);
  background: #10243a;
}

.level-chip.is-active .level-value strong {
  color: var(--accent);
}

.effect-value {
  color: var(--accent);
  font-weight: 800;
}

.competences-empty {
  grid-column: 1 / -1;
  padding: 32px 20px;
  border: 1px dashed #2c4963;
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.competences-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
}

@media (max-width: 900px) {
  .competences-page .topbar {
    height: auto;
    min-height: 60px;
    padding: 10px clamp(18px, 5vw, 72px);
    flex-wrap: wrap;
    gap: 6px;
  }

  .competences-page .nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .competences-page .nav::-webkit-scrollbar {
    display: none;
  }

  .competences-page .nav a {
    flex: none;
    padding: 7px 11px;
    font-size: 12px;
    white-space: nowrap;
  }

  .competences-layout {
    grid-template-columns: 1fr;
  }

  .competences-detail {
    position: static;
    grid-row: 1;
    min-height: 0;
  }
}

@media (max-width: 600px) {
  .competences-categories {
    gap: 5px;
  }

  .competences-category {
    min-height: 48px;
    padding: 10px 9px;
    font-size: 12px;
  }

  .competences-category .tab-count {
    padding: 2px 6px;
    font-size: 9px;
  }

  .competences-tabs {
    gap: 5px;
    padding: 5px;
  }

  .competences-tab {
    flex: 1 1 calc(50% - 5px);
    min-height: 42px;
    padding: 9px 10px;
  }

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

  .competences-sort {
    width: 100%;
  }

  .competences-sort select {
    width: 100%;
  }

  .skill-detail-hero {
    align-items: flex-start;
  }

  .skill-detail-icon-wrap {
    width: 76px;
    height: 76px;
    border-radius: 15px;
  }

  .skill-detail-icon {
    width: 60px;
    height: 60px;
  }

  .skill-detail-heading h2 {
    font-size: 20px;
  }
}
