:root {
  --bg: #161a1b;
  --bg-2: #202526;
  --bar: #292f2e;
  --panel: #222827;
  --panel-2: #303735;
  --line: #56605b;
  --text: #f1eddd;
  --muted: #b4b9ad;
  --accent: #efbd59;
  --accent-2: #8bc6b1;
  --shadow: 0 12px 28px rgba(0, 0, 0, .35);
}

html,
body.portal-body {
  background-color: var(--bg) !important;
  background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, .018) 0, rgba(255, 255, 255, .018) 1px, transparent 1px, transparent 5px);
  color: var(--text) !important;
  font-family: "Courier New", "Microsoft YaHei", monospace;
}

.portal-header {
  background: #292f2e !important;
  border-bottom: 5px solid #101414 !important;
  box-shadow: inset 0 -2px 0 var(--accent);
  display: grid !important;
  gap: 16px;
  grid-template-columns: 34px minmax(150px, 1fr) minmax(230px, 370px) auto;
  height: 82px;
  padding: 0 clamp(16px, 3vw, 48px);
}

.menu-button {
  background: #39413e !important;
  border: 1px solid #69726b !important;
  border-bottom: 3px solid #141918 !important;
  border-radius: 3px !important;
}

.menu-button span {
  background: var(--accent) !important;
}

.brand-logo {
  background: #e9e1c9;
  border: 3px solid var(--accent);
  border-radius: 3px !important;
  height: 48px;
  padding: 2px;
  width: 48px;
}

.brand strong {
  color: var(--accent) !important;
  font-family: "Courier New", monospace;
  font-size: 16px;
  font-weight: 900;
}

.site-search {
  background: #161c1b !important;
  border: 2px solid #64736a !important;
  border-radius: 3px !important;
  margin: 0 !important;
  max-width: none;
  width: 100%;
}

.site-search input,
.site-search button,
.language-picker summary {
  color: var(--text) !important;
}

.site-search input::placeholder {
  color: #a2aaa0 !important;
}

.portal-nav {
  background: #202625 !important;
  border-bottom: 2px solid var(--accent) !important;
  top: 82px;
}

.portal-nav-inner {
  gap: 7px;
  justify-content: center !important;
  margin: 0 auto;
  max-width: 1540px;
  padding: 0 16px;
}

.portal-nav-inner a {
  background: #343c39;
  border: 1px solid #626d65;
  border-bottom: 3px solid #111715;
  border-radius: 3px 3px 0 0;
  color: #e4e8dc !important;
  font-family: "Courier New", monospace;
  font-size: 12px;
  height: 39px;
  margin-top: 8px;
  padding: 0 12px;
}

.portal-nav-inner a:hover,
.portal-nav-inner a.active {
  background: #48554c;
  border-color: var(--accent);
  color: var(--accent) !important;
}

.portal-nav-inner a.active:after {
  display: none;
}

.language-panel {
  background: #202625 !important;
  border-color: var(--line) !important;
  color: var(--text) !important;
}

.language-option:hover,
.language-option.active {
  background: #39413e !important;
  color: var(--accent) !important;
}

.portal-main {
  background: #202625;
  border: 5px double #667168;
  box-shadow: inset 0 0 0 5px #161b1a, 0 14px 34px rgba(0, 0, 0, .24);
  margin: 24px auto 46px;
  max-width: 1580px;
  padding: 30px clamp(16px, 3vw, 44px) 62px;
}

.portal-arcade {
  max-width: 1580px;
}

.portal-page {
  max-width: 1440px;
}

.portal-section {
  margin-bottom: 42px;
}

.home-showcase {
  background: #171d1b;
  border: 3px double #667168;
  box-shadow: inset 0 0 0 4px #202625, 0 8px 0 #101413;
  margin-bottom: 34px;
  padding: 18px;
}

.home-showcase-heading h1,
.home-category-heading h2 {
  color: var(--accent);
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 23px;
}

