html:has(.portal-shell) {
  background: radial-gradient(ellipse at top, #f6f6e9 0, #e8e9db 65%, #e1e4d6 100%);
}
.portal-shell {
  --portal-paper: #fffff1;
  --portal-ink: #6c6c6c;
  --portal-blue: #2f6582;
  --portal-rule: #c6c8b8;
  --portal-faint-rule: #dedfd1;
  --portal-padding: clamp(61px, 6%, 84px);
  --portal-end: 53px;
  --portal-columns: minmax(0, 1.35fr) minmax(220px, 1fr);
  --portal-column-gap: clamp(18px, 4vw, 60px);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(var(--portal-max, 1200px), calc(100% - 48px));
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--portal-paper);
  color: var(--portal-ink);
  font: 14px/1.5 Verdana, Arial, Helvetica, sans-serif;
  box-shadow: 0 0 34px #3d473422;
}
:where(.portal-shell:not(.portal-board)) a:any-link {
  color: var(--portal-ink);
  font-family: inherit;
  font-weight: bold;
  text-decoration: none;
}
:where(.portal-shell:not(.portal-board)) a:is(:hover, :focus-visible) { color: var(--portal-blue); }
.portal-shell > .portal-banner, .portal-shell > .portal-footer { flex: none; }
.portal-shell > .portal-frame {
  flex: 1 0 auto;
  padding: 22px var(--portal-end) 22px var(--portal-padding);
  min-width: 0;
  min-height: 180px;
  color: inherit;
  font: inherit;
  background: url('/background_1.gif') repeat-y left top, url('/background_3.gif') repeat-y right top;
}
.portal-shell .portal-banner { position: relative; }
.portal-shell .portal-logo { position: absolute; }
.portal-shell .portal-logo img { display: block; }
.portal-shell .portal-today { position: absolute; font-weight: bold; white-space: nowrap; }

