:root {
  /* MIDNIGHT + ELECTRIC BLUE */
  --bg1: #080d28;
  --bg2: #151642;
  --ink: #f3f2ff;
  --soft: #a6b3dc;
  --rose: #4388ff;
  --rose-d: #2860e8;

  /* NEON SCRAPBOOK CARD COLORS */
  --pink: #252c69;
  --peach: #263c70;
  --butter: #33316e;
  --mint: #183e68;
  --lavender: #3b286c;
  --sky: #1d426d;

  --font: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN",
    "Nunito", "Quicksand", system-ui, sans-serif;
  --hand: "Bradley Hand", "Segoe Print", "Comic Sans MS", ui-rounded, cursive;

  --glitter: #9ceaff;
  --starlight: #e4ddff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

html {
  background: var(--bg1);
}

body {
  position: relative;
  isolation: isolate;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse at 12% 12%, #2149a64d, transparent 36%),
    radial-gradient(ellipse at 88% 28%, #6939bb35, transparent 32%),
    radial-gradient(ellipse at 50% 100%, #174ca635, transparent 42%),
    linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  -webkit-tap-highlight-color: transparent;
}

/* Starry sky: purely decorative, never blocks buttons */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 8% 16%, #ffffffdd 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 18% 73%, #70c8ff 50%, transparent 100%),
    radial-gradient(2px 2px at 27% 36%, #d9d5ff 50%, transparent 100%),
    radial-gradient(1px 1px at 38% 87%, #ffffffdd 50%, transparent 100%),
    radial-gradient(2px 2px at 48% 19%, #73dfff 50%, transparent 100%),
    radial-gradient(1px 1px at 57% 62%, #ffffffcc 50%, transparent 100%),
    radial-gradient(2px 2px at 68% 42%, #b9a5ff 50%, transparent 100%),
    radial-gradient(1.5px 1.5px at 76% 81%, #ffffffdd 50%, transparent 100%),
    radial-gradient(2px 2px at 87% 13%, #76cfff 50%, transparent 100%),
    radial-gradient(1px 1px at 94% 58%, #d9d5ff 50%, transparent 100%);
  opacity: 0.8;
  animation: starTwinkle 5s ease-in-out infinite alternate;
}

/* A subtle shooting-star trail across the background */
body::after {
  content: "";
  position: fixed;
  z-index: -1;
  top: 12%;
  left: -35%;
  width: 150px;
  height: 2px;
  pointer-events: none;
  border-radius: 50%;
  opacity: 0;
  background: linear-gradient(
    90deg,
    transparent,
    #79caff,
    #ffffff,
    transparent
  );
  box-shadow: 0 0 9px 2px #4388ff80;
  transform: rotate(-24deg);
  animation: cometFlight 12s ease-in-out infinite;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid #67caff;
  outline-offset: 2px;
}

/* LOGIN: a tiny portal into your universe */

#login {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  position: relative;
  width: min(340px, 100%);
  background: linear-gradient(145deg, #171b4bfa, #101737fa);
  border: 1px solid #718eff55;
  border-radius: 28px;
  padding: 32px 24px;
  text-align: center;
  box-shadow:
    0 12px 40px #02061766,
    0 0 28px #386dff26,
    inset 0 1px 0 #ffffff13;
  display: grid;
  gap: 12px;
  overflow: hidden;
}

/* Tiny sparkle decoration in the login panel */
.login-card::before {
  content: "✦";
  position: absolute;
  top: 9px;
  right: 15px;
  color: #8ce7ff;
  font-size: 1.2rem;
  text-shadow: 0 0 12px #5ac8ff;
  animation: sparklePulse 2.5s ease-in-out infinite;
}

.login-card::after {
  content: "✧";
  position: absolute;
  bottom: 10px;
  left: 13px;
  color: #b8a2ff;
  font-size: 1.2rem;
  text-shadow: 0 0 12px #9d7bff;
  pointer-events: none;
}

.login-card h1 {
  margin: 0;
  font-size: 1.4rem;
}

.seal {
  font-size: 2.6rem;
  filter: drop-shadow(0 0 12px #6797ff77);
}

.hint {
  margin: 0;
  color: var(--soft);
}

input,
textarea {
  font: inherit;
  color: var(--ink);
  border: 2px solid #5866a7;
  background: #0c1231;
  border-radius: 16px;
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #8999ca;
}

input:focus,
textarea:focus {
  border-color: #64cfff;
  box-shadow: 0 0 0 3px #4388ff25, 0 0 15px #4388ff22;
  outline: none;
}

.primary {
  background: linear-gradient(110deg, #3975ff, #6252ff);
  color: #fff;
  border-radius: 16px;
  padding: 12px 20px;
  font-weight: 800;
  box-shadow: 0 4px 18px #386dff45;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.primary:hover {
  box-shadow: 0 5px 24px #4388ff75;
  transform: translateY(-1px);
}

.primary:active {
  background: var(--rose-d);
  transform: scale(0.98);
}

.primary:disabled {
  opacity: 0.5;
}

.ghost {
  background: transparent;
  color: var(--soft);
  padding: 8px 12px;
  border-radius: 12px;
}

.ghost:hover {
  color: #83dcff;
  background: #4388ff15;
}

.err {
  color: #ff9dbb;
  min-height: 1.2em;
  margin: 0;
  font-size: 0.9rem;
}

/* APP: keep the original mobile layout */

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 8px;
}

header h1 {
  margin: 0;
  font-size: 1.25rem;
  text-shadow: 0 0 18px #4388ff3d;
}

#feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.day {
  align-self: center;
  color: #bdc8f3;
  font-size: 0.85rem;
  background: #242956dd;
  border: 1px solid #7488ff3d;
  padding: 4px 14px;
  border-radius: 99px;
  margin-top: 6px;
}

.empty {
  margin: auto;
  text-align: center;
  color: var(--soft);
}

/* SCRAPBOOK CARDS: same shapes, now cosmic */

.card {
  position: relative;
  max-width: 84%;
  padding: 16px 18px 12px;
  border: 1px solid #b4c8ff25;
  border-radius: 6px 22px 22px 22px;
  box-shadow:
    0 6px 16px #0206174d,
    inset 0 1px 0 #ffffff12;
  animation: land 0.35s ease-out;
  transition: box-shadow 0.2s ease;
}

.card.mine {
  align-self: flex-end;
  border-radius: 22px 6px 22px 22px;
  transform: rotate(0.6deg);
}

.card.theirs {
  align-self: flex-start;
  transform: rotate(-0.6deg);
}

.card .tape {
  position: absolute;
  top: -8px;
  left: 50%;
  width: 46px;
  height: 16px;
  margin-left: -23px;
  background: #a6dfffad;
  border: 1px solid #ffffff30;
  border-radius: 3px;
  transform: rotate(-3deg);
  box-shadow: 0 0 9px #4388ff26;
}

.card .sticker {
  position: absolute;
  right: -8px;
  bottom: -12px;
  font-size: 1.7rem;
  transform: rotate(10deg);
  filter: drop-shadow(0 0 7px #75aaff4a);
}

.card .msg {
  font-family: var(--hand);
  font-size: 1.15rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.card .meta {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #c0c9f0;
}

.card.fresh {
  box-shadow:
    0 0 0 3px #111637,
    0 0 0 5px #61bfff,
    0 0 22px #4388ff80;
}

/* Six selectable card colours, all within the night-sky palette */
.c-pink {
  background: linear-gradient(135deg, #272d72, #20285b);
}

.c-peach {
  background: linear-gradient(135deg, #243f79, #1e315d);
}

.c-butter {
  background: linear-gradient(135deg, #35336f, #272653);
}

.c-mint {
  background: linear-gradient(135deg, #164b6c, #193657);
}

.c-lavender {
  background: linear-gradient(135deg, #482d7a, #30265d);
}

.c-sky {
  background: linear-gradient(135deg, #1d4c82, #1d355f);
}

/* Composer: keep all original controls and spacing */

footer {
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px);
  background: #111733f2;
  border-top: 1px solid #829bff30;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -6px 24px #0206173d;
  backdrop-filter: blur(12px);
}

.row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.sw {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #dbe6ff;
  box-shadow: 0 0 0 1px #6478c5;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.sw:hover {
  transform: scale(1.08);
}

.sw[aria-checked="true"] {
  box-shadow:
    0 0 0 2px #111733,
    0 0 0 4px #61cfff,
    0 0 13px #4388ff66;
}

/* The swatches keep their existing c-* class names */
.sw.c-pink {
  background: #526dff;
}

.sw.c-peach {
  background: #368fff;
}

.sw.c-butter {
  background: #865bff;
}

.sw.c-mint {
  background: #26c8d9;
}

.sw.c-lavender {
  background: #b35cff;
}

.sw.c-sky {
  background: #4ab9ff;
}

.st {
  font-size: 1.3rem;
  background: transparent;
  border-radius: 12px;
  padding: 2px 6px;
  opacity: 0.65;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.st:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.st[aria-checked="true"] {
  opacity: 1;
  background: #31376e;
  box-shadow: 0 0 0 1px #6c91ff, 0 0 12px #4388ff35;
}

.compose {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.compose textarea {
  resize: none;
  flex: 1;
}

.count {
  margin: 4px 4px 0;
  text-align: right;
  font-size: 0.75rem;
  color: var(--soft);
}

/* ANIMATIONS */

@keyframes land {
  from {
    opacity: 0;
    translate: 0 10px;
  }

  to {
    opacity: 1;
    translate: 0 0;
  }
}

@keyframes starTwinkle {
  from {
    opacity: 0.55;
  }

  to {
    opacity: 1;
  }
}

@keyframes sparklePulse {
  0%, 100% {
    opacity: 0.65;
    transform: scale(0.9) rotate(0deg);
  }

  50% {
    opacity: 1;
    transform: scale(1.2) rotate(15deg);
  }
}

@keyframes cometFlight {
  0%, 65% {
    left: -35%;
    top: 12%;
    opacity: 0;
  }

  68% {
    opacity: 0.9;
  }

  78% {
    left: 115%;
    top: 35%;
    opacity: 0;
  }

  100% {
    left: 115%;
    top: 35%;
    opacity: 0;
  }
}

@media (max-width: 380px) {
  .card {
    max-width: 90%;
  }

  .login-card {
    padding: 28px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

/* ==========================================
   RETRO INTERNET HEADLINES
   ========================================== */

.login-card h1,
header h1 {
  font-family: "Arial Black", "Trebuchet MS", Arial, sans-serif;
  font-weight: 900;
  letter-spacing: -0.045em;
  color: #f4f4ff;
  text-shadow:
    0 0 8px #4388ff70,
    0 0 20px #754dff40;
}

.login-card h1 {
  font-size: 1.65rem;
}

header h1 {
  font-size: 1.3rem;
}

/* ==========================================
   FLOATING DISCO BALLS 🪩
   CSS-only decorations; no layout changes
   ========================================== */

#app::before,
#app::after,
#login::before,
#login::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  pointer-events: none;

  background:
    radial-gradient(
      circle at 30% 23%,
      #ffffff 0%,
      #d9f6ff 4%,
      transparent 13%
    ),
    repeating-conic-gradient(
      from 0deg,
      #e8f7ff 0deg 9deg,
      #7c9bff 10deg 17deg,
      #272e76 18deg 21deg,
      #c5aaff 22deg 28deg,
      #263b83 29deg 36deg
    );

  box-shadow:
    0 0 12px #58a6ff50,
    0 0 32px #6954ff35,
    inset -8px -8px 18px #090d2b99,
    inset 5px 5px 12px #ffffff65;

  opacity: 0.24;
  animation:
    discoSpin 12s linear infinite,
    discoFloat 5s ease-in-out infinite;
}

/* First ball: upper right */
#app::before,
#login::before {
  top: 16%;
  right: 7%;
}

/* Second ball: lower left */
#app::after,
#login::after {
  bottom: 19%;
  left: 5%;
  width: 55px;
  height: 55px;
  opacity: 0.2;
  animation:
    discoSpin 9s linear infinite reverse,
    discoFloat 6s ease-in-out infinite reverse;
}

/* Thin hanging strings */
#app,
#login {
  isolation: isolate;
}

#app::before,
#app::after,
#login::before,
#login::after {
  -webkit-mask-image: none;
  mask-image: none;
}

/* Keep real app content above the decorative background */
#app > *,
#login > * {
  position: relative;
  z-index: 1;
}

@keyframes discoSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes discoFloat {
  0%, 100% {
    margin-top: 0;
  }

  50% {
    margin-top: -12px;
  }
}

/* Smaller disco balls on phones */
@media (max-width: 600px) {
  #app::before,
  #login::before {
    width: 56px;
    height: 56px;
    right: 4%;
    opacity: 0.19;
  }

  #app::after,
  #login::after {
    width: 40px;
    height: 40px;
    left: 3%;
    opacity: 0.16;
  }
}

@media (prefers-reduced-motion: reduce) {
  #app::before,
  #app::after,
  #login::before,
  #login::after {
    animation: none;
  }
}
#disco-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#login,
#app {
  position: relative;
  z-index: 1;
  isolation: isolate;
}


/* ✦ 2D Y2K cosmic decorations ✦ */

.disco-decor {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.disco-ball {
  font-family: system-ui, sans-serif;
  font-size: 42px;
  filter: drop-shadow(0 0 9px #4388ff99)
          drop-shadow(0 0 20px #754dff66);
  animation: discoBob 5s ease-in-out infinite,
             discoTurn 8s ease-in-out infinite;
}

.disco-one {
  top: 13%;
  right: 5%;
  animation-delay: -1s;
}

.disco-two {
  bottom: 16%;
  left: 4%;
  font-size: 32px;
  animation-delay: -3s;
}

.disco-three {
  top: 47%;
  right: 3%;
  font-size: 24px;
  animation-delay: -2s;
}

.cosmic-star {
  color: #8deaff;
  font-size: 20px;
  text-shadow: 0 0 8px #4388ff, 0 0 18px #754dff;
  animation: starTwinkle 2.5s ease-in-out infinite alternate;
}

.star-one {
  top: 23%;
  left: 7%;
}

.star-two {
  top: 65%;
  right: 10%;
  animation-delay: -1.3s;
}

.star-three {
  bottom: 10%;
  right: 24%;
  font-size: 13px;
  animation-delay: -.7s;
}

@keyframes discoBob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -12px; }
}

@keyframes discoTurn {
  0%, 100% { rotate: -10deg; }
  50% { rotate: 10deg; }
}

@keyframes starTwinkle {
  from { opacity: .35; scale: .8; }
  to { opacity: 1; scale: 1.2; }
}

/* Keep decorations behind your interface */
.disco-decor {
  z-index: 0;
}

#login, #app {
  isolation: isolate;
}

#login > *, #app > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .disco-one { right: 2%; top: 10%; }
  .disco-two { left: 2%; bottom: 18%; }
  .disco-three { right: 2%; }
}

