:root {
  color-scheme: dark;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: #f2f0e9;
  background: #171c1b;
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.site-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 100%;
  padding: 22px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand { color: inherit; text-decoration: none; letter-spacing: .12em; font-size: 15px; }
.screen { position: relative; min-height: 100svh; overflow: hidden; }
.scene {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #303b36, #171d20 65%, #292c29);
}
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .22;
  background-image: repeating-linear-gradient(
    110deg, transparent 0 34px,
    rgba(220,235,230,.16) 35px,
    transparent 36px 72px
  );
  animation: rainfall 18s linear infinite;
}
@keyframes rainfall {
  from { transform: translateY(-40px); }
  to { transform: translateY(40px); }
}
.entry-scene {
  background:
    linear-gradient(90deg, rgba(10,17,15,.82), rgba(10,17,15,.2)),
    linear-gradient(145deg, #46554a, #202a2c 58%, #171d20);
}
.lead {
  color: rgba(242,240,233,.78);
  line-height: 2.2;
  letter-spacing: .08em;
  font-size: 14px;
}
.entry-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}
.primary-button, .secondary-button, .text-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid rgba(230,235,225,.35);
  border-radius: 3px;
  color: #f2f0e9;
  text-decoration: none;
}
.primary-button {
  background: rgba(190,205,185,.18);
  cursor: pointer;
}
.text-button { background: rgba(20,27,25,.25); cursor: pointer; }
.text-button:hover { background: rgba(190,205,185,.16); }
.primary-button:hover {
  background: rgba(190,205,185,.32);
}
.secondary-button {
  background: rgba(20,27,25,.25);
}
.secondary-button:hover {
  background: rgba(190,205,185,.16);
}
.candidate-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 16px;
}
.candidate-button {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(230,235,225,.25);
  border-radius: 3px;
  background: rgba(20,27,25,.35);
  color: #f2f0e9;
  text-align: left;
  cursor: pointer;
}
.candidate-button:hover,
.candidate-button.selected {
  border-color: rgba(190,205,185,.75);
  background: rgba(190,205,185,.2);
}
.entry-note {
  color: rgba(242,240,233,.55);
  font-size: 12px;
  margin-top: 18px;
}
.weather-screen {
  background: #202725;
}
.weather-scene {
  background:
    linear-gradient(rgba(12,19,17,.08), rgba(12,19,17,.12)),
    linear-gradient(145deg, #596454, #303d40 55%, #252b2c);
}
.screen-content {
  position: relative;
  z-index: 1;
  width: min(100% - 36px, 760px);
  margin: 0 auto;
  padding: 100px 0 70px;
}
.screen-content > h1 {
  font-size: clamp(32px, 7vw, 48px);
  font-weight: 400;
  letter-spacing: .12em;
  margin: 18px 0 8px;
}
.glass-panel {
  padding: 22px;
  margin: 18px 0;
  border: 1px solid rgba(230,235,225,.18);
  border-radius: 5px;
  background: rgba(18,25,23,.58);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.glass-panel h2 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .1em;
  margin: 0 0 18px;
}
.place-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(230,235,225,.12);
  font-size: 13px;
}
.place-row span { color: rgba(242,240,233,.58); }
.place-row strong { font-weight: 500; }
.glass-panel label {
  display: block;
  margin: 16px 0 8px;
  font-size: 13px;
  color: rgba(242,240,233,.75);
}
.glass-panel input, .glass-panel select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: #f2f0e9;
  background: rgba(8,13,12,.55);
  border: 1px solid rgba(230,235,225,.25);
  border-radius: 3px;
  outline: none;
}
.glass-panel input::placeholder {
  color: rgba(242,240,233,.42);
}
.glass-panel input:focus, .glass-panel select:focus {
  border-color: rgba(210,220,195,.75);
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel-heading h2 { margin-bottom: 0; }
.notification-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.notification-card {
  padding: 15px;
  border-left: 2px solid rgba(190,205,185,.55);
  background: rgba(235,240,230,.06);
  line-height: 1.7;
  font-size: 13px;
}
.global-status {
  position: fixed;
  z-index: 10;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: 90%;
  padding: 10px 16px;
  background: rgba(12,18,16,.9);
  border-radius: 4px;
  font-size: 12px;
}
footer {
  padding: 28px 16px;
  text-align: center;
  color: rgba(242,240,233,.45);
  background: #171d1b;
  font-size: 11px;
  letter-spacing: .12em;
}
@media (max-width: 600px) {
  .site-header { padding: 18px 20px; }
  .brand { font-size: 14px; }
  .entry-content { padding: 100px 26px 60px; }
  .entry-content h1 { font-size: 38px; }
  .entry-actions { width: 100%; flex-direction: column; }
  .entry-actions > * { width: 100%; }
  .screen-content { width: calc(100% - 28px); padding-top: 88px; }
  .glass-panel { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
/* Top screen layout */
.entry-screen {
  display: flex;
  align-items: center;
}
.entry-content {
  position: relative;
  z-index: 1;
  width: min(820px, 84%);
  margin-left: 8%;
  padding: 120px 0 64px;
}
.entry-content h1 {
  max-width: 780px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.55;
  font-weight: 500;
}

@media (max-width: 600px) {
  .entry-content {
    width: calc(100% - 40px);
    margin: 0 auto;
    padding: 110px 0 60px;
  }
  .entry-content h1 {
    font-size: 32px;
    line-height: 1.6;
  }
  .entry-content .lead {
    margin-top: 20px;
    font-size: 14px;
    line-height: 2;
  }
}

#demoScreen .screen-content {
  width: min(1100px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 20px 24px;
}
#demoScreen .screen-content > h1,
#demoScreen .screen-content > .solar-term,
#demoScreen #demoExit {
  grid-column: 1 / -1;
}
#demoScreen .glass-panel {
  margin: 0;
  padding: 26px;
  background: rgba(13, 22, 23, .62);
}

@media (max-width: 700px) {
  #demoScreen .screen-content {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
    gap: 14px;
  }
  #demoScreen .screen-content > section,
  #demoScreen #demoExit {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Discord screen layout */
#discordScreen .screen-content {
  width: min(1100px, calc(100% - 48px));
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 20px 24px;
}
#discordScreen .screen-content > h1,
#discordScreen .screen-content > .solar-term,
#discordScreen .account-actions {
  grid-column: 1 / -1;
}
#discordScreen .glass-panel {
  margin: 0;
  padding: 26px;
  background: rgba(13, 22, 23, .62);
}
#discordScreen .screen-content > section:first-of-type {
  grid-column: 1;
}
#discordScreen .screen-content > section:last-of-type {
  grid-column: 2;
}

