:root {
  --ink: #1d2a31;
  --paper: #f3f5f4;
  --orange: #e2551f;
  --blue: #1f9bd6;
  --ui: "Bahnschrift", "DIN Alternate", "Trebuchet MS", "Segoe UI", sans-serif;
  --talk: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #10161a; color: var(--ink); font-family: var(--ui); }
canvas#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }

#loading { position: fixed; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center; color: #dfe6e8; background: #10161a; font-size: 18px; z-index: 20; }
#loading .bar { width: 240px; height: 6px; background: #2b363c; border-radius: 3px; overflow: hidden; }
#loading i { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }

#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; }
#deeds { position: absolute; top: 18px; left: 20px; display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 14px;
  background: rgba(243,245,244,.92); border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.25); font-size: 17px; }
#deeds svg { width: 26px; height: 24px; margin-left: 3px; fill: none; stroke: #9aa5a9; stroke-width: 2; transition: fill .4s, stroke .4s, transform .4s; }
#deeds svg.on { fill: #e23b4a; stroke: #e23b4a; transform: scale(1.12); }
#deeds .hearts { display: flex; }

#objective { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); max-width: min(560px, 60vw); padding: 10px 18px;
  background: rgba(29,42,49,.82); color: #fff; border-radius: 12px; font-size: 17px; line-height: 1.35; text-align: center; }
#objective:empty { display: none; }

#prompt { position: absolute; bottom: 12vh; left: 50%; transform: translateX(-50%); padding: 10px 18px; background: var(--paper);
  border-radius: 999px; font-size: 17px; box-shadow: 0 3px 12px rgba(0,0,0,.3); white-space: nowrap; }
#prompt kbd { display: inline-block; min-width: 26px; padding: 1px 7px; margin-right: 8px; text-align: center; font: inherit; font-weight: 700;
  color: #fff; background: var(--orange); border-radius: 6px; }

#dialogue { position: absolute; left: 50%; bottom: 5vh; transform: translateX(-50%); width: min(680px, 92vw); padding: 18px 24px 16px;
  background: var(--paper); border-radius: 16px; border-left: 8px solid var(--orange); box-shadow: 0 8px 30px rgba(0,0,0,.35); pointer-events: auto; cursor: pointer; }
#dialogue .who { font-size: 16px; font-weight: 700; color: var(--orange); margin-bottom: 4px; }
#dialogue p { margin: 0; font-family: var(--talk); font-size: 21px; line-height: 1.45; min-height: 2.9em; }
#dialogue .next { margin-top: 8px; text-align: right; font-size: 14px; color: #5d6b71; }

#title, #end { position: fixed; inset: 0; display: flex; align-items: flex-end; padding: 6vh 5vw; z-index: 10;
  background: linear-gradient(to top, rgba(12,18,22,.72), rgba(12,18,22,0) 62%); }
#end { align-items: center; justify-content: center; background: rgba(12,18,22,.45); }
.panel { max-width: 560px; padding: 26px 30px 28px; background: var(--paper); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.panel h1 { margin: 0 0 10px; font-size: 40px; line-height: 1.1; font-weight: 700; }
.panel p { margin: 0 0 14px; font-family: var(--talk); font-size: 19px; line-height: 1.5; }
.panel p.keys { font-family: var(--ui); font-size: 15.5px; color: #44535a; }
button { font: inherit; font-size: 19px; font-weight: 700; padding: 12px 24px; border: 0; border-radius: 10px; color: #fff; background: var(--orange); cursor: pointer; pointer-events: auto; }
button:hover { background: #c94513; }
button.quiet { background: transparent; color: var(--ink); font-weight: 400; text-decoration: underline; }
button.quiet:hover { background: rgba(0,0,0,.06); }

#stick { position: absolute; left: 28px; bottom: 28px; width: 130px; height: 130px; border-radius: 50%; background: rgba(243,245,244,.28);
  border: 2px solid rgba(255,255,255,.55); pointer-events: auto; touch-action: none; }
#stick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; background: rgba(243,245,244,.9); }
#act { position: absolute; right: 30px; bottom: 46px; width: 96px; height: 96px; border-radius: 50%; padding: 0; box-shadow: 0 4px 14px rgba(0,0,0,.35); }

@media (max-width: 700px) {
  .panel h1 { font-size: 30px; }
  #objective { top: 70px; max-width: 92vw; }
  #dialogue p { font-size: 18px; }
}
