body {
  font-family: "Meiryo", "MS PGothic", monospace;
  font-size: 12px;
  color: #333;
  background-color: #fff;
  margin: 10px;
  line-height: 1.4;
}

h1 {
  font-size: 16px;
  border-bottom: 2px solid #333;
  padding-bottom: 2px;
  margin: 0 0 10px 0;
}

a {
  color: #0000ee;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  background-color: #e0e0e0;
}

.month-title {
  font-size: 14px;
  font-weight: bold;
  margin: 15px 0 5px 0;
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 5px;
  border-left: 5px solid #666;
}

.is-older-month {
  background: rgba(0,0,0,0.05);
}

.calendar-container {
  margin: auto;
  max-width: 900px;
}

table.calendar {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

table.calendar th,
table.calendar td {
  border: 1px solid #999;
  padding: 2px;
  vertical-align: top;
}

table.calendar th {
  background-color: #ddd;
  text-align: center;
  font-weight: normal;
  font-size: 11px;
  padding: 2px 0;
}

table.calendar th:first-child,
table.calendar td:first-child {
  color: #d00;
}

table.calendar th:last-child,
table.calendar td:last-child {
  color: #00d;
}

table.calendar td {
  min-height: 70px;
  vertical-align: top;
}

.day-num {
  display: block;
  border-bottom: 1px dotted #ccc;
  background: rgba(0,0,0,0.025);
  padding: 0 2px;
  font-size: 11px;
}

.evt-item {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  padding-left: 3px;
  word-wrap: break-word;
  line-height: 1.2;
  white-space: pre-wrap;

  transition:
    border 0.5s cubic-bezier(0.33, 1, 0.68, 1),
    background-color 0.2s ease;

  --theme-color: #000000;

  border-left: 2px solid var(--theme-color);
  background-color: color-mix(in srgb, var(--theme-color) 10%, transparent);
}

.evt-item:hover {
  border-left: 5px solid var(--theme-color);
  text-decoration: none;

  background-color: color-mix(in srgb, var(--theme-color) 20%, transparent);
}

.solo-event {
  --theme-color: #cc0000;
}
.unit-event {
  --theme-color: #ddb100;
}
.luminous-event {
  --theme-color: #1a0fb4;
}
.deadline-event {
  --theme-color: #8f11ce;
}

.cancelled-event {
  text-decoration: line-through;
  opacity: 0.5;
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 10px,
    #ccc 10px,
    #ccc 20px
  );
}

.color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  vertical-align: middle;
  background-color: var(--theme-color);
  border-radius: 2px;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#root > .calendar-container {
  animation: slideInFade 0.2s ease-out forwards;
}

.detail-grid {
  display: grid;
  grid-template-columns: 80px 1fr;
  width: 100%;
  margin: 10px auto;

  border-top: 1px solid #999;
  border-left: 1px solid #999;

  animation: expandOut 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  transform-origin: top center;
}

.detail-th,
.detail-td {
  border-right: 1px solid #999;
  border-bottom: 1px solid #999;
  padding: 4px;
  box-sizing: border-box;
}

.detail-th {
  background-color: #eee;
  text-align: left;
  font-weight: bolder;
}

