:root {
  --chalk: #f7f4ee;
  --chalk-soft: rgba(247, 244, 238, 0.7);
  --wall: #0e1b1f;
  --wall-2: #11272c;
  --wall-3: #0a1418;
  --accent: #f0c14b;
  --accent-2: #7fd1c6;
  --paper: #fef8ef;
  --ink: #1b1a17;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 20px;
}

* { box-sizing: border-box; }

body.die-page {
  margin: 0;
  font-family: 'Kalam', 'Manrope', sans-serif;
  color: var(--chalk);
  background: radial-gradient(circle at 20% 10%, #1b343b 0%, var(--wall) 45%, var(--wall-3) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

.chalk-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="160" height="160" viewBox="0 0 160 160"%3E%3Crect width="160" height="160" fill="%230e1b1f"/%3E%3Cg fill="%23ffffff" fill-opacity="0.06"%3E%3Ccircle cx="14" cy="18" r="1"/%3E%3Ccircle cx="88" cy="46" r="1"/%3E%3Ccircle cx="140" cy="120" r="1"/%3E%3Ccircle cx="46" cy="96" r="1"/%3E%3Ccircle cx="118" cy="70" r="1"/%3E%3C/g%3E%3C/svg%3E');
  mix-blend-mode: screen;
  opacity: 0.6;
  z-index: 0;
}

.chalk-glow {
  position: fixed;
  inset: -20% 0 auto 0;
  height: 45vh;
  background: radial-gradient(circle at 50% 0%, rgba(240, 193, 75, 0.2), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.die-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(120deg, rgba(8, 15, 18, 0.9), rgba(16, 33, 38, 0.75));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.back-btn {
  text-decoration: none;
  color: var(--chalk);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
}

.title-block {
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-2);
}

h1 {
  margin: 0;
  font-family: 'Fraunces', serif;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--chalk);
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  color: var(--chalk-soft);
}

.progress {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.wall {
  width: min(1100px, 92vw);
  margin: 1.6rem auto 3rem;
  display: grid;
  gap: 1.4rem;
  position: relative;
  z-index: 1;
}

.intro-note {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  padding: 1.3rem 1.6rem;
  box-shadow: 0 14px 30px var(--shadow);
  backdrop-filter: blur(8px);
}

.intro-title {
  margin: 0 0 0.4rem;
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
}

.intro-text {
  margin: 0;
  color: var(--chalk-soft);
  line-height: 1.6;
}

.bucket-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
}

.bucket-item {
  background: var(--paper);
  color: var(--ink);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.35);
  transform: translateY(10px);
  opacity: 0;
  animation: floatIn 0.7s ease forwards;
  animation-delay: var(--delay);
  position: relative;
}

.bucket-item::before,
.bucket-item::after {
  content: '';
  position: absolute;
  width: 48px;
  height: 18px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
  top: -8px;
}

.bucket-item::before {
  left: 12px;
  transform: rotate(-4deg);
}

.bucket-item::after {
  right: 12px;
  transform: rotate(4deg);
}

.item-btn {
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 1.1rem 1.2rem 1.4rem;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  gap: 0.45rem;
}

.check {
  font-size: 1.2rem;
  color: #c49a34;
}

.text {
  font-size: 1.1rem;
  line-height: 1.5;
}

.plain-text,
.new-idea {
  color: inherit;
}

.old-idea {
  color: rgba(27, 26, 23, 0.45);
  text-decoration-line: line-through;
  text-decoration-style: wavy;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(196, 154, 52, 0.8);
}

.swap {
  display: inline-block;
  margin: 0 0.45rem;
  font-size: 0.85rem;
  color: rgba(27, 26, 23, 0.55);
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.05em;
}

.tag {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(27, 26, 23, 0.6);
}

.bucket-item.done {
  background: linear-gradient(140deg, #f9f1e5, #efe3d1);
  box-shadow: 0 18px 26px rgba(0, 0, 0, 0.28);
}

.bucket-item.done .plain-text,
.bucket-item.done .new-idea {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(27, 26, 23, 0.5);
}

.bucket-item.done .check {
  color: #2f6a63;
}

.bucket-item.done .tag {
  color: rgba(27, 26, 23, 0.45);
}

.closing {
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem;
  text-align: center;
  box-shadow: 0 14px 30px var(--shadow);
  position: relative;
}

.stamp {
  display: inline-block;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  margin-bottom: 0.6rem;
  color: var(--accent);
}

.signature {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 1.1rem;
  color: var(--accent-2);
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(16px) rotate(-0.4deg); }
  to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

.ghost-btn {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: .85rem;
  padding: .4rem .9rem;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  color: var(--chalk-soft);
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
  justify-self: center;
}
.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  color: var(--chalk);
}
.ghost-btn.active {
  background: rgba(240, 193, 75, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 820px) {
  .die-topbar {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .back-btn { justify-self: center; }
  .progress { justify-self: center; }
  .ghost-btn { justify-self: center; }
}

@media (max-width: 540px) {
  .wall { width: min(92vw, 420px); }
  .item-btn { padding: 1rem; }
  .bucket-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