@media (max-width: 700px) {
  #discordScreen .screen-content {
    width: calc(100% - 32px);
    grid-template-columns: 1fr;
    gap: 14px;
  }
  #discordScreen .screen-content > section,
  #discordScreen .account-actions {
    grid-column: 1;
    grid-row: auto;
  }
}

/* Demo place selection map */
#demoMap {
  width: 100%;
  height: 320px;
  margin: 14px 0;
  border-radius: 10px;
  z-index: 1;
}
#demoCoordinates {
  font-size: .85rem;
  opacity: .85;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  #demoMap { height: 280px; }
}

/* Weather screen layout */
#demoScreen .screen-content,
#discordScreen .screen-content {
  width: min(1160px, calc(100% - 48px));
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 20px 24px;
  align-content: start;
}
#demoScreen .screen-content > h1,
#discordScreen .screen-content > h1,
#demoScreen .solar-term,
#discordScreen .solar-term {
  grid-column: 1 / -1;
}
#demoScreen .glass-panel,
#discordScreen .glass-panel {
  margin: 0;
  padding: 24px;
  border: 1px solid rgba(230,235,225,.25);
  border-radius: 8px;
  background: rgba(13,22,23,.62);
}

/* Mobile layout */
@media (max-width: 700px) {
  #demoScreen .screen-content,
  #discordScreen .screen-content {
    width: calc(100% - 28px);
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding-top: 88px;
  }
  #demoScreen .glass-panel,
  #discordScreen .glass-panel {
    padding: 19px;
  }
  #demoMap {
    height: 260px;
  }
}

/* Weather screen button states */
#demoScreen button,
#discordScreen button {
cursor: pointer;
transition: background .2s, border-color .2s, transform .15s;
}
#demoScreen button:hover,
#discordScreen button:hover {
border-color: rgba(225,235,215,.85);
background-color: rgba(190,205,185,.24);
}
#demoScreen button:active,
#discordScreen button:active {
transform: translateY(1px);
}
#demoScreen button:focus-visible,
#discordScreen button:focus-visible {
outline: 2px solid rgba(225,235,215,.9);
outline-offset: 3px;
}

/* Match Discord place names to the demo size. */
#discordScreen .place-row strong {
  font-size: 1.3rem;
}

/* Demo place registration controls. */
#demoScreen .place-row strong {
  font-size: 1.3rem;
  line-height: 1.6;
  font-weight: 700;
}
#demoScreen .place-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}
#demoScreen .place-actions button {
  flex: 1 1 0;
  min-height: 42px;
  padding: 8px 16px;
}
#demoScreen #demoPlaceInput {
  border: 1px solid rgba(230,235,225,.6);
  box-shadow: inset 0 0 0 1px rgba(8,13,12,.2);
}

/* Demo layout: the left stack grows naturally when the editor opens. */
#demoScreen .screen-content {
  align-items: start;
}
#demoScreen .demo-left-panels {
  grid-column: 1;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}
