/* elika ideas — a sky full of drifting idea-clouds */

:root {
  --ink: #20364f;
  --ink-soft: #5a708a;
  --card-bg: rgba(255, 255, 255, 0.66);
  --card-border: rgba(255, 255, 255, 0.65);
  /* a hairline of light along the top edge — reads as a real glass bevel */
  --card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  /* Layered depth (Apple-style): a tight contact shadow + a mid cast + a soft ambient
     bloom, rather than one heavy drop. Reads as physical elevation, not a flat blur. */
  --shadow: 0 1px 2px rgba(31, 72, 120, 0.07), 0 6px 14px rgba(31, 72, 120, 0.09),
    0 16px 38px rgba(31, 72, 120, 0.12);
  --shadow-lift: 0 2px 6px rgba(31, 72, 120, 0.1), 0 12px 26px rgba(31, 72, 120, 0.16),
    0 30px 62px rgba(31, 72, 120, 0.22);
  --blue: #4f7fe0;
  --amber: #e2922f;
  --green: #1faf6a;
  /* Motion: one set of easing curves used everywhere for a consistent, premium feel.
     --ease-out for settling, --ease-spring for playful entrances, --ease-soft for tints. */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.5, 1);
}

* {
  box-sizing: border-box;
}

/* The `hidden` attribute must always win: several full-viewport layers (.overlay,
   .shelf-backdrop, .user-chip) set their own `display`, which by author-vs-UA precedence
   overrides the UA `[hidden]{display:none}` — leaving an invisible click-eating layer on
   top of the whole sky. This keeps hidden meaning hidden. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  /* SF on Apple platforms, Segoe on Windows — the native UI face on each, like a system app */
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* ---- the sky --------------------------------------------------------------*/

.sky {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #bfe3fb; /* fallback under the animated sky layers */
}

