:root {
  --ink: #1c1714;
  --muted: #6b5e55;
  --paper: #f3ebe2;
  --card: rgba(255, 250, 244, 0.92);
  --accent: #c45c26;
  --accent-2: #2f6f6a;
  --danger: #a33b3b;
  --line: rgba(28, 23, 20, 0.12);
  --shadow: 0 18px 50px rgba(40, 24, 12, 0.18);
  --radius: 18px;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, #ffe7c8, transparent 40%),
    radial-gradient(circle at bottom right, #d9efe9, transparent 35%),
    var(--paper);
  min-height: 100vh;
}

#app { max-width: 920px; margin: 0 auto; padding: 16px 16px 40px; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.brand { font-weight: 800; letter-spacing: -0.03em; font-size: 1.15rem; }
.buffs { display: flex; gap: 6px; flex-wrap: wrap; }
.buff {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
}

.screen { display: none; }
.screen.active { display: block; }

.hero {
  height: 260px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 14px;
}
.hero-veil {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 22px;
  background: linear-gradient(transparent 20%, rgba(18, 12, 8, 0.72));
  color: #fff;
}
.hero-veil h1 { margin: 0 0 6px; font-size: 1.7rem; }
.hero-veil p { margin: 0; opacity: 0.92; line-height: 1.45; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.create label { display: block; margin-bottom: 12px; font-weight: 600; }
.create input {
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-size: 16px;
}

.type-pick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 12px 0 16px;
}
.type-card {
  border: 2px solid transparent;
  background: #fff;
  border-radius: 16px;
  padding: 8px;
  cursor: pointer;
}
.type-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}
.type-card span { display: block; text-align: center; margin-top: 6px; font-weight: 700; }
.type-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(196, 92, 38, 0.15); }

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: #efe6dc;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
button.primary {
  width: 100%;
  background: var(--accent);
  color: #fff;
  padding: 14px;
  font-size: 1rem;
}
button.danger { background: #f3d5d5; color: var(--danger); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }

.stage {
  position: relative;
  height: 280px;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 12px;
}
.hero-art, .mob-art {
  position: absolute;
  bottom: 18px;
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 24px;
  border: 3px solid #fff;
  box-shadow: var(--shadow);
}
.hero-art { left: 18px; }
.mob-art { right: 18px; }
.mob-art.hidden { display: none; }
.stage-caption {
  position: absolute;
  left: 16px;
  top: 14px;
  background: rgba(255,255,255,0.9);
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}
.stat b { display: block; font-size: 1.05rem; }
.stat span { color: var(--muted); font-size: 12px; }

.actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.actions a.btn-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--ink);
  background: #2a221c;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 700;
}
.actions a.btn-link:hover { border-color: var(--accent); color: #ffd4b8; }
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow: auto; }
.list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.list button { padding: 6px 8px; font-size: 12px; }
.inv-actions { display: flex; gap: 4px; flex-shrink: 0; }
.stats { grid-template-columns: repeat(5, 1fr); }
.log-panel pre {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 12px;
  color: var(--muted);
}
h3 { margin: 0 0 8px; font-size: 1rem; }

@media (max-width: 720px) {
  .actions, .stats, .cols { grid-template-columns: 1fr 1fr; }
  .hero-art, .mob-art { width: 120px; height: 120px; }
}
