/* Ridgeline feel test (2026-10-17, Jordan). Graphite only: the art pass comes later, if the verb earns it. */
:root {
  --ink: #1d1e21;
  --paper: #e9e7e2;
  --mid: #8d8e92;
  --hot: #f2efe6;
  --cond: "Avenir Next Condensed", "Bahnschrift", "DIN Condensed", "Arial Narrow", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: #3a3b3f; color: var(--paper);
  font-family: var(--cond); -webkit-text-size-adjust: 100%; overscroll-behavior: none; }
body { position: fixed; inset: 0; }
canvas#game { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; outline: none; }

/* Beta strip: overlays the top-left so the canvas fills the whole screen */
.rl-strip { position: fixed; top: 0; left: 0; z-index: 5; display: flex; align-items: center; gap: 2px;
  padding: env(safe-area-inset-top, 0px) 6px 0 max(6px, env(safe-area-inset-left)); min-height: 40px;
  font: 600 12px/1 var(--mono); letter-spacing: .03em; }
.rl-strip a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; color: #f1ede3; text-decoration: none;
  border-radius: 6px; background: rgba(20, 21, 24, .35); margin-right: 4px; touch-action: manipulation; }
.rl-strip a:hover { background: rgba(20, 21, 24, .6); }
.rl-strip a:focus-visible, button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.rl-strip-note { padding: 0 8px; color: rgba(241, 237, 227, .7); font-weight: 400; white-space: nowrap; }
@media (max-width: 520px) { .rl-strip-note { display: none; } }

/* HUD readouts */
#hud { position: fixed; z-index: 4; left: max(14px, env(safe-area-inset-left)); top: calc(env(safe-area-inset-top, 0px) + 50px);
  display: flex; gap: 18px; pointer-events: none; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.rl-read { display: grid; grid-template-columns: auto auto; column-gap: 4px; align-items: baseline; }
.rl-k { grid-column: 1 / -1; font: 600 10px/1.2 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: rgba(241, 237, 227, .72); }
.rl-v { font: 700 30px/1 var(--cond); font-variant-numeric: tabular-nums; color: var(--hot); min-width: 2.2ch; }
.rl-u { font: 600 13px/1 var(--cond); color: rgba(241, 237, 227, .72); }

/* Perfect landing flash */
#flash { position: fixed; z-index: 4; left: 50%; top: 22%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  opacity: 0; color: var(--hot); text-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
#flash span { display: block; font: 800 clamp(30px, 6vw, 54px)/1 var(--cond); letter-spacing: .12em; text-transform: uppercase; }
#flash small { display: block; margin-top: 4px; font: 600 14px/1 var(--mono); letter-spacing: .14em; color: rgba(241, 237, 227, .8); }
#flash.is-rough span { font-size: clamp(18px, 3.4vw, 26px); color: #cfc9bd; letter-spacing: .2em; }
#flash.is-on { animation: rl-flash .9s ease-out forwards; }
@keyframes rl-flash { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.82); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  30% { transform: translate(-50%, -50%) scale(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%); } }
.rl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Start card */
#start { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; background: rgba(40, 41, 45, .38); touch-action: none; }
#start[hidden] { display: none; }
.rl-card { max-width: 440px; padding: 26px 28px 24px; border-radius: 4px; background: rgba(28, 29, 32, .88); border-top: 3px solid var(--paper);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35); pointer-events: none; }
.rl-eyebrow { margin: 0 0 6px; font: 600 11px/1.2 var(--mono); letter-spacing: .2em; text-transform: uppercase; color: var(--mid); }
.rl-card h1 { margin: 0; font: 800 clamp(44px, 9vw, 64px)/.95 var(--cond); letter-spacing: .02em; text-transform: uppercase; color: var(--hot); }
.rl-how { margin: 14px 0 0; font: 600 24px/1.2 var(--cond); }
.rl-how b { color: #fff; }
.rl-tip { margin: 10px 0 0; font: 400 17px/1.4 var(--cond); color: #cfccc4; }
.rl-keys { margin: 12px 0 0; font: 500 12px/1.5 var(--mono); color: var(--mid); }
.rl-go { margin: 18px 0 0; font: 700 15px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--hot); animation: rl-pulse 1.6s ease-in-out infinite; }
@keyframes rl-pulse { 50% { opacity: .45; } }

/* Tune: corner button + panel */
#tuneBtn { position: fixed; z-index: 7; top: calc(env(safe-area-inset-top, 0px) + 4px); right: max(8px, env(safe-area-inset-right));
  min-width: 64px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(241, 237, 227, .35); border-radius: 6px;
  background: rgba(20, 21, 24, .35); color: #f1ede3; font: 600 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; cursor: pointer; touch-action: manipulation; }
#tuneBtn[aria-expanded="true"] { background: var(--paper); color: var(--ink); }
#tune { position: fixed; z-index: 8; top: 0; right: 0; bottom: 0; width: min(360px, 92vw); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(env(safe-area-inset-top, 0px) + 54px) max(16px, env(safe-area-inset-right)) calc(env(safe-area-inset-bottom, 0px) + 20px) 16px;
  background: rgba(24, 25, 28, .95); border-left: 1px solid #4b4c51; color: var(--paper); font: 400 14px/1.35 var(--cond); touch-action: pan-y; }
#tune[hidden] { display: none; }
.tn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tn-head strong { font: 800 22px/1 var(--cond); letter-spacing: .08em; text-transform: uppercase; }
.tn-x { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--paper); font-size: 28px; cursor: pointer; }
.tn-opt { display: flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; }
.tn-opt input { width: 20px; height: 20px; }
.tn-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.tn-btn { min-height: 40px; padding: 0 12px; border: 1px solid #66676c; border-radius: 6px; background: #2c2d31; color: var(--paper);
  font: 600 13px/1 var(--cond); letter-spacing: .04em; cursor: pointer; }
.tn-btn.pri { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.tn-code { margin: 6px 0; }
.tn-code textarea { width: 100%; padding: 8px; border: 1px solid #66676c; border-radius: 6px; background: #141518; color: var(--paper); font: 12px/1.4 var(--mono); resize: vertical; }
.tn-code .tn-btn { margin-top: 6px; }
.tn-msg { min-height: 1.2em; margin: 4px 0 8px; font: 12px/1.3 var(--mono); color: #c8c4ba; }
.tn-group { margin: 14px 0 4px; font: 600 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--mid); }
.tn-row { padding: 6px 0 8px; border-bottom: 1px solid #36373b; }
.tn-row label { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.tn-row output { font: 600 13px/1.4 var(--mono); color: #fff; }
.tn-row output.is-changed { color: #ffd27a; }
.tn-row small { display: block; color: var(--mid); font-size: 12.5px; line-height: 1.3; margin-top: 2px; }
.tn-row input[type=range] { width: 100%; height: 32px; margin: 2px 0 0; accent-color: #e9e7e2; }
.tn-foot { margin-top: 14px; font-size: 12.5px; color: var(--mid); }

@media (prefers-reduced-motion: reduce) {
  #flash.is-on { animation: rl-flash-calm .9s linear forwards; }
  @keyframes rl-flash-calm { 0%, 70% { opacity: 1; transform: translate(-50%, -50%); } 100% { opacity: 0; transform: translate(-50%, -50%); } }
  .rl-go { animation: none; }
}