.home-showcase-heading {
  border-bottom: 1px solid #56605b;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

.home-feature-layout {
  grid-template-columns: minmax(0, 1.6fr) minmax(280px, .9fr);
  min-height: 385px;
}

.home-feature-main {
  background: #101513;
  border: 3px double #66756a;
  border-radius: 3px !important;
  box-shadow: 0 4px 0 #0c1110;
}

.home-feature-image {
  min-height: 385px;
}

.home-feature-copy {
  padding: 22px;
}

.home-feature-main .home-feature-label {
  background: #efbd59;
  color: #171b16;
  font-family: "Courier New", monospace;
  padding: 5px 8px;
}

.home-feature-main .home-feature-action {
  color: var(--accent);
  font-family: "Courier New", monospace;
}

.home-feature-rail {
  gap: 7px;
}

.home-feature-mini {
  background: #2a3330;
  border: 1px solid #56675b;
  border-bottom-width: 3px;
  border-radius: 3px !important;
  padding: 8px;
}

.home-feature-mini:hover {
  background: #39433d;
  transform: translateY(-2px);
}

.home-feature-mini-image {
  border: 2px solid #56675b;
  border-radius: 3px;
  flex-basis: 82px;
  height: 72px;
}

.home-feature-mini-copy strong {
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 12px;
}

.home-category-band {
  background: #292f2e;
  border: 2px double #56605b;
  grid-template-columns: 180px minmax(0, 1fr);
  margin-bottom: 38px;
  padding: 13px;
}

.home-category-heading h2 {
  font-size: 17px;
}

.home-category-links {
  gap: 7px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.home-category-links a {
  background: #343c39;
  border: 1px solid #626d65;
  border-bottom: 3px solid #111715;
  border-radius: 3px !important;
  padding: 9px;
}

.home-category-links a:hover {
  background: #48554c;
}

.home-category-links a>span,
.home-category-links a small {
  color: var(--accent);
}

.portal-section-head {
  align-items: center;
  background: #292f2e;
  border-bottom: 2px solid #56605b;
  border-top: 2px solid #56605b;
  margin: 0 0 17px;
  max-width: none;
  min-height: 64px;
  padding: 9px 15px;
}

.portal-section-head h1,
.portal-section-head h2 {
  color: var(--text);
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 23px;
  line-height: 1.2;
}

.section-kicker,
.eyebrow {
  color: var(--accent) !important;
  font-family: "Courier New", monospace;
  font-size: 10px;
  font-weight: 900;
}

.result-count {
  color: var(--muted) !important;
  font-family: "Courier New", monospace;
  font-variant-numeric: tabular-nums;
}

.portal-game-grid,
.game-grid {
  gap: 12px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  max-width: none;
}

.portal-game-grid {
  grid-auto-rows: clamp(112px, 11vw, 154px);
}

.portal-game-grid .tile-featured {
  grid-column: span 2;
  grid-row: span 2;
}

.game-tile {
  aspect-ratio: auto;
  background: #171d1b;
  border: 3px double #66756a;
  border-radius: 3px !important;
  box-shadow: 0 4px 0 #0c1110, var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transform: translateZ(0);
}

.tile-cover {
  aspect-ratio: 1.1;
  flex: none;
  height: auto;
}

.portal-game-grid .tile-cover {
  height: 100%;
  position: absolute;
}

.portal-game-grid .tile-cover:after {
  background: linear-gradient(0deg, rgba(9, 14, 12, .88), transparent 58%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.game-tile strong {
  background: #171d1b !important;
  border-top: 1px solid #56675b;
  color: #f1eddd;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 11px;
  line-height: 1.35;
  min-height: 39px;
  overflow: hidden;
  padding: 8px 8px;
  position: static;
  text-overflow: ellipsis;
  transform: none !important;
  white-space: normal;
}

.portal-game-grid .game-tile strong {
  background: transparent !important;
  border: 0;
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  z-index: 1;
}

.portal-game-grid .tile-featured strong {
  font-size: 15px;
  padding: 36px 12px 12px;
}

.game-tile:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(239, 189, 89, .14), 0 6px 0 #0c1110;
  transform: translateY(-3px) !important;
  z-index: 2;
}

.game-tile:hover .tile-cover img {
  transform: scale(1.045);
}

.category-strip {
  border-color: #56605b;
}

.category-tiles {
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: none;
}

.category-tiles a {
  background: #2a3330 !important;
  border: 2px solid #56675b !important;
  border-bottom-width: 4px !important;
  border-radius: 3px !important;
  grid-template-columns: 34px minmax(0, 1fr);
  padding: 13px;
}

.category-tiles a:hover {
  background: #39433d !important;
  border-color: var(--accent) !important;
}

.category-tiles span,
.category-tiles small {
  color: var(--accent) !important;
}

.content-section,
.category-intro,
.game-detail,
.recommend-section,
.collection-hero,
.seo-copy,
.inline-related,
.download-panel,
.download-detail,
.download-compare-card,
.download-compare-full-card {
  background: #222a27 !important;
  border: 2px solid #56675b !important;
  border-radius: 3px !important;
  box-shadow: inset 0 0 0 2px rgba(239, 189, 89, .035), var(--shadow);
}

.category-intro,
.collection-hero,
.download-hero {
  border-left: 7px solid var(--accent) !important;
  padding: 26px 30px;
}

.category-intro h1,
.collection-hero h1,
.download-hero h1 {
  color: var(--text);
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 31px;
}

.section-head,
.download-panel-head {
  border-color: #56675b !important;
}

.section-head h2,
.download-panel-head h2,
.game-info h2,
.recommend-section h2,
.seo-copy h2 {
  color: var(--accent) !important;
  font-family: "Courier New", "Microsoft YaHei", monospace;
}

.collection-index-card,
.tag-index-card,
.download-category-list a,
.download-card,
.ranking-item,
.download-info {
  background: #2a3330 !important;
  border: 1px solid #56675b !important;
  border-radius: 3px !important;
  color: var(--text) !important;
}

.collection-index-card:hover,
.tag-index-card:hover,
.download-category-list a:hover,
.download-card:hover,
.ranking-item:hover {
  background: #39433d !important;
  border-color: var(--accent) !important;
}

.download-grid {
  gap: 11px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.download-card-link {
  min-height: 170px;
}

.download-card-icon,
.download-detail-icon,
.download-compare-cover {
  border: 2px solid #56675b !important;
  border-radius: 3px !important;
}

.download-toolbar,
.download-toolbar input,
.download-compare-row:nth-child(even),
.download-compare-head {
  background: #171e1b !important;
  border-color: #56675b !important;
  color: var(--text) !important;
}

.download-content,
.download-compare-full-content {
  color: #d5ddd1 !important;
}

.game-tag,
.download-tags span,
.download-tags a {
  background: #35423a !important;
  border: 1px solid #66756a;
  border-radius: 2px !important;
  color: #e5e4d2 !important;
}

.pagination a,
.pagination span {
  background: #2a3330 !important;
  border-color: #56675b !important;
  border-radius: 2px !important;
  color: var(--muted) !important;
}

.pagination a.active,
.pagination a:hover,
.download-actions a,
.download-compare-open {
  background: var(--accent) !important;
  color: #1a1c16 !important;
}

.notice-box,
.download-notice {
  background: #322e23 !important;
  border-color: #75633d !important;
  color: #eee0ba !important;
}

.player-frame {
  background: #060a08;
  border: 7px double var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 0 5px #292f2e, 0 16px 34px rgba(0, 0, 0, .45);
  height: min(70vh, 770px);
}

.play-center {
  background: #222a27 !important;
  border: 2px solid #56675b !important;
  border-radius: 3px !important;
  padding: 14px;
}

.portal-footer {
  background: #202625;
  border-color: #56605b;
  color: var(--muted);
  padding-left: max(16px, calc((100vw - 1440px) / 2));
  padding-right: max(16px, calc((100vw - 1440px) / 2));
}

.portal-footer strong {
  color: var(--accent) !important;
  font-family: "Courier New", monospace;
}

.portal-nav-inner a:focus-visible,
.game-tile:focus-visible,
.download-card:focus-within,
.download-actions a:focus-visible,
.pagination a:focus-visible {
  outline: 3px solid var(--accent-2);
  outline-offset: 3px;
  position: relative;
  z-index: 3;
}

@media (max-width: 1100px) {
  .portal-main {
    margin: 18px 12px 36px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .portal-game-grid,
  .game-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .category-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-header {
    gap: 9px;
    grid-template-columns: 28px minmax(0, 1fr) 38px auto;
    height: 62px;
    padding: 0 10px;
  }

  .brand-logo {
    height: 34px;
    width: 34px;
  }

  .brand strong {
    font-size: 13px;
    max-width: 32vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .portal-nav {
    top: 62px;
  }

  .portal-nav-inner {
    justify-content: flex-start !important;
  }

  .portal-main {
    margin: 12px 7px 28px;
    padding: 20px 10px 44px;
  }

  .home-showcase {
    padding: 12px;
  }

  .home-feature-layout {
    min-height: 0;
  }

  .home-feature-image {
    min-height: 310px;
  }

  .home-category-band {
    grid-template-columns: 1fr;
  }

  .home-category-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-game-grid,
  .game-grid {
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .portal-game-grid {
    grid-auto-rows: clamp(82px, 22vw, 116px);
  }

  .portal-game-grid .tile-featured {
    grid-column: span 2;
    grid-row: span 2;
  }

  .category-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .download-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .player-frame {
    height: 60vh;
    min-height: 320px;
  }
}

@media (max-width: 460px) {
  .portal-section-head h1,
  .portal-section-head h2 {
    font-size: 20px;
  }

  .portal-game-grid,
  .game-grid {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-game-grid {
    grid-auto-rows: 90px;
  }

  .portal-game-grid .tile-featured {
    grid-column: span 2;
    grid-row: span 2;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .category-intro,
  .collection-hero,
  .download-hero {
    padding: 22px 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* Cabinet wall: framed game art with a compact label plate below each cover. */
.portal-nav {
  border-bottom-width: 3px !important;
}

.portal-nav-inner {
  gap: 9px;
}

.portal-nav-inner a {
  border-radius: 3px;
  height: 40px;
  margin-top: 7px;
  padding: 0 14px;
}

.portal-section-head {
  background: #292f2e;
  border-bottom: 2px solid #56605b;
  border-top: 2px solid #56605b;
  margin-bottom: 16px;
  min-height: 62px;
  padding: 9px 14px;
}

.portal-section-head h1 {
  color: var(--accent);
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 21px;
}

.portal-game-grid {
  gap: 14px;
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.portal-game-grid .game-tile {
  background: #171d1b;
  border: 2px solid #56675b;
  border-bottom-width: 4px;
  border-radius: 3px !important;
  box-shadow: 0 4px 0 #101513;
}

.portal-game-grid .tile-cover {
  aspect-ratio: 1.08;
  flex: none;
  height: auto;
  position: relative;
}

.portal-game-grid .tile-cover:after {
  display: none;
}

.portal-game-grid .game-tile > .tile-copy {
  align-items: center;
  background: #2a3330;
  border-top: 1px solid #56675b;
  display: flex;
  height: 52px;
  padding: 8px 9px;
}

.portal-game-grid .game-tile > .tile-copy strong {
  color: #e4e8dc;
  display: -webkit-box;
  font-family: "Courier New", "Microsoft YaHei", monospace;
  font-size: 11px;
  line-height: 1.35;
  min-height: 2.7em;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.portal-game-grid .game-tile:hover {
  border-color: var(--accent);
  box-shadow: 0 5px 0 #101513, 0 10px 20px rgba(0, 0, 0, .28);
  transform: translateY(-3px) !important;
}

@media (max-width: 1100px) {
  .portal-game-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-nav-inner {
    gap: 5px;
    justify-content: flex-start !important;
    scroll-padding-inline: 10px;
  }

  .portal-nav-inner a {
    height: 36px;
    padding: 0 10px;
  }

  .portal-game-grid {
    gap: 9px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 460px) {
  .portal-section-head {
    min-height: 52px;
    padding: 7px 10px;
  }

  .portal-section-head h1 {
    font-size: 18px;
  }

  .portal-game-grid {
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (hover: none) {
  .portal-game-grid .game-tile:hover {
    box-shadow: 0 4px 0 #101513;
    transform: none !important;
  }

  .portal-game-grid .game-tile:hover .tile-cover img,
  .portal-game-grid .game-tile:hover .tile-cover .cover-fallback {
    transform: none;
  }
}
