:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #eef2ff;
  background: #0b1020;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 5%, rgba(64, 87, 150, .26), transparent 30rem),
    radial-gradient(circle at 95% 96%, rgba(21, 117, 119, .2), transparent 28rem),
    #0b1020;
}

button { font: inherit; touch-action: manipulation; }
button:focus-visible { outline: 3px solid #c6d7ff; outline-offset: 4px; }

.app {
  width: min(100%, 1060px);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 58px) 18px;
}

.view { animation: arrive .24s ease-out; }
.hidden { display: none; }

.home-view {
  display: grid;
  min-height: calc(100vh - 116px);
  align-content: center;
  justify-items: start;
  gap: 20px;
}

.eyebrow {
  margin: 0;
  color: #8aa6e9;
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .16em;
}

h1, h2, p { margin-top: 0; }
h1 {
  margin-bottom: 0;
  color: #f7f9ff;
  font-size: clamp(3rem, 13vw, 7rem);
  font-weight: 950;
  letter-spacing: -.07em;
  line-height: .83;
}

.home-actions { margin-top: 12px; }
.nav-button, .back-button {
  border: 1px solid #6075ad;
  border-radius: 12px;
  color: #eff4ff;
  background: rgba(27, 40, 77, .7);
  font-weight: 850;
  cursor: pointer;
}
.nav-button {
  min-width: 214px;
  padding: 14px 17px;
  box-shadow: 0 5px 0 #26385f;
  text-align: left;
}
.nav-button span { float: right; color: #b8dcff; font-size: 1.25rem; line-height: .8; }
.nav-button:hover { border-color: #c6d7ff; background: #314a88; transform: translateY(-2px); }
.nav-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #26385f; }

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}
.section-header h1 { margin-top: 8px; font-size: clamp(2.6rem, 10vw, 5.6rem); }
.back-button { padding: 10px 13px; white-space: nowrap; }
.back-button:hover { border-color: #c6d7ff; background: #314a88; }

.intro {
  max-width: 650px;
  margin-bottom: 30px;
  color: #b9c3dc;
  font-size: 1.04rem;
  line-height: 1.55;
}

.character-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.character-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(18, 27, 51, .9);
  box-shadow: 0 15px 35px rgba(0,0,0,.2);
}
.portrait {
  position: relative;
  display: grid;
  min-height: 220px;
  place-items: center;
  overflow: hidden;
  color: var(--accent);
  background: var(--portrait);
}
.portrait::before, .portrait::after { position: absolute; content: ""; }
.portrait::before {
  width: 175px;
  height: 175px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: .45;
}
.portrait::after {
  width: 105px;
  height: 105px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
  opacity: .3;
}
.portrait-symbol { z-index: 1; font-size: 5.8rem; font-weight: 100; line-height: 1; text-shadow: 0 0 30px currentColor; }
.portrait-name { position: absolute; z-index: 1; bottom: 18px; left: 18px; right: 18px; color: #fff; font-size: .68rem; font-weight: 950; letter-spacing: .12em; text-align: center; }

.character-info { padding: 20px; }
.role { margin-bottom: 7px; color: var(--accent); font-size: .7rem; font-weight: 950; letter-spacing: .12em; }
.character-info h2 { margin-bottom: 10px; color: #f4f7ff; font-size: 1.55rem; line-height: 1; }
.character-info > p:not(.role) { min-height: 66px; margin-bottom: 18px; color: #bbc5da; font-size: .93rem; line-height: 1.45; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; }
.stats div { padding-top: 9px; border-top: 1px solid rgba(255,255,255,.13); }
.stats dt { color: #8995b0; font-size: .67rem; font-weight: 800; }
.stats dd { margin: 2px 0 0; color: #fff; font-size: 1.12rem; font-weight: 950; }

.wizard { --accent: #ba9cf3; --line: #5f488a; --portrait: radial-gradient(circle at 50% 34%, #4a3474, #20172f 71%); }
.white-dragon { --accent: #dcecff; --line: #63778e; --portrait: radial-gradient(circle at 50% 34%, #6f9dc5, #202f4a 71%); }
.black-dragon { --accent: #ec9aab; --line: #774151; --portrait: radial-gradient(circle at 50% 34%, #632c45, #24101d 71%); }

@keyframes arrive { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 760px) {
  .character-grid { grid-template-columns: 1fr; }
  .portrait { min-height: 190px; }
  .character-info > p:not(.role) { min-height: auto; }
}

@media (max-width: 450px) {
  .section-header { align-items: start; flex-direction: column-reverse; }
  .section-header h1 { font-size: 3.4rem; }
}
