:root { --green: #239063; --ink: #2e222f; --grey: #7f708a; --red: #e83b3b; --font: 'Jersey 10', monospace; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; color: var(--ink); font-family: var(--font); }
body { overscroll-behavior: none; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 0; }
.title { text-align: center; }
h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: 0.06em; }
#height { margin: 0; font-size: 14px; color: var(--green); font-weight: 700; }
#status { margin: 4px 0 0; min-height: 1.3em; text-align: center; font-size: 14px; color: var(--grey); }
canvas { flex: 1; width: 100%; min-height: 0; touch-action: none; display: block; }

/* Kept focusable (for the mobile keyboard) but invisible. */
#word { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; font-size: 16px; border: 0; padding: 0; }

.icon {
  width: 36px; height: 36px; border-radius: 0; border: 3px solid var(--ink); background: #fff;
  color: var(--green); font: 700 18px var(--font); display: grid; place-items: center;
  text-decoration: none; cursor: pointer; padding: 0;
}

dialog { border: 4px solid var(--ink); border-radius: 0; box-shadow: 6px 6px 0 rgb(46 34 47 / 0.35); padding: 20px 22px; max-width: min(360px, calc(100vw - 32px)); color: var(--ink); font-family: inherit; }
dialog::backdrop { background: rgb(255 255 255 / 0.7); }
dialog h2 { margin: 0 0 10px; font-size: 20px; }
dialog p { margin: 8px 0; line-height: 1.4; font-size: 15px; }
.letter { color: var(--green); }
.small { font-size: 13px; color: var(--grey); }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
dialog button {
  margin-top: 8px; padding: 8px 16px; border-radius: 0; border: 3px solid var(--ink);
  background: var(--green); color: #fff; font: 700 15px var(--font); cursor: pointer;
}
dialog button.ghost { background: #fff; color: var(--green); }
pre#share { font-family: system-ui, sans-serif; font-size: 14px; line-height: 1.2; white-space: pre; overflow-x: auto; margin: 10px 0; }
#status.link { color: var(--green); cursor: pointer; text-decoration: underline; }

#banner {
  position: absolute; left: 50%; bottom: 16px; /* over the tower's base, clear of the next word */ transform: translate(-50%, 0); margin: 0; pointer-events: none;
  padding: 10px 16px; background: var(--ink); color: #fbff86; font-size: 18px; font-weight: 700;
  border: 3px solid #fff; box-shadow: 4px 4px 0 rgb(46 34 47 / 0.4); white-space: nowrap; opacity: 0;
}
#banner.show { animation: banner 2.8s steps(12) forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 12px); } 12%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
