html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

:root {
  --bg-top: #f4f7ec;
  --bg-bottom: #e3edf7;
  --surface: #ffffffcc;
  --line: #c4d0d6;
  --text-main: #1d2a2f;
  --text-sub: #4d6169;
  --accent: #006c67;
  --accent-soft: #b8e4df;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--text-main);
  background: linear-gradient(160deg, var(--bg-top), var(--bg-bottom));
}

.container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px 36px;
  overflow-x: hidden;
}

.hero {
  max-width: 100%;
  overflow-x: hidden;
  margin-bottom: 16px;
}

.badge {
  margin: 0;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

h1 {
  margin: 10px 0 8px;
  font-size: clamp(24px, 4vw, 34px);
}

#metaLine {
  margin: 0;
  color: var(--text-sub);
  font-size: 14px;
}

.promo-line {
  margin: 6px 0 0;
  max-width: 100%;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.promo-line a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.promo-line .promo-link-url {
  margin-left: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.promo-line a:hover {
  text-decoration: underline;
}

.calendar-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
}

.site-footer {
  margin-top: 14px;
  text-align: right;
}

.site-footer p {
  margin: 0;
  color: color-mix(in srgb, var(--text-sub) 82%, white 18%);
  font-size: 11px;
  line-height: 1.4;
}

.site-footer a {
  color: color-mix(in srgb, var(--accent) 68%, var(--text-sub) 32%);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.calendar-wrap {
  --calendar-gap: 8px;
  --calendar-cell-min-width: 54px;
  --calendar-cell-max-width: 134px;
  width: max-content;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  backdrop-filter: blur(2px);
}

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: nowrap;
}

.calendar-head h2 {
  margin: 0;
  font-size: clamp(20px, 3.3vw, 28px);
}

.month-label-btn {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font: inherit;
  font-size: clamp(20px, 3.3vw, 28px);
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
}

.month-label-btn:hover {
  color: var(--accent);
}

.month-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  position: sticky;
  left: 0;
  z-index: 5;
}

.month-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text-main);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.month-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.month-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.channel-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.channel-link:hover {
  text-decoration: underline;
}

.channel-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: block;
}

.channel-link.no-thumb .channel-thumb {
  display: none;
}

.weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--calendar-cell-min-width), var(--calendar-cell-max-width)));
  gap: var(--calendar-gap);
  margin-bottom: var(--calendar-gap);
  min-width: calc(var(--calendar-cell-min-width) * 7 + var(--calendar-gap) * 6);
}

.weekdays span {
  text-align: center;
  color: var(--text-sub);
  font-weight: 700;
  font-size: 13px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(var(--calendar-cell-min-width), var(--calendar-cell-max-width)));
  gap: var(--calendar-gap);
  min-width: calc(var(--calendar-cell-min-width) * 7 + var(--calendar-gap) * 6);
}

.edge-month-btn {
  display: none;
}

@media (hover: hover) and (pointer: fine) {
  .edge-month-btn {
    display: block;
    position: fixed;
    top: 0;
    height: 0;
    z-index: 30;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    color: transparent;
    font-size: 0;
    line-height: 0;
    cursor: pointer;
    overflow: visible;
  }

  .edge-month-btn.hidden-zone {
    display: none;
  }

  .edge-month-btn::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 22px;
    opacity: 0;
    transition: opacity 140ms ease;
    pointer-events: none;
  }

  .edge-left::before {
    right: 0;
    background: linear-gradient(to right, rgba(0, 108, 103, 0), rgba(0, 108, 103, 0.3));
  }

  .edge-right::before {
    left: 0;
    background: linear-gradient(to left, rgba(0, 108, 103, 0), rgba(0, 108, 103, 0.3));
  }

  .edge-month-btn::after {
    content: attr(aria-label);
    position: absolute;
    top: var(--edge-label-top, 50%);
    transform: translateY(-50%);
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--accent);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
    opacity: 0;
    transition: opacity 140ms ease;
    pointer-events: none;
    white-space: nowrap;
  }

  .edge-left::after {
    right: 30px;
  }

  .edge-right::after {
    left: 30px;
  }

  .edge-month-btn:hover::before,
  .edge-month-btn:hover::after,
  .edge-month-btn:focus-visible::before,
  .edge-month-btn:focus-visible::after {
    opacity: 1;
  }

  .edge-month-btn:disabled {
    pointer-events: none;
  }
}

.day-cell {
  min-height: 148px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.swipe-month-hint {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 10px);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 34, 40, 0.85);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  opacity: 0;
  z-index: 80;
  transition: transform 140ms ease, opacity 140ms ease;
}

.swipe-month-hint.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.day-cell.today {
  border-color: #d94a75;
  background: #fff6fa;
  box-shadow: inset 0 0 0 1px #f7bfd0, 0 0 0 1px rgba(217, 74, 117, 0.42), 0 0 14px rgba(217, 74, 117, 0.22);
}

.day-cell.today .day-head {
  border-bottom-color: #ee9fba;
}

.day-cell.today .date-label {
  color: #b8325d;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(238, 159, 186, 0.45);
}

.day-cell.empty {
  background: #f3f7f8;
}

.day-cell.out-month {
  background: #f7fbfc;
  border-color: #d7e2e7;
}

