/* =========================================================
   PRIMARY PLANNER — Paper Classroom theme
   ========================================================= */

:root {
  /* Palette */
  --paper:        #fbf3df;
  --paper-warm:   #fae9c8;
  --paper-dark:   #2a2438;
  --ink:          #2a2438;
  --ink-soft:     #5a4f6a;
  --line:         #2a2438;

  /* Day colors (crayon primaries) */
  --c-mon: #ff7aa9;
  --c-tue: #ffc24c;
  --c-wed: #5cd6b1;
  --c-thu: #5ea7ff;
  --c-fri: #b07cff;
  --c-sat: #ff945c;
  --c-sun: #c79fff;

  /* Sky */
  --sky-1: #ffeec5;
  --sky-2: #ffd6e0;
  --sky-3: #cfe8ff;

  /* 3D shadows */
  --shadow-card:  6px 8px 0 var(--ink);
  --shadow-pop:   10px 14px 0 var(--ink);
  --shadow-soft:  0 18px 36px rgba(42, 36, 56, .18);

  --radius:       18px;
  --radius-lg:    28px;
  --radius-pill:  999px;

  --hour-h:       72px;
}

[data-theme="plasticine"] {
  --paper:      #f6efe0;
  --paper-warm: #f1e3c5;
  --ink:        #3a2c4a;
  --line:       #3a2c4a;
  --c-mon: #ff8fa6; --c-tue: #ffd06b; --c-wed: #82e0c2; --c-thu: #8fb9ff; --c-fri: #c79fff;
}

[data-theme="chalkboard"] {
  --paper:      #1f3a36;
  --paper-warm: #2c4842;
  --ink:        #fff7e0;
  --ink-soft:   #d6cca8;
  --line:       #fff7e0;
  --sky-1: #1a322f; --sky-2: #25433d; --sky-3: #18302c;
  --shadow-card: 4px 6px 0 rgba(0,0,0,.5);
  --shadow-pop:  8px 10px 0 rgba(0,0,0,.6);
}

[data-theme="blocks"] {
  --paper:      #fff3d6;
  --paper-warm: #ffe3a3;
  --c-mon: #e3433f; --c-tue: #f5b316; --c-wed: #3aa86b; --c-thu: #2f7adc; --c-fri: #8b50d6;
}

/* =========================================================
   Base
   ========================================================= */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Baloo 2", "Fredoka", ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 800px at 12% 0%, var(--sky-1) 0%, transparent 55%),
    radial-gradient(900px 700px at 92% 8%, var(--sky-2) 0%, transparent 50%),
    radial-gradient(900px 700px at 60% 100%, var(--sky-3) 0%, transparent 55%),
    var(--paper);
}

button, input, select, textarea {
  font-family: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  font-weight: 600;
}

h1, h2, h3 { font-family: "Fredoka", sans-serif; font-weight: 600; margin: 0; }

/* Hide reduced motion if requested */
[data-motion="low"] *,
[data-motion="low"] *::before,
[data-motion="low"] *::after {
  animation-duration: 0.001s !important;
  transition-duration: 100ms !important;
}

/* =========================================================
   App layout
   ========================================================= */

#root {
  position: relative;
  min-height: 100vh;
  z-index: 1;
}

.app {
  position: relative;
  min-height: 100vh;
  padding: 22px 28px 100px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  max-width: 1620px;
  margin: 0 auto;
}

/* =========================================================
   Top bar
   ========================================================= */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  position: relative;
  background: var(--paper-warm);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  transform: rotate(-4deg);
}
.brand-mark svg { width: 36px; height: 36px; }

.brand h1 {
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.5px;
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
}
.brand .subline {
  font-size: 15px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand .subline .pin {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--c-tue);
  border: 2px solid var(--ink);
}

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

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-card);
  font-weight: 700;
  font-size: 15px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tool-btn:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 10px 0 var(--ink);
}
.tool-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 3px 0 var(--ink);
}
.tool-btn.icon-only { padding: 10px; }
.tool-btn svg { width: 18px; height: 18px; }

