.mode-selector {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}

.mode-selector button {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 12px;
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.mode-selector button > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--gold);
  font-weight: 900;
}

.mode-selector button strong {
  font-size: 1.05rem;
}

.mode-selector button small {
  color: var(--muted);
}

.mode-selector button:hover,
.mode-selector button:focus-visible,
.mode-selector button.is-active {
  border-color: rgba(240, 75, 55, 0.48);
  background:
    linear-gradient(135deg, rgba(240, 75, 55, 0.16), transparent 44%),
    var(--panel-strong);
}

.mode-class-content {
  min-height: 420px;
}

.mode-kit-grid,
.mode-profession-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mode-kit-card,
.mode-profession-card {
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(240, 75, 55, 0.08), transparent 34%),
    var(--panel);
}

.mode-kit-card h3,
.mode-profession-card h3,
.mode-kit-card p,
.mode-profession-card p {
  margin: 0;
}

.mode-kit-card header,
.mode-profession-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.mode-kit-card header span,
.mode-profession-card header span {
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 800;
}

.mode-kit-attributes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.mode-kit-attributes span {
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
  font-size: 0.82rem;
}

.mode-kit-equipment {
  margin-top: 14px !important;
  color: var(--text-soft);
  line-height: 1.65;
}

.mode-profession-card > p {
  margin-top: 12px;
  color: var(--text-soft);
  line-height: 1.7;
}

.round-profession-browser {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.profession-directory,
.profession-preview {
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(240, 75, 55, 0.1), transparent 36%),
    var(--panel);
  box-shadow: var(--shadow-soft);
}

.profession-directory {
  position: sticky;
  top: 16px;
  max-height: min(72vh, 720px);
  overflow: auto;
  padding: 16px;
}

.directory-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--panel-border);
}

.directory-head strong {
  font-size: 1.02rem;
}

.directory-head span {
  color: var(--gold);
  font-size: 0.84rem;
  font-weight: 800;
}

.directory-group {
  margin-top: 10px;
}

.directory-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.directory-toggle:hover,
.directory-toggle:focus-visible,
.directory-group.is-open .directory-toggle {
  border-color: rgba(230, 179, 94, 0.48);
  background: rgba(230, 179, 94, 0.08);
}

.directory-toggle span {
  font-weight: 900;
}

.directory-toggle small {
  color: var(--muted);
}

.directory-toggle i {
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.directory-group.is-open .directory-toggle i {
  transform: rotate(225deg);
}

.directory-options {
  display: grid;
  gap: 8px;
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  opacity: 0;
  transition:
    max-height 220ms ease,
    opacity 160ms ease,
    padding-top 160ms ease;
}

.directory-group.is-open .directory-options {
  max-height: min(46vh, 430px);
  overflow: auto;
  padding-top: 9px;
  opacity: 1;
}

.profession-option {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.profession-option:hover,
.profession-option:focus-visible,
.profession-option.is-active {
  border-color: rgba(240, 75, 55, 0.52);
  background: rgba(240, 75, 55, 0.14);
}

.profession-option span {
  font-weight: 850;
}

.profession-option small {
  color: var(--text-soft);
  line-height: 1.35;
}

.profession-preview {
  min-height: 520px;
  max-height: min(72vh, 720px);
  overflow-y: auto;
  padding: clamp(22px, 3vw, 34px);
}

.profession-preview h3,
.profession-preview p {
  margin: 0;
}

.profession-preview h3 {
  margin-top: 8px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.95;
}

.profession-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.profession-meta span {
  padding: 9px 11px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.profession-description {
  margin-top: 28px !important;
  max-width: 760px;
  color: var(--text);
  font-size: clamp(1.05rem, 1.4vw, 1.25rem);
  line-height: 1.85;
}

.profession-stat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.profession-stat-list span {
  padding: 8px 10px;
  border: 1px solid rgba(230, 179, 94, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(230, 179, 94, 0.07);
  color: var(--gold);
  font-size: 0.86rem;
  font-weight: 800;
}

.profession-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-border);
}

.profession-section h4 {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.profession-section ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  margin: 0;
  padding-left: 18px;
}

.profession-section li,
.profession-skill p {
  color: var(--text-soft);
  line-height: 1.65;
}

.profession-skill {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.profession-skill:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.profession-skill strong {
  color: var(--gold);
}

.profession-skill p {
  margin-top: 5px;
}

.fun-class-section {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.025);
}

.fun-class-section:first-child {
  margin-top: 0;
}

.fun-class-section header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.fun-class-section h3,
.fun-class-section p {
  margin: 0;
}

.fun-class-section header p {
  margin-top: 7px;
  color: var(--text-soft);
}

@media (max-width: 860px) {
  .mode-selector,
  .mode-kit-grid,
  .mode-profession-grid {
    grid-template-columns: 1fr;
  }

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

  .profession-directory {
    position: static;
    max-height: none;
  }

  .directory-group.is-open .directory-options {
    max-height: 360px;
  }

  .profession-preview {
    min-height: auto;
    max-height: none;
  }

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