/* Portal additions share the established tokens; the converter does not load this file. */
.portal-page .wrap {
  min-height: calc(100svh / var(--site-scale));
  display: flex;
  flex-direction: column;
}
.portal-main {
  flex: 1;
  padding: 36px 0 44px;
  min-width: 0;
}
.portal-heading {
  margin-bottom: 28px;
}
.portal-heading h1 {
  margin: 6px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
}
.portal-heading p {
  color: var(--sub);
  margin: 0;
  max-width: 760px;
}
.home-page .home-main {
  gap: 24px;
  padding: 42px 0;
}
.home-welcome {
  max-width: 860px;
}
.home-welcome .welcome-intro {
  font-size: clamp(16px, 1.3vw, 19px);
  line-height: 1.65;
  margin-top: 18px;
}
.home-welcome .server-version {
  font-size: 0.85rem;
  margin-top: 14px;
}
.home-welcome .welcome-rule {
  margin: 26px auto 4px;
}
.server-access,
.home-news {
  width: min(660px, 100%);
  min-width: 0;
}
.server-access h2 {
  font-size: 0.85rem;
}
.server-address-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.server-address-row input {
  min-width: 0;
  flex: 1;
  font-size: 0.9rem;
}
.server-address-row button {
  flex: none;
  font-size: 0.85rem;
}
.server-access .status {
  margin: 6px 0 0;
}
.server-access .status:empty {
  display: none;
}
.home-news {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.home-news h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}
.home-news p {
  font-size: 0.9rem;
}
.news-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--sub);
  font-size: 0.8rem;
}
.news-category {
  color: var(--gold);
}
.news-preview h3 {
  overflow-wrap: anywhere;
  font-size: 1rem;
  margin: 8px 0;
}
.news-preview p {
  margin: 0 0 12px;
}
.news-list {
  display: grid;
  gap: 18px;
}
.news-card {
  margin: 0;
  min-width: 0;
}
.news-card h2 {
  overflow-wrap: anywhere;
  margin: 10px 0;
  font-size: 1.2rem;
}
.news-content {
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--sub);
}
.news-image {
  display: block;
  max-width: 100%;
  max-height: 520px;
  width: auto;
  height: auto;
  border-radius: 10px;
  margin: 16px 0;
}
.portal-link {
  color: var(--gold);
  text-underline-offset: 3px;
  font-size: 0.9rem;
}
.portal-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.portal-error {
  color: var(--danger);
}
.portal-message,
.portal-error {
  overflow-wrap: anywhere;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--site-gap);
}
.gallery-card {
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--site-radius);
  color: var(--fg);
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  min-width: 0;
}
.gallery-card:hover {
  border-color: var(--gold);
}
.gallery-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
.gallery-card > img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.gallery-caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
}
.gallery-card-title {
  font-weight: 650;
}
.gallery-category {
  color: var(--sub);
  font-size: 0.8rem;
}
.gallery-dialog {
  width: min(1240px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 48px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--site-radius);
  color: var(--fg);
  background: var(--bg-navy);
  overflow-y: auto;
}
.gallery-dialog::backdrop {
  background: var(--bg-dark);
  opacity: 0.94;
}
.gallery-dialog figure {
  margin: 0;
}
.gallery-dialog figure > img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100dvh - 230px);
  object-fit: contain;
}
.gallery-dialog figcaption {
  text-align: center;
  overflow-wrap: anywhere;
}
.gallery-dialog h2 {
  font-size: 1rem;
  margin: 12px 0 4px;
}
.gallery-dialog p {
  font-size: 0.85rem;
  color: var(--sub);
}
.gallery-close {
  position: absolute;
  right: 12px;
  top: 9px;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 1.3rem;
}
.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}
.gallery-controls .btn {
  min-width: 44px;
}
#galleryImageStatus:empty {
  display: none;
}
@media (max-width: 1100px) {
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .portal-main {
    padding-top: 26px;
  }
}
@media (max-width: 400px) {
  .server-address-row {
    flex-wrap: wrap;
  }
  .server-address-row input {
    flex-basis: 100%;
  }
  .server-address-row button {
    margin-left: auto;
  }
}
