@font-face { font-family: "Anton"; src: url("/fonts/anton.woff2") format("woff2"); font-display: swap; }

:root {
  --blue: #0052ff;
  --blue-deep: #0033a8;
  --blue-dark: #001a5c;
  --ink: #0a0f2a;
  --white: #ffffff;
  --paper: #f3f6ff;
  --yellow: #ffd400;
  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { font-family: var(--body); color: var(--white); background: var(--blue); line-height: 1.45; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
h1, h2 { font-family: var(--display); font-weight: 400; letter-spacing: .01em; margin: 0; text-transform: uppercase; }

/* ---------- caution tape marquee */
.tape { background: repeating-linear-gradient(135deg, var(--white) 0 22px, var(--blue) 22px 44px); padding: 3px 0; overflow: hidden; }
.tape-track { display: flex; width: max-content; background: var(--ink); color: var(--white); font-family: var(--display); font-size: 15px; letter-spacing: .12em; padding: 6px 0; animation: tape 40s linear infinite; }
.tape-track.rev { animation-direction: reverse; }
.tape-track span { padding: 0 .5em; white-space: nowrap; }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(16px, 4vw, 48px); background: var(--blue-dark); border-bottom: 3px solid var(--white); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img { border-radius: 50%; border: 2px solid var(--white); }
.brand span { font-family: var(--display); font-size: 22px; line-height: 1; display: flex; flex-direction: column; }
.brand small { font-family: var(--body); font-weight: 700; font-size: 10px; letter-spacing: .25em; opacity: .8; }
.links { display: flex; gap: 6px 18px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.links a { text-decoration: none; opacity: .9; }
.links a:hover { text-decoration: underline; opacity: 1; }

/* ---------- buttons */
.btn { --bg: var(--white); --fg: var(--blue); display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--bg); color: var(--fg); border: 3px solid var(--ink); border-radius: 12px; padding: 10px 16px; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 4px 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; white-space: nowrap; }
.btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.big { font-size: 18px; padding: 14px 22px; }
.btn.small { padding: 6px 12px; font-size: 13px; box-shadow: 3px 3px 0 var(--ink); }
.btn.mini { padding: 6px 10px; font-size: 13px; border-width: 2px; box-shadow: 2px 2px 0 var(--ink); border-radius: 8px; }
.btn.ghost { --bg: transparent; --fg: var(--white); border-color: var(--white); box-shadow: 4px 4px 0 rgba(255,255,255,.35); }
.btn.primary { --bg: var(--yellow); --fg: var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- hero */
.hero { display: grid; grid-template-columns: minmax(240px, 400px) 1fr; gap: clamp(20px, 5vw, 64px); align-items: center; padding: clamp(28px, 6vw, 72px) clamp(16px, 4vw, 48px); max-width: 1200px; margin: 0 auto; }
.hero-cat { position: relative; justify-self: center; }
.hero-cat img { width: min(360px, 80vw); height: auto; border-radius: 50%; border: 6px solid var(--white); box-shadow: 0 0 0 6px var(--ink), 12px 12px 0 var(--ink); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-10px) rotate(1deg); } }
.hero-badge { position: absolute; right: -8px; bottom: 18px; background: var(--yellow); color: var(--ink); font-family: var(--display); letter-spacing: .08em; padding: 6px 12px; border: 3px solid var(--ink); border-radius: 8px; transform: rotate(-6deg); box-shadow: 3px 3px 0 var(--ink); }
.hero h1 { font-size: clamp(56px, 10vw, 128px); line-height: .9; text-shadow: 6px 6px 0 var(--ink); }
.lede { font-size: clamp(16px, 2vw, 20px); font-weight: 600; margin: 18px 0 22px; max-width: 60ch; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
.cta-row.center { justify-content: center; margin-top: 28px; }
.stats { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 0 16px; }
.stat { background: var(--blue-dark); border: 3px solid var(--white); border-radius: 12px; padding: 10px 16px; min-width: 140px; }
.stat b { display: block; font-family: var(--display); font-size: 30px; line-height: 1; letter-spacing: .02em; }
.stat span { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.stat i { font-style: normal; }
.stat i.up { color: #7dffb0; } .stat i.down { color: #ff8a8a; }
.ca { display: inline-flex; align-items: center; gap: 10px; background: var(--ink); border-radius: 12px; padding: 8px 8px 8px 14px; max-width: 100%; }
.ca-label { font-weight: 900; letter-spacing: .2em; font-size: 12px; opacity: .8; }
.ca code { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- sections */
section { padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px); }
.section-head { text-align: center; max-width: 800px; margin: 0 auto 28px; }
.section-head h2 { font-size: clamp(38px, 6vw, 72px); line-height: 1; text-shadow: 4px 4px 0 var(--ink); }
.section-head p { font-weight: 600; opacity: .95; margin: 10px 0 0; }

/* ---------- maker */
.maker { background: var(--paper); color: var(--ink); }
.maker .section-head h2 { color: var(--blue); text-shadow: 4px 4px 0 var(--ink); }
.maker-grid { display: grid; grid-template-columns: minmax(280px, 560px) minmax(280px, 420px); gap: 28px; justify-content: center; align-items: start; max-width: 1100px; margin: 0 auto; }
.stage-wrap { position: sticky; top: 84px; }
.stage { position: relative; aspect-ratio: 1; width: 100%; border: 4px solid var(--ink); border-radius: 16px; overflow: hidden; background: #dfe6ff; box-shadow: 8px 8px 0 var(--ink); touch-action: none; user-select: none; }
.stage canvas { width: 100%; height: 100%; display: block; cursor: grab; }
.stage.dragging canvas { cursor: grabbing; }
.drop-hint { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,82,255,.12); cursor: pointer; }
.drop-hint.hidden { display: none; }
.drop-inner { text-align: center; background: var(--white); border: 3px dashed var(--blue); border-radius: 16px; padding: 24px 28px; color: var(--blue); font-weight: 800; }
.drop-inner span { display: block; font-size: 13px; font-weight: 600; opacity: .8; margin-top: 4px; }
.drop-icon { font-size: 40px; }
.stage.over .drop-hint { background: rgba(0,82,255,.3); }
.stage.over .drop-inner { transform: scale(1.04); }
.stage-tip { font-size: 12px; font-weight: 600; opacity: .7; margin: 10px 2px 0; }

.controls { display: flex; flex-direction: column; gap: 14px; }
.ctl-group { background: var(--white); border: 3px solid var(--ink); border-radius: 14px; padding: 14px; box-shadow: 5px 5px 0 var(--ink); }
.ctl-title { font-family: var(--display); font-size: 20px; letter-spacing: .06em; color: var(--blue); margin-bottom: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.tiny { margin-top: 8px; }
.slider { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 700; font-size: 13px; }
.slider input { width: 100%; accent-color: var(--blue); }
.seg { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; padding: 3px; gap: 3px; display: inline-flex; }
.seg-btn { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; font-weight: 800; cursor: pointer; color: var(--ink); }
.seg-btn.active { background: var(--blue); color: var(--white); }
.swatches { margin-top: 10px; }
.sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--ink); background: var(--c); cursor: pointer; padding: 0; position: relative; }
.sw.active { outline: 3px solid var(--blue); outline-offset: 2px; }
.sw.custom { display: grid; place-items: center; background: #fff; font-size: 16px; overflow: hidden; }
.sw.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 700; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); }
.actions { display: flex; flex-direction: column; gap: 10px; background: var(--blue-dark); color: var(--white); }
.actions .btn { width: 100%; }
.handle-row { background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; padding: 0 12px; flex-wrap: nowrap; }
.handle-row .at { font-weight: 900; opacity: .6; }
.handle-row input { flex: 1; border: 0; padding: 12px 6px; outline: none; background: transparent; min-width: 0; font-weight: 700; }
.msg { min-height: 1.4em; font-size: 14px; font-weight: 700; text-align: center; }
.msg.err { color: #ffb0b0; } .msg.ok { color: #9dffc4; }

/* ---------- wall */
.wall { background: var(--blue-dark); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; max-width: 1200px; margin: 0 auto; }
.brick { background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: 4px 4px 0 var(--ink); animation: pop .3s ease-out both; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.brick img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.brick .meta { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 8px; font-size: 12px; font-weight: 800; }
.brick .meta a { color: var(--blue); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brick .meta .num { font-family: var(--display); letter-spacing: .05em; color: var(--blue); }
.wall .empty { grid-column: 1 / -1; text-align: center; font-weight: 700; opacity: .8; padding: 40px 0; }
.center { text-align: center; margin-top: 22px; }

/* ---------- code */
.code { background: var(--blue); }
.rules { max-width: 760px; margin: 0 auto; padding: 0; list-style: none; counter-reset: r; display: grid; gap: 12px; }
.rules li { counter-increment: r; background: var(--white); color: var(--ink); border: 3px solid var(--ink); border-radius: 14px; padding: 14px 18px 14px 74px; position: relative; font-weight: 600; box-shadow: 5px 5px 0 var(--ink); }
.rules li::before { content: counter(r, decimal-leading-zero); position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-family: var(--display); font-size: 34px; color: var(--blue); }
.rules b { color: var(--blue); }

/* ---------- footer */
footer { background: var(--ink); padding: 32px clamp(16px, 4vw, 48px) 40px; text-align: center; font-size: 14px; }
.foot-links { display: flex; gap: 8px 22px; justify-content: center; flex-wrap: wrap; font-weight: 700; margin-bottom: 12px; }
.foot-ca { opacity: .8; word-break: break-all; }
.disclaimer { max-width: 720px; margin: 12px auto 0; opacity: .6; font-size: 12px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { display: flex; flex-direction: column; align-items: center; }
  .cta-row, .stats { justify-content: center; }
  .maker-grid { grid-template-columns: 1fr; }
  .stage-wrap { position: static; }
  .links a:nth-child(3) { display: none; }
}
.ctl-group .btn.ghost { --fg: var(--blue); border-color: var(--blue); box-shadow: 4px 4px 0 var(--ink); }
[hidden] { display: none !important; }
.actions .btn.ghost { --fg: var(--white); border-color: var(--white); box-shadow: 4px 4px 0 rgba(255,255,255,.35); }
