/* Good Genes pilot page: you are one creature (web/live/pilot.js). Phone first. */
@font-face { font-family: Fredoka; src: url(Fredoka.ttf) format("truetype"); font-weight: 300 700; font-display: swap; }
:root {
  --ink: #06121a; --deep: #0b2427; --teal: #1a4e4a; --leaf: #47a47b; --mint: #aace93;
  --amber: #f2c66d; --text: #e6f2de; --cream: #fffdf4; --plum: #4a3b52; --coral: #e0675a;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--deep); color: var(--text);
  font: 16px/1.3 Fredoka, ui-rounded, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  touch-action: none; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
canvas#cv { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; }

.hud { position: fixed; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 10px) 16px 0;
  display: flex; gap: 10px; align-items: flex-start; pointer-events: none; }
.bars { flex: 1; min-width: 0; }
.bar { position: relative; height: 22px; border-radius: 11px; background: rgba(6,18,26,.72);
  border: 2px solid rgba(255,253,244,.25); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 50%; background: linear-gradient(90deg, #7fe0a0, #47a47b);
  transition: width .25s, background .25s; }
.bar .mark { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--amber); left: 85%; }
.bar.low i { background: linear-gradient(90deg, #f29a6d, #e0675a); }
.bar span { position: relative; display: block; text-align: center; font-size: 13px; line-height: 18px; font-weight: 600;
  color: var(--cream); text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.lifeline { margin-top: 6px; font-size: 14px; font-weight: 500; color: var(--cream);
  text-shadow: 0 1px 3px rgba(0,0,0,.8); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watch { pointer-events: auto; width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center;
  background: rgba(6,18,26,.72); text-decoration: none; font-size: 20px; border: 2px solid rgba(255,253,244,.25); }

.hint { position: fixed; left: 50%; top: 34%; transform: translateX(-50%); max-width: 300px; text-align: center;
  padding: 10px 16px; border-radius: 14px; background: rgba(6,18,26,.8); color: var(--cream); font-size: 17px;
  font-weight: 500; pointer-events: none; animation: bob 1.6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
.toast { position: fixed; left: 0; right: 0; top: calc(env(safe-area-inset-top) + 74px); text-align: center;
  pointer-events: none; font-size: 18px; font-weight: 600; color: var(--amber); text-shadow: 0 2px 4px rgba(0,0,0,.8);
  opacity: 0; transition: opacity .3s; }
.toast.on { opacity: 1; }
.net { position: fixed; left: 16px; bottom: calc(env(safe-area-inset-bottom) + 190px); font-size: 13px;
  color: var(--amber); background: rgba(6,18,26,.75); padding: 4px 10px; border-radius: 10px; }

.pad { position: fixed; width: 120px; height: 120px; margin: -60px 0 0 -60px; border-radius: 60px;
  border: 3px solid rgba(255,253,244,.35); background: rgba(255,253,244,.08); pointer-events: none;
  left: 86px; top: calc(100% - env(safe-area-inset-bottom) - 110px); opacity: .55; transition: opacity .15s; }
.pad.on { opacity: 1; }
.knob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 26px;
  background: rgba(255,253,244,.55); }

.btns { position: fixed; right: 14px; bottom: calc(env(safe-area-inset-bottom) + 22px); width: 170px; height: 170px; }
.btn { position: absolute; border: 0; border-radius: 50%; color: var(--ink); font: inherit; display: grid;
  place-items: center; align-content: center; gap: 0; touch-action: none; box-shadow: 0 4px 0 rgba(0,0,0,.35);
  transition: transform .06s, filter .2s, background .2s; }
.btn b { font-size: 26px; line-height: 1; }
.btn small { font-size: 12px; font-weight: 600; max-width: 84px; line-height: 1.1; text-align: center; }
.btn.a { right: 0; bottom: 0; width: 96px; height: 96px; background: var(--mint); }
.btn.b { left: 0; top: 0; width: 76px; height: 76px; background: #b9b2a4; }
.btn.b.ready { background: var(--amber); animation: glow 1s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 8px rgba(242,198,109,.35), 0 4px 0 rgba(0,0,0,.35); } }
.btn.off { filter: grayscale(.8) brightness(.7); }
.btn.down { transform: translateY(3px) scale(.96); box-shadow: 0 1px 0 rgba(0,0,0,.35); }

.card { position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); max-width: 420px; margin: 0 auto;
  background: var(--cream); color: var(--plum); border-radius: 22px; padding: 18px 16px 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5); text-align: center; touch-action: auto; }
.card h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.card .life { margin: 0 0 4px; font-size: 15px; }
.card .line { margin: 0 0 12px; font-size: 15px; font-weight: 600; color: #2f6f52; }
.cands { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 10px; }
.cand { border: 2px solid #e5dccb; background: #fff8ec; border-radius: 16px; padding: 8px 6px; font: inherit; color: var(--plum);
  display: grid; justify-items: center; gap: 4px; }
.cand:active, .cand.pick { border-color: var(--leaf); background: #eef7e6; }
.cand canvas { width: 64px; height: 64px; }
.cand .diff { font-size: 12px; line-height: 1.25; min-height: 30px; }
.cand .tag { font-size: 11px; font-weight: 600; color: #2f6f52; }
.card .foot { margin: 12px 0 0; font-size: 13px; color: #7a6a82; }
.primary { margin-top: 12px; border: 0; border-radius: 14px; padding: 12px 22px; font: inherit; font-weight: 600;
  background: var(--leaf); color: var(--cream); font-size: 17px; }