.tool-btn.tb-today { background: var(--c-tue); }
.tool-btn.tb-prev, .tool-btn.tb-next { background: var(--paper-warm); }
.tool-btn.account-chip {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #fff;
}

.sync-line {
  margin-top: -8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 800;
}

/* =========================================================
   Account gate
   ========================================================= */

.auth-page {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px;
  overflow: hidden;
}

.auth-card {
  position: relative;
  z-index: 3;
  width: min(520px, 100%);
  padding: 28px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow-pop);
}

.auth-brand {
  align-items: flex-start;
  margin-bottom: 22px;
}

.auth-brand h1 {
  font-size: 34px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.auth-tabs button {
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  background: #fff;
  box-shadow: 4px 5px 0 var(--ink);
}

.auth-tabs button.active {
  background: var(--c-tue);
}

.auth-field {
  display: grid;
  gap: 6px;
  margin-bottom: 13px;
}

.auth-field span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 3px solid rgba(42, 36, 56, 0.5);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.auth-error {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #ffe0e8;
  color: var(--ink);
  font-weight: 800;
}

.auth-submit {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
  background: var(--c-wed);
}

.auth-note {
  margin-top: 14px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.tool-btn.tb-export { background: var(--c-wed); }
.tool-btn.tb-print { background: var(--c-thu); color: #fff; }
.tool-btn.tb-print svg { stroke: #fff; }

[data-theme="chalkboard"] .tool-btn { background: #fff7e0; color: #2a2438; }
[data-theme="chalkboard"] .tool-btn.tb-print { color: #fff; }

/* =========================================================
   Metric strip
   ========================================================= */

.metrics {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.metric {
  position: relative;
  padding: 14px 22px 14px 56px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: var(--shadow-card);
  min-width: 180px;
}
.metric .m-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid; place-items: center;
  border: 2.5px solid var(--ink);
}
.metric .m-icon svg { width: 20px; height: 20px; }
.metric .m-value {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 1;
}
.metric .m-label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 4px;
}
.metric.m-blocks .m-icon { background: var(--c-mon); }
.metric.m-hours  .m-icon { background: var(--c-thu); }
.metric.m-plan   .m-icon { background: var(--c-wed); }

/* =========================================================
   Main board
   ========================================================= */

.board-wrap {
  position: relative;
  min-height: 660px;
}

.board {
  position: relative;
  display: grid;
  grid-template-columns: 64px repeat(var(--day-count, 5), minmax(180px, 1fr));
  gap: 12px;
  padding: 18px;
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--hour-h) - 1px), rgba(42,36,56,.07) calc(var(--hour-h) - 1px) var(--hour-h)),
    #fffaef;
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}

[data-theme="chalkboard"] .board {
  background:
    repeating-linear-gradient(0deg, transparent 0 calc(var(--hour-h) - 1px), rgba(255,247,224,.13) calc(var(--hour-h) - 1px) var(--hour-h)),
    #284540;
}

.time-axis {
  position: relative;
  padding-top: 110px;
}
.time-axis .time-tick {
  position: absolute;
  left: 0;
  right: 0;
  text-align: right;
  padding-right: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
  transform: translateY(-50%);
}

.day-col {
  position: relative;
  display: flex;
  flex-direction: column;
}

.day-head {
  position: relative;
  height: 110px;
  margin-bottom: 6px;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: var(--day-color, var(--c-mon));
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  overflow: hidden;
  transform: rotate(var(--head-tilt, -1deg));
  transition: transform .25s ease;
}
.day-head:hover { transform: rotate(0deg) translateY(-3px); }

.day-head .day-name {
  font-family: "Fredoka", sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
  line-height: 1;
}
.day-head .day-date {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.85);
  margin-top: 4px;
}
.day-head .mascot {
  position: absolute;
  right: -6px;
  top: -8px;
  width: 64px;
  height: 64px;
  pointer-events: none;
}
.day-head .mascot svg { width: 100%; height: 100%; }

/* Tape pieces */
.tape {
  position: absolute;
  width: 44px;
  height: 14px;
  background: rgba(255, 220, 120, .7);
  border: 1px dashed rgba(42,36,56,.4);
  border-left: 1px solid rgba(42,36,56,.2);
  border-right: 1px solid rgba(42,36,56,.2);
  transform: rotate(-12deg);
  z-index: 4;
  pointer-events: none;
}
.tape.tl { top: -6px; left: -8px; }
.tape.tr { top: -6px; right: -8px; transform: rotate(14deg); }

/* Day shelf (where blocks sit) */
.day-shelf {
  position: relative;
  flex: 1;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background: rgba(255,255,255,.6);
  min-height: calc(var(--hours, 10) * var(--hour-h));
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 -8px 0 rgba(42,36,56,.07);
  transition: background .2s ease;
}

[data-theme="chalkboard"] .day-shelf {
  background: rgba(255,247,224,.04);
}

.day-shelf::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 10% 12%, rgba(255,255,255,.5), transparent 30%),
    repeating-linear-gradient(0deg, transparent 0 calc(var(--hour-h) - 1px), color-mix(in srgb, var(--day-color) 22%, transparent) calc(var(--hour-h) - 1px) var(--hour-h));
  opacity: .7;
}