/* Continue the original header rules beyond the fixed-width artwork. */
.portal-shell .portal-banner {
  height: 115px;
  background:
    linear-gradient(#c4c5b7, #c4c5b7) 100% 66px / calc(100% - 412px) 1px no-repeat,
    linear-gradient(#dedfd1, #dedfd1) calc(100% - 14px) 70px / calc(100% - 420px) 1px no-repeat,
    linear-gradient(#cccebf, #cccebf) calc(100% - 34px) 97px / calc(100% - 322px) 1px no-repeat,
    linear-gradient(#ccccc1, #ccccc1) calc(100% - 24px) 31px / 1px 84px no-repeat,
    linear-gradient(#c9c9be, #c9c9be) calc(100% - 21px) 47px / 1px 68px no-repeat;
}
.portal-shell .portal-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: min(100%, 527px);
  background: url('/top.gif') no-repeat left top, url('/l_arrow.gif') no-repeat left 18px,
    url('/r_arrow_2.gif') no-repeat 279px 18px, url('/lol.gif') no-repeat 370px 18px,
    url('/lines_top.gif') no-repeat 417px 18px, url('/lines_bottom_2.gif') no-repeat 370px 65px;
  mask-image: linear-gradient(90deg, #000 91%, transparent);
  pointer-events: none;
}
.portal-shell .portal-logo { left: 61px; top: 18px; }
.portal-shell .portal-banner :is(.portal-today, .portal-date-anchor, .retro-date) {
  top: 45px;
  left: auto;
  right: 48px;
  font-size: 13px;
}
.portal-shell .portal-identity { font-size: 13px; }
.portal-shell .portal-identity-actions { max-width: 230px; }
.portal-shell .portal-identity-actions #portal-profile-open {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.portal-footer { width: 100%; }
.portal-footer img { display: block; width: 100%; height: auto; }
.portal-footer-line {
  position: relative;
  height: 25px;
  background: linear-gradient(#c2c2b6, #c2c2b6) 61px 10px / calc(100% - 96px) 1px no-repeat;
}
.portal-footer-line::before, .portal-footer-line::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 61px;
  background: url('/bottom_2.gif') no-repeat left top;
}
.portal-footer-line::after { inset: 0 0 0 auto; width: 35px; background-position: right top; }
.portal-footer-credits {
  display: grid;
  grid-template-columns: minmax(0,410px) minmax(0,1fr) 40px;
  background:
    linear-gradient(#ccccc1, #ccccc1) left 55px / 100% 1px no-repeat,
    linear-gradient(#c2c2b7, #c2c2b7) left 58px / 100% 1px no-repeat;
}
.portal-footer-design { position: relative; }
.portal-footer-design a { position: absolute; inset: 13.333% 75.61% 61.667% 10.488%; }
.portal-footer-banners { background: url('/banners_bg.gif') no-repeat right bottom; }
.portal-footer-banners img { width: 5px; margin-inline-start: auto; }

@media (max-width: 760px) {
  .portal-shell {
    --portal-padding: max(24px, 8.714%);
    --portal-end: max(17px, 6%);
    --portal-art-unit: calc(min(700px, 100vw - 20px) / 700);
    width: min(var(--portal-max, 700px), calc(100% - 20px));
  }
  .portal-shell > .portal-frame {
    padding: 15px var(--portal-end) 18px var(--portal-padding);
    background-size: 8.714% auto, 5% auto;
  }
  .portal-shell .portal-banner {
    height: max(78px, calc(115 * var(--portal-art-unit)));
    background: none;
  }
  .portal-shell .portal-banner::before {
    inset: 0;
    width: 100%;
    mask-image: none;
    background-position: left top, left calc(18 * var(--portal-art-unit)),
      45.81% calc(18 * var(--portal-art-unit)), 56.66% calc(18 * var(--portal-art-unit)),
      right calc(18 * var(--portal-art-unit)), right calc(65 * var(--portal-art-unit));
    background-size: 100% auto, 8.714% auto, 13% auto, 6.714% auto, 40.429% auto, 47.143% auto;
  }
  .portal-shell .portal-logo { left: 8.714%; top: calc(18 * var(--portal-art-unit)); width: 31.143%; }
  .portal-shell .portal-logo img { width: 100%; height: auto; }
  .portal-shell .portal-banner :is(.portal-today, .portal-date-anchor, .retro-date) {
    top: 40%; right: 8%; font-size: 11px;
  }
  .portal-shell .portal-identity { font-size: 12px; }
  .portal-footer-line { height: auto; aspect-ratio: 700/25; background: url('/bottom_2.gif') center top / 100% 100%; }
  .portal-footer-line::before, .portal-footer-line::after { display: none; }
  .portal-footer-credits {
    grid-template-columns: minmax(0,410fr) minmax(0,250fr) minmax(0,40fr);
    background: none;
  }
  .portal-footer-banners { background-size: 100% 100%; }
  .portal-footer-banners img { width: 2%; }
}
@media (max-width: 570px) {
  .portal-shell .portal-banner .portal-date-anchor { font-size: 10px; }
  .portal-shell .portal-identity-actions { max-width: 148px; }
}

.portal-shell .legacy-columns {
  display: grid;
  grid-template-columns: var(--portal-columns);
  gap: var(--portal-column-gap);
}
.legacy-content {
  min-width: 0;
  overflow-wrap: anywhere;
  font: inherit;
  color: inherit;
}
.legacy-content :is(div, td, p, a, b, i, li) { font-family: inherit; font-size: inherit; }
.legacy-content > div { text-align: start; }
.legacy-content :is(table, img, input, select) { max-width: 100%; }
.legacy-content img { object-fit: contain; }
.legacy-content table { max-inline-size: 100%; }
:is(.legacy-side, .portal-side) { min-width: 0; overflow-wrap: anywhere; padding-inline-start: clamp(14px, 3vw, 26px); border-inline-start: 1px solid var(--portal-faint-rule); }
@media (min-width: 661px) {
  .portal-home .portal-side { grid-area: 1 / 2; }
  .portal-home .legacy-primary { grid-area: 1 / 1; }
}
@media (max-width: 660px) {
  .portal-shell .legacy-columns { grid-template-columns: minmax(0, 1fr); }
  :is(.legacy-side, .portal-side) { padding: 16px 0 0; border-inline-start: 0; border-block-start: 1px solid var(--portal-faint-rule); }
  .portal-home .portal-side { padding: 0 0 14px; border-block: 0 solid var(--portal-faint-rule); border-block-end-width: 1px; }
}

.legacy-content .screenshot-list { width: 100%; border-collapse: collapse; margin: 5px 0 12px; }
.legacy-content .screenshot-list :is(th, td) {
  padding: 3px 6px;
  border-block-end: 1px solid var(--portal-faint-rule);
  vertical-align: middle;
}
.legacy-content .screenshot-list th { padding-inline-start: 0; text-align: start; font: inherit; }
.legacy-content .screenshot-list td { width: 1%; padding-inline-end: 0; text-align: end; white-space: nowrap; color: #777b6f; }
.legacy-content .screenshot-list td :is(a, b, font) { font: inherit; font-weight: 700; }
.legacy-content .screenshot-list td a { color: var(--portal-ink); }
.legacy-content .screenshot-list td a:is(:hover, :focus-visible) { color: var(--portal-blue); }
.legacy-content .screenshot-list td font { color: #c9cbc2; }


.portal-shell :is(.portal-side, .portal-menu-item) { color: var(--portal-ink); font: inherit; }
.portal-menu-item { margin-block-end: 13px; }
.portal-menu-item:last-child { margin-block-end: 0; }
.portal-menu-item a { font-size: inherit; }
.portal-menu-item a b { color: var(--portal-blue); font: inherit; }
.portal-menu-item p { color: inherit; font: inherit; margin: 3px 0 0; }
.portal-archive-menu { margin-block-start: 15px; }
.portal-archive-menu summary { color: var(--portal-blue); cursor: pointer; font-weight: bold; }
.portal-archive-menu .portal-menu-item { margin-block: 8px; padding-inline-start: 12px; }
.portal-archive-note { border-inline-start: 2px solid var(--portal-rule); padding-inline-start: 10px; margin-block: 0 17px; }
.portal-home-note { margin: 0 0 13px; }
.portal-home-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.portal-home-block { margin-block-end: 22px; }
:is(.portal-home-block, .portal-downloads) h2 { font-size: 1em; margin: 0 0 7px; }
:is(.portal-home-block, .portal-downloads) ul { margin: 0; padding-inline-start: 1.4em; }
:is(.portal-home-block, .portal-downloads) li { color: inherit; margin-block: 4px; }
.portal-home-block p { margin: 0; }
.portal-home-photos {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 90px), 1fr)); gap: 8px;
}
.portal-home-photos a { display: block; min-width: 0; }
.portal-home-photos img {
  display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover;
  box-sizing: border-box; border: 1px solid var(--portal-rule);
}
.portal-downloads {
  margin-block-start: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 16px;
  padding-block-start: 15px;
  border-block-start: 1px dashed var(--portal-faint-rule);
}

.portal-history h1 { color: var(--portal-blue); font-size: 1.25em; margin: 0 0 12px; }
.portal-history :is(h2, h3, summary, b.blue) { color: var(--portal-blue); }
.history-prose, .history-versions { max-width: 88ch; }
.history-prose pre { white-space: pre-wrap; }
.history-prose img { display: block; max-width: 100%; height: auto; margin-block: .6em; }
.history-versions { margin-block-start: 24px; border-block-start: 1px dashed var(--portal-faint-rule); padding-block-start: 12px; }
.history-versions summary { width: fit-content; font-weight: bold; cursor: pointer; }
.history-versions[open] summary { margin-block-end: 12px; }
.history-toolbar { display: flex; flex-wrap: wrap; gap: 5px; margin-block: 8px; }
.portal-history button { background: var(--portal-blue); border: 1px solid var(--portal-blue); color: white; padding: 3px 8px; font: inherit; cursor: pointer; }
.portal-history button:disabled { opacity: .55; }
.portal-history [data-history-edit] { margin-block-end: 12px; }
.portal-history [hidden] { display: none !important; }
.history-editor { min-height: 12em; padding: 10px; border: 1px solid var(--portal-rule); background: white; overflow-wrap: anywhere; }
.history-error { color: #a22617; }

.portal-mobile-menu, .portal-short-nav { display: none; }
@media (max-width: 680px) {
  .portal-shell { width: 100%; --portal-padding: 14px; --portal-end: 14px; box-shadow: none; }
  .portal-shell > .portal-frame { padding: 16px 14px 24px; background: none; }
  .portal-shell .portal-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    box-sizing: border-box; height: 67px; padding: 0 10px;
    background: var(--portal-paper);
  }
  .portal-shell .portal-banner::before {
    content: ""; inset: 0; width: 100%;
    background: url('/lines_bottom_2.gif') 56% -17px / 132% 166px no-repeat;
    mask-image: linear-gradient(transparent, #000 29% 70%, transparent);
    filter: grayscale(1) brightness(1.035);
    mix-blend-mode: multiply;
    opacity: .65;
  }
  .portal-shell .portal-logo {
    position: relative; inset: auto; display: flex; align-items: center; gap: clamp(4px, 1.5vw, 11px); width: auto;
  }
  .portal-shell .portal-logo img {
    width: clamp(102px, 31vw, 171px); height: auto;
    mask-image: linear-gradient(transparent 19%, #000 27% 72%, transparent 77%),
      linear-gradient(to right, transparent, #000 2.5% 97%, transparent);
    mask-composite: intersect;
    filter: brightness(1.025);
    mix-blend-mode: multiply;
  }
  .portal-shell .portal-logo::after {
    content: ''; width: clamp(23px, 6.6vw, 36px); aspect-ratio: 1; border-radius: 50%;
    background: url('/lol.gif') center / 122% no-repeat;
    filter: brightness(1.025);
    mix-blend-mode: multiply;
  }
  .portal-shell .portal-banner > .portal-today, .portal-shell .portal-date-anchor > .portal-today { display: none; }
  .portal-shell .portal-banner .portal-date-anchor, .portal-shell .portal-date-anchor .portal-identity { position: static; }
  .portal-shell .portal-banner .portal-date-anchor { z-index: 1; min-width: 0; margin-inline-start: auto; }
  .portal-shell .portal-identity-actions { max-width: 117px; }
  .portal-shell .portal-identity button { min-height: 36px; }
  .portal-mobile-menu { display: block; position: relative; flex: none; }
  .portal-mobile-menu summary {
    display: grid; place-items: center; width: 38px; height: 40px;
    color: #2f6582; cursor: pointer; list-style: none;
  }
  .portal-mobile-menu summary::-webkit-details-marker { display: none; }
  .portal-mobile-menu summary span {
    width: 18px; height: 2px; background: currentColor; box-shadow: 0 -6px currentColor, 0 6px currentColor;
  }
  .portal-mobile-menu nav {
    position: absolute; z-index: 9; inset: 100% 0 auto auto; display: grid;
    min-width: 168px; max-height: 65dvh; overflow: auto; padding: 5px;
    background: #fffff1; border: 1px solid #c6c8b8; box-shadow: 0 5px 15px #302f2b33;
  }
  .portal-mobile-menu:not([open]) nav { display: none; }
  .portal-mobile-menu nav a { padding: 7px 9px; }
  .portal-short-nav {
    display: flex; justify-content: space-evenly; align-items: center; gap: 2px;
    padding: 0 5px; background: #fffff1;
    border-block-start: 1px solid #c6c8b8;
    font: bold clamp(10px, 3.1vw, 13px)/1.25 Verdana, Arial, sans-serif;
  }
  .portal-mobile-primary { border-block-end: 1px solid #dedfd1; }
  .portal-short-nav a:any-link { color: #2f6582; padding: 9px 2px; white-space: nowrap; }
  .portal-short-nav a[aria-current=page] { text-decoration: underline; text-underline-offset: .25em; }
  .portal-shell .portal-footer-line, .portal-shell .portal-footer-credits, .portal-shell .portal-archive-menu,
  .portal-shell .portal-side .portal-menu-item, .portal-shell .portal-side:not(:has(.portal-home-note)) { display: none; }
  .portal-shell .legacy-columns { grid-template-columns: minmax(0, 1fr); }
  .portal-home .portal-side { grid-area: auto; padding: 0; border: 0; }
  .portal-home .legacy-primary { grid-area: auto; }
  .portal-home-note { font-size: .9em; margin: 0; }

}
