:root {
  --bg: #0f1115;
  --panel: #181b22;
  --line: #2a2f3a;
  --text: #f3f4f6;
  --muted: #9aa1ad;
  --accent: #f5c542;
  --NORMAL: #9aa1ad;
  --RARE: #4f8cff;
  --EPIC: #a46bff;
  --LEGEND: #ff8a3d;
  --SSR: #f5c542;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 16px calc(32px + env(safe-area-inset-bottom));
}

.top { text-align: center; margin-bottom: 20px; }
.eyebrow { margin: 0 0 6px; color: var(--accent); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; }
h1 { margin: 0; font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.lead { margin: 8px 0 0; color: var(--muted); font-size: 15px; }

.shared { margin-bottom: 16px; }
.shared-label { margin: 0 0 8px; color: var(--muted); font-size: 13px; text-align: center; }

.slot {
  min-height: 300px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.slot-idle { margin: 0; padding: 24px; color: var(--muted); text-align: center; line-height: 1.6; }

.spin {
  padding: 24px;
  text-align: center;
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  filter: blur(0.5px);
}

/* 결과 카드 */
.card {
  width: 100%;
  padding: 22px 20px 20px;
  border-radius: 20px;
  border: 2px solid var(--tier);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier) 14%, var(--panel)) 0%, var(--panel) 55%);
  animation: pop 0.35s ease-out;
}
.card[data-tier="SSR"] {
  box-shadow: 0 0 0 1px var(--tier), 0 0 36px color-mix(in srgb, var(--tier) 45%, transparent);
}
.tier-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tier { font-size: 26px; font-weight: 900; letter-spacing: 0.04em; color: var(--tier); }
.chance { font-size: 13px; color: var(--muted); }
.practice { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.official { border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent); }
.situation { margin: 16px 0 18px; font-size: 19px; font-weight: 700; line-height: 1.5; word-break: keep-all; }
.hp { margin-bottom: 16px; }
.hp-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hp-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.hp-fill { height: 100%; border-radius: 999px; background: var(--tier); }
.row { display: grid; grid-template-columns: 84px 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; line-height: 1.5; }
.row dt { color: var(--muted); }
.row dd { margin: 0; word-break: keep-all; }

.pull {
  width: 100%;
  margin-top: 16px;
  padding: 18px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #111;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}
.pull:disabled { opacity: 0.6; cursor: default; }
.pull:not(:disabled):active { transform: translateY(1px); }
.note { min-height: 20px; margin: 10px 0 0; color: var(--muted); font-size: 13px; text-align: center; }

.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.actions button {
  padding: 13px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.odds { margin-top: 28px; border-top: 1px solid var(--line); padding-top: 16px; color: var(--muted); font-size: 14px; }
.odds summary { cursor: pointer; }
.odds table { width: 100%; margin-top: 10px; border-collapse: collapse; }
.odds td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.odds td:last-child { text-align: right; }
.odds-note { font-size: 12px; line-height: 1.6; }

.foot { margin-top: 24px; color: var(--muted); font-size: 12px; text-align: center; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: #fff;
  color: #111;
  font-size: 14px;
  font-weight: 600;
}

@keyframes pop {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .card { animation: none; }
}
