:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #183e52;
  background: #eafaff;
  --portal-scale: 1;
  --portal-background-width: 1680px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#homepage {
  min-height: 100dvh;
  overflow: hidden;
  background: #fff url("/portal/body.jpg") top center / var(--portal-background-width) auto no-repeat;
}
.portal-frame {
  position: relative;
  width: 100%;
  height: max(100dvh, calc(590px * var(--portal-scale) + 24px));
  min-height: 230px;
}
.portal-shell {
  position: absolute;
  top: 24px;
  left: 50%;
  width: 998px;
  height: 590px;
  margin-left: -499px;
  transform: scale(var(--portal-scale));
  transform-origin: top center;
  user-select: none;
}
.sprite-button {
  display: block;
  padding: 0;
  border: 0;
  outline-offset: 2px;
  background-color: transparent;
  background-repeat: no-repeat;
  color: transparent;
  transition: filter .15s ease, transform .15s ease;
}
.sprite-button:hover { filter: brightness(1.055); transform: scale(1.035); }
.sprite-button:active { filter: brightness(.96); transform: scale(.985); }
.sprite-button:focus-visible,
.banner-dots button:focus-visible,
.news-tabs button:focus-visible,
.news-title:focus-visible {
  outline: 3px solid #ffe063;
  outline-offset: 2px;
}
.portal-left { position: absolute; top: 0; left: 22px; width: 275px; }
.start-command { width: 275px; height: 98px; background-image: url("/portal/start.png"); }
.left-actions { width: 260px; }
.art-button { width: 260px; height: 68px; background-image: url("/portal/buttons.png"); }
.register-command { margin-top: 12px; background-position: 0 0; }
.recharge-command { margin-top: 10px; background-position: 0 -76px; }
.gift-command {
  width: 244px;
  height: 80px;
  margin: 14px 0 0 12px;
  background-image: url("/portal/gift.png");
}
.catalog-command {
  width: 244px;
  height: 72px;
  margin: 22px 0 0 12px;
  background-image: url("/portal/catalog.png");
}

.portal-center { position: absolute; top: 90px; left: 310px; width: 418px; }
.banner-carousel {
  position: relative;
  width: 418px;
  height: 209px;
  background: url("/portal/banner.png") no-repeat;
}
.banner-viewport {
  position: absolute;
  top: 22px;
  left: 7px;
  width: 404px;
  height: 181px;
  overflow: hidden;
  background: #105d75;
}
.banner-image {
  position: absolute;
  inset: 0;
  display: block;
  width: 404px;
  height: 181px;
  object-fit: cover;
  opacity: 0;
  transition: opacity .35s ease;
}
.banner-image.is-active { opacity: 1; }
.banner-dots {
  position: absolute;
  z-index: 2;
  top: 3px;
  right: 14px;
  display: flex;
  gap: 3px;
}
.banner-dots button {
  width: 15px;
  height: 14px;
  padding: 0;
  border: 0;
  background: url("/portal/dian.png") right top / 30px 14px no-repeat;
}
.banner-dots button.is-active { background-position: left top; }

