:root {
  --paper: #efe7dd;
  --ink: #140f11;
  --brick-1: #4e221c;
  --brick-2: #643029;
  --mortar: #b8927f;
  --panel: rgba(17, 12, 13, 0.76);
  --panel-edge: rgba(255, 255, 255, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--paper);
  background:
    radial-gradient(circle at top, rgba(255, 84, 84, 0.16), transparent 35%),
    linear-gradient(180deg, #161112, #090708 70%);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,0.02) 0 1px,
      transparent 1px 4px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.015) 0 1px,
      transparent 1px 3px
    );
  mix-blend-mode: screen;
  opacity: 0.35;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--panel-edge);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  backdrop-filter: blur(4px);
  box-shadow: 0 14px 40px rgba(0,0,0,0.28);
}

.eyebrow, .modal-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.24em;
  color: #ff9cbc;
  text-transform: uppercase;
}

h1 {
  margin: 6px 0 6px;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.subtitle, .modal-copy, .form-hint {
  margin: 0;
  max-width: 42rem;
  color: #d8cbc3;
}

.wall-shell {
  position: relative;
  border: 6px solid #1a1515;
  background: #221515;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}

.wall-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: rgba(0,0,0,0.45);
  border-bottom: 2px solid rgba(255,255,255,0.06);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f2d6cb;
}

.wall {
  position: relative;
  min-height: calc(100vh - 190px);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.13) 0 1px, transparent 1px 116px),
    linear-gradient(rgba(0,0,0,0.14) 0 1px, transparent 1px 58px),
    linear-gradient(180deg, rgba(255,255,255,0.05), transparent 18%),
    linear-gradient(180deg, rgba(0,0,0,0.16), transparent 25%),
    linear-gradient(0deg, var(--brick-1), var(--brick-2));
}

.wall::before,
.wall::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wall::before {
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08), transparent 18%),
    radial-gradient(circle at 85% 72%, rgba(255,255,255,0.05), transparent 15%),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,0.04), transparent 10%),
    radial-gradient(circle at 65% 22%, rgba(0,0,0,0.18), transparent 16%);
  mix-blend-mode: screen;
}

.wall::after {
  background: repeating-linear-gradient(
    135deg,
    rgba(255,255,255,0.02) 0 5px,
    transparent 5px 11px
  );
  opacity: 0.4;
}

.word-tag {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: center;
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
}

.word-text {
  display: inline-block;
  line-height: 0.9;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  filter: saturate(1.2);
}

.word-tag::before {
  content: '';
  position: absolute;
  inset: -14% -8%;
  border-radius: 40%;
  background: radial-gradient(circle, rgba(255,255,255,0.22), transparent 60%);
  opacity: 0.22;
  mix-blend-mode: screen;
  transform: scale(1.15, 0.8);
}

.word-tag.pop {
  animation: tagIn 240ms ease-out;
}

@keyframes tagIn {
  from { opacity: 0; transform: translateY(12px) scale(0.8) rotate(0deg); }
  to { opacity: 1; }
}

.spray-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  color: #fff4f7;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 14px 20px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.4), transparent 24%),
    linear-gradient(135deg, #ff2f6d, #ff6b00 65%, #ffc400);
  box-shadow:
    0 10px 18px rgba(0,0,0,0.28),
    inset 0 -3px 0 rgba(0,0,0,0.22);
  clip-path: polygon(3% 4%, 97% 0%, 100% 30%, 96% 100%, 4% 96%, 0% 22%);
}

.spray-btn:hover { transform: translateY(-1px) rotate(-0.5deg); }
.spray-btn:active { transform: translateY(1px) scale(0.99); }

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.64);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(92vw, 560px);
  padding: 26px;
  background: linear-gradient(180deg, rgba(31,22,24,0.95), rgba(12,9,10,0.96));
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}

.modal-card h2 {
  margin: 10px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.word-form {
  display: flex;
  gap: 10px;
  margin: 18px 0 10px;
  flex-wrap: wrap;
}

.word-form input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 16px 14px;
  border: 2px solid rgba(255,255,255,0.08);
  background: #f7efe7;
  color: #140f11;
  font-size: 1.35rem;
  font-weight: 800;
  text-transform: uppercase;
}

.word-form input:focus {
  outline: none;
  border-color: #ff2f6d;
  box-shadow: 0 0 0 4px rgba(255,47,109,0.16);
}

.submit-btn { min-width: 150px; }

.close-btn {
  position: absolute;
  right: 10px;
  top: 8px;
  background: transparent;
  color: #f2dad1;
  border: 0;
  font-size: 2rem;
  cursor: pointer;
}

.form-hint.is-error { color: #ff8aa3; }
.form-hint.is-ok { color: #70ffb1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .page { padding: 12px; }
  .topbar { padding: 16px; flex-direction: column; align-items: stretch; }
  .wall { min-height: calc(100vh - 220px); }
  .spray-btn { width: 100%; }
  .word-form { flex-direction: column; }
  .submit-btn { width: 100%; }
}
