/* Portal layer: header, breadcrumbs, content sections, cards and footer. Scoped to .portal-* so it never changes a game's own styles. */
.portal-wrap, .portal-wrap * { box-sizing: border-box; }
.portal-wrap { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; line-height: 1.6; color: #e2e8f0; }
.portal-wrap a { color: #7dd3fc; }
.portal-wrap a:hover { color: #bae6fd; }
.portal-wrap :focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
body.portal-page { margin: 0; background: #0f172a; color: #e2e8f0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.portal-skip { position: absolute; left: -999px; top: 0; background: #fbbf24; color: #111; padding: 8px 12px; z-index: 100; }
.portal-skip:focus { left: 8px; }

/* header */
.portal-header { background: #0b1220; border-bottom: 1px solid #1e293b; }
.portal-header-in { max-width: 1100px; margin: 0 auto; padding: 8px 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.portal-logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.05rem; color: #f8fafc !important; text-decoration: none; letter-spacing: .01em; }
.portal-logo .home-logo-mark { display: block; width: 37px; height: 37px; flex: none; }
.portal-logo .home-logo-mark img { display: block; width: 100%; height: 100%; }
.portal-logo .home-logo-accent { color: #6ecad5; }
.portal-logo small { display: block; color: #94a3b8; font-size: .52rem; letter-spacing: .16em; }
.portal-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; flex: 1 1 auto; }
.portal-nav a { color: #cbd5e1; text-decoration: none; padding: 4px 2px; font-size: .92rem; border-bottom: 2px solid transparent; }
.portal-nav a:hover, .portal-nav a[aria-current="page"] { color: #fff; border-bottom-color: #38bdf8; }
.portal-search { position: relative; flex: 0 1 240px; }
.portal-search input { width: 100%; font: inherit; font-size: .92rem; color: #e2e8f0; background: #111b30; border: 1px solid #334155; border-radius: 8px; padding: 6px 10px; }
.portal-results { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: #111b30; border: 1px solid #334155; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); min-width: 260px; }
.portal-results a { display: block; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: #e2e8f0; }
.portal-results a:hover, .portal-results a:focus { background: #1e293b; }
.portal-results small { display: block; color: #94a3b8; }
.portal-results .none { padding: 8px 10px; color: #94a3b8; }

/* breadcrumbs */
.portal-crumbs { max-width: 1100px; margin: 0 auto; padding: 6px 14px; font-size: .85rem; color: #94a3b8; }
.portal-crumbs ol { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.portal-crumbs li + li::before { content: "›"; margin-right: 4px; color: #64748b; }
.portal-h1 { max-width: 1100px; margin: 0 auto; padding: 4px 14px; font-size: 1.35rem; }
.portal-intro { max-width: 760px; margin: 0 auto; padding: 2px 14px 10px; color: #cbd5e1; font-size: .98rem; }

/* content sections below a game and on portal pages */
.portal-info { background: #0f172a; color: #e2e8f0; padding: 8px 0 24px; }
.portal-info-in, .portal-main { max-width: 1100px; margin: 0 auto; padding: 0 14px; }
.portal-main { padding-top: 12px; padding-bottom: 28px; }
.portal-section { margin: 26px 0; }
.portal-section h2 { font-size: 1.3rem; margin: 0 0 10px; color: #f1f5f9; }
.portal-section h3 { font-size: 1.05rem; margin: 16px 0 6px; color: #e2e8f0; }
.portal-section p, .portal-section li { max-width: 760px; color: #cbd5e1; }
.portal-section ul, .portal-section ol { padding-left: 1.25rem; }
.portal-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 22px; max-width: 900px; margin: 0; }
.portal-info-grid div { background: #111b30; border: 1px solid #1e293b; border-radius: 10px; padding: 8px 12px; }
.portal-info-grid dt { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.portal-info-grid dd { margin: 2px 0 0; color: #e2e8f0; }
.portal-info-grid ul { margin: 2px 0 0; padding-left: 1.1rem; }
.portal-faq details { background: #111b30; border: 1px solid #1e293b; border-radius: 10px; padding: 8px 14px; margin: 8px 0; max-width: 760px; }
.portal-faq summary { cursor: pointer; font-weight: 600; color: #f1f5f9; }
.portal-faq p { margin: 8px 0 2px; }
.portal-more { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.portal-btn { display: inline-block; background: #38bdf8; color: #06202e !important; font-weight: 700; text-decoration: none; padding: 9px 18px; border-radius: 999px; }
.portal-btn.alt { background: #1e293b; color: #e2e8f0 !important; border: 1px solid #334155; }

/* cards */
.portal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; list-style: none; margin: 0; padding: 0; }
.portal-card { background: #111b30; border: 1px solid #1e293b; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.portal-card[hidden] { display: none; }
.portal-card a.thumb { display: block; line-height: 0; background: #0b1220; }
.portal-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.portal-card .body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.portal-card h3 { margin: 0; font-size: 1rem; }
.portal-card h3 a { color: #f1f5f9; text-decoration: none; }
.portal-card h3 a:hover { text-decoration: underline; }
.portal-card p { margin: 0; font-size: .88rem; color: #94a3b8; }
.portal-card .tagline { color: #64748b; font-size: .78rem; }
.portal-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.portal-cat { background: #111b30; border: 1px solid #1e293b; border-radius: 12px; padding: 14px; }
.portal-cat h3 { margin: 0 0 4px; font-size: 1.1rem; } .portal-cat h3 a { color: #f1f5f9; text-decoration: none; } .portal-cat p { margin: 0 0 8px; font-size: .9rem; color: #94a3b8; }
.portal-cat .count { color: #38bdf8; font-size: .85rem; font-weight: 600; }
.portal-hero { padding: 34px 0 10px; } .portal-hero h1 { font-size: clamp(1.7rem, 5vw, 2.6rem); margin: 0 0 10px; line-height: 1.15; } .portal-hero p { max-width: 640px; font-size: 1.05rem; color: #cbd5e1; }
.portal-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; align-items: center; }
.portal-filters button, .portal-filters select, .portal-filters input { font: inherit; font-size: .92rem; color: #e2e8f0; background: #111b30; border: 1px solid #334155; border-radius: 999px; padding: 6px 14px; }
.portal-filters button[aria-pressed="true"] { background: #38bdf8; color: #06202e; border-color: #38bdf8; font-weight: 700; }
.portal-filters input { border-radius: 8px; }
.portal-clear { background: none; border: 0; color: #94a3b8; text-decoration: underline; cursor: pointer; font: inherit; font-size: .85rem; }

/* footer */
.portal-footer { background: #0b1220; border-top: 1px solid #1e293b; padding: 18px 0 26px; color: #94a3b8; font-size: .9rem; }
.portal-footer-in { max-width: 1100px; margin: 0 auto; padding: 0 14px; display: flex; flex-wrap: wrap; gap: 10px 36px; }
.portal-footer a { color: #cbd5e1; } .portal-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; } .portal-footer p { margin: 0; }
.portal-footer-in { display:grid; grid-template-columns:minmax(250px,1.7fr) 1fr 1fr; gap:24px 40px; padding-top:10px; }
.portal-footer-in > div { display:grid; align-content:start; gap:6px; }
.portal-footer-in > nav ul { display:grid; justify-items:start; gap:5px; }
@media (max-width:700px) {
  .portal-footer-in { grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px 18px; }
  .portal-footer-in > div { grid-column:1/-1; }
}
.portal-note { color: #94a3b8; font-size: .85rem; }
@media (prefers-reduced-motion: reduce) { .portal-wrap * { transition: none !important; animation: none !important; } }

/* compact header on phones: logo and search share a row, the nav scrolls sideways */
@media (max-width: 640px) {
  .portal-header-in { gap: 4px 10px; padding: 6px 12px; }
  .portal-logo { flex: 0 0 auto; font-size: 1rem; }
  .portal-search { order: 2; flex: 1 1 120px; }
  .portal-search input { padding: 4px 8px; }
  .portal-header-in > nav { order: 3; flex: 0 0 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .portal-header-in > nav::-webkit-scrollbar { display: none; }
  .portal-nav { flex-wrap: nowrap; gap: 14px; width: max-content; }
  .portal-nav a { white-space: nowrap; font-size: .88rem; padding: 2px; }
  .portal-crumbs { padding: 4px 12px; font-size: .8rem; }
}
