/* The Good Years Run. Every rule sits under .gyr so nothing leaks into the site, and Tailwind's reset can't undo it. */
.gyr { --paper:#F6F3EE; --ink:#1A1A18; --muted:#6A665E; --rule:rgba(26,26,24,.14); --ember:#C9512A;
  --eat:#5E7F4F; --move:#3F6E8C; --sleep:#2E3560; --connect:#A88457;
  --display:"Newsreader",Georgia,serif; --body:"Inter",system-ui,sans-serif;
  max-width:720px; margin:0 auto; display:flex; flex-direction:column; gap:12px;
  font-size:15px; line-height:1.45; color:var(--ink); touch-action:manipulation; -webkit-tap-highlight-color:transparent; }
body.gyr-playing { touch-action:none; overscroll-behavior:none; }
.gyr .gyr-top { display:grid; overflow:hidden; transition:height .45s ease; }
.gyr .gyr-top > * { grid-area:1/1; }
.gyr .gyr-intro { display:flex; flex-direction:column; gap:12px; }
.gyr .gyr-intro p { margin:0; max-width:46ch; }
.gyr .gyr-score { align-self:start; visibility:hidden; }
.gyr.started .gyr-intro { visibility:hidden; }
.gyr.started .gyr-score { visibility:visible; }
.gyr .gyr-age { display:flex; align-items:baseline; gap:8px; }
.gyr .gyr-age b { font-family:var(--display); font-weight:400; font-size:58px; line-height:.95; font-variant-numeric:tabular-nums; }
.gyr .gyr-age span { color:var(--muted); font-size:13px; }
.gyr .gyr-date { color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; display:flex; justify-content:space-between; gap:12px; }
.gyr .gyr-date b { color:var(--ink); font-weight:600; }

.gyr .meters { list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; }
.gyr .meter { display:flex; flex-direction:column; gap:5px; min-width:0; }
.gyr .meter .name { font-size:12.5px; font-weight:600; display:flex; align-items:center; gap:4px; min-width:0; overflow:hidden; }
.gyr .ico { width:17px; height:17px; flex:none; color:var(--c); }
.gyr .meter .tag { display:none; }
.gyr .meter.need .bar { outline:1.5px solid var(--ember); outline-offset:2px; animation:gyrNeed .6s ease-in-out infinite alternate; }
.gyr .meter.got .bar i { animation:gyrGot .35s ease-out; }
.gyr .meter.out .bar { outline:2px solid var(--ember); outline-offset:2px; background:rgba(201,81,42,.42); }
@keyframes gyrNeed { from { background:rgba(26,26,24,.09); } to { background:rgba(201,81,42,.42); } }
@keyframes gyrGot { from { filter:brightness(1.7); transform:scaleY(2.4); } to { filter:none; transform:none; } }
.gyr .bar { height:7px; border-radius:4px; background:rgba(26,26,24,.09); }
.gyr .bar i { display:block; height:100%; width:70%; border-radius:4px; background:var(--c); }
.gyr [data-k="eat"] { --c:var(--eat); } .gyr [data-k="move"] { --c:var(--move); }
.gyr [data-k="sleep"] { --c:var(--sleep); } .gyr [data-k="connect"] { --c:var(--connect); }

