body {
  background: #193257;
  font-family: sans-serif;
  color: #ccc;
}

#wrap {
  text-align: center;
}

#phase {
  display: block;
}

.shadow {
  background-color: #051631;
}

.light {
  background-color: #a7b2bd;
}

#today {
  margin: 1em auto;
}

#today span {
  display: block;
  text-align: center;
}

.calendar-body {
  display: inline-flex;
  align-items: flex-start;
  max-width: 100%;
}

.date-column {
  flex: 0 0 auto;
  padding-right: 8px;
  border-right: 1px solid #445;
  margin-right: 4px;
}

.months-row {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  align-items: flex-start;
  min-width: 0;
}

.month {
  flex: 0 0 auto;
  padding: 0 4px;
}

.month.current-month {
  border-left: 1px solid #667;
  border-right: 1px solid #667;
}

.month .moon {
  margin: 7px;
  border-color: #193257;
  border-style: solid;
  border-width: 4px;
}

.moon-day.phase-full .moon {
  border-color: #fc0;
}

.moon-day.phase-new .moon {
  border-color: #fc0;
  border-style: dashed;
}

#today > .moon {
  margin: 1em auto;
}

#calendar {
  display: block;
}

.year-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0 100px; /* Space for hidden buttons */
}

.year-nav h1 {
  margin: 0 20px;
  font-size: 3em;
}

.nav-btn {
  font-size: 2em;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  user-select: none;
  padding: 10px;
}

.nav-btn:hover {
  opacity: 1 !important;
  color: #fc0;
}

.year-nav:hover .nav-btn {
  opacity: 0.7;
}

.nav-btn.reset {
  position: absolute;
  right: 0;
  font-size: 1.5em;
}

#calendar h1 {
  text-align: center;
}

.month h2 {
  text-align: center;
}

.moon-day {
  display: flex;
  align-items: center;
  min-height: 70px;
}

.moon-day.placeholder {
  visibility: hidden;
}

.moon-day.past {
  opacity: 0.5;
}

.moon-day.today .moon {
  box-shadow: 0 0 0 2px #193257, 0 0 0 4px #f2ead2;
}

.day-num {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

span.phase {
  font-size: 2em;
  font-weight: bold;
  margin-bottom: 0.2em;
}

.current-date {
  font-size: 1.2em;
  margin-bottom: 1.5em;
  color: #999;
}

.title-next {
  font-weight: bold;
  display: block;
  margin-bottom: 0.2em;
}

.next-date {
  display: block;
  font-size: 0.9em;
  color: #999;
}

table {
  margin: auto;
}

table td {
  padding-left: 1em;
}

table td:nth-child(1) {
  text-align: right;
}

table td:nth-child(2) {
  text-align: left;
}

.moon {
  cursor: default;
}

.moon:focus {
  outline: 2px solid #f2ead2;
  outline-offset: 3px;
}

.moon-tooltip {
  display: none;
  position: fixed;
  z-index: 1000;
  background: #f2ead2;
  color: #193257;
  border: 1px solid #fc0;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.8em;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 3px 8px rgba(5, 22, 49, 0.5);
}

.moon-tooltip div:first-child {
  font-weight: bold;
}