.day-shelf.drop-target {
  background: color-mix(in srgb, var(--day-color) 18%, white);
  outline: 3px dashed var(--day-color);
  outline-offset: -8px;
}

/* =========================================================
   Calendar blocks (paper cards)
   ========================================================= */

.block {
  position: absolute;
  left: 8px;
  right: 8px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--block-color, var(--c-tue));
  box-shadow: var(--shadow-card);
  padding: 8px 10px 18px;
  cursor: grab;
  user-select: none;
  z-index: 2;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  container-type: size;
  container-name: block;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease;
  transform: rotate(var(--rot, -0.5deg));
  will-change: transform;
}

.block:hover {
  transform: rotate(0deg) translate(-2px, -3px);
  box-shadow: 9px 11px 0 var(--ink);
  z-index: 3;
}

.block.active {
  transform: rotate(0deg) translate(-3px, -4px) scale(1.02);
  box-shadow: 12px 14px 0 var(--ink);
  z-index: 5;
}

.block.dragging {
  cursor: grabbing;
  transform: rotate(2deg) scale(1.04);
  box-shadow: 14px 18px 0 rgba(42,36,56,.5);
  z-index: 20;
  transition: none;
}

.block .b-time {
  align-self: flex-start;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(255,255,255,.55);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.block .b-title {
  font-family: "Fredoka", sans-serif;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  min-width: 0;
}

.block .b-meta {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(42,36,56,.78);
  min-width: 0;
}
.block .b-meta > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Adaptive density — shrink/hide pieces in tight blocks */
@container block (max-height: 110px) {
  .block { padding: 6px 9px 14px; }
  .block .b-title { font-size: 14px; -webkit-line-clamp: 1; }
  .block .b-meta { font-size: 10px; }
  .block .b-type-icon { width: 18px; height: 18px; }
  .block .b-type-icon svg { width: 12px; height: 12px; }
}
@container block (max-height: 78px) {
  .block { padding: 5px 8px 10px; gap: 2px; }
  .block .b-meta { display: none; }
  .block .b-time { font-size: 9px; padding: 0 6px; }
}
@container block (max-height: 56px) {
  .block .b-title { font-size: 13px; }
  .block .b-time { display: none; }
  .block .b-progress { display: none; }
}
@container block (max-width: 120px) {
  .block .b-meta > span:last-child { display: none; }
}

.block .b-type-icon {
  width: 22px; height: 22px;
  border-radius: 7px;
  background: #fff;
  border: 2px solid var(--ink);
  display: grid; place-items: center;
}
.block .b-type-icon svg { width: 14px; height: 14px; }

.block .b-stickers {
  position: absolute;
  bottom: 4px;
  right: 6px;
  display: flex;
  gap: 2px;
}
.block .b-stickers .sticker-mini {
  width: 22px; height: 22px;
  transform: rotate(var(--r, 0deg));
}

.block .b-progress {
  position: absolute;
  left: 8px;
  bottom: 5px;
  display: flex;
  gap: 3px;
  z-index: 2;
}
.block .b-progress .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(42,36,56,.2);
  border: 1.5px solid var(--ink);
}
.block .b-progress .dot.on { background: var(--ink); }