.news-panel {
  position: relative;
  width: 418px;
  height: 270px;
  background: url("/portal/news_bg.png") no-repeat;
}
.news-tabs { display: flex; height: 34px; padding: 0 1px; }
.news-tabs button {
  width: 103px;
  height: 26px;
  margin: 8px 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
}
.news-tabs button:last-child { margin-right: 0; }
.news-tabs button[aria-selected="true"] {
  height: 31px;
  margin-top: -5px;
  background: url("/portal/news_title.png") no-repeat;
  color: #303e43;
  font-size: 14px;
  line-height: 31px;
}
.news-list { margin: 3px 10px 0; padding: 0; list-style: none; }
.news-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  height: 26px;
  padding-left: 49px;
  background-image: url("/portal/news_icon.png");
  background-repeat: no-repeat;
  line-height: 26px;
}
.news-list li.kind-news { background-position: 0 5px; }
.news-list li.kind-notices { background-position: 0 -91px; }
.news-list li.kind-activities { background-position: 0 -45px; }
.news-title {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #303b40;
  font-size: 12px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-title:hover { color: #006b8d; text-decoration: underline; }
.news-date { margin-left: 5px; color: #08728f; font-size: 11px; }
.news-new { width: 22px; height: 9px; margin-left: 4px; vertical-align: middle; }
.news-empty { display: block !important; padding-left: 50px !important; background: none !important; color: #4b6d79; }
.noscript-message { padding: 40px 20px; text-align: center; }

.portal-right {
  position: absolute;
  top: 86px;
  left: 738px;
  width: 260px;
  height: 493px;
  background: url("/portal/a_right.png") no-repeat;
}
.right-actions { padding: 10px; }
.right-actions .art-button + .art-button { margin-top: 10px; }
.guide-command { background-position: 0 -154px; }
.shop-command { background-position: 0 -230px; }
.support-command { background-position: 0 -307px; }
.server-panel { margin: 38px 10px 0; color: #07547d; }
.server-panel h2 { margin: 0 0 14px; font-size: 16px; }
.server-state { display: flex; align-items: center; gap: 8px; margin: 0 0 17px; font-size: 15px; font-weight: 700; }
.status-light { width: 10px; height: 10px; border-radius: 50%; background: #ef9b32; box-shadow: 0 0 6px #ffd28a; }
.status-light.is-online { background: #35bc34; box-shadow: 0 0 6px #75ed6e; }
.status-light.is-offline { background: #d85338; box-shadow: 0 0 6px #ef9c77; }
.status-light.is-checking { background: #e5a535; }
.server-panel dl { margin: 0; font-size: 12px; }
.server-panel dl div { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; }
.server-panel dt { color: #52717f; }
.server-panel dd { margin: 0; color: #315362; }

.account-dialog,
.info-dialog {
  width: min(390px, calc(100vw - 28px));
  padding: 0;
  overflow: visible;
  border: 4px solid #28647e;
  border-radius: 10px;
  background: linear-gradient(180deg, #eefcff, #d5eef4);
  color: #173f54;
  box-shadow: 0 18px 65px #06283e66, inset 0 0 0 1px #fff;
}
.account-dialog { max-height: calc(100dvh - 28px); overflow-y: auto; }
.account-dialog::backdrop,
.info-dialog::backdrop { background: #062c486b; backdrop-filter: blur(2px); }
.dialog-close {
  position: absolute;
  z-index: 1;
  top: 5px;
  right: 8px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #194d65;
  font-size: 25px;
  line-height: 25px;
}
.dialog-close:hover { color: #b13b27; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 38px 0 10px; gap: 5px; }
.auth-tabs button {
  min-height: 39px;
  border: 1px solid #76aebf;
  border-radius: 6px 6px 0 0;
  background: #b9dce6;
  color: #315d6e;
  font-weight: 700;
}
.auth-tabs button[aria-pressed="true"] { border-bottom-color: #f4fdff; background: #f4fdff; color: #075e7e; }
.account-content { padding: 18px 26px 22px; }
.account-content h2 { margin: 0 0 5px; color: #075778; font-size: 23px; }
.auth-help { min-height: 20px; margin: 0 0 16px; color: #567382; font-size: 13px; line-height: 1.55; }
#login-fields, #login-confirm-row, #register-email-row, #register-code-row, #recovery-fields { display: grid; gap: 7px; }
#login-fields label, #recovery-fields label { margin-top: 3px; color: #285b70; font-size: 13px; font-weight: 700; }
#login-fields input, #recovery-fields input {
  width: 100%;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #77aebb;
  border-radius: 5px;
  background: #fff;
  color: #173e51;
  box-shadow: inset 0 1px 3px #255b7420;
}
#login-fields input:focus, #recovery-fields input:focus { border-color: #1085aa; outline: 2px solid #6dc8e066; }
.verification-control { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 8px; }
.verification-control button {
  min-height: 40px;
  padding: 6px;
  border: 1px solid #428da4;
  border-radius: 5px;
  background: #e1f4f8;
  color: #12627d;
  font-size: 13px;
  font-weight: 700;
}
.verification-control button:hover:enabled { background: #c9ebf3; }
.verification-control button:disabled { opacity: .6; }
.auth-primary,
.info-confirm {
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid #14627e;
  border-radius: 5px;
  background: linear-gradient(#25a6cb, #087a9f);
  color: #fff;
  font-weight: 700;
  text-shadow: 0 1px #07526d;
}
.auth-primary:hover:enabled, .info-confirm:hover { background: linear-gradient(#32b4d6, #0a89af); }
.auth-primary:disabled { opacity: .6; }
.auth-status { margin: 4px 0 0; color: #12627d; font-size: 13px; line-height: 1.5; }
.auth-status[data-state="error"] { color: #a33529; }
.auth-status[data-state="success"] { color: #21733d; }
.auth-link {
  display: block;
  margin: 10px auto 0;
  padding: 3px 8px;
  border: 0;
  background: transparent;
  color: #21687f;
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.auth-link:hover { color: #07516d; }
.auth-terms { margin: 12px 0 0; color: #66808b; font-size: 12px; text-align: center; }
.auth-terms a { color: #21687f; text-underline-offset: 2px; }
.info-dialog { padding: 28px 28px 24px; }
.info-dialog h2 { margin: 0 25px 14px 0; color: #075778; font-size: 22px; }
.info-dialog p { margin: 0; color: #385f6e; font-size: 14px; line-height: 1.8; white-space: pre-line; }
.info-confirm { display: block; min-width: 110px; margin: 20px auto 0; padding: 6px 20px; }
button:focus-visible, a:focus-visible { outline: 2px solid #0e7c9e; outline-offset: 3px; }

#game { position: fixed; inset: 0; overflow: hidden; background: #111a25; }
#game-frame { display: block; width: 100%; height: 100%; border: 0; }

body:has(.terms) { background: #edf6f8; }
.terms { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0 50px; line-height: 1.65; }
.terms h1 { margin: 18px 0 4px; line-height: 1.25; }
.terms section { margin-top: 28px; }
.terms h2 { margin: 0 0 8px; font-size: 20px; }
.terms ul { padding-inline-start: 22px; }
.terms li + li { margin-top: 7px; }

@media (prefers-reduced-motion: reduce) {
  .sprite-button, .banner-image { transition: none; }
}
