:root { --mono: JetBrains Mono, ui-monospace, monospace; --gap: 14px; --pad: 14px; }
* { box-sizing: border-box; }
html, body { margin: 0; background: #070d16; color: #cfe; font-family: var(--mono); }
body { overflow-x: hidden; }

#wall { position: relative; min-height: 100vh; min-height: 100svh; padding: var(--pad); overflow: hidden; background: #070d16; }
#wall[hidden] { display: none; }
#wall::after { content: ""; position: absolute; inset: 0; z-index: 7; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); }

#grid { --rows: 2; display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: calc((100vh - 2 * var(--pad) - (var(--rows) - 1) * var(--gap)) / var(--rows)); grid-auto-rows: calc((100svh - 2 * var(--pad) - (var(--rows) - 1) * var(--gap)) / var(--rows)); gap: var(--gap); }
@media (max-width: 640px) { #grid { --rows: 3; grid-template-columns: repeat(2, 1fr); } }

.cell { position: relative; min-width: 0; min-height: 0; }
.tile { position: absolute; inset: 0; overflow: hidden; border-radius: 12px; background: #0b121d; cursor: pointer; filter: brightness(.88) saturate(.9); outline: none; }
.tile canvas { display: block; width: 100%; height: 100%; }
.tile .name { position: absolute; left: 10px; bottom: 8px; font: 700 15px var(--mono); letter-spacing: 1px; color: #fff; text-shadow: 0 2px 0 #000; pointer-events: none; }
.tile .by { position: absolute; left: 10px; bottom: 28px; font: 500 10.5px var(--mono); letter-spacing: .5px; color: #cfe; text-shadow: 0 1px 0 #000; pointer-events: none; }
.tile.on { filter: none; box-shadow: 0 0 0 2px #ffd61f; }

.tile.big { position: fixed; z-index: 4; cursor: default; filter: none; box-shadow: 0 0 0 3px #ffd61f, 0 0 44px rgba(255,214,31,.5); }

.cmd { position: absolute; left: 50%; top: 50%; max-width: 90%; transform: translate(-50%, -50%); padding: 10px 16px; border: 0; border-radius: 10px; background: #ffd61f; color: #111; font: 600 14px var(--mono); text-align: center; cursor: pointer; opacity: 0; visibility: hidden; }
.tile.big .cmd { opacity: 1; visibility: visible; }
.cmd.done { background: #16c79a; color: #fff; }

.coin { position: absolute; z-index: 6; font: 700 16px var(--mono); color: #ffd61f; text-shadow: 0 2px 0 #000; pointer-events: none; }

#mute { position: absolute; right: 22px; top: 20px; z-index: 8; font: 700 16px var(--mono); color: #ffd61f; background: rgba(0,0,0,.45); border: 0; border-radius: 8px; padding: 4px 9px; cursor: pointer; }
#mute.off { opacity: .5; text-decoration: line-through; }
#mute.hint { box-shadow: 0 0 0 2px rgba(255,214,31,.55); }
@keyframes nudge { 0%, 100% { box-shadow: 0 0 0 2px rgba(255,214,31,.55); } 50% { box-shadow: 0 0 0 7px rgba(255,214,31,0); } }

#stick { position: fixed; left: 50%; bottom: 22px; width: 96px; height: 96px; margin-left: -48px; z-index: 5; pointer-events: none; }
#base { position: absolute; inset: 18px 6px 0 6px; border-radius: 50% / 40%; background: radial-gradient(ellipse at 50% 35%, #3a3f4a, #15181e); box-shadow: 0 8px 18px rgba(0,0,0,.6); }
#shaft { position: absolute; left: 44px; top: 20px; width: 8px; height: 46px; background: linear-gradient(90deg, #999, #eee, #888); border-radius: 4px; transform-origin: 50% 100%; }
#ball { position: absolute; left: -12px; top: -22px; width: 32px; height: 32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff8a8a, #e8213c 55%, #8a0f1e); box-shadow: 0 4px 8px rgba(0,0,0,.5); }
#stick.away { opacity: 0; pointer-events: none; }
@media (hover: none) { #stick { display: none; } }

#down { position: absolute; left: 50%; top: calc(100vh - 24px); top: calc(100svh - 24px); z-index: 8; transform: translateX(-50%); padding: 0 12px; font: 700 13px var(--mono); color: #8aa; text-decoration: none; }

#about { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 48px 16px; text-align: center; }
#about p { margin: 0; max-width: 34em; font-size: 18px; line-height: 1.5; }
#about h2 { margin: 14px 0 0; font: 700 22px var(--mono); letter-spacing: 1px; color: #ffd61f; }
#about .note { max-width: 34em; margin: 0 0 18px; font-size: 15px; line-height: 1.5; opacity: .85; }
.prompt { width: 100%; max-width: 40em; display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.prompt pre { margin: 0; padding: 14px 16px; border-radius: 10px; background: #0b121d; box-shadow: inset 0 0 0 1px #1d2b3d; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13.5px; line-height: 1.55; user-select: all; -webkit-user-select: all; }
.prompt code { font: inherit; }
.prompt mark { background: #ffd61f; color: #111; padding: 0 4px; border-radius: 4px; font-weight: 700; }
#copy-prompt { align-self: center; padding: 10px 16px; border: 0; border-radius: 10px; background: #ffd61f; color: #111; font: 600 14px var(--mono); cursor: pointer; }
#copy-prompt.done { background: #16c79a; color: #fff; }
#about .links { display: flex; gap: 22px; font-size: 15px; }
#about a { color: #ffd61f; }

@media (prefers-reduced-motion: no-preference) {
  #mute.hint { animation: nudge 1.6s ease-in-out infinite; }
  .tile { transition: filter .18s, box-shadow .18s; }
  .tile.big { transition: top .5s cubic-bezier(.2,.8,.2,1), left .5s cubic-bezier(.2,.8,.2,1), right .5s cubic-bezier(.2,.8,.2,1), bottom .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s; }
  .tile.big.nomotion { transition: none; }
  .cmd { transition: opacity .2s, visibility 0s .2s; }
  .tile.big .cmd { transition: opacity .2s .45s, visibility 0s .45s; }
  .cmd.done, #copy-prompt.done { animation: pop .35s; }
  .coin { animation: rise .9s ease-out forwards; }
  #shaft { transition: transform .08s; }
  #stick { transition: opacity .2s; }
}
@keyframes pop { 0% { scale: 1 } 40% { scale: 1.18 } 100% { scale: 1 } }
@keyframes rise { to { transform: translateY(-60px); opacity: 0; } }

.cmd code { font: inherit; user-select: all; -webkit-user-select: all; }
