:root { --accent: #7a9e7e; --bg: #f6f1e7; --card: #fffdf8; --ink: #2d261c; --quiet: #7b7163; --line: #e6dece; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) 0 calc(72px + env(safe-area-inset-bottom)); }
main { max-width: 520px; margin: 0 auto; padding: 12px 14px; }
h1 { font-size: 22px; margin: 6px 0 10px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
p { margin: 6px 0; }
.quiet { color: var(--quiet); font-size: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; }
.hero { display: grid; grid-template-columns: 132px 1fr; gap: 10px; align-items: center; }
.hero svg { width: 132px; height: auto; }
.hero .name { font-weight: 700; font-size: 18px; }
.say { background: var(--bg); border-radius: 12px; padding: 8px 10px; font-size: 14px; margin-top: 8px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chip { background: var(--bg); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 6px 0 2px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.bar.over > i { background: #d9534f; }
.quest { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 8px; font: inherit; color: inherit; }
.quest .box { width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--accent); display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.quest.done .box { background: var(--accent); }
.quest.done .label { text-decoration: line-through; color: var(--quiet); }
.quest .label { flex: 1; }
.quest .xp { font-size: 13px; font-weight: 700; color: var(--accent); }
.quest.auto { border-style: dashed; }
button, .btn { font: inherit; border: 0; border-radius: 12px; padding: 11px 14px; background: var(--accent); color: #fff; font-weight: 700; }
button.ghost { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
button.danger { background: #d9534f; }
button:disabled { opacity: .45; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.row > .fit { flex: none; }
.wide { width: 100%; }
input, select { font: inherit; width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); }
input[type=checkbox] { width: 22px; height: 22px; flex: none; }
input[type=color] { padding: 2px; height: 42px; }
label { display: block; font-size: 13px; color: var(--quiet); margin: 10px 0 4px; }
.list > div { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list > div:last-child { border-bottom: 0; }
.x { background: none; color: var(--quiet); padding: 4px 8px; font-weight: 400; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.item { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; text-align: center; font-size: 13px; color: var(--ink); font-weight: 400; }
.item svg { width: 100%; height: 84px; }
.item.on { border: 2px solid var(--accent); }
.item b { display: block; }
.days { display: flex; gap: 4px; }
.days button { padding: 6px 0; flex: 1; font-size: 12px; background: var(--bg); color: var(--quiet); border: 1px solid var(--line); }
.days button.on { background: var(--accent); color: #fff; }
#tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
#tabs button { flex: 1; background: none; color: var(--quiet); font-size: 11px; font-weight: 600; padding: 8px 0 10px; border-radius: 0; }
#tabs button span { display: block; font-size: 20px; }
#tabs button.on { color: var(--ink); }
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 10; display: flex; align-items: flex-end; }
#modal[hidden], #toast[hidden] { display: none; }
#sheet { background: var(--bg); width: 100%; max-width: 520px; margin: 0 auto; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
#toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 20; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }
#reader { width: 100%; border-radius: 14px; overflow: hidden; background: #000; min-height: 200px; }
.chest { text-align: center; }
.chest .big { font-size: 64px; line-height: 1; }
svg.chart { width: 100%; height: 160px; }

.den-wrap { position: relative; }
.aura { border: 4px solid transparent; border-radius: 28px; padding: 2px; }
.den-tag { position: absolute; left: 0; bottom: -6px; font-size: 11px; background: rgba(255,255,255,.85); border-radius: 999px; padding: 2px 8px; font-weight: 600; }
.stage { font-weight: 700; font-size: 13px; margin-top: 2px; }
.tier { font-weight: 800; letter-spacing: .5px; }
.tier-rare { color: #3a86c8; } .tier-epic { color: #7b4bd0; } .tier-legendary { color: #d9a900; font-size: 20px; }
.item.legend { border-color: #f4c20d; }
.boss .bossicon { font-size: 40px; width: 52px; text-align: center; }
.bar.hp > i { background: #d9534f; }
.lane { display: grid; grid-template-columns: 84px 1fr 44px; gap: 8px; align-items: center; margin: 8px 0; font-size: 14px; }
.lane span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lane b { text-align: right; }
.bar.other > i { background: #8a8f98; }
.tug { position: relative; height: 14px; border-radius: 999px; margin: 14px 4px 18px; background: linear-gradient(90deg, var(--accent) 0 50%, #8a8f98 50% 100%); }
.tug span { position: absolute; top: -12px; font-size: 26px; transform: translateX(-50%); transition: left .4s; }
.bingo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.bingo button { background: var(--bg); color: var(--ink); border: 1px solid var(--line); font-weight: 600; font-size: 12px; padding: 10px 4px; min-height: 64px; }
.bingo button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.evo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.evo span { font-size: 11px; text-align: center; border: 2px solid var(--line); border-radius: 10px; padding: 6px 2px; color: var(--quiet); }
.evo span.on { color: var(--ink); font-weight: 700; }
