:root { --bg: #ecebf0; --ink: #1b1726; --mute: #6c6878; --pink: #ff2e93; }
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(120% 80% at 70% 0%, #f7f6fa 0%, var(--bg) 60%); color: var(--ink); font: 15px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: inherit; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; font-family: Unbounded, sans-serif; font-size: 14px; }
.top nav a { margin-left: 18px; text-decoration: none; color: var(--mute); font-family: ui-sans-serif, system-ui, sans-serif; }
.hero { max-width: 1240px; position: relative; display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 12px; padding: 0 24px; min-height: min(86vh, 860px); }
.copy { padding-top: 6vh; z-index: 2; }
h1 { font: 44px/1.12 "Black Han Sans", sans-serif; margin: 0 0 16px; letter-spacing: -0.5px; }
h1 span { font: 800 32px/1.2 Unbounded, sans-serif; color: var(--pink); letter-spacing: -1px; }
.copy p { color: #44404f; max-width: 380px; }
#write { display: flex; gap: 6px; margin: 20px 0 10px; }
input, button { font: inherit; border-radius: 10px; border: 1px solid #d4d1dc; background: #fff; padding: 9px 12px; color: var(--ink); }
input { flex: 1; min-width: 0; }
button { cursor: pointer; } button:hover { border-color: var(--ink); }
#write button { background: var(--ink); color: #fff; border-color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
kbd { font: 11px "Space Mono", monospace; color: var(--mute); border: 1px solid #ddd; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
#count { font: 12px "Space Mono", monospace; color: var(--mute); margin-left: 6px; }
#stage { width: 100%; height: 100%; touch-action: none; display: block; }
.hero canvas { position: relative; }
section { padding: 24px; max-width: 1100px; margin: 0 auto; }
h2 { font: 800 22px Unbounded, sans-serif; } h2 small { font: 12px "Space Mono", monospace; color: var(--mute); margin-left: 8px; }
#gallery { display: flex; flex-wrap: wrap; gap: 12px; }
#gallery canvas, #gallery img { width: 120px; cursor: pointer; border-radius: 2px; box-shadow: 0 6px 18px rgba(40, 20, 60, .15); transition: transform .15s; }
#gallery canvas:hover { transform: translateY(-3px) rotate(-1deg); }
.empty { color: var(--mute); }
pre { background: #1b1726; color: #f2eff8; padding: 16px; border-radius: 12px; overflow: auto; font: 13px/1.5 "Space Mono", monospace; }
table { border-collapse: collapse; width: 100%; font-size: 14px; } td { border-top: 1px solid #d9d6e0; padding: 8px 6px; vertical-align: top; } td:first-child { white-space: nowrap; }
code { font-family: "Space Mono", monospace; font-size: .92em; }
footer { padding: 30px 24px 50px; text-align: center; color: var(--mute); font-size: 13px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: 0; } .copy { padding-top: 8px; } h1 { font-size: 34px; } h1 span { font-size: 24px; }
  #stage { height: 160vw; max-height: 780px; } td:first-child { white-space: normal; }
}
.cur { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; margin: -10px 0 0 -14px; filter: drop-shadow(0 3px 4px rgba(30, 10, 50, .3)); }
.cur svg path { fill: #fff; stroke: #1b1726; stroke-width: 1.3; stroke-linejoin: round; } .cur .closed { display: none; } .cur.down .closed { display: block; } .cur.down .open { display: none; }
.cur i { position: absolute; left: 34px; top: 30px; font: 700 13px "Space Mono", monospace; font-style: normal; background: #1b1726; color: #fff; border-radius: 7px; padding: 3px 8px; white-space: nowrap; } .cur i:empty { display: none; }

/* film mode: the stage only */
body.film { background: radial-gradient(120% 90% at 50% 0%, #f8f7fb 0%, var(--bg) 70%); overflow: hidden; }
body.film .top, body.film section:not(.hero), body.film footer, body.film .copy { display: none; }
body.film .hero { display: block; padding: 0; min-height: 0; height: 100vh; max-width: none; }
body.film #stage { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; }
.filmtag { position: fixed; left: 28px; bottom: 22px; pointer-events: none; font: 800 15px Unbounded, sans-serif; color: var(--ink); display: none; }
.filmtag span { font: 13px "Space Mono", monospace; color: var(--mute); margin-left: 8px; }
body.film .filmtag { display: block; }
.filmhead { position: fixed; left: 28px; top: 24px; display: none; pointer-events: none; } body.film .filmhead { display: block; }
.filmhead b { display: block; font: 30px/1.15 "Black Han Sans", sans-serif; } .filmhead span { font: 800 20px Unbounded, sans-serif; color: var(--pink); }

@media (orientation: portrait) { body.film .filmhead { left: 0; right: 0; top: 34px; text-align: center; } body.film .filmhead b { font-size: 40px; } body.film .filmhead span { font-size: 24px; } body.film .filmtag { left: 0; right: 0; text-align: center; } }
