:root {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-strong: #f1f5f9;
  --text: #111827;
  --muted: #6b7280;
  --line: #dfe7f0;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff6ff;
  --bad: #dc2626;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(37, 99, 235, 0.12), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(14, 165, 233, 0.12), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 40px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 18px;
  border: 1px solid rgba(223, 231, 240, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  padding: 18px 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 32px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

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

.character-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.character-hero {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(255, 255, 255, 0.96) 45%, rgba(241, 245, 249, 0.9));
}

.portrait-frame {
  display: grid;
  place-items: end center;
  min-height: 178px;
  border: 1px solid rgba(219, 234, 254, 0.9);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f1f7ff);
  box-shadow: inset 0 1px 0 #fff, 0 10px 26px rgba(37, 99, 235, 0.08);
}

.character-image {
  width: 178px;
  height: 178px;
  object-fit: contain;
  align-self: end;
  filter: drop-shadow(0 12px 14px rgba(15, 23, 42, 0.08));
}

.character-title {
  min-width: 0;
  align-self: center;
}

.character-title h3 {
  margin-bottom: 8px;
  font-size: 23px;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.level-panel {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 6px 11px;
}

.level-panel span {
  font-size: 12px;
  font-weight: 800;
}

.level-panel strong {
  font-size: 15px;
  line-height: 1;
}

.shortcut-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.shortcut-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  padding: 0 14px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.08);
  transition: 0.16s ease;
}

.shortcut-button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.card-body {
  padding: 14px 18px 18px;
}

.exp-block {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  padding: 12px 14px;
}

.exp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.exp-content {
  min-width: 0;
}

.exp-head strong {
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.progress {
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-strong);
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #38bdf8, #2563eb);
}

.error {
  border: 1px dashed #fecaca;
  border-radius: 8px;
  padding: 16px;
  color: var(--bad);
  background: #fff5f5;
}

.skeleton {
  display: grid;
  grid-template-columns: 178px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 20px;
}

.skeleton .avatar,
.skeleton .line,
.skeleton .button-line,
.skeleton .metric-row span {
  border-radius: 8px;
  background: linear-gradient(90deg, #edf2f7, #f8fafc, #edf2f7);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
}

.skeleton .avatar {
  width: 178px;
  height: 178px;
}

.skeleton .line {
  height: 17px;
  width: 65%;
  margin-bottom: 12px;
}

.skeleton .line.wide {
  width: 86%;
}

.skeleton .button-line {
  width: min(330px, 100%);
  height: 36px;
  margin-top: 16px;
}

.metric-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.metric-row span {
  height: 70px;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

@media (max-width: 860px) {
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .character-hero,
  .skeleton {
    grid-template-columns: 178px minmax(0, 1fr);
  }

  .portrait-frame {
    min-height: 178px;
  }

  .character-image,
  .skeleton .avatar {
    width: 178px;
    height: 178px;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1080px);
    padding-top: 18px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .character-hero {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .portrait-frame {
    min-height: 140px;
  }

  .character-image,
  .skeleton .avatar {
    width: 140px;
    height: 140px;
  }

  .shortcut-button {
    flex: 1 1 calc(50% - 8px);
  }

  .exp-block {
    grid-template-columns: 1fr;
  }

  .level-panel {
    width: fit-content;
  }
}