.gyr .stage { display:grid; background:var(--paper); overflow:hidden; user-select:none; -webkit-user-select:none; }
.gyr .stage > * { grid-area:1/1; }
.gyr canvas { display:block; width:100%; }
/* Home page ("keep"): the street sits close under the intro, Run sits just under the street line, the intro stays during a run. */
.gyr.keep .stage { margin-top:-12px; }
.gyr.keep canvas { margin-top:-26px; }
.gyr .gyr-sky { align-self:center; position:relative; z-index:2; margin-top:calc(-1 * min(49px, (100vw - 32px) * 0.1167) - 3px); }
.gyr .gyr-sky .gbtn { padding:9px 34px; box-shadow:0 4px 14px rgba(201,81,42,.22); }
.gyr.started .gyr-sky { visibility:hidden; }
.gyr.keep.started .gyr-intro { visibility:visible; }
.gyr.keep .stage .gyr-score { align-self:start; justify-self:end; margin:22px 4px 0 0; z-index:1; pointer-events:none; }
.gyr.keep .stage .gyr-age b { font-size:40px; }
.gyr .overlay { background:rgba(246,243,238,.94); padding:18px 0; display:flex; flex-direction:column; gap:12px; z-index:1; }
.gyr .overlay[hidden] { display:none; }
.gyr .overlay h2 { font-family:var(--display); font-size:20px; font-weight:500; margin:0; line-height:1.08; text-wrap:balance; }
.gyr .overlay p { margin:0; max-width:46ch; }
.gyr .small { color:var(--muted); font-size:13px; }
.gyr .good { font-family:var(--display); font-size:46px; line-height:1; color:var(--ember); font-variant-numeric:tabular-nums; }
.gyr #gyr-guideLine a { color:var(--ember); font-weight:600; text-decoration:underline; text-underline-offset:3px; }
.gyr #gyr-guideNote { color:var(--muted); font-size:13px; }
.gyr .avg { list-style:none; margin:2px 0; padding:0; display:grid; gap:7px; max-width:360px; }
.gyr .avg li { display:grid; grid-template-columns:70px 1fr 40px; align-items:center; gap:10px; font-size:13px; }
.gyr .avg li span:last-child { text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); }
.gyr .actions { display:flex; flex-wrap:wrap; gap:10px; margin-top:2px; }
.gyr button.gbtn { font:600 15px var(--body); border-radius:999px; padding:12px 20px; border:1.5px solid var(--ink); background:transparent; color:var(--ink); cursor:pointer; }
.gyr a.gbtn { display:inline-flex; align-items:center; font:600 15px var(--body); border-radius:999px; padding:12px 20px; border:1.5px solid var(--ink); color:var(--ink); text-decoration:none; }
.gyr button.gbtn.primary { background:var(--ember); border-color:var(--ember); color:#fff; }
.gyr button.gbtn.primary:hover { background:#A9411F; border-color:#A9411F; }
.gyr button:focus-visible, .gyr a:focus-visible { outline:3px solid var(--ember); outline-offset:3px; }
.gyr pre.share { margin:0; padding:10px 12px; border:1px dashed var(--rule); border-radius:8px; font:13px/1.5 var(--body); white-space:pre-wrap; user-select:text; -webkit-user-select:text; }
.gyr pre.share[hidden] { display:none; }
.gyr .statusrow { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.gyr #gyr-status { margin:0; min-height:1.45em; font-weight:500; }
.gyr button.quiet { font:500 12.5px var(--body); padding:7px 12px; border-radius:999px; border:1px solid var(--rule); color:var(--muted); background:transparent; cursor:pointer; flex:none; }
.gyr button.quiet[aria-pressed="true"] { color:var(--ink); border-color:var(--ink); }
.gyr .gyr-how { font-size:14px; font-weight:500; text-decoration:underline; text-underline-offset:3px; width:fit-content; }

/* "How it works" panel (Play page) */
.gyr-legend { display:grid; gap:8px; font-size:15px; line-height:1.5; }
.gyr-legend h2 { font-family:"Newsreader",Georgia,serif; font-weight:500; font-size:22px; margin:14px 0 2px; }
.gyr-legend ul { list-style:none; margin:0; padding:0; display:grid; gap:8px; }
.gyr-legend li { display:grid; grid-template-columns:24px 1fr; gap:10px; align-items:start; }
.gyr-legend .ico { width:22px; height:22px; margin-top:1px; color:var(--c); }
.gyr-legend [data-k="eat"] { --c:#5E7F4F; } .gyr-legend [data-k="move"] { --c:#3F6E8C; }
.gyr-legend [data-k="sleep"] { --c:#2E3560; } .gyr-legend [data-k="connect"] { --c:#A88457; }
.gyr-legend .decades li { grid-template-columns:96px 1fr; }
.gyr-legend .rules { list-style:disc; padding-left:20px; }
.gyr-legend .rules li { display:list-item; }
.gyr-legend .decades b { font-family:"Newsreader",Georgia,serif; font-weight:500; font-size:17px; }

@media (prefers-reduced-motion: reduce) { .gyr .gyr-top { transition:none; } .gyr .meter.need .bar, .gyr .meter.got .bar i { animation:none; } }
/* Home page ("keep"): a short results card. Title, guide link and buttons only; the full breakdown stays on the Play page. */
.gyr.keep #gyr-whyLine, .gyr.keep #gyr-goodLine, .gyr.keep #gyr-goodNote, .gyr.keep #gyr-avg, .gyr.keep #gyr-resLine { display:none !important; }
/* Results buttons: Run again, Share and Leaderboard on one line, even on a small phone. */
.gyr .overlay .actions { flex-wrap:nowrap; gap:8px; }
.gyr .overlay .actions .gbtn { padding:10px 15px; font-size:14.5px; white-space:nowrap; }
.gyr.keep .overlay h2 { padding-right:112px; }
