:root {
  --ja-bg: #f7f5ff;
  --ja-surface: #ffffff;
  --ja-ink: #1b1340;
  --ja-muted: #5b5478;
  --ja-border: #e2dcf5;
  --ja-brand: #7c3aed;
  --ja-brand-dark: #5b21b6;
  --ja-accent: #f59e0b;
  --ja-radius: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ja-bg);
  color: var(--ja-ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}
a { color: var(--ja-brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

.ja-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
}

.ja-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--ja-border);
}
.ja-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 62px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}
.ja-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.18rem;
  color: var(--ja-ink);
  letter-spacing: -0.02em;
}
.ja-brand:hover { text-decoration: none; }
.ja-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  color: #fff;
  font-weight: 900;
  font-size: 1rem;
  box-shadow: 0 3px 0 var(--ja-ink);
}
.ja-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ja-nav a {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ja-ink);
}
.ja-nav a:hover {
  background: #ede9fe;
  color: var(--ja-brand-dark);
  text-decoration: none;
}
.ja-nav a.ja-nav-cta {
  background: var(--ja-brand);
  color: #fff;
}
.ja-nav a.ja-nav-cta:hover {
  background: var(--ja-brand-dark);
  color: #fff;
}

.ja-main { padding: 26px 0 48px; }

.ja-hero {
  margin-bottom: 20px;
}
.ja-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.ja-sub {
  margin: 0;
  color: var(--ja-muted);
  font-size: 1.03rem;
  max-width: 72ch;
}
.ja-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #ede9fe;
  color: var(--ja-brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ja-stage {
  background: var(--ja-surface);
  border: 2px solid var(--ja-ink);
  border-radius: 20px;
  box-shadow: 0 6px 0 var(--ja-ink);
  overflow: hidden;
  margin-bottom: 24px;
}
.ja-frame {
  position: relative;
  width: 100%;
  min-height: 480px;
  height: min(calc(100svh - 96px), 62vw, 780px);
  background: #140f2d;
}
.ja-frame:fullscreen { height: 100%; width: 100%; }
.ja-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.ja-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e9e4f7;
  font-weight: 800;
  font-size: 1.05rem;
}
.ja-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #faf8ff;
  border-top: 2px solid var(--ja-border);
}
.ja-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ja-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 2px solid var(--ja-ink);
  background: #fff;
  color: var(--ja-ink);
  font-weight: 800;
  font-size: 0.88rem;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ja-ink);
}
.ja-btn:hover { background: #ede9fe; text-decoration: none; }
.ja-btn.pri { background: var(--ja-brand); color: #fff; }
.ja-btn.pri:hover { background: var(--ja-brand-dark); }
.ja-msg { font-size: 0.86rem; color: var(--ja-muted); font-weight: 600; }

.ja-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}
.ja-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--ja-border);
  color: var(--ja-ink);
  font-weight: 700;
  font-size: 0.88rem;
}
.ja-chip:hover {
  border-color: var(--ja-brand);
  background: #f3efff;
  text-decoration: none;
}

.ja-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 14px;
}
.ja-section-head h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 900;
}
.ja-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.ja-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.ja-game-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 15px 16px;
  background: #fff;
  border: 2px solid var(--ja-border);
  border-radius: var(--ja-radius);
  color: var(--ja-ink);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.ja-game-card:hover {
  transform: translateY(-2px);
  border-color: var(--ja-brand);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.12);
  text-decoration: none;
}
.ja-game-card strong { font-size: 1.02rem; font-weight: 800; }
.ja-game-card span { font-size: 0.88rem; color: var(--ja-muted); }
.ja-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f3efff;
  color: var(--ja-brand-dark);
  font-size: 0.75rem;
  font-weight: 800;
}

.ja-card {
  background: #fff;
  border: 2px solid var(--ja-border);
  border-radius: var(--ja-radius);
  padding: 20px 22px;
  margin-bottom: 20px;
}
.ja-card h2, .ja-article h2 {
  margin: 0 0 10px;
  font-size: 1.3rem;
  font-weight: 900;
}
.ja-card h3, .ja-article h3 {
  margin: 18px 0 8px;
  font-size: 1.08rem;
  font-weight: 800;
}
.ja-steps {
  margin: 0;
  padding-left: 20px;
}
.ja-steps li { margin-bottom: 8px; }