#demoScreen .demo-left-panels > .glass-panel {
  margin: 0;
  min-width: 0;
}

/* Match the left panels' total height to the right notification panel. */
#demoScreen .demo-left-panels {
  height: 680px;
}
#demoScreen .demo-left-panels > .glass-panel:first-child {
  flex: 1 1 auto;
  min-height: 0;
}
#demoScreen #demoPlaceEditor[hidden] {
  display: none !important;
}
#demoScreen #demoNotificationsPanel {
  grid-column: 2;
  grid-row: 3;
  height: 680px;
  align-self: start;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#demoScreen #demoNotifications {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#demoScreen #demoExit {
  grid-column: 1 / -1;
  grid-row: 4;
  justify-self: start;
}
@media (max-width: 700px) {
  #demoScreen .screen-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  #demoScreen #demoNotificationsPanel {
    order: 1;
    width: 100%;
    height: 480px;
    align-self: auto;
  }
  #demoScreen .demo-left-panels {
    order: 2;
    width: 100%;
    height: auto;
    gap: 14px;
  }
  #demoScreen #demoExit {
    order: 3;
  }
}

/* Discord notification panel: fixed height with internal scrolling. */
#discordScreen .screen-content > section:last-of-type {
  height: 620px;
  min-height: 0;
  align-self: start;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#discordScreen #discordNotifications {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-width: 700px) {
  #discordScreen .screen-content > section:last-of-type {
    width: 100%;
    height: 480px;
    align-self: stretch;
  }
}

/* Mobile: allow the weather screens to grow and scroll vertically. */
@media (max-width: 700px) {
  #demoScreen,
  #discordScreen {
    min-height: 100svh;
    height: auto;
    overflow: visible;
  }

  #demoScreen .screen-content,
  #discordScreen .screen-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: calc(100% - 28px);
    min-width: 0;
    gap: 14px;
    padding: 88px 0 32px;
    box-sizing: border-box;
  }

  #demoScreen .screen-content > *,
  #discordScreen .screen-content > * {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  #demoScreen #demoNotificationsPanel,
  #discordScreen .screen-content > section:last-of-type {
    width: 100%;
    height: clamp(280px, 45svh, 400px);
    min-height: 280px;
    flex: 0 0 auto;
    align-self: stretch;
  }

  #demoScreen #demoNotifications,
  #discordScreen #discordNotifications {
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Discord mobile: latest information before registered places. */
@media (max-width: 700px) {
  #discordScreen .screen-content > section:last-of-type {
    order: 1;
  }

  #discordScreen .screen-content > section:first-of-type {
    order: 2;
  }

  #discordScreen .account-actions {
    order: 3;
  }
}

/* Mobile: double latest-information panels on Demo and Discord. */
@media (max-width: 700px) {
  #demoScreen #demoNotificationsPanel,
  #discordScreen .screen-content > section:last-of-type {
    height: clamp(560px, 90svh, 800px);
    min-height: 560px;
  }
}

.discord-info-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
}

.discord-info-overlay[hidden] {
  display: none !important;
}

.discord-info-dialog {
  width: min(560px, 100%);
  max-height: 85vh;
  overflow-y: auto;
}

.discord-info-dialog .panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.discord-info-content h3 {
  margin: 1.2em 0 0.5em;
}

.discord-info-content li {
  margin: 0.65em 0;
  line-height: 1.6;
}

.discord-invite-link {
  display: inline-block;
  margin-top: 0.5em;
}


