:root {
  color-scheme: dark;
  --bg: #091318;
  --panel: rgba(17, 29, 35, 0.84);
  --panel-strong: rgba(12, 22, 27, 0.92);
  --border: rgba(242, 208, 141, 0.26);
  --border-strong: rgba(242, 208, 141, 0.45);
  --text: #f9f0df;
  --muted: #b8c6c8;
  --gold: #f0c977;
  --gold-soft: #d7a64a;
  --teal: #65cfc8;
  --red: #ff6d63;
  --orange: #ffab54;
  --ss: #f6db85;
  --s: #95dcb0;
  --a: #78d5e1;
  --b: #a7a7ff;
  --c: #c49fe8;
  --d: #c88d6d;
  --f: #ac5a57;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(101, 207, 200, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(240, 201, 119, 0.12), transparent 28%),
    linear-gradient(180deg, #081116 0%, #0c171d 100%);
  color: var(--text);
  font-family: "Trebuchet MS", "Gill Sans", sans-serif;
}

body {
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
}

.scene-glow {
  position: fixed;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.24;
  pointer-events: none;
}

.scene-glow-left {
  top: 20px;
  left: -80px;
  background: #3ba6a0;
}

.scene-glow-right {
  top: 180px;
  right: -60px;
  background: #b88429;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 20px 14px 40px;
}

.app-frame {
  display: grid;
  gap: 18px;
}

.top-menu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(10, 19, 23, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.top-menu__item,
.wiki-card,
.back-button {
  border: 0;
  cursor: pointer;
}

.top-menu__item {
  min-height: 44px;
  border-radius: 16px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.top-menu__item.is-active {
  background: linear-gradient(135deg, rgba(240, 201, 119, 0.18), rgba(101, 207, 200, 0.2));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 119, 0.22);
}

.back-button {
  justify-self: start;
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(240, 201, 119, 0.12);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 119, 0.2);
}

.hero-banner,
.section-block,
.detail-card,
.note-banner,
.legend-block {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-banner {
  padding: 26px;
  background:
    linear-gradient(140deg, rgba(240, 201, 119, 0.09), rgba(101, 207, 200, 0.08)),
    var(--panel);
}

.hero-banner--logo {
  display: grid;
  place-items: center;
  padding: 18px 18px 10px;
  background:
    radial-gradient(circle at top center, rgba(240, 201, 119, 0.12), transparent 55%),
    linear-gradient(180deg, rgba(8, 17, 22, 0.86), rgba(8, 17, 22, 0.24)),
    transparent;
  box-shadow: none;
}

.hero-banner__logo {
  display: block;
  width: min(100%, 760px);
  height: auto;
  filter: drop-shadow(0 22px 35px rgba(0, 0, 0, 0.38));
}

.hero-banner__eyebrow,
.wiki-card__eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 201, 119, 0.14);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-banner__title,
.section-block__header h1,
.section-block__header h2,
.detail-card h2 {
  margin: 14px 0 10px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-weight: 700;
  line-height: 1.08;
}

.hero-banner__title {
  font-size: clamp(30px, 7vw, 46px);
}

.hero-banner__text,
.section-block__header p,
.wiki-card__text,
.detail-card p,
.detail-card__placeholder,
.legend-item__text,
.stat-row__value,
.skill-item__text,
.skill-note {
  color: var(--muted);
  line-height: 1.6;
}

.section-block,
.legend-block,
.detail-card {
  padding: 22px;
}

.section-block__header {
  margin-bottom: 18px;
}

.section-block__header h1,
.section-block__header h2 {
  margin-bottom: 0;
}

.section-block__header--centered {
  display: grid;
  justify-items: center;
  text-align: center;
}

.card-grid,
.triple-grid {
  display: grid;
  gap: 14px;
}

.card-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.triple-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 18px;
}

.home-link-list {
  display: grid;
  gap: 10px;
}

.home-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.home-link:last-child {
  border-bottom: 0;
}

.home-link__main {
  display: grid;
  gap: 4px;
}

.home-link__title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.2;
}

.home-link__text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.home-link__arrow {
  color: var(--muted);
  font-size: 28px;
  line-height: 1;
}

.wiki-card {
  display: grid;
  gap: 10px;
  align-content: start;
  text-align: left;
  padding: 16px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--panel-strong);
  box-shadow: inset 0 0 0 1px var(--border);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wiki-card:active {
  transform: scale(0.99);
}

.wiki-card:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px var(--border-strong), 0 18px 30px rgba(0, 0, 0, 0.2);
}

.wiki-card--static {
  cursor: default;
}

.wiki-card__art {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 20px;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.06);
}

.wiki-card__art--compact {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.wiki-card__title {
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 25px;
  font-weight: 700;
}

.note-banner {
  margin-bottom: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(101, 207, 200, 0.12), rgba(240, 201, 119, 0.12));
  color: var(--text);
}

.toolbar,
.filter-group,
.quick-rank-grid,
.detail-meta-grid {
  display: grid;
  gap: 12px;
}

.toolbar {
  margin-bottom: 16px;
}

.quick-rank-item__label,
.search-box__label,
.detail-meta-item span {
  color: var(--muted);
  font-size: 13px;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-form {
  display: grid;
  gap: 10px;
}

.search-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.search-box__input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid rgba(240, 201, 119, 0.18);
  border-radius: 16px;
  background: rgba(12, 22, 27, 0.88);
  color: var(--text);
  font: inherit;
}

.search-box__input::placeholder {
  color: #7f9799;
}

