:root {
  --bg: #071116; --panel: #10222a; --line: #24454f; --txt: #e2ecee; --dim: #8ca5ac;
  --cyan: #6fe3ff; --gold: #e8a23a; --rust: #8e3b2a; --ok: #5be39a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt);
  font-family: "Bahnschrift", "Segoe UI", system-ui, sans-serif; }
#app { display: flex; flex-direction: column; min-height: 100%; max-width: 1280px; margin: 0 auto; padding: 8px; gap: 8px; }
#hud { display: flex; align-items: center; gap: 12px; }
.brand { font-weight: 700; letter-spacing: .12em; color: var(--cyan); white-space: nowrap; }
.brand span { color: var(--dim); }
#steps { display: flex; gap: 6px; list-style: none; margin: 0 auto 0 0; padding: 0; flex-wrap: wrap; }
#steps li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--dim); font-size: 14px; }
#steps li.active { color: var(--bg); background: var(--cyan); border-color: var(--cyan); }
#steps li.done { color: var(--ok); border-color: var(--ok); }
button, .secondary, .primary { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); text-decoration: none; }
.icon { background: var(--panel); color: var(--txt); padding: 6px 10px; font-size: 18px; }
#stage { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
canvas { width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--gold); }
.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 3%; background: rgba(5, 12, 16, .92); overflow: auto; gap: 10px; }
.overlay.hidden, .hidden { display: none !important; }
.overlay h1 { margin: 0; font-size: clamp(22px, 4vw, 44px); color: var(--cyan); letter-spacing: .04em; }
.overlay .lead { max-width: 720px; margin: 0; color: var(--txt); font-size: clamp(14px, 1.8vw, 19px); }
.logo { width: clamp(70px, 14vw, 150px); border-radius: 12px; }
.howto { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; max-width: 760px; text-align: left; font-size: clamp(13px, 1.6vw, 16px); }
.howto h2 { margin: 2px 0; font-size: 1.05em; color: var(--gold); }
.howto ol { margin: 6px 0; padding-left: 20px; }
.controls { color: var(--dim); margin: 4px 0; }
.primary { background: var(--cyan); color: #04161d; border-color: var(--cyan); padding: 12px 26px; font-size: 18px; font-weight: 700; }
.primary:hover, .primary:focus-visible { background: #a6f0ff; }
.secondary { background: var(--panel); color: var(--txt); padding: 12px 22px; font-size: 17px; display: inline-block; }
.small { padding: 6px 14px; font-size: 15px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
#stars { font-size: clamp(30px, 5vw, 52px); color: var(--gold); letter-spacing: .15em; }
#stats { list-style: none; padding: 0; margin: 0; color: var(--dim); font-size: 16px; }
#talk { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; min-height: 76px; }
.avatar { width: 58px; height: 58px; object-fit: contain; flex: none; transition: transform .2s; }
.avatar.bounce { transform: translateY(-6px) rotate(-6deg); }
.bubble { flex: 1; font-size: clamp(14px, 1.9vw, 19px); line-height: 1.35; }
.bubble b { color: var(--gold); }
.rotate-hint { display: none; color: var(--gold); margin: 0; font-size: 14px; }
@media (max-width: 760px) and (orientation: portrait) {
  .overlay { position: fixed; z-index: 20; justify-content: flex-start; padding: 18px 14px 28px; }
  .rotate-hint { display: block; }
}
@media (max-width: 640px) {
  #app { padding: 4px; }
  .brand span, #steps li { font-size: 12px; }
  #steps li { padding: 3px 7px; }
  .avatar { width: 44px; height: 44px; }
  .howto { padding: 6px 10px; }
}
