:root {
  --black: #050505;
  --line: #b6b6b6;
  --red: #e60012;
  --pink: #ffb0d0;
  --purple: #9d00ff;
  --cyan: #20dde2;
  --yellow: #fff100;
  --blue: #c8dcff;
  --page-x: clamp(8px, 1.7vw, 34px);
  --weekday-h: clamp(18px, 4vh, 52px);
  --day-h: clamp(58px, calc((100dvh - 250px) / var(--week-count, 5)), 202px);
  --date-h: clamp(16px, calc(var(--day-h) * 0.25), 50px);
  --event-h: calc((var(--day-h) - var(--date-h)) / 2);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  height: 100dvh;
  margin: 0;
  overflow: hidden;
  font-family: Tahoma, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: var(--black);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.2) 42%, rgba(214, 218, 224, 0.4) 100%),
    repeating-conic-gradient(from 0deg, rgba(255, 255, 255, 0.62) 0% 25%, rgba(226, 229, 233, 0.48) 0% 50%) 0 0 / 128px 128px,
    linear-gradient(135deg, #dfe2e6 0%, #fbfbfc 45%, #e4e7eb 100%);
}

.poster {
  position: fixed;
  top: 0;
  left: 0;
  width: 2048px;
  height: 1461px;
  transform-origin: 0 0;
}

.admin-toggle {
  position: fixed;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  color: #777;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  opacity: 0.42;
}

.admin-toggle:hover,
.admin-toggle:focus-visible {
  opacity: 1;
  background: #fff;
  color: #222;
}

body.admin-enabled .admin-toggle {
  background: #222;
  color: #fff;
  opacity: 0.92;
}

.download-button,
button {
  font: inherit;
}

.toolbar {
  position: fixed;
  right: 10px;
  bottom: 52px;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  max-width: min(520px, calc(100vw - 20px));
  padding: 8px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(0, 0, 0, 0.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

body.admin-enabled .toolbar {
  opacity: 1;
  pointer-events: auto;
}

.status {
  color: #555;
  font-size: 12px;
  font-weight: 900;
}

.status {
  width: 96px;
  margin: 0;
  text-align: right;
}

button,
.download-button {
  min-height: 34px;
  border: 2px solid var(--black);
  border-radius: 0;
  background: #fff;
  color: var(--black);
  font-size: 14px;
  font-weight: 900;
}

button,
.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  cursor: pointer;
  text-decoration: none;
}

button:hover,
.download-button:hover {
  background: var(--black);
  color: #fff;
}

.app-header {
  display: grid;
  grid-template-columns: clamp(260px, 26vw, 535px) minmax(0, 1fr);
  gap: 140px;
  align-items: center;
  width: min(100%, 1840px);
  margin: 0 auto;
  padding: clamp(10px, 2.3vh, 34px) var(--page-x) clamp(4px, 1vh, 18px);
}

.brand {
  display: block;
}

.brand img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.header-copy h1 {
  margin: 0;
  color: #ff6a45;
  font-size: clamp(30px, min(7.7vw, 13vh), 158px);
  font-weight: 900;
  font-family: "Arial Black", "Hiragino Kaku Gothic StdN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 0.94;
  white-space: nowrap;
  text-shadow:
    0 5px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(240, 60, 50, 0.38);
}

main {
  width: min(100%, 1840px);
  margin: 0 auto;
  padding: 0 var(--page-x);
}

.schedule-shell {
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 2px solid var(--line);
  border-left: 2px solid var(--line);
}

.weekday {
  display: grid;
  place-items: center;
  height: var(--weekday-h);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: #fff;
  font-size: clamp(14px, min(1.8vw, 4vh), 34px);
  font-weight: 900;
  line-height: 1;
}

.weekday.sun {
  background: #f7cfd2;
}

.weekday.sat {
  background: var(--blue);
}

.day {
  display: grid;
  grid-template-rows: var(--date-h) calc(var(--event-h) * 2);
  height: var(--day-h);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
}

.datebar {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--date-h);
  background: #969696;
  color: #fff;
  font-size: clamp(12px, min(2vw, 4.6vh), 36px);
  font-weight: 700;
  line-height: 1;
}

.day.outside {
  background: rgba(240, 240, 240, 0.72);
}

.day.outside .datebar {
  opacity: 0.92;
}

.events {
  display: grid;
  grid-template-rows: repeat(2, var(--event-h));
  height: calc(var(--event-h) * 2);
}

.event {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: var(--event-h);
  min-width: 0;
  padding: clamp(1px, 0.5vh, 6px) clamp(2px, 0.45vw, 8px) clamp(1px, 0.45vh, 5px);
  border: 0;
  border-bottom: 2px solid rgba(0, 0, 0, 0.18);
  color: var(--black);
  text-align: center;
  text-decoration: none;
}

.event.empty {
  background: transparent;
}

