#releaseNotice[hidden] { display: none; }

#releaseNotice {
  --notice-gap: clamp(14px, 2.9vw, 44px);
  --notice-inset: clamp(18px, 3vw, 44px);
  --notice-gold: #e7bd72;
  --notice-ink: #273747;
  --notice-muted: #5b5042;
  position: fixed;
  inset: 0;
  z-index: 13000;
  display: grid;
  place-items: center;
  padding: var(--notice-gap);
  background: #121c2b9c;
  color: var(--notice-ink);
  font-family: 'Yuanti SC', 'YouYuan', ui-rounded, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.release-notice-frame {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 38fr) minmax(0, 62fr);
  grid-template-rows: minmax(0, 1fr);
  width: min(1170px, 100%);
  min-height: min(550px, calc(100dvh - 2 * var(--notice-gap)));
  max-height: calc(100dvh - 2 * var(--notice-gap));
  padding: 7px;
  border: 2px solid var(--notice-gold);
  border-radius: 10px;
  box-shadow: 0 2px 0 #664322, 0 20px 55px #0b132b9c, inset 0 0 0 1px #466189;
  background: #172c46;
  animation: release-notice-arrive .24s ease-out both;
}

.release-notice-frame::after {
  content: '';
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid #f5cb82;
  border-radius: 4px;
  background:
    linear-gradient(135deg, #ffde96 0 50%, transparent 52%) top left,
    linear-gradient(225deg, #ffde96 0 50%, transparent 52%) top right,
    linear-gradient(45deg, #ffde96 0 50%, transparent 52%) bottom left,
    linear-gradient(315deg, #ffde96 0 50%, transparent 52%) bottom right;
  background-size: 7px 7px;
  background-repeat: no-repeat;
}

.release-notice-poster {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border-radius: 3px 0 0 3px;
  background: #263650;
}

.release-notice-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 52%;
}

.release-notice-poster::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  background: linear-gradient(transparent, #111c32c9);
}

.release-notice-credit {
  position: absolute;
  z-index: 1;
  bottom: 18px;
  left: 21px;
  color: #ffebbd;
  font-size: 17px;
  font-weight: 800;
  text-shadow: 0 2px #302034;
}

.release-notice-paper {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  border-left: 2px solid #c79954;
  border-radius: 0 3px 3px 0;
  background:
    radial-gradient(ellipse at 42% 3%, #fff9e7 0%, transparent 70%),
    linear-gradient(128deg, #f8e6be, #fff0d1 56%, #f4deaf);
}

.release-notice-content {
  min-height: 0;
  overflow-y: auto;
  padding: 0 var(--notice-inset);
  scrollbar-color: #bb8e5a #f2dfb9;
  scrollbar-width: thin;
}

/* Scope the panel header against the game's top-bar header rules. */
#releaseNotice .release-notice-header {
  position: static;
  pointer-events: auto;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  width: auto;
  height: auto;
  padding: clamp(18px, 2.55vw, 36px) var(--notice-inset) 10px;
  margin: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
}

#releaseNoticeTitle {
  margin: 0;
  color: var(--notice-ink);
  font-size: clamp(22px, 3.05vw, 43px);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: .015em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

#releaseNoticeTitle::after {
  content: '';
  display: block;
  width: 66px;
  height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  background: #c45b43;
}

#releaseNoticeLanguage { flex: none; }

#releaseNoticeLanguage .language-switch {
  min-height: 34px;
  gap: 5px;
  padding: 1px 7px 1px 9px;
  border: 1px solid #b88a52;
  border-radius: 6px;
  background: linear-gradient(#fff8e6, #f2dfb7);
  box-shadow: inset 0 1px #fff9e5, 0 1px #bb89514d;
  color: var(--notice-ink);
  text-shadow: none;
}

#releaseNoticeLanguage .language-switch > span { font-size: 14px; }

#releaseNoticeLanguage select {
  width: auto;
  min-width: 62px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 750;
}

#releaseNoticeLanguage .language-switch:focus-within { outline: 2px solid #2a5279; }

.release-notice-item {
  display: grid;
  grid-template-columns: clamp(44px, 5.15vw, 74px) minmax(0, 1fr);
  gap: clamp(11px, 1.5vw, 23px);
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #ad815459;
}

.release-notice-item:last-child { border-bottom: 0; }

.release-notice-emblem {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1.25;
  border-right: 1px solid #b98e595e;
  padding-right: 9px;
}

.release-notice-emblem img {
  width: 83%;
  height: 100%;
  max-height: 55px;
  object-fit: contain;
}

.release-notice-emblem--mage img {
  width: 100%;
  transform: scale(1.23);
}

.release-notice-item h3 {
  margin: 0 0 3px;
  color: var(--notice-ink);
  font-size: clamp(17px, 1.65vw, 23px);
  font-weight: 850;
  line-height: 1.2;
}

.release-notice-item p {
  margin: 0;
  color: var(--notice-muted);
  font-size: clamp(13px, 1.16vw, 16px);
  font-weight: 600;
  line-height: 1.48;
}

.release-notice-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 1px 10px;
}

.release-notice-regions span { white-space: nowrap; }
#releaseNoticeRescue { margin-top: 2px; }

.release-notice-save {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 9px 0 3px;
  color: #674d37;
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}

.release-notice-save::before,
.release-notice-save::after {
  content: '';
  flex: 1 0 10px;
  height: 1px;
  background: #b48c5894;
}

.release-notice-actions {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 13px var(--notice-inset) clamp(17px, 2.3vw, 33px);
}

.release-notice-feedback {
  min-width: 0;
  margin: 0;
  font-size: clamp(11px, .92vw, 13px);
  font-weight: 600;
  line-height: 1.55;
  color: var(--notice-muted);
}

#releaseNoticeFeedbackEmail {
  display: block;
  width: fit-content;
  max-width: 100%;
  color: #324a60;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

#releaseNoticeConfirm {
  position: relative;
  flex: 0 0 auto;
  min-width: clamp(112px, 14.4vw, 200px);
  min-height: 48px;
  padding: 7px 17px 9px;
  border: 2px solid #773322;
  border-radius: 8px;
  background: linear-gradient(#d46649, #ad392b);
  box-shadow: 0 3px #773322, 0 4px 4px #6842244d, inset 0 0 0 2px #e9aa61;
  color: #fff4cf;
  font-family: inherit;
  font-size: clamp(16px, 1.6vw, 23px);
  font-weight: 850;
  line-height: 1.15;
  text-shadow: 0 2px #732f24;
  cursor: pointer;
}

#releaseNoticeConfirm::after {
  content: '';
  position: absolute;
  inset: 4px;
  border: 1px solid #f3bc7773;
  border-radius: 3px;
  pointer-events: none;
}

