:root {
  --ink: #231f1a;
  --muted: #6a6055;
  --card: rgba(255, 252, 245, 0.84);
  --line: rgba(35, 31, 26, 0.12);
  --shadow: 0 18px 42px rgba(84, 61, 41, 0.14);
  --title-font: "Cooper Black", "Trebuchet MS", sans-serif;
  --body-font: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body-font);
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(244, 181, 68, 0.32), transparent 30%),
    linear-gradient(150deg, #fff6e3 0%, #f6ecd6 48%, #efdfbb 100%);
}

.page-shell {
  width: min(1360px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 2.5rem;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: end;
  margin-bottom: 1.25rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.masthead h1,
.poster-header h2,
.section-heading h2,
.detail-card h2,
.quick-add-card h3 {
  margin: 0;
  font-family: var(--title-font);
  line-height: 0.95;
}

.masthead h1 {
  font-size: clamp(3rem, 7vw, 5.4rem);
}

.deck,
.poster-note,
.detail-copy,
.helper-copy,
.draft-empty p,
.draft-main p,
.save-status {
  margin: 0;
  line-height: 1.55;
  color: var(--muted);
}

.deck {
  max-width: 58ch;
  margin-top: 0.85rem;
}

.masthead-stats {
  display: grid;
  gap: 0.75rem;
}

.stat-badge,
.poster-card,
.detail-card,
.workshop-card,
.quick-add-card,
.draft-card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 1.5rem;
  box-shadow: var(--shadow);
}

.stat-badge {
  min-width: 11rem;
  padding: 0.95rem 1.1rem;
}

.stat-badge-edit {
  display: grid;
  gap: 0.55rem;
}

.stat-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.stat-badge strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.35rem;
}

.page-content,
.hero-layout,
.planner-layout {
  display: grid;
  gap: 1rem;
}

.hero-layout {
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.72fr);
  align-items: start;
}

.planner-layout {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.78fr);
  align-items: start;
}

.poster-card,
.detail-card,
.workshop-card,
.quick-add-card,
.draft-card {
  padding: 1.1rem;
}

.poster-header,
.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.poster-note {
  max-width: 22rem;
  text-align: right;
}

.bingo-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.bingo-square {
  min-height: 150px;
  padding: 0.95rem;
  border: 2px solid rgba(35, 31, 26, 0.08);
  border-radius: 1.25rem;
  background: rgba(255, 249, 240, 0.95);
  cursor: pointer;
  text-align: left;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.bingo-square:nth-child(5n + 1) { background: rgba(255, 244, 212, 0.92); }
.bingo-square:nth-child(5n + 2) { background: rgba(252, 236, 224, 0.92); }
.bingo-square:nth-child(5n + 3) { background: rgba(241, 236, 255, 0.92); }
.bingo-square:nth-child(5n + 4) { background: rgba(232, 245, 232, 0.92); }
.bingo-square:nth-child(5n + 5) { background: rgba(228, 240, 252, 0.92); }

.bingo-square:hover,
.bingo-square:focus-visible {
  transform: translateY(-3px) rotate(-0.35deg);
  box-shadow: 0 14px 22px rgba(96, 70, 47, 0.12);
  outline: none;
}

.bingo-square.is-selected {
  border-color: rgba(35, 31, 26, 0.38);
}

.bingo-square.is-placeholder {
  background: rgba(249, 245, 236, 0.96);
  border-style: dashed;
}

.square-topline {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.square-index,
.square-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.8);
}

.square-status {
  padding: 0 0.65rem;
}

.square-status-toggle {
  border: none;
  cursor: pointer;
  color: inherit;
}

.square-title {
  margin: 0;
  font-size: 1.04rem;
  line-height: 1.15;
}

.square-note {
  margin: 0.7rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--muted);
}

.detail-toggle-row {
  margin: 1rem 0;
}

.detail-label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.detail-notes-input,
input,
textarea {
  width: 100%;
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  font: inherit;
}

textarea {
  resize: vertical;
}

.detail-notes-view {
  min-height: 10rem;
  padding: 0.85rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  white-space: pre-wrap;
  line-height: 1.55;
}

.detail-notes-input[readonly],
input:disabled,
textarea:disabled {
  opacity: 0.78;
}

.save-status {
  margin-top: 0.7rem;
  min-height: 1.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.form-grid label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.span-2 {
  grid-column: span 2;
}

.form-actions,
.draft-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.form-actions {
  margin-top: 1rem;
}

.primary-button,
.ghost-button,
.draft-action {
  border-radius: 999px;
  font: inherit;
  cursor: pointer;
}

.primary-button {
  border: none;
  padding: 0.78rem 1.15rem;
  background: var(--ink);
  color: #fff8ec;
}

.ghost-button,
.draft-action {
  border: 1px solid var(--line);
  padding: 0.7rem 0.95rem;
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.stat-button {
  width: fit-content;
}

.quick-add-button {
  margin-top: 0.85rem;
}

.draft-list {
  display: grid;
  gap: 0.75rem;
}

.draft-item,
.draft-empty {
  display: grid;
  gap: 0.65rem;
  padding: 0.95rem 1rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(35, 31, 26, 0.08);
}

.draft-main {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.draft-main strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.draft-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: rgba(35, 31, 26, 0.08);
  font-weight: 700;
}

.draft-meta {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.meta-pill {
  display: inline-flex;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 0.76rem;
}

.status-done .square-status {
  background: rgba(107, 157, 110, 0.18);
}

.status-open .square-status {
  background: rgba(35, 31, 26, 0.08);
}

body[data-mode="readonly"] .planner-layout {
  display: none;
}

body[data-mode="readonly"] .draft-actions {
  display: none;
}

body[data-mode="readonly"] .detail-label,
body[data-mode="readonly"] .detail-notes-input {
  display: none;
}

body[data-mode="editing"] .detail-notes-view {
  display: none;
}

@media (max-width: 1150px) {
  .hero-layout,
  .planner-layout,
  .masthead {
    grid-template-columns: 1fr;
  }

  .masthead h1 {
    max-width: none;
  }
}

@media (max-width: 800px) {
  .bingo-board {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .page-shell {
    width: min(100% - 1rem, 100%);
    padding-top: 1rem;
  }

  .poster-header,
  .section-heading,
  .draft-main {
    flex-direction: column;
    align-items: stretch;
  }

  .poster-note {
    max-width: none;
    text-align: left;
  }

  .bingo-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .bingo-board {
    grid-template-columns: 1fr;
  }
}
