:root {
  --felt: #0E3B2E;
  --felt-dark: #0A2C22;
  --cream: #FAF6EC;
  --ink: #1B2A22;
  --ink-soft: #4B5A52;

  --calm: #2F7DE1;
  --calm-soft: #E4EEFC;
  --soon: #E08A1E;
  --soon-soft: #FCEEDA;
  --today: #D64545;
  --today-soft: #FBE1E1;
  --overdue: #7A1F2B;
  --overdue-soft: #F3D9DC;
  --scheduled: #3D8361;
  --scheduled-soft: #DFF1E7;

  --radius: 18px;
  --shadow: 0 10px 24px rgba(10, 30, 22, 0.28);

  font-family: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--felt);
  background-image:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.05), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(255,255,255,0.04), transparent 40%);
  color: var(--cream);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: 'Fredoka', 'Inter', system-ui, sans-serif;
  margin: 0;
}

.hidden { display: none !important; }

#app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 6px 0 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  font-size: 28px;
  color: var(--soon);
}

.brand h1 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.pill-btn {
  border: 1.5px solid rgba(250, 246, 236, 0.35);
  background: transparent;
  color: var(--cream);
  padding: 9px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.pill-btn:hover { background: rgba(250, 246, 236, 0.1); }
.pill-btn:active { transform: scale(0.96); }

.pill-btn--solid {
  background: var(--soon);
  border-color: var(--soon);
  color: #241000;
}
.pill-btn--solid:hover { background: #ec9c33; }

.holiday-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: rgba(61, 131, 97, 0.25);
  border: 1px solid var(--scheduled);
  color: var(--cream);
  padding: 10px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 14px;
}

.holiday-banner button {
  margin-left: auto;
  background: none;
  border: 1px solid rgba(250, 246, 236, 0.4);
  color: var(--cream);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}

.board-section { margin-bottom: 30px; }

.board-section h2 {
  font-size: 15px;
  font-weight: 600;
  color: rgba(250, 246, 236, 0.75);
  text-transform: none;
  letter-spacing: 0.2px;
  margin-bottom: 12px;
}

.empty-note {
  color: rgba(250, 246, 236, 0.55);
  font-size: 14px;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.card {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--ink);
  position: relative;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 0.15s ease;
}

.card:nth-child(3n+1) { --tilt: -1.2deg; }
.card:nth-child(3n+2) { --tilt: 0.8deg; }
.card:nth-child(3n)   { --tilt: -0.4deg; }

.card:hover { transform: rotate(0deg) translateY(-3px); }

.card-band {
  padding: 10px 12px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: #fff;
}

.card-band.calm     { background: var(--calm); }
.card-band.soon     { background: var(--soon); }
.card-band.today    { background: var(--today); }
.card-band.overdue  { background: var(--overdue); }
.card-band.scheduled{ background: var(--scheduled); }

.card-icon { font-size: 20px; line-height: 1; }

.card-count {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 20px;
  line-height: 1;
}

.card-count small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.4px;
  opacity: 0.85;
  margin-top: 2px;
}

.card-body {
  padding: 12px;
}

.card-name {
  font-weight: 700;
  font-size: 15px;
  margin: 0 0 4px;
  line-height: 1.25;
}

.card-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.3;
}

.card-sched {
  font-size: 12px;
  font-weight: 600;
  color: var(--scheduled);
  margin: 0 0 10px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-actions button {
  flex: 1 1 auto;
  border: none;
  background: rgba(27, 42, 34, 0.08);
  color: var(--ink);
  padding: 7px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.card-actions button:hover { background: rgba(27, 42, 34, 0.16); }

.card-actions .primary {
  background: var(--ink);
  color: var(--cream);
}
.card-actions .primary:hover { background: #33473c; }

.card-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.15);
  border: none;
  color: #fff;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 16, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.modal-card h3 { font-size: 18px; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--ink-soft); margin: 0 0 14px; }

.modal-card label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 14px 0 6px;
}

.optional { font-weight: 400; color: #94a099; }

.modal-card input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #DDD6C4;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--ink);
}

.modal-card input:focus {
  outline: none;
  border-color: var(--scheduled);
}

.cadence-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cadence-row input { width: 90px; }
.cadence-row span { font-size: 13px; color: var(--ink-soft); }

.icon-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-opt {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1.5px solid #DDD6C4;
  background: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-opt.selected {
  border-color: var(--scheduled);
  background: var(--scheduled-soft);
}

.presets {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.presets button {
  border: none;
  background: #EFE9D8;
  color: var(--ink-soft);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
.presets button:hover { background: #E3DBC4; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .pill-btn {
  border-color: #DDD6C4;
  color: var(--ink);
}
.modal-actions .pill-btn--solid {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}
.modal-actions .pill-btn--solid:hover { background: #33473c; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--cream);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(0,0,0,0.3);
  z-index: 100;
}

@media (max-width: 420px) {
  .brand h1 { font-size: 19px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
}
