:root {
  --bg: #0d0f14; --panel: #161a22; --panel2: #1d2230; --line: #2a3040; --text: #e8ebf2; --muted: #8b93a7;
  --trash: #8a6b4e; --common: #9aa3b5; --uncommon: #4ade80; --rare: #60a5fa; --epic: #c084fc; --anomaly: #fb923c; --mythic: #facc15;
  --accent: #7c5cff;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: radial-gradient(1200px 600px at 50% -200px, #1f1b3a 0%, var(--bg) 60%); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; min-height: 100vh; background-repeat: no-repeat; }
main { max-width: 820px; margin: 0 auto; padding: 0 16px 40px; display: grid; gap: 16px; }
.top { text-align: center; padding: 28px 16px 12px; }
h1 { margin: 0; font-size: 2.2rem; letter-spacing: -0.02em; }
h1 span { background: linear-gradient(90deg, #a78bfa, #f472b6, #facc15); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tag { margin: 4px 0 14px; color: var(--muted); }
.stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 0.85rem; color: var(--muted); }
.stat b { color: var(--text); font-variant-numeric: tabular-nums; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
h2 { margin: 0 0 12px; font-size: 1.05rem; }
.muted { color: var(--muted); font-size: 0.88rem; }

.roller { text-align: center; }
.tiles { display: flex; justify-content: center; gap: 8px; margin: 6px 0 18px; }
.tile { width: 62px; height: 78px; display: grid; place-items: center; font: 700 2.4rem/1 ui-monospace, "SFMono-Regular", Menlo, monospace; background: var(--panel2); border: 2px solid var(--line); border-radius: 12px; transition: border-color .2s, transform .15s, color .2s; }
.tile.spin { color: var(--muted); }
.tile.lock { transform: scale(1.06); border-color: var(--tc, var(--accent)); }
.tile.lead { color: #3a4154; }
@media (max-width: 520px) { .tile { width: min(44px, calc((100vw - 110px) / 7)); height: 58px; font-size: 1.6rem; } .tiles { gap: 5px; } .card { padding: 16px 12px; } }
.verdict { min-height: 96px; }
.tier { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--tc, var(--muted)); }
.tier.mythic { background: linear-gradient(90deg, #facc15, #f472b6, #60a5fa, #facc15); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2s linear infinite; }
@keyframes shine { to { background-position: 200% center; } }
.sub { color: var(--muted); }
.ep { font-size: 1.1rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ep span { font-weight: 800; font-size: 1.4rem; }
.controls { display: flex; gap: 10px; justify-content: center; margin: 14px 0 10px; }
button { font: inherit; cursor: pointer; }
.roll { background: linear-gradient(135deg, #7c5cff, #c026d3); color: white; border: 0; border-radius: 12px; padding: 12px 44px; font-weight: 800; font-size: 1.2rem; letter-spacing: 0.08em; box-shadow: 0 6px 24px #7c5cff55; transition: transform .1s, opacity .2s; }
.roll:active { transform: scale(0.97); }
.roll:disabled { opacity: 0.55; cursor: default; }
.ghost { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 16px; }
.ghost:hover:not(:disabled) { border-color: var(--accent); }
.ghost:disabled { opacity: 0.5; cursor: default; }
.ghost.small { padding: 4px 12px; font-size: 0.85rem; }
.ghost.danger:hover { border-color: #ef4444; color: #fca5a5; }
.options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; color: var(--muted); font-size: 0.88rem; }
.options select { background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; font: inherit; }
.sep { width: 1px; height: 18px; background: var(--line); }

.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.badges .empty { color: var(--muted); }
.badge { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; background: var(--panel2); border: 1px solid var(--line); border-left: 4px solid var(--rc); border-radius: 12px; padding: 10px 14px; animation: pop .35s both; }
.badge .ico { font-size: 1.6rem; text-align: center; }
.badge .name { font-weight: 700; }
.badge .desc { color: var(--muted); font-size: 0.85rem; }
.badge .pts { text-align: right; font-variant-numeric: tabular-nums; }
.badge .pts b { font-size: 1.05rem; }
.badge .rar { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--rc); font-weight: 700; }
.badge.dim { opacity: 0.55; }
.badge.dim .pts b { text-decoration: line-through; }
.badge .new { background: var(--accent); color: white; border-radius: 6px; font-size: 0.68rem; padding: 1px 6px; margin-left: 6px; vertical-align: middle; font-weight: 700; }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.r-trash { --rc: var(--trash); --tc: var(--trash); } .r-common { --rc: var(--common); --tc: var(--common); } .r-uncommon { --rc: var(--uncommon); --tc: var(--uncommon); }
.r-rare { --rc: var(--rare); --tc: var(--rare); } .r-epic { --rc: var(--epic); --tc: var(--epic); } .r-anomaly { --rc: var(--anomaly); --tc: var(--anomaly); } .r-mythic { --rc: var(--mythic); --tc: var(--mythic); }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 8px; padding: 6px 12px; }
.tabs button.active { background: var(--panel2); color: var(--text); border-color: var(--line); }
.hidden { display: none; }
.rolls { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 420px; overflow: auto; }
.rolls li { display: grid; grid-template-columns: 3.5em 7em 1fr auto; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.rolls li:hover { background: var(--panel2); }
.rolls .num { font: 700 1rem ui-monospace, Menlo, monospace; }
.rolls .t { color: var(--tc); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; }
.rolls .idx { color: var(--muted); font-size: 0.8rem; }
.rolls .e { font-variant-numeric: tabular-nums; }
.coll-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 8px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.cb { background: var(--panel2); border: 1px solid var(--line); border-top: 3px solid var(--rc); border-radius: 10px; padding: 8px 10px; font-size: 0.85rem; }
.cb .top2 { display: flex; gap: 6px; align-items: center; font-weight: 700; }
.cb .odds { color: var(--muted); font-size: 0.75rem; }
.cb.locked { opacity: 0.45; }
.check { display: flex; gap: 8px; }
.check input { flex: 1; background: var(--panel2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; }
.tierlist { list-style: none; padding: 0; display: grid; gap: 4px; }
.tierlist li b { color: var(--tc); display: inline-block; width: 6.5em; }
code { background: var(--panel2); padding: 1px 6px; border-radius: 6px; }
footer { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 0 24px; }
footer a { color: var(--muted); }
#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.bit { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: 0.8; } }
body.shake main { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