#releaseNoticeConfirm:hover { background: linear-gradient(#df7756, #b74632); }
#releaseNoticeConfirm:active { transform: translateY(1px); box-shadow: 0 2px #773322, inset 0 0 0 2px #e9aa61; }
#releaseNoticeConfirm:focus-visible,
#releaseNoticeFeedbackEmail:focus-visible { outline: 2px solid #2a5279; outline-offset: 3px; }

@keyframes release-notice-arrive {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-height: 680px) {
  #releaseNotice { --notice-gap: 16px; }
  .release-notice-frame { min-height: min(426px, calc(100dvh - 2 * var(--notice-gap))); }
  #releaseNotice .release-notice-header { padding-top: 17px; padding-bottom: 5px; }
  #releaseNoticeTitle { font-size: clamp(22px, 2.8vw, 32px); }
  #releaseNoticeTitle::after { margin-top: 7px; height: 3px; }
  .release-notice-item { padding: 7px 0; }
  .release-notice-emblem img { max-height: 40px; }
  .release-notice-actions { padding-top: 10px; padding-bottom: 15px; }
}

@media (max-width: 640px) {
  #releaseNotice { --notice-gap: 12px; }
  .release-notice-frame {
    width: min(480px, 100%);
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(80px, 18vh, 125px) minmax(0, 1fr);
  }
  .release-notice-poster { border-radius: 3px 3px 0 0; }
  .release-notice-poster img { object-position: center 42%; }
  .release-notice-credit { bottom: 8px; left: 13px; font-size: 13px; }
  .release-notice-paper { border-left: 0; border-top: 2px solid #c79954; border-radius: 0 0 3px 3px; }
  #releaseNotice .release-notice-header { padding-top: 14px; }
  .release-notice-item { padding: 8px 0; }
  .release-notice-actions { gap: 8px; align-items: center; padding-top: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .release-notice-frame { animation: none; }
}
