:root { color-scheme: light; }
  html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #bfe4f5; }
  canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
  canvas:active { cursor: grabbing; }
  #hud {
    position: fixed; left: 14px; bottom: 12px; z-index: 2;
    font: 600 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #2f3d22; text-shadow: 0 1px 0 rgba(255,255,255,.5);
    pointer-events: none; user-select: none;
  }
  #hud h1 { display: block; font-size: 15px; letter-spacing: .04em; margin: 0; font-weight: 700; }
  #skipHint {
    position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 4;
    font: 600 12px -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: .08em;
    color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.6); text-transform: uppercase;
    pointer-events: none; opacity: .85;
  }
  body.intro #prompt, body.intro #keyTag { display: none; }
  body:not(.intro) #skipHint { display: none; }
  #hud span { opacity: .78; }
  /* dev-only surfaces: hidden unless body.dev (toggle with ~, or ?dev) */
  #perf, #gear { display: none; }
  body.dev #perf, body.dev #gear { display: block; }
  #perf {
    position: fixed; right: 14px; top: 12px; z-index: 2;
    font: 600 11px/1.5 ui-monospace, Menlo, monospace;
    color: #2f3d22; background: rgba(255,255,255,.5); border-radius: 6px;
    padding: 6px 9px; pointer-events: none; user-select: none; white-space: pre;
  }
  #prompt {
    position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 3;
    font: 700 14px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #fff; text-shadow: 0 2px 6px rgba(0,0,0,.55);
    pointer-events: none; user-select: none; white-space: nowrap;
  }
  #found {
    position: fixed; left: 50%; top: 20%; transform: translateX(-50%); z-index: 3;
    background: rgba(255,247,221,.95); color: #6b4d06; border-radius: 14px;
    padding: 14px 26px; font: 800 20px -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 8px 26px rgba(0,0,0,.25); letter-spacing: .02em;
    opacity: 0; pointer-events: none; transition: opacity .35s;
  }
  #found.show { opacity: 1; }
  #prompt.far { color: #ff6a5a; text-shadow: 0 2px 6px rgba(0,0,0,.7); }
  #keyTag {
    position: fixed; left: 14px; top: 12px; z-index: 3; display: none;
    background: rgba(255,247,221,.94); color: #6b4d06; border-radius: 9px;
    padding: 7px 13px; font: 800 13px -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 3px 12px rgba(0,0,0,.2);
  }
  #keyTag.show { display: block; }
  #howto {
    position: fixed; inset: 0; z-index: 7; display: none;
    align-items: center; justify-content: center;
    background: rgba(24, 38, 18, .42); backdrop-filter: blur(2px);
  }
  #howto.show { display: flex; animation: howfade .35s ease both; }
  @keyframes howfade { from { opacity: 0 } to { opacity: 1 } }
  #howto .sheet {
    background: #fffdf4; border-radius: 22px; padding: 26px 30px 24px; max-width: 430px;
    text-align: center; box-shadow: 0 18px 50px rgba(0,0,0,.32);
    animation: howrise .4s cubic-bezier(.2,.9,.3,1) both;
  }
  @keyframes howrise { from { transform: translateY(16px) scale(.97) } to { transform: none } }
  #howto svg { display: block; margin: 0 auto 14px; }
  #howto h2 {
    margin: 0 0 6px; font: 800 26px/1.1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: .09em; color: #35461f;
  }
  #howto p {
    margin: 0 0 16px; font: 500 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #5a6349;
  }
  #howto .keys {
    display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; text-align: left;
    margin: 0 auto 20px; max-width: 300px;
    font: 500 13px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #4d5642;
  }
  #howto kbd {
    background: #eef0e4; border: 1px solid #d3d8c4; border-bottom-width: 2px;
    border-radius: 6px; padding: 3px 8px; font: 700 12px ui-monospace, Menlo, monospace;
    color: #3d4634; white-space: nowrap;
  }
  #howto button {
    border: 0; border-radius: 12px; padding: 13px 40px; cursor: pointer;
    font: 800 15px -apple-system, BlinkMacSystemFont, sans-serif; letter-spacing: .04em;
    background: #6fae3d; color: #fff; box-shadow: 0 4px 0 #5a8f31;
  }
  #howto button:active { transform: translateY(2px); box-shadow: 0 2px 0 #5a8f31; }
  #howto button:hover { filter: brightness(1.06); }
  #popup {
    position: fixed; inset: 0; z-index: 8; display: none;
    align-items: center; justify-content: center; background: rgba(20,30,15,.45);
  }
  #popup.show { display: flex; }
  #popup .card {
    background: #fffdf5; border-radius: 18px; padding: 26px 30px; max-width: 400px;
    text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.3);
  }
  #popup .ttl {
    font: 700 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #3a3020; margin-bottom: 18px;
  }
  #popup button {
    border: 0; border-radius: 10px; padding: 11px 22px; cursor: pointer; margin: 0 4px;
    font: 800 14px -apple-system, BlinkMacSystemFont, sans-serif;
    background: #6fae3d; color: #fff;
  }
  #popup button.ghost { background: #e4e7dc; color: #4b5340; }
  #popup button:hover { filter: brightness(1.07); }
  /* ---- tuning panel ---- */
  #gear {
    position: fixed; right: 14px; bottom: 12px; z-index: 5;
    width: 40px; height: 40px; border-radius: 10px; border: 0;
    background: rgba(255,255,255,.82); box-shadow: 0 2px 10px rgba(0,0,0,.18);
    font-size: 19px; line-height: 1; cursor: pointer; color: #2f3d22;
  }
  #gear:hover { background: #fff; }
  #panel {
    position: fixed; right: 0; top: 0; bottom: 0; width: 310px; z-index: 4;
    background: rgba(252,253,248,.96); box-shadow: -3px 0 22px rgba(0,0,0,.16);
    display: none; flex-direction: column;
    font: 500 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #2b2f24;
  }
  #panel.open { display: flex; }
  #panelHead {
    padding: 12px 14px 10px; border-bottom: 1px solid #e2e5d8;
    display: flex; gap: 8px; align-items: center;
  }
  #panelHead b { font-size: 13px; letter-spacing: .05em; flex: 1; }
  #panel button.act {
    border: 0; border-radius: 7px; padding: 7px 10px; cursor: pointer;
    background: #6fae3d; color: #fff; font-weight: 700; font-size: 11px;
  }
  #panel button.act.ghost { background: #dfe3d6; color: #46503a; }
  #panel button.act:hover { filter: brightness(1.07); }
  #rows { overflow-y: auto; padding: 4px 14px 22px; flex: 1; }
  .grp {
    margin: 14px 0 6px; font-size: 10px; font-weight: 800; letter-spacing: .1em;
    text-transform: uppercase; color: #8a9478;
  }
  .row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin: 7px 0; align-items: center; }
  .row label { grid-column: 1; }
  .row .val { grid-column: 2; font: 600 11px ui-monospace, Menlo, monospace; color: #6c7a58; }
  .row input[type=range] { grid-column: 1 / -1; width: 100%; margin: 1px 0 0; accent-color: #6fae3d; }
  .row input[type=color] { grid-column: 2; width: 34px; height: 20px; padding: 0; border: 1px solid #ccd2c0; border-radius: 4px; background: none; cursor: pointer; }
  .note { margin-top: 12px; font-size: 11px; color: #8a9478; line-height: 1.45; }
  #toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    background: #2f3d22; color: #fff; padding: 9px 16px; border-radius: 9px;
    font: 600 12px -apple-system, BlinkMacSystemFont, sans-serif; z-index: 9;
    opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  #toast.show { opacity: 1; }

/* --- anul.space site chrome (added by build-site.mjs) --- */
.hub-back {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 60; /* above the panels: the way home is always visible */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: #2f3d22;
  background: rgba(255, 255, 255, 0.86);
  border-radius: 10px;
  padding: 9px 13px;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  -webkit-tap-highlight-color: transparent;
}
.hub-back:hover, .hub-back:focus-visible { background: #fff; }
/* the gear lives bottom-right in dev mode; shift it clear of the hub chip */
body.dev #gear { right: 92px; }
