:root {
  --bg: #0b1020;
  --bg2: #121a33;
  --card: #18203c;
  --accent: #2f6bff;
  --accent2: #00d4ff;
  --text: #eaf0ff;
  --muted: #9fb0d8;
  --ok: #25c685;
  --grid-line: rgba(255, 255, 255, 0.06);
  --occupied: #2a3358;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 50% -100px, #1a2550 0%, var(--bg) 60%);
  color: var(--text);
  line-height: 1.5;
}
a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 24px; position: sticky; top: 0; z-index: 20;
  background: rgba(11, 16, 32, 0.8); backdrop-filter: blur(8px);
}
.brand { font-weight: 800; font-size: 20px; }
.topbar nav a { color: var(--muted); margin-left: 18px; font-size: 14px; }

.hero { text-align: center; padding: 56px 20px 24px; }
.hero h1 { font-size: clamp(32px, 6vw, 64px); margin: 0 0 12px; line-height: 1.05; font-weight: 900; }
.accent { background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { color: var(--muted); font-size: clamp(15px, 2.5vw, 20px); max-width: 640px; margin: 0 auto 28px; }

.stats { display: flex; gap: 28px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 28px; font-weight: 800; }
.stat span { color: var(--muted); font-size: 13px; }

.progress { max-width: 520px; height: 10px; margin: 0 auto 28px; background: var(--card); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .6s; }

.cta {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: white; border: none; padding: 16px 32px; font-size: 18px; font-weight: 700;
  border-radius: 14px; cursor: pointer; box-shadow: 0 8px 30px rgba(47, 107, 255, .4);
  transition: transform .1s;
}
.cta:hover { transform: translateY(-2px); }
.cta:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.wall-section { max-width: 1100px; margin: 24px auto; padding: 0 16px; }
.wall-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.hint { color: var(--muted); font-size: 14px; }
.zoom button { background: var(--card); color: var(--text); border: 1px solid #2a3358; width: 36px; height: 36px; border-radius: 8px; font-size: 18px; cursor: pointer; }

.canvas-wrap {
  position: relative; border: 1px solid #2a3358; border-radius: 12px; overflow: auto;
  background: #0e1430; max-height: 70vh;
}
#grid { display: block; image-rendering: pixelated; cursor: crosshair; width: 100%; }
.selection {
  position: absolute; border: 2px solid var(--accent2);
  background: rgba(0, 212, 255, .2); pointer-events: none; z-index: 5;
}
.tooltip {
  position: fixed; background: #000; color: #fff; padding: 6px 10px; border-radius: 8px;
  font-size: 13px; pointer-events: none; z-index: 50; max-width: 240px;
}

.how { max-width: 760px; margin: 48px auto; padding: 0 20px; }
.how h2 { text-align: center; }
.how ol { line-height: 2; color: var(--muted); }
.how b { color: var(--text); }

.footer { text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; }

.hidden { display: none !important; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .7);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal-box {
  background: var(--card); border-radius: 16px; padding: 28px; width: 100%; max-width: 440px;
  position: relative; max-height: 92vh; overflow: auto;
}
.modal-close { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.selinfo { color: var(--muted); font-size: 14px; }
.selinfo b { color: var(--text); }
#buyForm label { display: block; margin: 14px 0 4px; font-size: 14px; }
#buyForm input[type=file], #buyForm input[type=url], #buyForm input[type=text], #buyForm input[type=email] {
  width: 100%; padding: 10px; border-radius: 8px; border: 1px solid #2a3358; background: #0e1430; color: var(--text);
}
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px !important; color: var(--muted); margin-top: 16px !important; }
#buyForm .cta { width: 100%; margin-top: 18px; }
.formerror { color: #ff6b6b; font-size: 14px; margin-top: 10px; }
.banner { text-align: center; padding: 12px; font-weight: 600; }
.banner.ok { background: var(--ok); color: #04221a; }
.banner.warn { background: #ffb020; color: #2a1a00; }