/* slowly cycling time-of-day: day -> golden -> dreamy -> night -> dawn, cross-fading */
.sky-cycle {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* the full day cycle takes 450s (5× slower than before) — one phase per ~90s */
.sky-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: skyCycle 450s linear infinite;
}
.l-day {
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(255, 247, 214, 0.9), transparent 60%),
    linear-gradient(180deg, #7cc4f3 0%, #a9dbf7 40%, #eaf6ff 100%);
  animation-delay: 0s;
}
.l-gold {
  background:
    radial-gradient(900px 520px at 80% 16%, rgba(255, 214, 150, 0.95), transparent 60%),
    linear-gradient(180deg, #ffd9a0 0%, #ffb070 45%, #ff8f76 100%);
  animation-delay: -90s;
}
.l-dream {
  background: linear-gradient(180deg, #8a5cd0 0%, #c45cc0 30%, #ff6fae 55%, #ffa17f 78%, #9bd0ff 100%);
  animation-delay: -180s;
}
.l-night {
  background:
    radial-gradient(700px 460px at 22% 8%, rgba(150, 170, 240, 0.28), transparent 60%),
    linear-gradient(180deg, #0a163a 0%, #142a63 55%, #2c3f80 100%);
  animation-delay: -270s;
}
.l-dawn {
  background: linear-gradient(180deg, #c6a7ec 0%, #f0a6c0 45%, #ffd9b0 100%);
  animation-delay: -360s;
}
@keyframes skyCycle {
  0% { opacity: 0; }
  4% { opacity: 1; }
  16% { opacity: 1; }
  20% { opacity: 0; }
  100% { opacity: 0; }
}
.stars {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: skyCycle 450s linear infinite;
  animation-delay: -270s; /* visible during the night phase */
  background-repeat: no-repeat;
  background-image:
    radial-gradient(2px 2px at 12% 22%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 28% 14%, #fff, transparent),
    radial-gradient(2px 2px at 42% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 55% 12%, #fff, transparent),
    radial-gradient(2px 2px at 68% 26%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 80% 16%, #fff, transparent),
    radial-gradient(2px 2px at 90% 32%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 18% 40%, #fff, transparent),
    radial-gradient(2px 2px at 35% 48%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 44%, #fff, transparent),
    radial-gradient(2px 2px at 75% 52%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 8% 58%, #fff, transparent);
}

/* ---- floaters & cards -----------------------------------------------------*/

.floater {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  touch-action: none; /* let the engine own drag gestures (no scroll/zoom hijack) */
  /* Settle in with a soft fade. Opacity only — the engine owns `transform`, so animating
     it here would conflict; this stays clear of that and reads as a calm arrival. */
  animation: floatIn 0.6s var(--ease-out) both;
}
@keyframes floatIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.floater.dragging {
  z-index: 40;
}
.floater.dragging .card {
  cursor: grabbing;
  transform: scale(1.06) rotate(-1deg);
  box-shadow: var(--shadow-lift), var(--card-highlight);
  background: rgba(255, 255, 255, 0.92);
}
.floater-top {
  z-index: 30; /* "Yours" stays above the other drifting cards */
}

.card {
  display: block;
  width: 232px;
  text-align: left;
  font: inherit;
  color: var(--ink);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow), var(--card-highlight);
  /* richer frosted glass: a saturation lift makes the sky behind the card glow through */
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  cursor: grab;
  /* never let a drag turn into a text selection — that's what made cards feel un-draggable */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  /* border-radius is in the transition so a status change visibly morphs the shape */
  transition: transform 0.32s var(--ease-out), box-shadow 0.32s var(--ease-out),
    background 0.32s var(--ease-out), border-radius 0.8s var(--ease-out);
}
/* images inside a card must not start a native drag or eat the card's pointer events */
.card img {
  -webkit-user-drag: none;
  user-select: none;
}
.card-top img,
.idea-text {
  pointer-events: none;
}
.card:hover,
.card:focus-visible {
  transform: translateY(-6px) scale(1.035);
  box-shadow: var(--shadow-lift), var(--card-highlight);
  background: rgba(255, 255, 255, 0.82);
  outline: none;
}
.card:focus-visible {
  outline: 3px solid rgba(95, 145, 230, 0.6);
  outline-offset: 3px;
}

.card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}
.avatar.lg {
  width: 44px;
  height: 44px;
}
.author {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.idea-text {
  margin: 0 0 12px;
  font-size: 15px;
  line-height: 1.4;
  font-weight: 550;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* status chips */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}
.chip .cdot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.chip.blue { color: var(--blue); background: rgba(79, 127, 224, 0.13); }
.chip.blue .cdot { background: var(--blue); }
.chip.amber { color: var(--amber); background: rgba(226, 146, 47, 0.15); }
.chip.amber .cdot { background: var(--amber); }
.chip.green { color: var(--green); background: rgba(31, 175, 106, 0.15); }
.chip.green .cdot { background: var(--green); }
.chip .arrow { font-weight: 800; }
.cdot.pulse {
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226, 146, 47, 0.55); }
  50% { box-shadow: 0 0 0 5px rgba(226, 146, 47, 0); }
}

/* card footer: status chip (left) + like cluster (right) */
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.likes {
  display: flex;
  align-items: center;
  gap: 6px;
}
.likes.empty .stack { display: none; }
.stack {
  display: flex;
  align-items: center;
}
.stack img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  margin-left: -7px;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.stack img:first-child { margin-left: 0; }
.stack .more {
  font-size: 10px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-left: 5px;
}
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
.like-btn:hover { background: rgba(0, 0, 0, 0.06); }
.like-btn svg { width: 15px; height: 15px; }
.like-btn svg path { fill: none; stroke: currentColor; stroke-width: 2; }
.like-btn.liked { color: #ff4d6d; }
.like-btn.liked svg path { fill: currentColor; stroke: none; }
.like-btn.pop svg { animation: likePop 0.32s ease; }
@keyframes likePop {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); }
  100% { transform: scale(1); }
}
.d-foot {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.mini-yours {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(90deg, #ff5f6d, #ffc371, #47e891, #2ec5ff, #a17bff);
}

/* ---- the rainbow (compose card + the user's own ideas) --------------------*/

.rainbow {
  position: relative;
}
.rainbow::before,
.rainbow::after {
  content: "";
  position: absolute;
  border-radius: inherit;
  background: conic-gradient(from 210deg, #ff5f6d, #ffc371, #47e891, #2ec5ff, #a17bff, #ff5f6d);
  z-index: -1;
}
.rainbow::before {
  inset: -2.5px;
}
.rainbow::after {
  inset: -7px;
  filter: blur(13px);
  opacity: 0.65;
}
@keyframes spin {
  to { transform: rotate(1turn); }
}

/* the singleton "Yours" compose control — a soft, glowing light bulb */
.card.compose.bulb {
  width: 184px;
  height: 238px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: grid;
  place-items: center;
}
.card.compose.bulb:hover {
  transform: scale(1.04);
  background: transparent;
  box-shadow: none;
}
.card.compose.bulb:focus-visible {
  outline: 3px solid rgba(255, 205, 80, 0.85);
  outline-offset: 10px;
}
.compose-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  pointer-events: none;
}
.bulb-glass {
  width: 158px;
  height: 158px;
  border-radius: 50% 50% 49% 49% / 52% 52% 48% 48%;
  background: radial-gradient(circle at 50% 36%, #fffdf2 0%, #fff4c6 38%, #ffe48f 66%, #ffd25e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: inset 0 -7px 16px rgba(214, 150, 40, 0.35), inset 0 7px 14px rgba(255, 255, 255, 0.75);
  animation: bulbGlow 3.8s ease-in-out infinite;
}
@keyframes bulbGlow {
  0%, 100% {
    box-shadow: inset 0 -7px 16px rgba(214, 150, 40, 0.35),
      inset 0 7px 14px rgba(255, 255, 255, 0.75), 0 0 24px 5px rgba(255, 214, 90, 0.5);
  }
  50% {
    box-shadow: inset 0 -7px 16px rgba(214, 150, 40, 0.35),
      inset 0 7px 14px rgba(255, 255, 255, 0.75), 0 0 46px 14px rgba(255, 212, 86, 0.95);
  }
}
.bulb-base {
  width: 58px;
  height: 36px;
  margin-top: -3px;
  border-radius: 5px 5px 9px 9px;
  background: repeating-linear-gradient(180deg, #cdd2dc 0 5px, #b3b9c5 5px 9px);
  box-shadow: 0 7px 13px rgba(31, 72, 120, 0.22);
}
.compose-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #6a4b00;
}
.compose-sub {
  font-size: 11px;
  font-weight: 700;
  color: #8a6a1f;
}

/* new-idea entrance */
.floater.pop .card {
  animation: pop 0.62s var(--ease-spring);
}
@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  60% { opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- brand & user chip ----------------------------------------------------*/

.brand {
  position: fixed;
  top: 18px;
  left: 20px;
  z-index: 5;
  pointer-events: none;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 2px 10px rgba(40, 90, 150, 0.35);
}
.brand-mark b {
  font-weight: 800;
}
.brand-tag {
  margin: 6px 0 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 6px rgba(40, 90, 150, 0.3);
}

.user-chip {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px 6px 6px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  box-shadow: var(--shadow), var(--card-highlight);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  font-size: 14px;
  font-weight: 700;
}
.user-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.user-chip .signout {
  border: none;
  background: rgba(79, 127, 224, 0.12);
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}
.user-chip .signout:hover {
  background: rgba(79, 127, 224, 0.22);
}

/* ---- overlay & panels -----------------------------------------------------*/

.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(36, 60, 90, 0);
  backdrop-filter: blur(0px);
  transition: background 0.18s ease, backdrop-filter 0.18s ease;
}
.overlay.open {
  background: rgba(36, 60, 90, 0.28);
  backdrop-filter: blur(4px);
}

.panel {
  position: relative;
  width: min(440px, 94vw);
  background: rgba(255, 255, 255, 0.96);
  border-radius: 24px;
  padding: 24px 24px 22px;
  box-shadow: 0 4px 12px rgba(20, 50, 90, 0.12), 0 18px 40px rgba(20, 50, 90, 0.22),
    0 40px 90px rgba(20, 50, 90, 0.34), var(--card-highlight);
  transform: translateY(16px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s var(--ease-spring), opacity 0.22s var(--ease-soft);
}
.overlay.open .panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.panel.rainbow::before { inset: -2.5px; }
.panel.rainbow::after { inset: -10px; opacity: 0.5; }

.panel .x {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 8px;
  width: 34px;
  height: 34px;
}
.panel .x:hover {
  background: rgba(0, 0, 0, 0.06);
}

.p-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.p-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-time {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.p-text {
  margin: 4px 0 18px;
  font-size: 19px;
  line-height: 1.45;
  font-weight: 600;
  letter-spacing: -0.012em;
}

/* status timeline */
.timeline {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex;
  gap: 0;
}
.timeline li {
  flex: 1;
  position: relative;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #adb9c8;
  padding-top: 22px;
}
.timeline li i {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #d7dee7;
  z-index: 1;
}
.timeline li::before {
  content: "";
  position: absolute;
  top: 10px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: #d7dee7;
}
.timeline li:first-child::before { display: none; }
.timeline li.done,
.timeline li.current { color: var(--green); }
.timeline li.done i,
.timeline li.current i { background: var(--green); }
.timeline li.done::before,
.timeline li.current::before { background: var(--green); }
.timeline li.current i {
  box-shadow: 0 0 0 4px rgba(31, 175, 106, 0.22);
}

.p-blurb {
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.45;
}

.open-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1faf6a, #19c07a);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(31, 175, 106, 0.35);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out),
    filter 0.18s var(--ease-out);
}
.open-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(31, 175, 106, 0.42);
}
.open-btn:active {
  transform: scale(0.97);
}
.p-host {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

/* compose */
.p-h {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.p-lead {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-soft);
  font-weight: 600;
}
.p-lead code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  background: rgba(79, 127, 224, 0.12);
  color: var(--blue);
  padding: 1px 6px;
  border-radius: 6px;
}
.gbtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 13px;
  border: 1px solid #dadce0;
  border-radius: 14px;
  background: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: #3c4043;
  cursor: pointer;
  transition: box-shadow 0.18s var(--ease-out), background 0.18s var(--ease-out),
    transform 0.18s var(--ease-out);
}
.gbtn:hover {
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.18);
  background: #f8faff;
}
.gbtn:active {
  transform: scale(0.98);
}
.gbtn.loading {
  opacity: 0.6;
  cursor: progress;
}

textarea#idea {
  width: 100%;
  resize: none;
  border: 1.5px solid #d7dee7;
  border-radius: 14px;
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}
textarea#idea:focus {
  border-color: var(--blue);
}
.compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}
.counter {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.submit {
  border: none;
  padding: 12px 22px;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(90deg, #5b8def, #8a6cf0);
  box-shadow: 0 10px 22px rgba(91, 141, 239, 0.4);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out),
    filter 0.18s var(--ease-out), opacity 0.18s var(--ease-out);
}
.submit:not(:disabled):hover {
  filter: brightness(1.04);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(91, 141, 239, 0.46);
}
.submit:not(:disabled):active {
  transform: scale(0.97);
}
.submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.submit.loading {
  cursor: progress;
}

/* ---- ideas taking shape: blob (new) → forming (building) → card (shipped) -*/

/* a fresh idea is a formless blob — 4 seeded organic shapes, slightly extra padding so
   text stays clear of the rounded corners */
.shape-blob { padding: 20px 20px 14px; }
.shape-blob.b1 { border-radius: 60% 40% 56% 44% / 56% 52% 48% 44%; }
.shape-blob.b2 { border-radius: 42% 58% 46% 54% / 60% 42% 58% 40%; }
.shape-blob.b3 { border-radius: 55% 45% 38% 62% / 46% 56% 44% 54%; }
.shape-blob.b4 { border-radius: 48% 52% 60% 40% / 52% 46% 54% 48%; }

/* an idea being built is actively resolving toward a card — a gentle wobble */
.shape-forming {
  padding: 17px 18px 13px;
  animation: forming 6s ease-in-out infinite;
  animation-delay: var(--fd, 0s);
}
@keyframes forming {
  0%, 100% { border-radius: 30px 13px 26px 16px; }
  50% { border-radius: 14px 30px 15px 28px; }
}
/* shipped ideas keep the crisp 22px card radius (default) */

/* the user's own ideas glow softly (replaces the old rainbow ring) — any shape */
.card.idea.mine {
  animation: mineGlow 3.8s ease-in-out infinite;
}
/* keep the forming wobble AND the glow when an own idea is mid-build */
.card.idea.mine.shape-forming {
  animation: forming 6s ease-in-out infinite, mineGlow 3.8s ease-in-out infinite;
  animation-delay: var(--fd, 0s), 0s;
}
@keyframes mineGlow {
  0%, 100% {
    box-shadow: var(--shadow), var(--card-highlight), 0 0 0 0 rgba(130, 170, 255, 0);
  }
  50% {
    box-shadow: var(--shadow), var(--card-highlight), 0 0 26px 7px rgba(130, 170, 255, 0.6);
  }
}
.panel.detail.mine {
  box-shadow: 0 30px 80px rgba(20, 50, 90, 0.4), 0 0 0 2px rgba(130, 170, 255, 0.5),
    0 0 40px 6px rgba(130, 170, 255, 0.35);
}

/* ---- the shipped pile: implemented ideas settle, overlapping, into the corner -*/

.shelf-ground {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 380px;
  height: 240px;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(150px 60px at 80% 88%, rgba(20, 50, 90, 0.16), transparent 72%);
}
.shelf {
  position: fixed;
  right: 28px;
  bottom: 28px;
  width: 232px;
  height: 158px;
  z-index: 6;
  pointer-events: none; /* children re-enable */
}
.shelf-card {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 232px;
  transform: translate(var(--dx, 0), var(--dy, 0)) rotate(var(--rot, 0deg));
  z-index: var(--z, 1);
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1), filter 0.28s ease;
  filter: drop-shadow(0 10px 20px rgba(31, 72, 120, 0.16));
  pointer-events: auto;
}
.shelf-card .card {
  width: 232px;
  cursor: pointer; /* shelf cards open; they don't drag */
}
.shelf-card:hover {
  transform: translate(var(--dx, 0), calc(var(--dy, 0) - 18px)) rotate(0deg) scale(1.025);
  z-index: 900;
  filter: drop-shadow(0 20px 36px rgba(31, 72, 120, 0.32));
}
.shelf-label {
  position: absolute;
  top: 50%;
  right: calc(100% + 16px);
  transform: translateY(-50%);
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 8px rgba(40, 90, 150, 0.4);
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* fanned-out state: cards spread into a centered row above a dimming backdrop */
.shelf.expanded {
  z-index: 45;
}
.shelf.expanded .shelf-label {
  opacity: 0;
}
.shelf.expanded .shelf-card {
  z-index: var(--z);
}
.shelf.expanded .shelf-card:hover {
  transform: translate(var(--dx), calc(var(--dy) - 12px)) rotate(0deg) scale(1.03);
  filter: drop-shadow(0 22px 40px rgba(20, 50, 90, 0.4));
}
.shelf-backdrop {
  position: fixed;
  inset: 0;
  z-index: 44;
  background: rgba(18, 38, 68, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.26s ease;
}
.shelf-backdrop.show {
  opacity: 1;
}

/* ---- responsive -----------------------------------------------------------*/

@media (max-width: 520px) {
  .card { width: 200px; }
  .brand-tag { max-width: 60vw; }
  .p-text { font-size: 17px; }
}

/* ---- reduced motion: calm, static sky ------------------------------------*/

@media (prefers-reduced-motion: reduce) {
  .bulb-glass,
  .card.idea.mine,
  .card.idea.mine.shape-forming,
  .cdot.pulse,
  .shape-forming,
  .sky-layer,
  .stars,
  .floater,
  .floater.pop .card,
  .rainbow::before,
  .rainbow::after {
    animation: none !important;
  }
  .bulb-glass {
    box-shadow: inset 0 -7px 16px rgba(214, 150, 40, 0.35),
      inset 0 7px 14px rgba(255, 255, 255, 0.75), 0 0 30px 8px rgba(255, 214, 90, 0.7);
  }
  .l-day { opacity: 1; }
  .card {
    transition: box-shadow 0.2s ease;
  }
  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}
