/* Jokess Forge – shared styles. No external fonts or resources. */

:root {
  --bg: #0d0f12;
  --bg-raised: #161a1f;
  --line: #2a3038;
  --text: #e9e4d8;
  --text-dim: #a8a293;
  --gold: #d8b25a;
  --gold-bright: #f2d48a;
  --accent: #3fd98a;          /* overridden per game */
  --accent-dim: #1f6b46;
  --radius: 10px;
  --max: 1100px;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body.theme-idle {
  --accent: #3fd98a;
  --accent-dim: #1f6b46;
}

body.theme-infernal {
  --accent: #ff7a2f;
  --accent-dim: #8a2412;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--gold-bright);
}

a:hover {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--serif);
  color: var(--gold-bright);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  margin: 0 0 0.4em;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 0.6em;
}

h3 {
  font-size: 1.25rem;
  margin: 0 0 0.4em;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 10;
  background: var(--bg-raised);
  padding: 0.5rem 1rem;
}

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(13, 15, 18, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 64px;
}

.brand img {
  height: 44px;
  width: auto;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  font-size: 0.95rem;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--gold-bright);
}

/* Hero */

.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0;
  text-align: center;
  background:
    radial-gradient(ellipse at 25% 60%, rgba(63, 217, 138, 0.18), transparent 55%),
    radial-gradient(ellipse at 75% 60%, rgba(255, 122, 47, 0.2), transparent 55%),
    var(--bg);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

/* Background image is set inline (url() must resolve relative to the page). */
.hero.has-image {
  background-color: var(--bg);
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
}

.hero .logo {
  width: min(640px, 90%);
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, 0.7));
}

.hero.has-image {
  padding-bottom: clamp(4rem, 10vw, 8rem);
}

.hero p {
  max-width: 40em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  margin: 0 auto;
  font-size: 1.15rem;
  color: var(--text);
}

/* Sections */

section {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}

section + section {
  border-top: 1px solid var(--line);
}

.lead {
  font-size: 1.15rem;
  color: var(--text);
  max-width: 42em;
}

.dim {
  color: var(--text-dim);
}

/* Game cards on the start page */

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.75rem;
}

.game-card {
  display: grid;
  color: inherit;
  text-decoration: none;
  grid-template-columns: 40% 1fr;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.game-card:hover {
  border-color: var(--gold);
  transform: translateY(-3px);
}

.game-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card .body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.game-card .body p {
  margin: 0 0 1rem;
  font-size: 0.97rem;
}

.game-card .body .button {
  margin-top: auto;
  align-self: flex-start;
}

.game-card.idle {
  --accent: #3fd98a;
  --accent-dim: #1f6b46;
}

.game-card.infernal {
  --accent: #ff7a2f;
  --accent-dim: #8a2412;
}

@media (max-width: 520px) {
  .game-card {
    grid-template-columns: 1fr;
  }

  .game-card img {
    aspect-ratio: 4 / 3;
  }
}

/* Buttons and tags */

.button {
  display: inline-block;
  padding: 0.65rem 1.3rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(216, 178, 90, 0.18), rgba(216, 178, 90, 0.05));
  color: var(--gold-bright);
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.button:hover {
  background: var(--gold);
  color: #1a1408;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: #fff;
}

.button.primary:hover {
  background: var(--accent);
  color: #0d0f12;
}

.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 1rem;
  list-style: none;
}

.tags li {
  padding: 0.15rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Game page intro */

.game-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: center;
}

.game-intro .key-art {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 80px color-mix(in srgb, var(--accent) 18%, transparent);
}

.game-intro .icon {
  width: 88px;
  height: 88px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

@media (max-width: 760px) {
  .game-intro {
    grid-template-columns: 1fr;
  }

  .game-intro .key-art {
    max-width: 360px;
    margin: 0 auto;
  }
}

/* Feature list */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  padding: 0;
  list-style: none;
}

.features li {
  padding: 1.25rem;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
}

.features h3 {
  font-size: 1.1rem;
}

.features p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* Gallery */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 0;
}

.gallery.wide {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@media (min-width: 900px) {
  .gallery.five {
    grid-template-columns: repeat(5, 1fr);
  }
}

.gallery figure {
  margin: 0;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.gallery.wide img {
  aspect-ratio: 3 / 2;
}

.gallery figcaption {
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.band {
  background-color: var(--bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Legal pages */

.legal {
  max-width: 46em;
}

.legal h1 {
  margin-bottom: 0.2em;
}

.legal h2 {
  font-size: 1.4rem;
  margin-top: 2.2em;
}

.legal h3 {
  font-size: 1.1rem;
  margin-top: 1.6em;
}

.legal address {
  font-style: normal;
}

.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.legal th,
.legal td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line);
}

.legal th {
  color: var(--gold-bright);
  font-weight: 600;
}

.notice {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--bg-raised);
}

.toc {
  columns: 2 16em;
  padding-left: 1.2em;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-footer a {
  color: var(--text-dim);
}

.site-footer a:hover {
  color: var(--gold-bright);
}

.site-footer .fineprint {
  flex-basis: 100%;
  font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .game-card {
    transition: none;
  }
}
