:root {
  --bg-color: #000610;
  --text-color: #e0e0e0;
  --accent-color: #00aaff;
  --wave-color1: #0099ff;
  --wave-color2: #002266;
  --wave-color3: #000610;
  --wave-speed: 24s;
  --wave-amplitude: 0px;
  --particle-speed: 4s;
}

body.intensity-low {
  --wave-speed: 24s;
  --wave-amplitude: 0px;
  --particle-speed: 4s;
}
body.intensity-medium {
  --wave-speed: 18s;
  --wave-amplitude: 8px;
  --particle-speed: 2s;
}
body.intensity-high {
  --wave-speed: 2s;
  --wave-amplitude: 16px;
  --particle-speed: 0.5s;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  overflow-x: hidden;
  min-height: 100vh;
  font-family: 'Merriweather', serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-color);
  transition: background-color 0.6s, color 0.6s;
}

body.free-time {
  overflow: hidden;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  z-index: 800;
}

.overlay.active {
  display: block;
}

body.modal-open {
  overflow: hidden;
}

body.modal-open .navbar {
  pointer-events: none;
}

body.modal-open .sidebar {
  pointer-events: none;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 8vh;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  z-index: 1000;
  transition: transform 0.3s;
}

body.nav-up .navbar {
  transform: translateY(-100%);
}

.nav-btn {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  border: none;
  border-radius: 4px;
  font-size: 1.2rem;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  transition: background 0.3s;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.sidebar {
  position: fixed;
  top: calc(8vh + 6rem);
  left: 0;
  width: 4rem;
  height: calc(100vh - 8vh - 6rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 0 1rem;
  z-index: 1000;
  transition: transform 0.3s;
  transform: translateX(-100%);
  background: none;
}

.sidebar::before {
  content: "";
  position: absolute;
  top: -6rem;
  left: 0;
  width: 100%;
  height: calc(100% + 6rem);
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 0 9rem, 100% 6rem);
  pointer-events: none;
  z-index: -1;
}

body.nav-down .sidebar {
  transform: translateX(0);
}

.character-icons {
  position: absolute;
  top: 50%;
  right: 20%;
  transform: translateY(-50%);
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.character-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
}

.character-icon.enter {
  opacity: 0;
  transform: translateY(-10px);
}

.character-icon.leave {
  opacity: 0;
  transform: translateY(-10px);
}

.character-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1100;
}

.character-panel.active {
  visibility: visible;
  opacity: 1;
}

.character-panel .profile {
  background-size: 200% 200%;
  animation: profile-bg 10s linear infinite alternate;
  padding: 1rem;
  border-radius: 8px;
  color: #fff;
  text-align: center;
}

.profile-close {
  margin-top: 1rem;
}

@keyframes profile-bg {
  from { background-position: 0 0; }
  to { background-position: 100% 100%; }
}

.free-time-menu .no-tasks {
  color: var(--text-color);
  padding: 1rem;
  text-align: center;
}

.free-time-menu .task-chars {
  margin-left: 0.5rem;
}

.free-time-menu .task-chars .char-icon {
  width: 24px;
  height: 24px;
  margin-left: 0.2rem;
}

  #calendar-btn {
    position: fixed;
    left: 3rem;
    top: 6vh;
    background: none;
    border: none;
    padding: 0;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transform-origin: center;
    transition: opacity 0.3s;
  }
  #calendar-btn .calendar-display {
    width: 80px;
    height: 80px;
  }

body.nav-down #calendar-btn {
  opacity: 1;
  pointer-events: auto;
}

/* ── CALENDAR PANEL ── */
.calendar-panel {
  position: fixed;
  left: 50%;
  bottom: -110%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 800px;
  height: 90vh;
  background: rgba(0, 20, 40, 0.95);
  color: var(--text-color);
  padding: 1rem;
  box-sizing: border-box;
  transition: bottom 0.5s ease;
  z-index: 900;
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.calendar-panel.active {
  bottom: 0;
}

.calendar-panel #calendar-month {
  text-align: center;
  margin: 0 0 2rem;      /* space below */
  font-size: 1.2rem;     /* adjust as you like */
  font-weight: initial;
  color: var(--text-color);           /* or whatever your theme uses */
}

/* ── WEEKDAY HEADERS ── */
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  text-align: center;
  color: var(--text-color);
}

/* ── DATE GRID ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-auto-rows: 60px;    /* ← thin rectangles */
  gap: 0.5rem;
}

/* ── EACH DAY CELL ── */
.calendar-day {
  display: flex;
  flex-direction: column;
  justify-content: space-between; /* date at top, dots at bottom */
  align-items: center;
  padding: 0.25rem;                /* tighten up the padding */
  background: rgba(255,255,255,0.05);
  border-radius: 0.25rem;
  text-align: center;
}
.calendar-day.empty {
  visibility: hidden;
  pointer-events: none;
}
.calendar-day.past {
  opacity: 0.4;
  pointer-events: none;
}
.calendar-day.current-day {
  outline: 2px solid var(--accent-color);
  background: rgba(0,170,255,0.1);
}

