@font-face {
  font-family: 'SF Pro Rounded';
  src: url('/SF-Pro-Rounded-Regular.otf') format('opentype');
  font-weight: 500;
  font-style: normal;
}

:root {
  --primary: #3c2569;
  --primary-light: #553f8f;
  --text-light: #e8e8e8;
  --bg-dark: #0b0b0b;
  --card-dark: #1e1e1e;
  --glow: 0 0 12px rgba(85, 63, 143, 0.8);
}

body.theme-purple { --primary: #3c2569; --primary-light: #553f8f; --glow: 0 0 12px rgba(85, 63, 143, 0.8); }
body.theme-red { --primary: #9d182e; --primary-light: #b82e38; --glow: 0 0 12px rgba(184, 46, 56, 0.8); }
body.theme-orange { --primary: #a94300; --primary-light: #b8651b; --glow: 0 0 12px rgba(184, 101, 27, 0.8); }
body.theme-yellow { --primary: #9b7e00; --primary-light: #c19d0c; --glow: 0 0 12px rgba(193, 157, 12, 0.8); }
body.theme-green { --primary: #1f8b4d; --primary-light: #25a35a; --glow: 0 0 12px rgba(37, 163, 90, 0.8); }
body.theme-blue { --primary: #216694; --primary-light: #2a7aaf; --glow: 0 0 12px rgba(42, 122, 175, 0.8); }
body.theme-indigo { --primary: #324191; --primary-light: #4a569a; --glow: 0 0 12px rgba(74, 86, 154, 0.8); }
body.theme-pink { --primary: #9b1349; --primary-light: #ba184f; --glow: 0 0 12px rgba(186, 24, 79, 0.8); }

* {
  font-family: 'SF Pro Rounded', sans-serif;
  box-sizing: border-box;
}

body {
  background: var(--bg-dark);
  color: var(--text-light);
  margin: 0;
  padding: 20px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transition: all 0.3s ease;
  padding-bottom: 100px;
}

body::-webkit-scrollbar {
  display: none;
}

/* Calendar page: remove left/right body padding so calendar can go full width */
body.calendarPage {
  padding-left: 0;
  padding-right: 0;
}

@keyframes gradientShift {
  0% { background-position: 0% 0%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes gradientShift2 {
  0% { background-position: 0% 0%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes gradientShift3 {
  0% { background-position: 0% 0%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

@keyframes gradientShift5 {
  0% { background-position: 0% 0%; }
  25% { background-position: 100% 0%; }
  50% { background-position: 100% 100%; }
  75% { background-position: 0% 100%; }
  100% { background-position: 0% 0%; }
}

h1, h2, h3 {
  text-align: center;
  color: white;
}

.homeHeaderRow {
  max-width: 650px;
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.homeHeaderRow h1 {
  margin: 0;
  text-align: left;
}

.topRightButtons {
  position: static;
  display: flex;
  gap: 10px;
  margin-left: auto;
}

.circleBtn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift3 8s ease infinite;
  color: white;
  border: none;
  font-size: 1.5em;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
}

.circleBtn:hover {
  transform: scale(1.1);
}

.backBtn {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift3 8s ease infinite;
  color: transparent;
  border: none;
  padding: 0;
  font-size: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: all 0.3s;
  text-decoration: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.backBtn::before {
  content: '←';
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
}

.backBtn:hover {
  transform: scale(1.1);
}

.pageContainer {
  max-width: 650px;
  margin: 0 auto;
  padding: 20px 0 10px 0;
  display: flex;
  flex-direction: column;
}

body.calendarPage .pageContainer {
  max-width: none;
  width: 100%;
  padding: 20px 20px 10px 20px;
  box-sizing: border-box;
  /* ensure the container shrinks to its contents now that the grid is outside */
  height: auto;
}

#calendarContainer {
  max-width: 100%;
  padding: 40px 40px 0 40px; /* no bottom padding now that grid sits outside */
  box-sizing: border-box;
}

#calendarContainer .calendar-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto 20px;
  padding: 10px;
  background: var(--card-dark);
  border-radius: 12px;
  width: auto;
  box-sizing: border-box;
}

/* legend/key styles for monthly calendar */
.calendar-key {
  margin: 0 auto 10px;
  text-align: center;
}

.calendar-key ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.calendar-key li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-key li:not(:last-child)::after {
  content: '|';
  margin: 0 8px;
  color: var(--text-light);
}

.key-box {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  background: var(--card-dark);
  /* border removed for cleaner look */
}

.key-box.holiday {
  background: #cc0000;
}

.key-box.half-day {
  background: #a94300;
}

.key-box.special-schedule {
  background: #216694;
}

.key-box.today {
  background: var(--primary-light);
}




#digitalClock {
  font-weight: 700;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--glow);
  max-width: 650px;
  margin: 20px auto;
}

#clockLabel {
  font-size: 0.8em;
  margin-bottom: 10px;
  color: white;
  opacity: 0.9;
  font-weight: 700;
}

#clockDisplay {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 15px;
  margin-top: 15px;
}

.time-block {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.time-value {
  font-size: clamp(1.8em, 6vw, 2.8em);
  font-weight: 700;
  color: white;
  line-height: 1;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  display: block;
}

.time-label {
  font-size: 0.7em;
  font-weight: 400;
  color: white;
  opacity: 0.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 5px;
}

.time-block.hidden {
  display: none;
}

#timer {
  font-size: clamp(0.9em, 4vw, 1.1em);
  margin-top: 20px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  padding: 15px;
  border-radius: 16px;
  box-shadow: var(--glow);
  color: var(--text-light);
  max-width: 650px;
  margin: 20px auto;
}

#timer.hidden {
  display: none;
}

.mainButtons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  justify-content: center;
  max-width: 650px;
  margin: 30px auto;
}

.mainBtn {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift2 8s ease infinite;
  color: white;
  border: none;
  padding: 15px 30px;
  font-size: 1.1em;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: all 0.3s;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  display: block;
}

.mainBtn:hover {
  transform: scale(1.05);
}

.homeModeToggleRow {
  width: 100%;
  max-width: 430px;
  margin: 0 auto 22px auto;
  padding: 0 12px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.homeModeToggleLabel {
  font-size: 1.05em;
  font-weight: 600;
}

.homeModeToggleSwitch {
  position: relative;
  width: 48px;
  height: 26px;
}

.homeModeToggleSwitch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.homeModeToggleSlider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #383838;
  transition: 0.4s;
  border-radius: 26px;
}

.homeModeToggleSlider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.homeModeToggleSwitch input:checked + .homeModeToggleSlider {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.homeModeToggleSwitch input:checked + .homeModeToggleSlider:before {
  transform: translateX(22px);
}

body.minimal-mode .mainButtons {
  display: block;
  max-width: 360px;
  margin: 20px auto 16px;
}

body.minimal-mode .mainButtons .mainBtn {
  display: none;
}

body.minimal-mode .mainButtons .mainBtn[href="/today"] {
  display: block;
}

body.minimal-mode .topRightButtons .circleBtn:not([href="/info"]):not([href="/settings"]) {
  display: none;
}

body.minimal-mode .home-ticker-close {
  display: none;
}

.mainBtn.disabledBtn {
  opacity: 0.5;
  cursor: not-allowed;
  background: #444444 !important;
  animation: none !important;
}

.mainBtn.disabledBtn:hover {
  background: #444444 !important;
  transform: none;
}

.scheduleTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #181818;
  border-radius: 12px;
  overflow: hidden;
}

.scheduleTable th {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift5 8s ease infinite;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 700;
}

.scheduleTable td {
  padding: 12px;
  border-bottom: 1px solid #383838;
}

.scheduleTable tr:last-child td {
  border-bottom: none;
}

.scheduleTable tr.highlight {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift5 8s ease infinite;
  color: white;
  font-weight: 700;
}

.scheduleTable tr:not(.highlight):hover {
  background: #222222;
}

.weekTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #181818;
  border-radius: 12px;
  overflow: hidden;
  font-size: clamp(0.9em, 2.5vw, 1em);
}

.weekTable th {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift5 8s ease infinite;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 700;
}

.weekTable td {
  padding: 12px;
  border-bottom: 1px solid #383838;
  line-height: 1.5;
}

.weekTable td:first-child {
  font-weight: 700;
  white-space: nowrap;
}

.weekTable td:last-child {
  text-align: right;
}

.weekTable tr:last-child td {
  border-bottom: none;
}

.weekTable tr.clickable-row {
  cursor: pointer;
  transition: all 0.2s;
}

.weekTable tr.clickable-row:hover {
  background: #222222;
  transform: scale(1.01);
}

.weekTable tr.highlight {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift5 8s ease infinite;
  color: white;
  font-weight: 700;
}

.weekTable tr.clickable-row.highlight:hover {
  filter: brightness(1.1);
}

.noSchoolMessage {
  text-align: center;
  padding: 40px 20px;
  font-size: 1.3em;
}

.noSchoolMessage h3 {
  font-size: 2em;
  margin-bottom: 20px;
  color: white;
  margin-top: 0;
}

.noSchoolMessage p {
  font-size: 1.2em;
  color: var(--text-light);
  opacity: 0.8;
  margin: 0;
}

.settingsRow {
  padding: 0;
  margin: 0 0 15px 0;
  background: transparent;
}

.resetBtn {
  display: block;
  width: 100%;
  background: #444444;
  color: white;
  border: none;
  padding: 12px 30px;
  font-size: 1em;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: 700;
  margin-top: 20px;
  text-decoration: none;
  text-align: center;
}

.resetBtn:hover {
  background: #9d182e;
  transform: scale(1.05);
}

.holidayTable {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  background: #181818;
  border-radius: 12px;
  overflow: hidden;
}

.holidayTable th {
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift5 8s ease infinite;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 700;
}

.holidayTable td {
  padding: 12px;
  border-bottom: 1px solid #383838;
}

.holidayTable tr:last-child td {
  border-bottom: none;
}

.holidayTable tr:hover {
  background: #222222;
}

#holidayCountdown {
  font-weight: 700;
  text-align: center;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  padding: 20px;
  border-radius: 16px;
  box-shadow: var(--glow);
  margin: 20px 0;
}

#holidayCountdownLabel {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: white;
  opacity: 0.9;
  font-weight: 700;
}

#holidayCountdownTime {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-top: 15px;
}

.countdown-block {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 15px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.countdown-value {
  font-size: clamp(1.8em, 6vw, 2.8em);
  font-weight: 700;
  color: white;
  line-height: 1;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  display: block;
}

.countdown-label {
  font-size: 0.7em;
  font-weight: 400;
  color: white;
  opacity: 0.8;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 5px;
  text-align: center;
}

.calendar-nav {
  position: relative; /* for absolute title centering */
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* centre the nav and allow it to shrink to content width */
  margin: 10px auto;
  padding: 15px;
  background: var(--card-dark);
  border-radius: 12px;
  width: auto;
  box-sizing: border-box;
  flex-shrink: 0;
}

.calendar-nav h3 {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 1.1em;
}

.calendar-nav button {
  background: var(--primary-light);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.3s;
  font-size: 0.9em;
}

.calendar-nav button:hover:not(:disabled) {
  transform: scale(1.05);
}

.calendar-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}


.calendar-grid {
  /* moved styles from the former .calendar container so the grid stands on its own */
  background: #181818;
  border-radius: 12px;
  padding: 15px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  overflow-x: hidden;

  /* grid-specific properties */
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  justify-content: center;
  align-items: center;

  /* height override: prioritize vertical space (nav+key estimated at 180px) */
  height: calc(100vh - 180px);
  max-height: calc(100vh - 180px);
  /* also prevent width from growing beyond the available vertical space */
  max-width: calc(100vh - 180px);
  overflow-y: auto;
}


.calendar-day-header {
  text-align: center;
  font-weight: 700;
  padding: 8px 4px;
  color: white;
  font-size: clamp(0.7em, 2.5vw, 0.9em);
}

.calendar-day {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 8px 4px 4px;
  background: var(--card-dark);
  border: 3px solid transparent;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  cursor: pointer;
}

.calendar-day:hover {
  transform: scale(1.05);
}

.calendar-day.today {
  border: 3px solid var(--primary-light) !important;
  box-shadow: var(--glow);
}

.calendar-day.other-month {
  opacity: 0.3;
}

.calendar-day.holiday {
  border-color: #cc0000 !important;
}

.calendar-day.week-special {
  border-color: #216694;
}


.day-number {
  font-weight: 700;
  font-size: clamp(0.75em, 2.5vw, 1em);
  line-height: 1.2;
}

.club-indicator {
  color: white;
  font-weight: 700;
}

.home-ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1400;
  background: linear-gradient(90deg, rgba(8, 8, 8, 0.98), rgba(22, 22, 22, 0.98));
  border-top: 1px solid #2b2b2b;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.45);
}

.home-ticker.hidden {
  display: none;
}

.home-ticker-inner {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 0;
}

.home-ticker-viewport {
  flex: 1;
  overflow: hidden;
  padding-left: 12px;
}

.home-ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  will-change: transform;
}

.home-ticker-group {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.home-ticker-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.92em;
  color: var(--text-light);
  white-space: nowrap;
}

.home-ticker-item-with-link {
  gap: 0.35em;
}

.home-ticker-link {
  color: white;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-ticker-link:hover {
  opacity: 0.85;
}

.home-ticker-separator {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9em;
}

.home-ticker-close {
  width: 34px;
  height: 34px;
  border: 1px solid #4a4a4a;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-size: 1.2em;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.home-ticker-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

#homeTickerSpacer {
  height: 56px;
}

@media (max-width: 600px) {
  .mainButtons {
    grid-template-columns: 1fr;
  }

  .homeModeToggleRow {
    margin: 0 auto 16px auto;
  }

  .home-ticker-inner {
    min-height: 44px;
  }

  .home-ticker-item {
    font-size: 0.84em;
  }

  .home-ticker-close {
    width: 30px;
    height: 30px;
    font-size: 1.05em;
  }

  #homeTickerSpacer {
    height: 50px;
  }

  .homeHeaderRow {
    gap: 8px;
  }

  body.homePage .homeHeaderRow h1 {
    margin: 0;
    text-align: left;
    font-size: clamp(1.35em, 5.8vw, 1.8em);
  }

  body.homePage .homeHeaderRow .topRightButtons {
    position: static;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
  }

  body.homePage .homeHeaderRow .circleBtn {
    width: 42px;
    height: 42px;
    font-size: 1.15em;
  }

  .circleBtn {
    width: 45px;
    height: 45px;
    font-size: 1.3em;
  }

  #clockDisplay {
    grid-template-columns: repeat(2, 1fr);
  }

  .backBtn {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 45px;
    height: 45px;
  }

  .pageContainer {
    padding: 20px 0 0 0;
  }

  /* smaller padding on narrow screens */
  #calendarContainer {
    padding: 0 20px;
  }

  .calendar-grid {
    min-width: 320px;
    gap: 6px;
  }

  .calendar-day {
    padding: 4px 2px 2px;
    border-width: 2px;
  }

  .calendar-day.today {
    border-width: 3px;
  }

  .day-number {
    font-size: 0.8em;
  }

  .calendar-day-header {
    font-size: 0.85em;
    padding: 6px 3px;
  }
}