/* Ghost preview while dragging */
.drop-ghost {
  position: absolute;
  left: 8px; right: 8px;
  border: 3px dashed var(--ink);
  border-radius: 16px;
  background: rgba(255,255,255,.4);
  pointer-events: none;
  z-index: 1;
}

/* =========================================================
   Editor panel (slides in from right)
   ========================================================= */

.editor-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(42,36,56,.32);
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.editor-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.editor {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(460px, 100%);
  background: var(--paper);
  border-left: 4px solid var(--ink);
  box-shadow: -12px 0 0 var(--ink), -22px 0 60px rgba(0,0,0,.2);
  z-index: 40;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4, 1.2, .4, 1);
  overflow-y: auto;
  padding: 22px;
}
.editor.open { transform: translateX(0); }

.editor h2 {
  font-family: "Fredoka", sans-serif;
  font-size: 26px;
  margin: 4px 0 4px;
}
.editor .e-eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--ink-soft);
}

.editor .close-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: grid; place-items: center;
}
.editor .close-btn svg { width: 18px; height: 18px; }

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
}
.field > label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field input[type="text"],
.field input[type="time"],
.field select,
.field textarea {
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  box-shadow: inset 0 -3px 0 rgba(42,36,56,.06);
}
.field textarea { resize: vertical; min-height: 70px; line-height: 1.4; }
.field input:focus, .field select:focus, .field textarea:focus {
  box-shadow: var(--shadow-card);
  transform: translate(-1px,-1px);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c);
  border: 3px solid var(--ink);
  box-shadow: 3px 4px 0 var(--ink);
  position: relative;
  transition: transform .15s ease;
}
.swatch:hover { transform: translate(-1px,-2px) rotate(-6deg); }
.swatch.selected::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 3px dashed var(--ink);
}

.activity-row {
  display: grid;
  grid-template-columns: 1fr 70px 36px;
  gap: 8px;
  margin-top: 8px;
  align-items: start;
}
.activity-row textarea {
  grid-column: 1 / -1;
  min-height: 48px;
}
.activity-row .remove-act {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--c-mon);
  color: #fff;
  box-shadow: 3px 4px 0 var(--ink);
  display: grid; place-items: center;
}
.activity-row .remove-act svg { width: 14px; height: 14px; stroke: #fff; }

.add-activity {
  margin-top: 10px;
  padding: 8px 14px;
  background: var(--c-wed);
  color: var(--ink);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-card);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.editor-actions {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-danger {
  padding: 12px 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--shadow-card);
  display: inline-flex;
  gap: 8px;
  align-items: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-primary:hover, .btn-secondary:hover, .btn-danger:hover {
  transform: translate(-2px,-2px);
  box-shadow: 8px 10px 0 var(--ink);
}
.btn-primary:active, .btn-secondary:active, .btn-danger:active {
  transform: translate(2px,3px); box-shadow: 2px 3px 0 var(--ink);
}
.btn-primary { background: var(--c-wed); }
.btn-secondary { background: #fff; }
.btn-danger { background: var(--c-mon); color: #fff; }
.btn-danger svg { stroke: #fff; }

/* =========================================================
   Sticker tray
   ========================================================= */

.sticker-tray {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  box-shadow: var(--shadow-pop);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 25;
}
.sticker-tray .tray-label {
  font-family: "Fredoka", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 0 6px;
  color: var(--ink-soft);
}
.sticker-tray .sticker {
  width: 40px; height: 40px;
  cursor: grab;
  transition: transform .2s ease;
}
.sticker-tray .sticker:hover {
  transform: scale(1.2) rotate(-8deg);
}
.sticker-tray .sticker svg { width: 100%; height: 100%; }

.sticker.dragging-sticker {
  cursor: grabbing;
}

/* Sticker placed on a block — sits in the top-right corner, doesn't cover content */
.placed-sticker {
  position: absolute;
  width: 26px; height: 26px;
  z-index: 6;
  pointer-events: none;
  transition: transform .2s ease;
  transform: rotate(var(--rot, 0deg));
}
.placed-sticker svg { width: 100%; height: 100%; filter: drop-shadow(1.5px 2px 0 rgba(0,0,0,.22)); }
@container block (max-height: 78px) {
  .placed-sticker { width: 20px; height: 20px; }
}
@container block (max-height: 56px) {
  .placed-sticker { width: 16px; height: 16px; }
}

/* =========================================================
   Background scene (clouds, sun, stars)
   ========================================================= */

.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene .cloud,
.scene .sun-bg,
.scene .star-bg,
.scene .planet-bg {
  position: absolute;
}

.scene .cloud { width: 160px; }
.scene .cloud svg { width: 100%; }

.scene .sun-bg {
  top: 80px; right: 8%;
  width: 220px; height: 220px;
  animation: spin-slow 60s linear infinite;
}

@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes float-1 {
  0%,100% { transform: translateY(0) translateX(0); }
  50%     { transform: translateY(-18px) translateX(10px); }
}
@keyframes float-2 {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-12px); }
}
@keyframes drift {
  from { transform: translateX(-200px); }
  to   { transform: translateX(calc(100vw + 200px)); }
}

.scene .cloud-1 { top: 18%; left: -200px; animation: drift 80s linear infinite; }
.scene .cloud-2 { top: 6%;  left: -200px; animation: drift 110s linear infinite 20s; opacity: .7; }
.scene .cloud-3 { top: 38%; left: -200px; animation: drift 95s linear infinite 40s; opacity: .85; }

.scene .planet-bg {
  bottom: 8%;
  right: 4%;
  width: 90px; height: 90px;
  animation: float-1 8s ease-in-out infinite;
}

.scene .star-bg {
  animation: float-2 4s ease-in-out infinite;
}

/* =========================================================
   Confetti
   ========================================================= */

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 14px; height: 18px;
  animation: confetti-fall 1.6s cubic-bezier(.2,.6,.2,1) forwards;
  border: 2px solid var(--ink);
  border-radius: 3px;
}

@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 1; }
}

