/* Stage A6: My Stats. Level (or a badge) and the tasks chart on the left, money on the right, badges along
   the bottom; the page fits the window (Nicolas: nothing needs scrolling). Aqua, never purple. */
.st-body{display:grid;grid-template-columns:1fr 430px;grid-template-rows:auto 1fr auto;gap:12px;padding:14px 20px 18px;height:calc(100vh - 72px);min-height:640px;box-sizing:border-box}
.st-body h2{font:400 22px var(--serif);margin:0}
.st-body .lbl{margin:0}
.st-top{grid-column:1;padding:16px 20px;display:flex;gap:22px;align-items:center;min-height:212px;box-sizing:border-box}
.st-chart{grid-column:1;padding:14px 18px;display:flex;flex-direction:column;gap:8px;min-height:0}
.st-right{grid-column:2;grid-row:1 / span 2;display:flex;flex-direction:column;gap:10px;min-height:0}
.st-money{flex:1;padding:14px 16px;display:flex;flex-direction:column;gap:9px;min-height:0}
.st-badges{grid-column:1 / -1;padding:12px 18px 10px}
.bi{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* Level ring and track. */
.st-ring{position:relative;flex:none;width:136px;height:136px;display:grid;place-items:center;color:var(--aqua-ink)}
.st-ring svg:not(.bi){position:absolute;inset:0;width:100%;height:100%;transform:rotate(-90deg)}
.st-ring .rt{fill:none;stroke:var(--soft);stroke-width:7}
.st-ring .rf{fill:none;stroke:var(--aqua-deep);stroke-width:7;stroke-linecap:round}
.st-ring>.bi{width:56px;height:56px}
.st-ring.big{border-radius:50%;border:5px solid var(--soft);box-sizing:border-box}
.st-ring.big.got{border-color:var(--aqua)}
.st-ring .stars{position:absolute;bottom:-6px;left:50%;transform:translateX(-50%);background:var(--panel);padding:0 4px;white-space:nowrap}
.stars i{font-style:normal;color:var(--line);font-size:14px}
.stars i.on{color:var(--ochre)}
.st-lv{flex:1;min-width:0;display:flex;flex-direction:column;gap:10px}
.st-name{display:flex;align-items:center;gap:10px;position:relative}
.st-name h2{font-size:28px}
.st-name .st-x{margin-left:auto;background:var(--soft);color:var(--muted)}
.st-pts{font-size:14px;color:var(--muted)}
.st-pts b{font:400 30px var(--serif);color:var(--ink);margin-right:4px}
.st-track{position:relative;height:6px;border-radius:99px;background:var(--soft);margin:8px 12px 20px}
.st-fill{position:absolute;inset:0 auto 0 0;border-radius:99px;background:var(--aqua-deep)}
.lv-stop{position:absolute;top:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center}
.lv-stop i{width:20px;height:20px;border-radius:50%;background:var(--soft);border:2px solid var(--panel);font-style:normal;font-size:11px;line-height:20px;text-align:center;color:#fff}
.lv-stop.on i{background:var(--aqua-ink)}
.lv-stop small{position:absolute;top:24px;font-size:11px;color:var(--muted);white-space:nowrap}
.lv-stop:first-child small{left:-6px}
.lv-stop:last-child small{right:-6px}
.st-tiles{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.st-tiles span{display:flex;flex-direction:column;gap:2px;padding:8px 12px;border:1px solid var(--line);border-radius:11px;background:var(--bg);font-size:11.5px;color:var(--muted)}
.st-tiles b{font:400 20px var(--serif);color:var(--ink)}
.st-help{top:calc(100% + 6px);left:0;right:auto}

/* The group as a whole. */
.st-pct{font:400 30px var(--serif);color:var(--aqua-ink)}
.st-tiles.three{grid-template-columns:repeat(3,1fr)}
.gstars{font-size:12.5px;color:var(--muted)}
.gstars i{font-style:normal;color:var(--ochre)}
.st-badge:not(.got) .gstars i{color:var(--line)}

/* A badge in the top panel. */
.st-why{margin:0;font-size:13.5px;line-height:1.5;color:var(--ink)}
.st-levels{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.st-level{display:flex;flex-direction:column;gap:3px;padding:9px 12px;border:1px solid var(--line);border-radius:11px;background:var(--bg);font-size:12.5px;color:var(--muted)}
.st-level .stars{color:var(--line);font-size:13px;letter-spacing:1px}
.st-level em{font-style:normal;font-size:11.5px}
.st-level.got{background:var(--aqua-soft);border-color:var(--aqua-deep);color:var(--aqua-text)}
.st-level.got .stars{color:var(--ochre)}
.st-level.next{border-color:var(--aqua-deep);color:var(--ink)}
.st-bar{display:block;height:5px;border-radius:99px;background:var(--soft);overflow:hidden;margin-top:3px}
.st-bar i{display:block;height:100%;background:var(--aqua-deep)}
html[data-theme="dark"] .st-level.got{color:var(--aqua-ink)}

/* Group tasks by cycle. */
.st-bars{flex:1;min-height:0;display:flex;align-items:stretch;justify-content:center;gap:28px;padding:4px 10px 0;border-bottom:1px solid var(--line)}
.st-col{flex:0 1 120px;display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0}
.st-cap{font-size:12.5px;color:var(--muted);white-space:nowrap}
.st-stack{flex:1;width:72%;display:flex;flex-direction:column;justify-content:flex-end;gap:2px}
.st-stack i{display:block;border-radius:6px}
.st-stack .done{background:var(--aqua-deep)}
.st-stack .miss{background:var(--terra)}
.st-stack .todo{border:2px dashed var(--line);box-sizing:border-box}
.st-when{font-size:12.5px;color:var(--ink);white-space:nowrap;padding:4px 0 6px}

/* Where my money went. */
.st-sum span{padding:8px 10px}
.st-sum b{font-size:17px}
.st-chs{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.st-ch{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:8px 11px;border:1px solid var(--line);border-radius:11px;background:var(--bg);font-size:12.5px}
.st-ch a{color:var(--aqua-ink);text-decoration:none}
.st-ch b{font-size:14px}
.st-lines{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:5px}
.st-lines .cy-line{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;padding:6px 10px;border:1px solid var(--line);border-radius:9px;background:var(--bg)}
.st-lines .cy-line b{color:var(--terra);white-space:nowrap}
.st-body .empty{font-size:13px;color:var(--muted);padding:10px 0}

/* The badges row. */
.st-bhead{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:6px}
.st-blist{display:grid;grid-template-columns:repeat(14,1fr);gap:2px}
.st-badge{display:flex;flex-direction:column;align-items:center;gap:3px;border:0;background:none;padding:4px 0;border-radius:12px;cursor:pointer;color:var(--muted);font:12px var(--sans);min-width:0}
.st-badge .st-disc{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;border:2px solid var(--line);color:var(--line);background:var(--bg)}
.st-badge.got .st-disc{border-color:var(--aqua-deep);color:var(--aqua-ink);background:var(--aqua-soft)}
.st-badge.got{color:var(--ink)}
.st-badge.on .st-disc{box-shadow:0 0 0 3px var(--aqua)}
.st-badge .nm{font-size:11.5px;line-height:1.25;text-align:center;max-width:100%}
.st-badge:hover .st-disc{border-color:var(--aqua-deep)}

/* The star-earned card. */
.earned-dialog{width:min(480px,calc(100vw - 32px))}
.earned-dialog .dlg-actions{justify-content:flex-start}
.earned-body{display:flex;flex-direction:column;align-items:center;gap:14px;text-align:center}
.earned-body .st-ring{width:120px;height:120px}
.st-earned{margin:6px 0 0;font-size:14px;line-height:1.5}
.st-nextstar{width:100%;display:flex;flex-direction:column;gap:4px;font-size:12.5px;color:var(--muted)}

@media (max-width:900px){
  .st-body{grid-template-columns:1fr;grid-template-rows:none;height:auto}
  .st-right{grid-column:1;grid-row:auto}
  .st-top{flex-direction:column;align-items:stretch}
  .st-tiles{grid-template-columns:1fr 1fr}
  .st-blist{grid-template-columns:repeat(7,1fr)}
  .st-levels{grid-template-columns:1fr}
}

/* Phones and narrow windows (Nicolas, 17 October): the level's name and points sit to the right of the ring
   (or a badge's name and why), the track and tiles under them; the cycle chart is short and shows its bars. */
@media (max-width:900px){
  .st-top{display:grid;grid-template-columns:auto 1fr;column-gap:16px;row-gap:8px;align-items:center;min-height:0;padding:14px 16px}
  .st-top>.st-ring{grid-row:1 / span 2;width:92px;height:92px}
  .st-top>.st-ring>.bi{width:40px;height:40px}
  .st-top>.st-lv{display:contents}
  .st-top>.st-lv>*{grid-column:1 / -1}
  .st-top>.st-lv>.st-name,.st-top>.st-lv>.st-name+*{grid-column:2}
  .st-top>.st-lv>.st-name{align-self:end}
  .st-top>.st-lv>.st-name+*{align-self:start}
  .st-top .st-name h2{font-size:24px}
  .st-top .st-pts b{font-size:24px}
  .st-chart{padding:10px 14px;gap:4px}
  .st-chart h2{font-size:18px}
  .st-bars{flex:none;height:112px;gap:12px;padding:2px 4px 0}
  .st-cap,.st-when{font-size:12px}
  .st-when{padding:2px 0 4px}
}
