:root {
  --bg-a: #d7ff4f;
  --bg-b: #00e3ff;
  --panel: rgba(255, 255, 255, 0.88);
  --text: #0f172a;
  --accent-a: #ff2d55;
  --accent-b: #7c3aed;
  --accent-c: #ffea00;
  --ink: #0b0b0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Impact", "Arial Black", "Trebuchet MS", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 46, 102, 0.22), transparent 32%),
    radial-gradient(circle at 80% 75%, rgba(111, 0, 255, 0.2), transparent 34%),
    linear-gradient(120deg, var(--bg-a), var(--bg-b));
  color: var(--text);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

#duck-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.duck-toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 7;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid var(--ink);
  box-shadow: 8px 8px 0 rgba(11, 11, 11, 0.9);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  max-width: min(90vw, 340px);
  transform: rotate(1deg);
}

.duck-toast p {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: #7f001f;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
}

.bread-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12;
  pointer-events: none;
  font-size: 1.9rem;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: opacity 120ms ease, transform 120ms ease;
}

body.bread-armed .bread-cursor {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

body.frenzy-mode .layout {
  animation: frenzy-panel 180ms steps(2, end) infinite;
}

.layout {
  width: min(680px, 92vw);
  background: var(--panel);
  border-radius: 14px;
  padding: 1.7rem;
  border: 3px solid var(--ink);
  transform: rotate(-0.9deg);
  box-shadow:
    12px 12px 0 rgba(11, 11, 11, 0.95),
    0 20px 46px rgba(15, 23, 42, 0.25);
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.layout::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 234, 0, 0.12) 0 8px,
      rgba(255, 45, 85, 0.08) 8px 16px
    );
  pointer-events: none;
}

h1 {
  margin: 0 0 0.45rem;
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow:
    2px 2px 0 #ffffff,
    5px 5px 0 var(--accent-a),
    -3px -3px 0 var(--accent-b);
  animation: title-shake 1900ms steps(2, end) infinite;
}

p {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  max-width: 50ch;
}

button {
  background: linear-gradient(95deg, var(--accent-a), var(--accent-b));
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  font-size: 1.08rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button:hover {
  transform: translate(2px, 2px) rotate(-1deg);
  box-shadow: 2px 2px 0 var(--ink);
  filter: saturate(1.2) brightness(1.05);
}

.card {
  margin-top: 1rem;
  background: rgba(255, 255, 255, 0.96);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 6px 6px 0 rgba(11, 11, 11, 0.8);
}

.card img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--ink);
  margin: 0.6rem 0;
}

.hidden {
  display: none;
}

.duck-dock {
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  gap: 0.55rem;
  padding: 0.55rem;
  background: rgba(255, 255, 255, 0.86);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 10px 10px 0 rgba(11, 11, 11, 0.85);
  backdrop-filter: blur(6px);
  max-width: min(96vw, 1200px);
  overflow-x: auto;
}

.dock-btn {
  white-space: nowrap;
  padding: 0.65rem 0.95rem;
  font-size: 0.88rem;
}

.dock-btn.dock-danger {
  background: linear-gradient(95deg, #e11d48, #9f1239);
}

.duck-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: rgba(8, 8, 8, 0.56);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.duck-modal.hidden {
  display: none;
}

.duck-modal-card {
  width: min(760px, 94vw);
  max-height: min(90vh, 860px);
  background: rgba(255, 255, 255, 0.95);
  border: 4px solid var(--ink);
  border-radius: 14px;
  box-shadow: 12px 12px 0 rgba(11, 11, 11, 0.9);
  padding: 1rem 1.1rem 1.2rem;
  position: relative;
  display: flex;
  flex-direction: column;
}

.duck-modal-card h2 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.35rem, 4vw, 2rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  order: 1;
}

.duck-modal-close {
  position: static;
  float: none;
  font-size: 0.8rem;
  padding: 0.45rem 0.6rem;
  align-self: flex-end;
  margin-top: 0.8rem;
  order: 3;
}

.duck-faq {
  overflow-y: auto;
  max-height: min(62vh, 620px);
  padding-right: 0.45rem;
  -webkit-overflow-scrolling: touch;
  order: 2;
  flex: 1 1 auto;
}

.faq-item {
  margin: 0 0 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 2px solid rgba(11, 11, 11, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.faq-item:last-child {
  margin-bottom: 0.25rem;
}

.faq-q {
  margin: 0 0 0.32rem;
  max-width: none;
  font-weight: 900;
}

.faq-a {
  margin: 0;
  max-width: none;
  font-weight: 500;
  color: #1f2937;
}

.status {
  min-height: 1.2rem;
  margin-top: 0.8rem;
  color: #6b021d;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 800;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.5);
}

@keyframes title-shake {
  0%,
  100% {
    transform: translateX(0) translateY(0);
  }
  25% {
    transform: translateX(1px) translateY(-1px);
  }
  50% {
    transform: translateX(-1px) translateY(1px);
  }
  75% {
    transform: translateX(1px) translateY(1px);
  }
}

@keyframes frenzy-panel {
  0%,
  100% {
    transform: rotate(-0.9deg) translate(0, 0);
  }
  50% {
    transform: rotate(-0.9deg) translate(2px, -2px);
  }
}

@media (max-width: 700px) {
  .layout {
    width: min(92vw, 620px);
    transform: rotate(-0.4deg);
    padding: 1.2rem;
  }

  h1 {
    font-size: clamp(1.6rem, 8vw, 2.2rem);
  }

  .duck-toast {
    right: 0.5rem;
    left: 0.5rem;
    top: 2.8rem;
    max-width: none;
  }

  .duck-dock {
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
    justify-content: flex-start;
  }
}
