:root {
  --bg: #0e1116; --panel: #161b22; --line: #262d38;
  --fg: #e6edf3; --dim: #8b949e;
  --ok: #3fb950; --over: #1f6feb; --miss: #f85149; --warn: #d29922;
  --c0: #1b2129; --c1: #4d3b1b; --c2: #1f6f3a; --c3: #2ea043;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
#gate { padding: 3rem 1.25rem; max-width: 26rem; }
#gate input, #gate button {
  width: 100%; padding: .7rem; margin-top: .5rem; font-size: 1rem;
  background: var(--panel); color: var(--fg); border: 1px solid var(--line); border-radius: .5rem;
}
#gate button { background: var(--over); border-color: var(--over); font-weight: 600; }

header { display: flex; gap: 1.1rem; align-items: center; padding: 1.1rem 1.25rem .6rem; }
.ring-wrap { position: relative; width: 120px; height: 120px; flex: none; }
.ring { transform: rotate(-90deg); width: 120px; height: 120px; }
.ring circle { fill: none; stroke-width: 11; stroke-linecap: round; }
.track { stroke: var(--line); }
.arc { stroke: var(--ok); transition: stroke-dashoffset .4s ease; }
.ring-text {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.ring-text b { font-size: 2rem; font-variant-numeric: tabular-nums; display: block; }
.ring-text span { color: var(--dim); font-size: .95rem; }
.head-meta { min-width: 0; }
#streak-num { font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
#streak-num::after { content: " Tage"; font-size: .95rem; font-weight: 400; color: var(--dim); }
.state { font-size: .9rem; margin-top: .15rem; }
.state.active { color: var(--ok); } .state.wounded { color: var(--warn); } .state.lost { color: var(--miss); }
.zone, .left { font-size: .82rem; color: var(--dim); margin-top: .2rem; }

#banners { padding: 0 1.25rem; }
.banner {
  border: 1px solid var(--warn); color: var(--warn); background: #2a220d;
  padding: .55rem .75rem; border-radius: .5rem; font-size: .85rem; margin-bottom: .5rem;
}
.banner.bad { border-color: var(--miss); color: var(--miss); background: #2b1416; }

main { padding: .5rem 1.25rem 2rem; display: grid; gap: 1.4rem; }
section { background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; padding: .85rem 1rem 1rem; }
section.two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; background: none; border: 0; padding: 0; }
section.two > div { background: var(--panel); border: 1px solid var(--line); border-radius: .75rem; padding: .85rem 1rem 1rem; }
h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--dim); margin: 0 0 .7rem; font-weight: 600; }
h2 small { text-transform: none; letter-spacing: 0; float: right; font-weight: 400; }

.calendar { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 14px); gap: 3px; overflow-x: auto; padding-bottom: .3rem; }
.calendar i {
  width: 14px; height: 14px; border-radius: 2px; background: var(--c0); display: block;
  font: 600 11px/14px system-ui, sans-serif; font-style: normal; text-align: center;
  color: var(--miss);
}
.calendar i.c1 { background: var(--c1); } .calendar i.c2 { background: var(--c2); } .calendar i.c3 { background: var(--c3); }
/* Today is outlined, never crossed out: the day is still running. */
.calendar i.today { box-shadow: inset 0 0 0 1.5px var(--fg); color: var(--fg); }

/* Legends are not decoration here: every colour in this page means something
   specific, and a wrong reading of the ladder is worse than no ladder. */
.legend { display: flex; flex-wrap: wrap; gap: .5rem .8rem; font-size: .72rem; color: var(--dim); margin-top: .5rem; }
.legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: .25rem; background: var(--c0); vertical-align: 1px; }
.legend .c1 { background: var(--c1); } .legend .c2 { background: var(--c2); } .legend .c3 { background: var(--c3); }
.legend .ctoday { background: var(--c0); box-shadow: inset 0 0 0 1.5px var(--fg); }
.legend .x { color: var(--miss); margin-right: .25rem; }
.legend .b-hit { background: var(--ok); } .legend .b-miss { background: var(--miss); }
.legend .b-today { background: var(--over); opacity: .55; }
.legend .b-due { background: var(--over); } .legend .b-over { background: var(--warn); }
.legend .b-line { background: none; border-top: 2px dashed var(--line); height: 0; width: 14px; }
.legend .open { background: var(--c0); } .legend .queued { background: #30363d; }
.legend .learning { background: var(--warn); } .legend .review { background: var(--over); }
.legend .mature { background: var(--ok); } .legend .entrenched { background: #a371f7; }
.note { font-size: .72rem; color: var(--dim); margin: .55rem 0 0; line-height: 1.4; }
.note b { color: var(--fg); font-weight: 600; }

#scope-stack { height: 14px; border-radius: 7px; }
.rung { margin-bottom: .6rem; }
.rung-head { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .2rem; }
.rung-head span:last-child { color: var(--dim); font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--c0); }
.stack i { display: block; height: 100%; }
.stack .learning { background: var(--warn); } .stack .review { background: var(--over); }
.stack .mature { background: var(--ok); } .stack .entrenched { background: #a371f7; }
.stack .queued { background: #30363d; }
.rung-key { font-size: .72rem; color: var(--dim); margin-top: .15rem; }

.bars { display: flex; align-items: flex-end; gap: 2px; height: 90px; }
.bars i { flex: 1; min-width: 2px; background: var(--over); border-radius: 2px 2px 0 0; display: block; }
.bars i.miss { background: var(--miss); } .bars i.hit { background: var(--ok); } .bars i.today { opacity: .55; }

.kv { display: grid; gap: .3rem; font-size: .9rem; }
.kv div { display: flex; justify-content: space-between; }
.kv b { font-variant-numeric: tabular-nums; }
footer { color: var(--dim); font-size: .75rem; text-align: center; padding: 0 1rem 2rem; }