.calendar-day.weekday {
  background: rgba(255, 255, 255, 0.05);
}
.calendar-day.weekend {
  background: rgba(136, 100, 255, 0.1);
}
.calendar-day.golden-week {
  border: 2px solid gold;
  background: rgba(255, 255, 255, 0.05);
}
.calendar-day.sports-day {
  border-bottom: 4px solid var(--accent-color);
}
.calendar-day.exam-week {
  background: rgba(191, 0, 255, 0.1);
}


/* ── EVENT DOT (single‐type) ── */
/* base styles */
.calendar-day .event-dot {
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  border-radius: 50%;
}
.calendar-day .event-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.calendar-day .event-container {
  display: flex;
  flex-direction: row;      /* ensure horizontal stacking */
  justify-content: center;  /* center in the cell */
  align-items: center;
  gap: 3px;                 /* even space between each dot/icon */
  padding-bottom: 4px;      /* keep a little breathing room at the bottom */
}

.calendar-day .event-dot,
.calendar-day .event-icon {
  position: static;         /* let flex handle positioning */
  /* remove any left‐margin here since gap covers it */
}

/* ── PER‑TYPE ICON COLORS ── */
.event-icon.meeting  { background: #ffcc00; }
.event-icon.deadline { background: #ff3300; }
.event-icon.reminder { background: #33ff33; }


/* make schedule-panel *always* in the flow, but shifted down out of view */
.schedule-panel {
  width: 100%;
  box-sizing: border-box;
  margin-top: 1rem;

  /* start completely below its normal spot: 100% of its own height */
  transform: translateY(100%);
  opacity: 0;
  visibility: hidden;

  transition:
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    opacity   0.3s ease;
}

/* when active: slide into place and fade in */
.schedule-panel.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}


/* full‑width header for “Day X” */
.schedule-panel .schedule-header {
  width: 100%;
  background: rgba(0, 170, 255, 0.1);
  color: var(--accent-color);
  font-weight: bold;
  text-align: center;
  padding: 0.75rem 0;
  border-radius: 0.25rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* 2×2 grid container */
.schedule-panel .schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

/* each time‑of‑day card */
.schedule-panel .schedule-cell {
  background: rgba(255,255,255,0.05);
  border-radius: 0.25rem;
  padding: 0.5rem;
  min-height: 60px;
  display: flex;
  flex-direction: column;
}

/* title (e.g. “Morning”) */
.schedule-panel .cell-title {
  font-weight: bold;
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
  color: var(--text-color);
}

/* events list text */
.schedule-panel .cell-content {
  flex: 1;
  font-size: 0.9rem;
  color: var(--text-color);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

/* shared calendar display */
  .calendar-display {
    position: relative;
    width: 90px;
    height: 90px;
  }
  .calendar-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 170, 255, 0.8);
    clip-path: polygon(0 0, 100% 45%, 0 100%);
    transform: skewX(-15deg);
    z-index: -1;
  }
  .calendar-display .date-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4rem;
    color: var(--text-color);
    font-family: 'Merriweather', serif;
    z-index: 2;
  }
  .calendar-display .date-day,
  .calendar-display .date-month {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2rem;
    color: var(--text-color);
    font-family: 'Merriweather', serif;
  }
  .calendar-display .date-day {
    right: 60%;
    margin-right: 0.25rem;
    opacity: 0.6;
  }
  .calendar-display .date-month {
    left: 60%;
    bottom: 30%;
    margin-left: 0.25rem;
  }

/* Free time selection */
.free-time-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  transform-origin: center;
  transform: scale(0);
}

.free-time-menu button {
  background: rgba(0, 170, 255, 0.2);
  border: 1px solid var(--accent-color);
  color: var(--text-color);
  padding: 1rem 2rem;
  border-radius: 4px;
  font-family: 'Merriweather', serif;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.3s;
}

.free-time-menu button:hover {
  background: rgba(0, 170, 255, 0.3);
}

#text-area.free-time {
  position: fixed;
  inset: 0;
  width: 100vw;
  max-width: none;
  margin: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

#text-area.free-time .free-time-menu {
  transform: none;
}

#next-btn {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  margin: 4rem auto calc(12vh + 2rem);
  padding: 1rem 1rem 1rem 110px;
  font-size: 2rem;
  font-family: 'Merriweather', serif;
  color: var(--text-color);
  background: none;
  border: none;
  cursor: pointer;
}

#next-btn::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 100px;
  height: 80px;
  background: rgba(0, 170, 255, 0.8);
  clip-path: polygon(0 0, 100% 60%, 0 100%);
  z-index: -1;
}