.filter-group {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.filter-chip {
  min-height: 42px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.filter-chip.is-active {
  background: linear-gradient(135deg, rgba(240, 201, 119, 0.16), rgba(101, 207, 200, 0.18));
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 119, 0.22);
}

.inline-note {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
}

.legend-list {
  display: grid;
  gap: 12px;
}

.legend-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tier-board {
  display: grid;
  gap: 12px;
}

.tier-board--dense .tier-row {
  gap: 14px;
}

.tier-row {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tier-badge {
  display: grid;
  place-items: center;
  width: 56px;
  min-height: 56px;
  border-radius: 18px;
  font-weight: 800;
  color: #0f171b;
}

.tier-ss {
  background: var(--ss);
}

.tier-s {
  background: var(--s);
}

.tier-a {
  background: var(--a);
}

.tier-b {
  background: var(--b);
}

.tier-c {
  background: var(--c);
}

.tier-d {
  background: var(--d);
}

.tier-f {
  background: var(--f);
  color: #fff2e9;
}

.tier-row__content {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(240, 201, 119, 0.1);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 119, 0.16);
}

.tier-hero-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tier-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.tier-hero-chip__icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
}

.detail-card {
  display: grid;
  gap: 14px;
}

.detail-card--centered {
  justify-items: center;
  text-align: center;
}

.detail-card__image {
  width: min(260px, 100%);
  border-radius: 26px;
  object-fit: cover;
}

.detail-card__image--hero {
  width: min(280px, 100%);
}

.detail-card__image--profession {
  width: min(96px, 100%);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
}

.detail-card__image--boss {
  box-shadow: inset 0 0 0 1px rgba(240, 201, 119, 0.18), 0 12px 24px rgba(0, 0, 0, 0.28);
}

.detail-meta-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.detail-meta-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.detail-meta-item strong {
  font-size: 18px;
}

.quick-rank-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-rank-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.tier-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 70px;
  min-height: 38px;
  margin-top: 10px;
  padding: 0 12px;
  border-radius: 999px;
  color: #0f171b;
  font-weight: 800;
}

.stats-list,
.skill-list {
  display: grid;
  gap: 12px;
}

.stat-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.stat-row__label,
.skill-heading {
  color: var(--text);
  font-weight: 700;
}

.skill-heading {
  font-size: 22px;
  font-family: Georgia, "Palatino Linotype", serif;
}

.class-tree-grid,
.class-stage-grid {
  display: grid;
  gap: 16px;
}

.class-stage-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.class-branch__header {
  display: grid;
  gap: 12px;
}

.class-branch__focus {
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
}

.class-stage-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.class-stage-card__top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.class-stage-card__icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
  flex-shrink: 0;
}

.class-stage-card__heading {
  display: grid;
  gap: 4px;
}

.class-stage-card__heading h3 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 24px;
  line-height: 1.1;
}

.class-stage-card__tier,
.class-stage-card__official {
  color: var(--muted);
  font-size: 13px;
}

.stat-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-chip {
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(240, 201, 119, 0.1);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(240, 201, 119, 0.16);
  font-size: 14px;
}

.stats-overview-grid,
.stats-anchor-grid,
.stats-card-grid,
.stats-section-list {
  display: grid;
  gap: 16px;
}

.stats-overview-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.stats-overview-card {
  padding: 18px;
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  box-shadow:
    inset 0 0 0 1px rgba(240, 201, 119, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.stats-overview-card h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 24px;
  line-height: 1.08;
}

.stats-overview-card p {
  margin: 0;
  color: var(--muted);
}

.stats-overview-card__kicker {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 201, 119, 0.12);
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-anchor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.stats-anchor-card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.stats-anchor-card:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.045);
  box-shadow:
    inset 0 0 0 1px rgba(240, 201, 119, 0.18),
    0 8px 22px rgba(0, 0, 0, 0.16);
}

.stats-anchor-card span {
  font-size: 20px;
  font-weight: 700;
  font-family: Georgia, "Palatino Linotype", serif;
}

.stats-anchor-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stats-section {
  display: grid;
  gap: 16px;
}

.stats-section__header {
  display: grid;
  gap: 6px;
}

.stats-section__header h2 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 34px;
  line-height: 1.02;
}

.stats-section__header p {
  margin: 0;
  color: var(--muted);
}

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

.stat-info-card {
  display: grid;
  gap: 14px;
}

.stat-info-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.stat-info-card__heading {
  display: grid;
  gap: 6px;
}

.stat-info-card__heading h3 {
  margin: 0;
  font-family: Georgia, "Palatino Linotype", serif;
  font-size: 28px;
  line-height: 1.02;
}

.stat-formula-flag {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(112, 199, 255, 0.12);
  color: #7bc8ff;
  box-shadow: inset 0 0 0 1px rgba(112, 199, 255, 0.18);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.skill-item {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.skill-item__stars {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 20px;
  letter-spacing: 0.08em;
}

.accent-red {
  color: var(--red);
  font-weight: 700;
}

.accent-orange {
  color: var(--orange);
  font-weight: 700;
}

.accent-blue {
  color: #70c7ff;
  font-weight: 700;
}

.accent-green {
  color: #7edda2;
  font-weight: 700;
}

@media (max-width: 640px) {
  .app-shell {
    padding: 14px 10px 32px;
  }

  .top-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-row,
  .legend-item,
  .tier-row {
    grid-template-columns: 1fr;
  }

  .quick-rank-grid {
    grid-template-columns: 1fr;
  }

  .stats-overview-grid,
  .stats-anchor-grid,
  .stats-card-grid {
    grid-template-columns: 1fr;
  }

  .stats-section__header h2 {
    font-size: 28px;
  }

  .stat-info-card__top {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-info-card__heading h3 {
    font-size: 24px;
  }

  .tier-badge {
    width: 100%;
  }

  .hero-banner--logo {
    padding: 12px 8px 6px;
  }
}
