:root { --bg: #05060a; --accent: #ffc247; --accent-ink: #1e1300; }
#stage { cursor: crosshair; touch-action: none; }

#levels {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 64px);
  transform: translate(-50%, 10px);
  width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 160px); overflow-y: auto;
  padding: 16px 18px 18px; border-radius: 18px;
  background: var(--surface-strong); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 12;
  opacity: 0; visibility: hidden;
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s linear 0.18s;
}
#levels.open { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0s; }
.lv-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.lv-head h2 { font-family: var(--serif); font-weight: 400; font-size: 20px; }
.lv-x { display: grid; place-items: center; width: 36px; height: 36px; margin-right: -8px; border-radius: 10px; color: var(--muted); }
.lv-x:hover { background: var(--raised-2); color: var(--text); }
#levelGrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
#levelGrid button {
  display: grid; justify-items: center; gap: 2px; padding: 9px 2px 7px; border-radius: 12px;
  background: var(--raised); font-variant-numeric: tabular-nums;
}
#levelGrid button:hover:not(:disabled) { background: var(--raised-2); }
#levelGrid button.current { outline: 2px solid var(--accent); outline-offset: -2px; }
#levelGrid button:disabled { opacity: 0.35; cursor: default; }
#levelGrid b { font-size: 17px; font-weight: 600; }
#levelGrid span { font-size: 11px; letter-spacing: 1px; color: var(--accent); min-height: 14px; }

#result {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(340px, calc(100vw - 32px)); padding: 22px 22px 18px; text-align: center;
  border-radius: 20px; background: var(--surface-strong); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); z-index: 14;
  animation: res-in 0.35s var(--ease);
}
#result[hidden] { display: none; }
@keyframes res-in { from { opacity: 0; transform: translate(-50%, -44%) scale(0.96); } }
.res-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.res-stars { margin: 8px 0 4px; font-size: 44px; line-height: 1.1; letter-spacing: 6px; color: var(--accent); }
.res-stars i { font-style: normal; opacity: 0.2; }
.res-stars i.on { opacity: 1; }
.res-line { font-size: 15px; color: var(--muted); }
.res-actions { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
.res-actions .dock-btn { background: var(--raised); }
.res-actions .dock-btn.primary { background: var(--accent); }
@media (prefers-reduced-motion: reduce) { #result { animation: none; } }

.lv-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.5; color: var(--muted); }
.lv-more a { color: var(--accent); }
