:root {
  --bg: #070405;
  --crimson: #dc143c;
  --crimson-soft: rgba(220, 20, 60, 0.55);
  --blood: #8b0000;
  --text: #f3e9ea;
  --muted: #b9a3a8;
  --glass: rgba(24, 10, 14, 0.62);
  --glass-border: rgba(220, 20, 60, 0.28);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(139, 0, 0, 0.5), transparent 60%),
    radial-gradient(800px 480px at 90% 0%, rgba(220, 20, 60, 0.22), transparent 55%),
    linear-gradient(160deg, #0d0508 0%, var(--bg) 55%, #12040a 100%);
  padding: 2.5rem 1.25rem 2rem;
  overflow-x: hidden;
}

.backdrop { position: fixed; inset: 0; pointer-events: none; }
.bat { position: absolute; opacity: 0.14; filter: grayscale(0.3); }
.bat-1 { top: 6%; left: 4%; font-size: 3.4rem; transform: rotate(-12deg); }
.bat-2 { top: 14%; right: 6%; font-size: 2.4rem; transform: rotate(9deg); }
.bat-3 { bottom: 10%; right: 14%; font-size: 4.2rem; transform: rotate(-6deg); }

.hero { text-align: center; max-width: 720px; margin: 0 auto 2rem; }
.hero h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  letter-spacing: 0.04em;
  font-weight: 800;
  text-shadow: 0 0 28px var(--crimson-soft);
}
.accent { color: var(--crimson); }
.tagline { margin: 0.4rem 0 0.6rem; font-size: 1.15rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.sub { margin: 0; color: var(--muted); line-height: 1.55; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  max-width: 1080px;
  margin: 0 auto;
}

.card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.6rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.card h2 { margin: 0 0 1.1rem; font-size: 1.35rem; letter-spacing: 0.03em; }

label { display: block; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 0.9rem 0 0.35rem; }

textarea, input[type="number"], select {
  width: 100%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(220, 20, 60, 0.35);
  border-radius: 10px;
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font: inherit;
  resize: vertical;
}
textarea:focus, input:focus, select:focus { outline: 2px solid var(--crimson); outline-offset: 1px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input[type="color"] { width: 100%; height: 2.6rem; border: 1px solid rgba(220, 20, 60, 0.35); border-radius: 10px; background: rgba(0,0,0,0.45); padding: 0.25rem; cursor: pointer; }

.hint { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.meta { font-size: 0.88rem; color: var(--muted); }
.error { color: #ff7a93; min-height: 1.2em; font-size: 0.92rem; }
.warning {
  background: rgba(220, 20, 60, 0.14);
  border: 1px solid var(--crimson-soft);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 1rem;
  margin-top: 1rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px dashed rgba(220, 20, 60, 0.3);
  border-radius: 12px;
}
canvas { max-width: 100%; height: auto; border-radius: 6px; image-rendering: pixelated; }

button {
  margin-top: 0.8rem;
  background: linear-gradient(135deg, var(--crimson), var(--blood));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.7rem 1.4rem;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(220, 20, 60, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(220, 20, 60, 0.5); }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.drop-zone {
  margin-top: 1rem;
  border: 2px dashed rgba(220, 20, 60, 0.45);
  border-radius: 12px;
  padding: 2rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.drop-zone:hover, .drop-zone.dragging { background: rgba(220, 20, 60, 0.1); border-color: var(--crimson); }
.drop-zone p { margin: 0; line-height: 1.6; }

footer { text-align: center; margin-top: 2.5rem; color: var(--muted); font-size: 0.9rem; }
footer a { color: var(--crimson); text-decoration: none; }
footer a:hover { text-decoration: underline; }

@media (max-width: 520px) {
  .row { grid-template-columns: 1fr; }
  .card { padding: 1.2rem; }
}