.discord-promo { margin-top: 0.5em; }
.discord-promo p { margin: 0.2em 0; }
.discord-promo p:first-child { display: block; text-align: center; }
.discord-promo p:last-child { margin-top: 0.7em; }
.discord-promo .discord-promo-button { display: block; width: 100%; padding: 12px 16px; border: 1px solid #7289da; border-radius: 10px; background: #5865f2; color: #fff; font-weight: 700; text-align: center; }
.discord-promo .text-button { margin: 0; vertical-align: middle; }

#demoScreen .screen-content > h1 { margin-bottom: -12px; }
#demoScreen .weather-intro { grid-column: 1 / -1; margin-top: -8px; }
#demoScreen .weather-intro p { margin: 0 0 3px; line-height: 1.5; }


/* 24-term background images */
.entry-scene[data-term="01"] { --scene-image: url("/assets/images/entry-01.webp"); }
.weather-scene[data-term="01"] { --scene-image: url("/assets/images/weather-01.webp"); }
.entry-scene[data-term="02"] { --scene-image: url("/assets/images/entry-02.webp"); }
.weather-scene[data-term="02"] { --scene-image: url("/assets/images/weather-02.webp"); }
.entry-scene[data-term="03"] { --scene-image: url("/assets/images/entry-03.webp"); }
.weather-scene[data-term="03"] { --scene-image: url("/assets/images/weather-03.webp"); }
.entry-scene[data-term="04"] { --scene-image: url("/assets/images/entry-04.webp"); }
.weather-scene[data-term="04"] { --scene-image: url("/assets/images/weather-04.webp"); }
.entry-scene[data-term="05"] { --scene-image: url("/assets/images/entry-05.webp"); }
.weather-scene[data-term="05"] { --scene-image: url("/assets/images/weather-05.webp"); }
.entry-scene[data-term="06"] { --scene-image: url("/assets/images/entry-06.webp"); }
.weather-scene[data-term="06"] { --scene-image: url("/assets/images/weather-06.webp"); }
.entry-scene[data-term="07"] { --scene-image: url("/assets/images/entry-07.webp"); }
.weather-scene[data-term="07"] { --scene-image: url("/assets/images/weather-07.webp"); }
.entry-scene[data-term="08"] { --scene-image: url("/assets/images/entry-08.webp"); }
.weather-scene[data-term="08"] { --scene-image: url("/assets/images/weather-08.webp"); }
.entry-scene[data-term="09"] { --scene-image: url("/assets/images/entry-09.webp"); }
.weather-scene[data-term="09"] { --scene-image: url("/assets/images/weather-09.webp"); }
.entry-scene[data-term="10"] { --scene-image: url("/assets/images/entry-10.webp"); }
.weather-scene[data-term="10"] { --scene-image: url("/assets/images/weather-10.webp"); }
.entry-scene[data-term="11"] { --scene-image: url("/assets/images/entry-11.webp"); }
.weather-scene[data-term="11"] { --scene-image: url("/assets/images/weather-11.webp"); }
.entry-scene[data-term="12"] { --scene-image: url("/assets/images/entry-12.webp"); }
.weather-scene[data-term="12"] { --scene-image: url("/assets/images/weather-12.webp"); }
.entry-scene[data-term="13"] { --scene-image: url("/assets/images/entry-13.webp"); }
.weather-scene[data-term="13"] { --scene-image: url("/assets/images/weather-13.webp"); }
.entry-scene[data-term="14"] { --scene-image: url("/assets/images/entry-14.webp"); }
.weather-scene[data-term="14"] { --scene-image: url("/assets/images/weather-14.webp"); }
.entry-scene[data-term="15"] { --scene-image: url("/assets/images/entry-15.webp"); }
.weather-scene[data-term="15"] { --scene-image: url("/assets/images/weather-15.webp"); }
.entry-scene[data-term="16"] { --scene-image: url("/assets/images/entry-16.webp"); }
.weather-scene[data-term="16"] { --scene-image: url("/assets/images/weather-16.webp"); }
.entry-scene[data-term="17"] { --scene-image: url("/assets/images/entry-17.webp"); }
.weather-scene[data-term="17"] { --scene-image: url("/assets/images/weather-17.webp"); }
.entry-scene[data-term="18"] { --scene-image: url("/assets/images/entry-18.webp"); }
.weather-scene[data-term="18"] { --scene-image: url("/assets/images/weather-18.webp"); }
.entry-scene[data-term="19"] { --scene-image: url("/assets/images/entry-19.webp"); }
.weather-scene[data-term="19"] { --scene-image: url("/assets/images/weather-19.webp"); }
.entry-scene[data-term="20"] { --scene-image: url("/assets/images/entry-20.webp"); }
.weather-scene[data-term="20"] { --scene-image: url("/assets/images/weather-20.webp"); }
.entry-scene[data-term="21"] { --scene-image: url("/assets/images/entry-21.webp"); }
.weather-scene[data-term="21"] { --scene-image: url("/assets/images/weather-21.webp"); }
.entry-scene[data-term="22"] { --scene-image: url("/assets/images/entry-22.webp"); }
.weather-scene[data-term="22"] { --scene-image: url("/assets/images/weather-22.webp"); }
.entry-scene[data-term="23"] { --scene-image: url("/assets/images/entry-23.webp"); }
.weather-scene[data-term="23"] { --scene-image: url("/assets/images/weather-23.webp"); }
.entry-scene[data-term="24"] { --scene-image: url("/assets/images/entry-24.webp"); }
.weather-scene[data-term="24"] { --scene-image: url("/assets/images/weather-24.webp"); }
.entry-scene[data-term] { background-image: linear-gradient(90deg, rgba(10,17,15,.48), rgba(10,17,15,.12)), var(--scene-image), linear-gradient(145deg, #46554a, #202a2c 58%, #171d20); background-size: cover; background-position: center; }
.weather-scene[data-term] { background-image: linear-gradient(rgba(12,19,17,.08), rgba(12,19,17,.12)), var(--scene-image), linear-gradient(145deg, #596454, #303d40 55%, #252b2c); background-size: cover; background-position: center; }