.ja-article {
  background: #fff;
  border: 2px solid var(--ja-border);
  border-radius: var(--ja-radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.ja-article p { margin: 0 0 12px; }
.ja-article ul, .ja-article ol { margin: 0 0 14px; padding-left: 22px; }
.ja-article li { margin-bottom: 6px; }
.ja-article h2 { margin-top: 28px; text-wrap: balance; }
.ja-article h2:first-child { margin-top: 0; }
.ja-article [id] { scroll-margin-top: 88px; }
.ja-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}
.ja-article th, .ja-article td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--ja-border);
  text-align: left;
  vertical-align: top;
}
.ja-article th { background: #faf8ff; font-weight: 800; }
.ja-article figure { margin: 0 0 18px; }
.ja-article figure svg text { font-size: 14px; }
.ja-article figcaption {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--ja-muted);
  text-align: center;
}
a:focus-visible, .ja-btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--ja-brand);
  outline-offset: 2px;
}

.ja-faq {
  background: #fff;
  border: 2px solid var(--ja-border);
  border-radius: var(--ja-radius);
  padding: 20px 22px;
  margin-bottom: 22px;
}
.ja-faq h2 { margin: 0 0 12px; font-size: 1.25rem; font-weight: 900; }
.ja-faq details {
  border-top: 1px solid var(--ja-border);
  padding: 12px 0;
}
.ja-faq details:first-of-type { border-top: 0; }
.ja-faq summary {
  cursor: pointer;
  font-weight: 800;
  color: var(--ja-ink);
}
.ja-faq details p { margin: 8px 0 0; color: var(--ja-muted); }

.ja-comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
}
.ja-comment-form input,
.ja-comment-form textarea,
.ja-form input,
.ja-form textarea,
.ja-form select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d4cbe9;
  border-radius: 10px;
  font: inherit;
  background: #fff;
  color: var(--ja-ink);
}
.ja-comment-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.ja-comment-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: #faf8ff;
  border: 1px solid var(--ja-border);
}
.ja-comment-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 700;
}
.ja-comment-time { color: var(--ja-muted); font-weight: 500; }

.ja-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--ja-muted);
  margin-bottom: 10px;
}

.ja-itch-embed {
  width: 100%;
  min-height: 520px;
  border: 0;
  border-radius: 14px;
  background: #140f2d;
}

.ja-footer {
  border-top: 2px solid var(--ja-border);
  background: #fff;
  padding: 24px 0;
  color: var(--ja-muted);
  font-size: 0.9rem;
}
.ja-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.ja-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.ja-footer-links a { color: var(--ja-muted); font-weight: 600; }
.ja-footer-links a:hover { color: var(--ja-brand); }

@media (max-width: 640px) {
  .ja-frame { min-height: 440px; height: 64vh; }
  .ja-article, .ja-card, .ja-faq { padding: 16px; }
  .ja-article table { display: block; overflow-x: auto; }
  .ja-article th, .ja-article td { padding: 6px 8px; }
  .ja-article td + td, .ja-article th + th { min-width: 7.5em; }
  .ja-article td:nth-child(4), .ja-article th:nth-child(4) { min-width: 15em; }
}


