:root{font:16px system-ui,"Malgun Gothic",sans-serif;background:#eaf2ff;color:#172a4a;--blue:#234fc0;--line:#c3d4ed}
*{box-sizing:border-box}[hidden]{display:none!important}
body{margin:0;min-width:280px}
main{max-width:530px;margin:auto;padding:20px 14px 110px}
header,.row,.summary{display:flex;align-items:center;justify-content:space-between;gap:10px}
header{margin:0 0 14px}h1,h2,h3,p{margin:0}h1{font-size:clamp(1.7rem,7vw,2.45rem);letter-spacing:-.06em}h2{font-size:1.3rem}h3{font-size:1.08rem}p{line-height:1.55}
#date{font-weight:700;color:#435a7b}.logo{display:grid;place-items:center;background:#ffe283;color:#523906;border-radius:14px;width:48px;height:48px;font-size:1.6rem;box-shadow:0 4px #dba842}
button,input,select,textarea{font:inherit;color:inherit}button{cursor:pointer;min-height:44px;border:1px solid var(--line);padding:7px 10px;border-radius:11px;background:#fff;font-weight:740}button:disabled{opacity:.5;cursor:default}:focus-visible{outline:3px solid #2049c6;outline-offset:2px}.primary,.selected{background:var(--blue);color:white;border-color:var(--blue)}
.week,.stats,.period{display:grid;gap:5px;margin:10px 0}.week{grid-template-columns:repeat(7,minmax(0,1fr))}.week button{padding:4px 0;font-size:.85rem}.stats,.period{grid-template-columns:repeat(3,minmax(0,1fr))}
.stat{text-align:center;background:white;border:1px solid var(--line);padding:8px 2px;border-radius:12px}.stat span,.stat strong{display:block}.stat span{font-size:.83rem;color:#415577}.stat strong{font-size:1.16rem}
.points,.danger{border-radius:10px;padding:7px 10px;font-weight:740}.points,.level1{background:#ffefad;color:#5b3d04}.level0{background:#dcf5e1;color:#1c5934}.level2{background:#ffd7b9;color:#753100}.level3{background:#ffdfe2;color:#8b232d}
.arena{border:1px solid #b5cdf2;background:#dceaff radial-gradient(#afc8ee 1px,transparent 1px);background-size:18px 18px;border-radius:19px;padding:10px;overflow:hidden}.roll{max-height:min(48vh,430px);overflow:auto;display:flex;flex-direction:column-reverse;padding:8px 3px}.stack{display:flex;flex-direction:column;justify-content:end;gap:9px;min-height:clamp(140px,30vh,285px)}.base{background:#536b99;box-shadow:inset 0 -5px #394c72;border-radius:8px;height:13px}
.empty{text-align:center;margin:auto}.empty p{margin-bottom:8px}
.tile{--tone:#97c6ff;--edge:#528bd9;position:relative;display:flex;align-items:center;gap:9px;text-align:left;min-height:59px;border:2px solid var(--edge);background:linear-gradient(160deg,#ffffff65,transparent 75%),var(--tone);box-shadow:0 4px var(--edge);overflow-wrap:anywhere}
.tile.math{--tone:#a0e5aa;--edge:#57a464}.tile.writing{--tone:#d4baff;--edge:#8f69c0}.tile.exercise{--tone:#ffc194;--edge:#c87842}.tile.habits{--tone:#ffe283;--edge:#c29a2d}.tile.reading{--tone:#ffc2dc;--edge:#c476a0}.tile.carried{border:3px solid #bd343c}
.tile-icon{display:grid;place-items:center;flex:none;width:38px;min-height:32px;background:#ffffffa0;border-radius:8px}.tile small,.tile strong{display:block}
.tile.crack::after{content:"";position:absolute;inset:0;background:#34496c;clip-path:polygon(54% 0,56% 0,47% 36%,57% 48%,49% 75%,52% 100%,50% 100%,46% 75%,53% 49%,43% 37%)}
.chip{position:absolute;left:50%;top:50%;width:14px;height:14px;pointer-events:none;border-radius:2px;background:var(--tone);border:2px solid var(--edge);z-index:1}
.card{margin:10px 0;background:white;border:1px solid var(--line);border-radius:14px;padding:11px}.card h3{margin-bottom:5px}.card button{margin:3px 3px 1px 0}.entry{border-top:1px solid #e8eff9;padding:5px 0}.bar{display:grid;grid-template-columns:minmax(55px,auto) minmax(25px,1fr) 42px;gap:7px;align-items:center;min-height:35px}.bar span:last-child{text-align:right}progress{width:100%;accent-color:var(--blue)}
nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);display:grid;grid-template-columns:repeat(5,minmax(0,1fr));width:min(100%,530px);background:white;border:1px solid var(--line);z-index:2;padding:5px 6px calc(5px + env(safe-area-inset-bottom))}nav button{border:0;padding:3px 0;font-size:1.1rem}nav button span{display:block;font-size:.77rem}nav button[aria-current]{background:#e4edff;color:#204ab3}
dialog{border:1px solid var(--line);border-radius:17px;width:min(94%,490px);color:inherit;padding:15px;max-height:86dvh}dialog::backdrop{background:#14294788}dialog p{margin:8px 0}
label{display:block;margin:7px 0;font-weight:650}input:not([type=checkbox]),select,textarea{min-height:44px;width:100%;min-width:0;border:1px solid #a8bad6;border-radius:8px;background:#fff;padding:5px 8px}input[type=checkbox]{vertical-align:middle;width:20px;height:20px;margin:0 0 0 8px;accent-color:var(--blue)}.toggle{min-height:39px;display:flex;justify-content:space-between;align-items:center}.editor .primary{width:100%}
#feedback{padding:8px 10px;background:#fff1b6;color:#513600;border-radius:9px;margin-bottom:7px}
#notice{position:fixed;z-index:3;bottom:calc(64px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);width:min(96%,505px);display:flex;justify-content:space-between;align-items:center;gap:6px;padding:8px 11px;background:#192c50;color:white;border-radius:12px}#notice button{color:#172a4a}