a.event.has-link {
  cursor: pointer;
  box-shadow:
    inset 0 0 0 3px rgba(0, 0, 0, 0.42),
    inset 0 -5px 0 rgba(0, 0, 0, 0.18);
}

a.event.has-link::after {
  content: "参加";
  position: absolute;
  right: 4px;
  bottom: 3px;
  padding: 2px 5px 3px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

a.event.has-link:hover {
  filter: brightness(0.92) saturate(1.08);
  transform: translateY(-1px);
}

.event-title {
  display: block;
  overflow: hidden;
  color: var(--red);
  font-family: "Arial Black", "Hiragino Kaku Gothic StdN", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(8px, min(1.85vw, 3.7vh), 34px);
  font-weight: 900;
  line-height: 1.02;
  white-space: nowrap;
  min-width: 0;
}

.event-time {
  display: block;
  overflow: hidden;
  color: var(--black);
  font-family: Tahoma, "Hiragino Sans", "Yu Gothic", Meiryo, sans-serif;
  font-size: clamp(7px, min(1.6vw, 3.2vh), 30px);
  font-weight: 800;
  line-height: 1.02;
  white-space: nowrap;
  min-width: 0;
}

.event.purple .event-title,
.event.purple .event-time {
  color: #fff;
}

.event.purple {
  background: var(--purple);
}

.event.pink {
  background: var(--pink);
}

.event.yellow {
  background: var(--yellow);
}

.event.cyan {
  background: var(--cyan);
}

.event.plain {
  background: #fff;
}

.notice {
  max-width: 1920px;
  margin: clamp(5px, 1.5vh, 32px) auto 0;
  padding: 0 var(--page-x) clamp(4px, 1vh, 30px);
  color: var(--black);
  font-size: clamp(12px, min(2.35vw, 4.2vh), 42px);
  font-weight: 900;
  font-style: italic;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.86);
}

.notice a {
  color: var(--red);
  text-decoration: none;
}

.notice a:hover,
.notice a:focus-visible {
  text-decoration: underline;
}

@media (max-width: 900px) {
  :root {
    --page-x: 6px;
    --weekday-h: clamp(14px, 3.2vh, 40px);
    --day-h: clamp(42px, calc((100dvh - 265px) / var(--week-count, 5)), 148px);
    --date-h: clamp(12px, calc(var(--day-h) * 0.25), 36px);
  }

  .toolbar {
    position: fixed;
    right: 8px;
    bottom: 50px;
    justify-content: flex-start;
    padding: 6px;
  }

  .toolbar button,
  .download-button {
    width: 100%;
  }

  .status {
    width: 100%;
    text-align: left;
  }

  .app-header {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 8px var(--page-x) 5px;
  }

  .brand {
    max-width: min(190px, 55vw);
  }

  .header-copy h1 {
    font-size: clamp(26px, 13vw, 48px);
    line-height: 1;
    white-space: normal;
  }

  main {
    padding: 0 var(--page-x);
  }

  .schedule-shell {
    min-width: 0;
  }

  .weekday {
    height: var(--weekday-h);
    font-size: clamp(11px, 4.4vw, 26px);
  }

  .day {
    height: var(--day-h);
    grid-template-rows: var(--date-h) calc(var(--event-h) * 2);
  }

  .datebar {
    height: var(--date-h);
    font-size: clamp(10px, 4.2vw, 27px);
  }

  .event {
    height: var(--event-h);
  }

  .events {
    grid-template-rows: repeat(2, var(--event-h));
    height: calc(var(--event-h) * 2);
  }

  .notice {
    padding: 0 var(--page-x) 4px;
    font-size: clamp(10px, 4.2vw, 24px);
    white-space: normal;
  }
}

.poster .app-header {
  display: grid;
  grid-template-columns: 535px minmax(0, 1fr);
  gap: 140px;
  align-items: center;
  width: 1840px;
  margin: 0 auto;
  padding: 34px 34px 18px;
}

.poster .brand {
  max-width: none;
}

.poster .header-copy h1 {
  font-size: 142px;
  line-height: 0.94;
  white-space: nowrap;
  transform: scaleX(0.92);
  transform-origin: left center;
}

.poster main {
  width: 1840px;
  margin: 0 auto;
  padding: 0 34px;
}

.poster .weekday {
  height: 52px;
  font-size: 34px;
}

.poster .day {
  grid-template-rows: 50px 152px;
  height: 202px;
}

.poster .datebar {
  height: 50px;
  font-size: 36px;
}

.poster .events {
  grid-template-rows: repeat(2, 76px);
  height: 152px;
}

.poster .event {
  height: 76px;
  padding: 6px 8px 5px;
}

.poster .event-title {
  font-size: 34px;
}

.poster .event-time {
  font-size: 30px;
}

.poster .notice {
  max-width: 1920px;
  margin: 32px auto 0;
  padding: 0 34px 30px;
  font-size: 36px;
  white-space: nowrap;
}
.download-button.disabled {
  cursor: wait;
  opacity: 0.55;
  pointer-events: none;
}
