/* Achievements, developer mode, and the piano echo game. */
.ach-toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 95;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--panel-solid);
  border: 1px solid var(--accent);
  color: var(--text);
  font: 500 13px/1.3 var(--mono);
  box-shadow: 0 10px 30px -10px #000;
}
.ach-toast[hidden] { display: none !important; }
.ach-toast .ach-name { white-space: nowrap; }
.ach-toast .kicker {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.ach-count {
  position: fixed;
  z-index: 40;
  left: max(12px, env(safe-area-inset-left, 0px));
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel-solid);
  color: var(--muted);
  font: 500 12px/1 var(--mono);
  cursor: pointer;
}
.ach-count:hover { color: var(--text); border-color: var(--accent); }
.ach-count b { color: var(--accent); font-weight: 600; }
body.editing .ach-toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
body.editing .ach-count { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }

html.dev-mode .dev-scan {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(62, 245, 184, .05) 0 1px,
    transparent 1px 4px
  );
  mix-blend-mode: screen;
}
html.dev-mode .dev-badge {
  position: fixed;
  z-index: 65;
  top: max(8px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: #3ef5b8;
  color: #04110c;
  font: 600 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: none;
}

.echo-game {
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--sunk);
}
.echo-game[hidden] { display: none !important; }
.echo-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 12px; color: var(--muted); }
.echo-top b { color: var(--text); font-weight: 600; }
.echo-top .echo-stop {
  margin-left: auto;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 500 12px var(--mono);
  cursor: pointer;
}
.echo-status { margin: 0; color: var(--text); font-size: 13px; }
.echo-keys { display: flex; gap: 8px; }
.echo-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 76px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(#fbf6ea, #e4dac3);
  color: #24180a;
  font: 600 22px/1 var(--display);
  cursor: pointer;
  touch-action: manipulation;
}
.echo-key small { font: 500 11px/1 var(--mono); color: #6d5c3e; letter-spacing: .08em; }
.echo-key.is-lit { background: var(--accent); color: var(--on-accent); }
.echo-key.is-lit small { color: var(--on-accent); }
.echo-key.is-bad { background: var(--accent-2); color: #fff; }
#echoLaunch { justify-self: start; }

@media (prefers-reduced-motion: reduce) {
  .ach-toast, .ach-count, html.dev-mode .dev-scan, html.dev-mode .dev-badge {
    animation: none !important;
    transition: none !important;
  }
}
