:root { --red: #e5191c; --ink: #0f0f0f; --paper: #fdfdfd; --gold: #ffd23f; --pop: cubic-bezier(.175,.885,.32,1.275); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--ink); overflow-x: clip; }
body { margin: 0; min-height: 100svh; color: var(--paper); font-family: "Arsenal", system-ui, sans-serif; -webkit-font-smoothing: antialiased; user-select: none;
  background: var(--red); }
button, textarea { font: inherit; color: inherit; background: none; border: 0; padding: 0; }
button { cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body::before { content: ""; position: fixed; inset: 0; background: url(stars.svg) 0 0 / 220px 220px; clip-path: polygon(58% 0, 100% 0, 100% 42%, 34% 34%); pointer-events: none; }
main { position: relative; width: min(460px, 100%); min-height: 100svh; margin: 0 auto; padding: max(10px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; overflow-x: clip; }

/* top: the date on the left, both pentagons on the right */
.top { display: flex; justify-content: space-between; align-items: stretch; min-height: 176px; }
.left { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: space-between; }
.hud { display: flex; align-items: flex-end; gap: 8px; rotate: -5deg; transform-origin: 0 100%; margin-top: 8px; }
.day { font: 700 76px/1 "Oswald", sans-serif; padding: 2px 12px 6px; background: var(--ink); color: var(--paper); clip-path: polygon(0 4%, 100% 0, 95% 100%, 5% 96%); }
.hd { display: grid; gap: 4px; justify-items: start; padding-bottom: 6px; font-family: "Oswald", sans-serif; font-weight: 700; text-transform: uppercase; }
.hd b { font-size: 21px; line-height: 1; padding: 2px 8px; background: var(--paper); color: var(--ink); }
.hd i { font-style: normal; font-size: 19px; line-height: 1; padding: 2px 8px; background: var(--ink); }
.tools { display: flex; align-items: center; gap: 6px; }
.off { font: 700 15px "Oswald", sans-serif; text-transform: uppercase; letter-spacing: .03em; padding: 8px 14px; background: var(--ink); color: var(--paper); clip-path: polygon(0 8%, 100% 0, 96% 100%, 3% 92%); }
.off.on { background: var(--gold); color: var(--ink); }
.ico { width: 44px; height: 38px; display: grid; place-items: center; background: var(--ink); color: var(--paper); clip-path: polygon(0 8%, 100% 0, 96% 100%, 3% 92%); }
.ico svg { width: 22px; height: 22px; fill: currentColor; }

.stage { position: relative; width: 176px; flex: none; display: grid; place-items: center; }
.burst { position: absolute; inset: -14px; background: var(--ink); clip-path: polygon(50% 0, 60% 13%, 79% 7%, 80% 23%, 98% 27%, 88% 42%, 100% 56%, 85% 63%, 91% 82%, 72% 80%, 63% 97%, 50% 86%, 34% 100%, 28% 81%, 8% 83%, 15% 64%, 0 52%, 13% 41%, 3% 24%, 21% 22%, 24% 4%, 40% 13%); animation: turn 80s linear infinite; }
@keyframes turn { to { rotate: 360deg; } }
.radar { position: relative; width: 100%; display: block; overflow: visible; }
.radar svg { fill: var(--paper); }
#mine { fill: var(--red); fill-opacity: .9; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; }

/* five tasks: the game's menu, a done line turns into the lit item */
.menu { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.t { position: relative; display: flex; align-items: center; gap: 10px; flex: 1; min-height: 56px; max-height: 84px; padding: 4px 92px 4px 12px; text-align: left; color: var(--paper); transition: transform .14s var(--pop); }
.t:nth-child(1) { margin-left: 0; } .t:nth-child(2) { margin-left: 16px; } .t:nth-child(3) { margin-left: 6px; } .t:nth-child(4) { margin-left: 22px; } .t:nth-child(5) { margin-left: 10px; }
.t::before { content: ""; position: absolute; inset: 0 -40px 0 0; background: var(--ink); clip-path: polygon(0 12%, 100% 0, 100% 100%, 2% 90%); z-index: -1; }
.menu { isolation: isolate; }
.t:nth-child(even)::before { clip-path: polygon(2% 0, 100% 10%, 100% 92%, 0 100%); }
.lb { font-family: "Oswald", sans-serif; font-weight: 700; line-height: 1.1; text-transform: uppercase; letter-spacing: .01em; }
.t svg { width: 26px; height: 26px; fill: currentColor; flex: none; }
.t small u { display: block; text-decoration: none; font-size: 12px; color: #a8a8a8; margin-top: 2px; }
.t.on small u { color: #666; }
.t small { position: absolute; right: 2px; top: 50%; translate: 0 -50%; max-width: 84px; text-align: right; font: 500 13px/1.05 "Oswald", sans-serif; color: var(--gold); }
.t:active { transform: scale(.97); }
.t.on { color: var(--red); }
.t.on::before { background: var(--paper); }
.t.on .lb { color: var(--ink); }
.t.on small { color: var(--ink); }
.t.pop { animation: hit .3s var(--pop); }
@keyframes hit { from { transform: translateX(-26px) scale(1.06) rotate(-2deg); } }
.menu.jk .t { opacity: .35; pointer-events: none; }

/* a new rank */
.rankup { position: fixed; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 8px; pointer-events: none; background: rgba(15,15,15,.72); animation: rk 1.7s ease both; }
.rankup small { font-family: "Oswald", sans-serif; font-weight: 700; font-size: 16px; letter-spacing: .14em; text-transform: uppercase; background: var(--red); padding: 2px 12px; rotate: -3deg; }
.big { font: 700 clamp(36px, 12vw, 56px)/1.1 "Oswald", sans-serif; text-transform: uppercase; color: var(--paper); }
.rankup .big { rotate: -4deg; }
@keyframes rk { 0% { opacity: 0; transform: scale(1.5); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* the week: streak, seven days, share against the 70% bar */
.week { display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; gap: 10px; align-items: center; background: var(--ink); padding: 10px 12px; clip-path: polygon(0 5%, 100% 0, 100% 100%, 1% 96%); font-family: "Oswald", sans-serif; }
.sum { display: grid; justify-items: center; gap: 2px; text-align: center; }
.sum b { font-size: 28px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.sum b.ok { color: var(--gold); }
.sum small { font-size: 11px; font-weight: 500; line-height: 1.1; color: #a8a8a8; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.c { display: grid; gap: 3px; justify-items: center; }
.c u { width: 100%; text-align: center; text-decoration: none; font-size: 12px; font-weight: 500; color: #8a8a8a; }
.c.now u { color: var(--ink); background: var(--gold); }
.c i { position: relative; width: 100%; height: 30px; background: #2b2b2b; overflow: hidden; }
.c i::after { content: ""; position: absolute; inset: auto 0 0; height: calc(var(--n) * 20%); background: var(--red); transition: height .3s var(--pop); }
.c i.off { background: repeating-linear-gradient(45deg, #666 0 3px, #2b2b2b 3px 6px); }

/* the result */
.over { position: fixed; inset: 0; z-index: 5; display: grid; place-content: center; justify-items: center; gap: 22px; padding: 24px; background: var(--ink); text-align: center; animation: in .3s var(--pop); }
@keyframes in { from { opacity: 0; transform: scale(1.08); } }
.over .big { rotate: -4deg; }
.wish { margin: 0; font: 700 44px/1 "Oswald", sans-serif; color: var(--gold); }
.ok { width: 64px; height: 64px; display: grid; place-items: center; background: var(--red); color: var(--paper); clip-path: polygon(6% 3%, 100% 0, 95% 97%, 0 100%); }
.ok svg { width: 34px; height: 34px; fill: currentColor; }
.gate { margin: auto; }

/* settings */
.sheet { position: fixed; inset: 0; z-index: 3; display: flex; align-items: flex-end; justify-content: center; background: rgba(15,15,15,.6); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.pane { width: min(460px, 100%); display: grid; gap: 6px; padding: 12px 16px max(12px, env(safe-area-inset-bottom)); background: var(--ink); border-top: 4px solid var(--paper); animation: up .22s var(--pop); }
@keyframes up { from { translate: 0 40px; } }
.f { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; gap: 12px; }
.f svg { width: 24px; height: 24px; fill: var(--paper); }
.f input { width: 100%; min-width: 0; height: 44px; padding: 0 12px; background: #262626; color: var(--paper); font: 700 17px "Arsenal", sans-serif; border: 0; border-radius: 0; outline: 0; user-select: text; }
.f input:focus { box-shadow: inset 0 -3px var(--red); }
.foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.foot .ok { margin-left: auto; }
.foot .off { background: #262626; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