/* --- Entrance & Loading Animations --- */
@keyframes expandOut {
  0% {
    opacity: 0;
    transform: scale(0.97) translateY(-5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fetching-text {
  display: inline-block;
  animation: pulseOpacity 1s infinite alternate ease-in-out;
  color: #666;
  user-select: none;
  pointer-events: none;
}

@keyframes pulseOpacity {
  0% {
    opacity: 0.4;
  }
  100% {
    opacity: 1;
  }
}

.reveal-wrapper {
  display: grid;
  grid-template-rows: 0fr;
  animation: openGrid 0.3s ease-out forwards;
}

.reveal-text {
  overflow: hidden;
  opacity: 0;
  animation: fadeIn 0.3s ease-out 0.1s forwards;
  white-space: pre-wrap;
}

@keyframes openGrid {
  to {
    grid-template-rows: 1fr;
  }
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.nav-link {
  display: inline-block;
  border: 1px solid #999;
  padding: 4px 8px;
  background: #f0f0f0;
}

.cast-tag {
  border: 1px solid #aaa;
  padding: 0 3px;
  margin: 0 2px 2px 0;
  display: inline-block;
  background: #fff;
  font-size: 11px;
}

.err {
  color: red;
  font-weight: bold;
}

.event-desc {
  white-space: pre-wrap;
}

tr.empty-week td {
  height: 8px;
  min-height: 8px;
  background-color: rgba(0,0,0,0.01);
}

tr.empty-week td span.day-num {
  font-size: 8px;
}

tr.empty-week .day-num {
  color: #bbb;
  border-bottom: none;
}

td.today-cell .day-num {
  background-color: rgba(255, 255, 0, 0.5);
}

td.today-cell {
  background-color: #fff9e6;
  border: 2px solid #ffcc00;
}

.source-box {
  font-size: 11px;
  background-color: #fcfcfc;
  border-top: 1px dashed #ccc;
  padding-top: 5px;
}

.source-box ul {
  margin: 5px 0 0 0;
  padding-left: 20px;
}

.source-box a {
  color: #0066cc;
}

.qrt-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.qrt-link {
  color: #1da1f2;
  text-decoration: none;
  font-size: 0.9em;
}

.qrt-link:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  table.calendar th {
    display: none;
  }

  .evt-item {
    border-left: 5px solid var(--theme-color);
  }

  tr.empty-week {
    display: none;
  }

  table.calendar td:not(.has-events) {
    display: none;
  }

  .day-num {
    display: none;
  }

  table.calendar,
  table.calendar tbody,
  table.calendar tr,
  table.calendar td {
    display: block;
  }

  table.calendar td {
    border-width: 0 0 1px 0;
    padding: 12px 8px;
    min-height: 0;
  }

  table.calendar td.has-events::before {
    content: attr(data-day);
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .evt-item {
    margin-left: 5px;
  }

  td.today-cell {
    border-left: 4px solid #ffcc00;
    padding-left: 10px;
    background-color: #fff9e6;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }
}

.top-nav {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
}

.clock-box {
  background: #eee;
  border: 1px solid #ccc;
  padding: 4px 10px;
  font-size: 11px;
  color: #333;
}

.clock-text {
  font-weight: bold;
  letter-spacing: 1px;
}

.contact-note {
  font-size: 11px;
  color: #666;
  margin-bottom: 20px;
}

.about-container {
  max-width: 800px;
  margin: 0 auto;
}

.detail-container {
  max-width: 600px;
  margin: 0 auto;
}

.reveal-text {
  animation: slideFadeIn 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  white-space: pre-wrap;
}

@keyframes slideFadeIn {
  0% {
    opacity: 0;
    transform: translateY(-8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.about-nav {
  margin-bottom: 15px;
}

.about-container h2 {
  font-size: 14px;
  border-bottom: 2px solid #666;
  padding-bottom: 4px;
  margin: 0 0 10px 0;
}

.about-container h3 {
  font-size: 13px;
  border-bottom: 1px dotted #999;
  padding-bottom: 3px;
  margin: 25px 0 10px 0;
}

.about-container p {
  margin: 0 0 10px 0;
}

.criteria-list {
  list-style-type: none;
  padding: 10px;
  margin: 10px 0;
  background-color: #f9f9f9;
  border: 1px solid #ccc;
}

.criteria-list li {
  margin-bottom: 8px;
  line-height: 1.4;
}

.criteria-list li:last-child {
  margin-bottom: 0;
}

.mark-ok,
.mark-ng,
.mark-warn {
  font-weight: bold;
  margin-right: 6px;
  display: inline-block;
  width: 14px;
  text-align: center;
}

.rule-ng {
  color: #d00;
}
.mark-ng {
  color: #d00;
}

.rule-warn {
  color: #cc5200;
}
.mark-warn {
  color: #ff6600;
}