.day-cell.out-month .date-label {
  color: #7b8f97;
}

.day-cell.out-month.today .date-label {
  color: #c95c2d;
}

.day-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 5px;
  border-bottom: 3px solid #c8d6dc;
  margin-bottom: 8px;
}

.date-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  flex: 0 0 auto;
}

.day-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.day-thumb-link {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  line-height: 0;
}

.day-thumb-link.disabled {
  cursor: default;
}

.day-thumb-link:hover {
  outline: 1px solid var(--accent);
}

.day-thumb-link.disabled:hover {
  outline: none;
}

.day-thumb-link.unreleased-confirmed {
  outline: 1px solid #8eabd0;
}

.day-thumb-link.unreleased-confirmed:hover {
  outline: 1px solid #5d82b5;
}

.events {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.event-entry {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.event-link {
  display: block;
  padding: 6px;
  border-radius: 7px;
  background: #f0f8f7;
  color: #053f3d;
  text-decoration: none;
  line-height: 1.3;
  border: 1px solid transparent;
}

.event-link.disabled {
  cursor: default;
}

.event-link.unreleased {
  background: #fff4e3;
  border-color: #efc37f;
  color: #69490f;
}

.event-link.unreleased .event-time {
  color: #8a5d11;
}

.event-link.unreleased-confirmed {
  background: #e9f2ff;
  border-color: #a8c1e3;
  color: #1a3f71;
}

.event-link.unreleased-confirmed .event-time {
  color: #2b5b95;
}

.event-main {
  display: block;
  min-width: 0;
  margin-bottom: 0;
}

.event-topline {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.event-title {
  display: block;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.event-link:hover {
  background: #dbefed;
}

.event-link.unreleased:hover {
  background: #ffe8c4;
}

.event-link.unreleased-confirmed:hover {
  background: #ddebff;
}

.event-bonus-link {
  align-self: flex-end;
  padding: 1px 6px;
  border-radius: 999px;
  background: #e9fbf4;
  color: #13856f;
  border: 1px solid #b8eadc;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.event-bonus-link:hover {
  background: #d8f6eb;
}

.event-time {
  display: block;
  color: #0b5954;
  font-size: 11px;
  font-weight: 700;
}

.event-thumb {
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #c8dcdc;
  background: #e8f2f1;
}

.day-thumb-image {
  width: 24px;
  height: 18px;
  display: block;
}

.event-thumb-missing {
  opacity: 0.35;
}

.empty-note {
  color: #97a8ad;
  font-size: 12px;
}

@media (max-width: 900px) {
  .day-cell {
    min-height: 128px;
  }
}

@media (max-width: 700px) {
  html {
    -webkit-text-size-adjust: 50%;
    text-size-adjust: 50%;
  }

  .container {
    padding: 12px 8px 18px;
  }

  .hero {
    margin-bottom: 8px;
  }

  .badge {
    padding: 2px 5px;
    border-radius: 50px;
  }

  h1 {
    margin: 5px 0 4px;
  }

  .promo-line {
    margin: 3px 0 0;
  }

  .promo-line .promo-link-url {
    margin-left: 2px;
  }

  .calendar-scroll {
    margin-left: 0;
    margin-right: 0;
  }

  .calendar-wrap {
    --calendar-gap: 3px;
    --calendar-cell-min-width: 18px;
    --calendar-cell-max-width: 40px;
    width: 100%;
    padding: 6px;
    border-radius: 6px;
  }

  .weekdays,
  .calendar-grid {
    width: 100%;
    min-width: 100%;
    grid-template-columns: repeat(7, minmax(var(--calendar-cell-min-width), 1fr));
  }

  .calendar-head {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 6px;
  }

  .month-nav {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    justify-content: flex-start;
    gap: 4px;
  }

  .month-btn {
    padding: 2px 4px;
    font-size: 12px;
  }

  .month-label-btn {
    font-size: 12px;
  }

  .channel-link {
    flex: 0 0 auto;
    max-width: 100%;
    gap: 4px;
    white-space: nowrap;
  }

  .channel-thumb {
    width: 18px;
    height: 18px;
  }

  .day-cell {
    min-height: 38px;
    padding: 2px;
    border-radius: 5px;
  }

  .day-head {
    gap: 3px;
    padding-bottom: 2px;
    border-bottom-width: 2px;
    margin-bottom: 4px;
  }

  .day-thumbs {
    gap: 2px;
  }

  .day-thumb-link {
    border-radius: 2px;
  }

  .events {
    gap: 4px;
  }

  .event-link {
    padding: 1px 2px;
    border-radius: 4px;
  }

  .event-entry {
    gap: 2px;
  }

  .event-time {
    font-size: 10px;
    margin-bottom: 1px;
  }

  .event-topline {
    margin-bottom: 1px;
  }

  .day-thumb-image {
    width: 8px;
    height: 6px;
  }

  .event-thumb {
    border-radius: 2px;
  }

  .swipe-month-hint {
    bottom: 9px;
    padding: 4px 7px;
  }

  .event-title {
    font-size: 11px;
  }

  .event-bonus-link {
    padding: 1px 4px;
    font-size: 9px;
  }
}
