* {
  box-sizing: border-box;
}

/* Page background and layout */

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #0b0f19;
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 2rem 3rem;
  position: relative;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.35) blur(2px);
  transition: background-image 1s ease-in-out;
  z-index: -1;
}

/* Optional subtle starfield */
.bg-overlay::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(248, 250, 252, 0.3) 1px, transparent 1px),
    radial-gradient(circle at 80% 30%, rgba(248, 250, 252, 0.25) 1px, transparent 1px),
    radial-gradient(circle at 50% 80%, rgba(248, 250, 252, 0.2) 1px, transparent 1px);
  background-size: 200px 200px, 260px 260px, 180px 180px;
  animation: star-drift 40s linear infinite;
  pointer-events: none;
}

@keyframes star-drift {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-80px, -40px, 0);
  }
}

/* Two-column layout */

.main-layout {
  width: 100%;
  max-width: 1200px;
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(280px, 1fr);
  gap: 2rem;
  align-items: flex-start;
}

.left-column {
  display: flex;
  justify-content: flex-start;
}

.right-column {
  display: flex;
  justify-content: flex-end;
}

/* Glassmorphism container */

.container {
  text-align: left;
  padding: 2.5rem 2.5rem;
  background: rgba(11, 15, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(16px);
  max-width: 650px;
  width: 100%;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0.35rem 0.85rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
  border-radius: 50px;
  margin-bottom: 1rem;
  font-weight: 700;
}

.clock {
  font-size: 4.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  margin-bottom: 0.25rem;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.date {
  font-size: 1.05rem;
  margin-top: 0.25rem;
  color: #93c5fd;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.greeting {
  font-size: 1.6rem;
  font-weight: 600;
  margin-top: 1.5rem;
  color: #f3f4f6;
}

.focus-text {
  font-size: 0.95rem;
  margin-top: 0.75rem;
  color: #9ca3af;
  font-style: italic;
  line-height: 1.4;
  padding: 0 1rem 0 0;
}

/* Quick Access links */

.links-section {
  margin-top: 0.5rem;
  max-width: 420px;
}

.links-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.links-header h2 {
  font-size: 1.1rem;
  margin: 0;
}

.icon-button {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: none;
  background: #111827;
  color: #e5e7eb;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}

.icon-button:hover {
  background: #1f2937;
  transform: translateY(-1px);
}

.links {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.link-chip {
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: #1f2937;
  color: #e5e7eb;
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.link-chip span {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.link-chip button {
  border: none;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0;
}

.link-chip button:hover {
  color: #f97316;
}

/* Modal (used for user setup and links) */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #020617;
  border-radius: 0.75rem;
  padding: 1rem 1.25rem;
  width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.modal-content label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  border: none;
  margin-top: 0.2rem;
  background: #020617;
  color: #e5e7eb;
  outline: 1px solid #1f2937;
}

.modal-content input:focus,
.modal-content select:focus {
  outline-color: #6366f1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.modal-actions button {
  border: none;
  border-radius: 0.5rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  background: #4f46e5;
  color: #e5e7eb;
}

/* Sticky notes */

.todo {
  margin-top: 2.5rem;
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.todo h2 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

#todo-form {
  margin-bottom: 0.75rem;
}

#todo-input {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: none;
  outline: none;
  background: #020617;
  color: #e5e7eb;
  box-shadow: 0 0 0 1px #1f2937;
}

#todo-input:focus {
  box-shadow: 0 0 0 1px #6366f1;
}

.todo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}

.sticky-note {
  background: #fef3c7;
  color: #111827;
  padding: 0.6rem 0.5rem 0.8rem;
  border-radius: 0.4rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  position: relative;
  min-height: 110px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: rotate(-1deg);
}

.sticky-note:nth-child(2n) {
  transform: rotate(1deg);
}

.sticky-note.done {
  opacity: 0.8;
  transform: scale(0.97) rotate(-1deg);
}

.sticky-note-text {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.sticky-note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.75rem;
}

.sticky-note-buttons {
  display: flex;
  gap: 0.25rem;
}

.sticky-note-buttons button {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
}

.sticky-note-buttons button:hover {
  color: #1f2937;
}

/* Pixel-art avatar layer */

.character-layer {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 10;
}

.avatar {
  width: 128px;
  height: 128px;
  image-rendering: pixelated;
  background-repeat: no-repeat;
  background-position: 0 0;
  background-size: auto 128px; /* width depends on frame count */
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.8));
  animation: avatar-float 3s ease-in-out infinite;
}

.avatar-hidden {
  display: none;
}

/* Floating/glow animation */
@keyframes avatar-float {
  0% {
    transform: translate(-50%, 0px);
  }
  50% {
    transform: translate(-50%, -10px);
  }
  100% {
    transform: translate(-50%, 0px);
  }
}

/* Sprite animations via steps() */

/* Example: dino idle (4 frames, 512x128) */
.avatar.dino-idle {
  background-image: url("assets/dino_idle.png");
  animation: avatar-float 3s ease-in-out infinite, dino-idle 0.8s steps(4) infinite;
}

@keyframes dino-idle {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -512px 0;
  }
}

/* Example: dino walk (6 frames, 768x128) */
.avatar.dino-walk {
  background-image: url("assets/dino_walk.png");
  animation: avatar-float 3s ease-in-out infinite, dino-walk 0.7s steps(6) infinite;
}

@keyframes dino-walk {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -768px 0;
  }
}

/* Astronaut male idle (4 frames) */
.avatar.astronaut-m-idle {
  background-image: url("assets/astronaut_m_idle.png");
  animation: avatar-float 3s ease-in-out infinite, astro-m-idle 0.9s steps(4) infinite;
}

@keyframes astro-m-idle {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -512px 0;
  }
}

/* Astronaut female idle (4 frames) */
.avatar.astronaut-f-idle {
  background-image: url("assets/astronaut_f_idle.png");
  animation: avatar-float 3s ease-in-out infinite, astro-f-idle 0.9s steps(4) infinite;
}

@keyframes astro-f-idle {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -512px 0;
  }
}

/* Rocket fly (6 frames) */
.avatar.rocket-fly {
  background-image: url("assets/rocket_fly.png");
  animation: avatar-float 3s ease-in-out infinite, rocket-fly 0.6s steps(6) infinite;
}

@keyframes rocket-fly {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -768px 0;
  }
}

/* UFO float (4 frames) */
.avatar.ufo-float {
  background-image: url("assets/ufo_float.png");
  animation: avatar-float 3s ease-in-out infinite, ufo-float 1s steps(4) infinite;
}

@keyframes ufo-float {
  from {
    background-position: 0 0;
  }
  to {
    background-position: -512px 0;
  }
}