@media (max-width: 420px) {
  .calendar-grid {
    padding: 10px;
    gap: 4px;
  }

  .calendar-day {
    padding: 3px 2px 2px;
    border-width: 2px;
  }

  .calendar-day.today {
    border-width: 2px;
  }

  .calendar-day-header {
    font-size: 0.75em;
    padding: 4px 2px;
  }

  .day-number {
    font-size: 0.75em;
  }
}

@media (max-width: 360px) {
  .calendar-grid {
    padding: 8px;
    width: 98%;
    gap: 3px;
  }

  .calendar-day {
    padding: 2px 1px 1px;
    border-width: 1.5px;
  }

  .calendar-day-header {
    font-size: 0.7em;
    padding: 3px 2px;
  }

  .day-number {
    font-size: 0.7em;
  }
}

@media (max-width: 400px) {
  #calendarContainer {
    display: none;
  }
  .calendar-grid {
    display: none;
  }

  #deviceWarning {
    display: block !important;
  }
}

.announcement-banner {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary), var(--primary-light), var(--primary));
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  color: white;
  padding: 15px 20px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  font-weight: 700;
}

.announcement-banner span {
  flex: 1;
  text-align: center;
}

.banner-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 1.5em;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: 15px;
}

.banner-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* ─── Large screen calendar (single merged block) ─── */
@media (min-width: 1200px) {
  #calendarContainer {
    width: 100%;
    max-width: 100%;
  }

  .calendar-nav {
    /* keep auto width and centered, no full-width override */
    margin: 10px auto;
  }

  .calendar-grid {
    width: 100%;
    max-width: 100%;
    padding: 25px;
    /* preserve height-based scaling on large screens */
    height: calc(100vh - 180px);
    max-height: calc(100vh - 180px);
    max-width: calc(100vh - 180px);
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 15px;
  }

  .calendar-day {
    padding: 10px 6px 6px;
    border-width: 4px;
  }

  .calendar-day.today {
    border-width: 4px;
  }

  .calendar-day-header {
    font-size: 1.2em;
    padding: 15px 8px;
  }

  .day-number {
    font-size: 1.5em;
  }

  
}

.calendar-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.calendar-modal.hidden {
  display: none;
}

.calendar-modal .modal-content {
  background: var(--card-dark);
  padding: 20px;
  border-radius: 12px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  position: relative;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 1001;
}

.calendar-modal .modal-close {
  position: absolute;
  top: 8px;
  left: 8px;
  background: transparent;
  border: none;
  font-size: 1.5em;
  color: white;
  cursor: pointer;
  padding: 4px;
}

.calendar-modal .modal-close:hover {
  color: var(--primary-light);
}