/* =========================================================
   Status toast
   ========================================================= */

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -80px);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 700;
  z-index: 200;
  transition: transform .35s cubic-bezier(.4,1.4,.5,1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.toast.show { transform: translate(-50%, 0); }
.toast svg { stroke: var(--paper); width: 16px; height: 16px; }

/* =========================================================
   Empty / new block button on shelf
   ========================================================= */

.day-shelf .add-here {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 3px dashed var(--ink);
  background: rgba(255,255,255,.7);
  opacity: 0;
  display: grid; place-items: center;
  transition: opacity .2s ease, transform .2s ease;
}
.day-shelf:hover .add-here {
  opacity: 1;
}
.day-shelf .add-here:hover {
  transform: translateX(-50%) scale(1.1);
  background: var(--c-tue);
}

/* =========================================================
   Hour line indicator
   ========================================================= */

.now-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--c-mon);
  z-index: 6;
  pointer-events: none;
}
.now-line::before {
  content: "";
  position: absolute;
  left: -7px;
  top: -6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c-mon);
  border: 3px solid var(--ink);
}
.now-line::after {
  content: "Now";
  position: absolute;
  left: 12px;
  top: -10px;
  background: var(--c-mon);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .board { grid-template-columns: 48px repeat(var(--day-count, 5), minmax(150px, 1fr)); }
  .day-head .day-name { font-size: 18px; }
  .day-head .mascot { width: 50px; height: 50px; }
}

@media (max-width: 720px) {
  .app { padding: 14px 14px 100px; }
  .brand h1 { font-size: 24px; }
  .brand-mark { width: 44px; height: 44px; }
  .board-wrap { overflow-x: auto; }
  .board { min-width: 800px; }
  .editor { width: 100vw; }
  .sticker-tray { bottom: 10px; padding: 6px 10px; }
  .sticker-tray .tray-label { display: none; }
}

/* Print */
@media print {
  .scene, .sticker-tray, .toolbar, .editor, .editor-backdrop, .toast, .confetti-layer { display: none; }
  body { background: #fff; }
  .board { box-shadow: none; }
}