.ja-hero-cta { margin-top: 16px; }
.ja-hero-cta .ja-btn { min-height: 44px; padding: 10px 18px; font-size: 1rem; }
.ja-home-body > p, .ja-home-intro { max-width: 70ch; color: var(--ja-muted); margin: 0 0 14px; }
.ja-home-body .ja-section-head h2 { font-size: 1.35rem; }
.ja-hot { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.ja-hot .ja-game-card { border-color: var(--ja-brand); }


/* Daily lineup: scoreboard-style rows, one game per row */
.ja-article .ja-lineup {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  background: var(--ja-surface);
  border: 2px solid var(--ja-ink);
  border-radius: var(--ja-radius);
  box-shadow: 0 4px 0 var(--ja-ink);
  overflow: hidden;
}
.ja-article .ja-lineup li { margin: 0; }
.ja-article .ja-lineup li + li { border-top: 1px solid var(--ja-border); }
.ja-lineup a {
  display: grid;
  grid-template-columns: 104px 1fr auto;
  gap: 4px 16px;
  align-items: center;
  min-height: 64px;
  padding: 12px 16px;
  color: var(--ja-ink);
}
.ja-lineup a:hover { background: #f3efff; text-decoration: none; }
.ja-lineup a:focus-visible { outline: 3px solid var(--ja-brand); outline-offset: -3px; }
.ja-l-cat { font-weight: 800; font-size: 0.875rem; color: var(--ja-brand-dark); }
.ja-l-main { min-width: 0; }
.ja-l-name { display: block; font-weight: 800; font-size: 1.05rem; line-height: 1.3; }
.ja-l-how { display: block; color: var(--ja-muted); font-size: 0.95rem; line-height: 1.45; }
.ja-l-fmt {
  justify-self: end;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1.5px solid #e3b866;
  background: #fff7e6;
  color: #6b4100;
  font-weight: 800;
  font-size: 0.875rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ja-article h3.ja-l-group { margin: 24px 0 10px; font-size: 1.1rem; }
.ja-article h3.ja-l-group:first-of-type { margin-top: 8px; }
@media (max-width: 640px) {
  .ja-lineup a { grid-template-columns: 1fr auto; padding: 12px 14px; }
  .ja-l-cat { grid-column: 1 / -1; }
  .ja-l-fmt { align-self: start; }
}


/* Lineup pages: drop the outer card so the scoreboard is not a card inside a card */
.ja-article:has(> .ja-lineup, > .ja-section-head, > .ja-grid) { background: transparent; border: 0; padding: 0; }
.ja-article:has(> .ja-lineup, > .ja-section-head, > .ja-grid) > p { max-width: 70ch; }


/* Accessibility & interaction pass (web-design-guidelines + WCAG 2.2) */
.ja-skip {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ja-ink);
  color: #fff;
  font-weight: 800;
}
.ja-skip:focus { top: 12px; text-decoration: none; }
.ja-main:focus { outline: none; }
.ja-nav a[aria-current="page"] { background: #ede9fe; color: var(--ja-brand-dark); }
.ja-tag { font-size: 0.75rem; }
a, button, summary { touch-action: manipulation; }
a, button, summary, input, textarea, select { scroll-margin-top: 96px; scroll-margin-bottom: 24px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .ja-game-card:hover { transform: none; }
}


/* itch player: click-to-play cover */
.ja-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #140f2d;
}
.ja-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.ja-cover .ja-play {
  position: relative;
  min-height: 52px;
  padding: 12px 26px;
  font-size: 1.1rem;
  box-shadow: 0 4px 0 var(--ja-ink);
}
.ja-credit {
  margin: 0;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--ja-muted);
  border-top: 1px solid var(--ja-border);
  background: var(--ja-surface);
}
.ja-label { font-weight: 800; font-size: 0.9rem; margin-bottom: -4px; }


/* Let the engine's hidden attribute win over component display rules */
[hidden] { display: none !important; }



/* Game card thumbnails (injected by partials/bottom.html) */
.ja-game-card { overflow: hidden; }
.ja-game-card > .ja-thumb {
  display: block;
  width: calc(100% + 32px);
  max-width: none;
  margin: -15px -16px 6px;
  aspect-ratio: 16 / 10;
  height: auto;
  object-fit: cover;
  background: #140f2d;
  border-bottom: 2px solid var(--ja-border);
}
.ja-game-card:hover > .ja-thumb { filter: saturate(1.15); }
.ja-game-card > span:not(.ja-tag):not(.ja-thumb) {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ja-game-card > .ja-thumb-ph, .ja-lineup a > .ja-thumb-ph, .ja-thumb-ph {
  display: flex;
  align-items: flex-end;
  padding: 12px 14px;
  background: linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  color: #fff;
  font-weight: 900;
  font-size: 1.15rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.ja-lineup a:has(> .ja-thumb) { grid-template-columns: 96px 104px 1fr auto; }
.ja-lineup a > .ja-thumb {
  width: 96px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--ja-ink);
}
.ja-lineup a > .ja-thumb-ph { font-size: .75rem; padding: 6px; }
@media (max-width: 640px) {
  .ja-lineup a:has(> .ja-thumb) { grid-template-columns: 88px 1fr; column-gap: 12px; }
  .ja-lineup a > .ja-thumb { width: 88px; height: 55px; grid-row: 1 / span 3; align-self: start; }
  .ja-lineup a:has(> .ja-thumb) .ja-l-cat,
  .ja-lineup a:has(> .ja-thumb) .ja-l-main { grid-column: 2; }
  .ja-lineup a:has(> .ja-thumb) .ja-l-fmt { grid-column: 2; justify-self: start; }
}



/* Big picks row (one game per style) */
.ja-picks { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.ja-picks .ja-game-card { border: 2px solid var(--ja-ink); box-shadow: 0 4px 0 var(--ja-ink); }
.ja-picks .ja-game-card strong { font-size: 1.15rem; }
.ja-picks .ja-tag { background: #fde68a; color: #5b3a00; }



/* Guide pages: big official artwork on top of the "play on official site" card */
.ja-offsite { overflow: hidden; }
.ja-offsite > .ja-offsite-img {
  display: block;
  width: calc(100% + 44px);
  max-width: none;
  margin: -20px -22px 16px;
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 340px;
  object-fit: cover;
  background: #140f2d;
  border-bottom: 2px solid var(--ja-border);
}
