/* Realms of Omnia website - the same look as the game (play.realmsofomnia.com): white page, black frames,
   the cards' own pixel font, square corners, no shadows. Colours and sizes are named at the top.
   Sizes are multiples of 5px so every pixel of the font lands on whole screen pixels. */
:root {
  --paper: #fff; /* background */
  --ink: #000; /* text, frames */
  --dim: #7a7a7a; /* secondary text */
  --p1: #1c7fd6; /* blue, as player 1 and mana in the game */
  --p2: #d63a2a; /* red, as player 2 in the game */
  --select: #f5a300; /* the one highlight */
  --page-w: 1100px; /* widest the content gets */
  --card-w: 150px; /* card images in the grids */
  color-scheme: light;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.6 'Omnia Pixel',
    monospace;
  text-transform: uppercase;
  -webkit-font-smoothing: none;
  font-smooth: never;
  -webkit-tap-highlight-color: transparent;
}
[hidden] {
  display: none !important;
}
img {
  display: block;
  image-rendering: pixelated;
}
h1,
h2,
h3,
p {
  margin: 0;
  font-weight: normal;
}
a {
  color: inherit;
}
.page {
  max-width: var(--page-w);
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Buttons and fields: as in the game - a black frame that fills in on hover. */
button,
select,
input,
.button {
  font: inherit;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 5px 10px;
  box-sizing: border-box;
}
button,
.button {
  cursor: pointer;
  display: inline-block;
}
button:hover,
.button:hover,
button.on {
  background: var(--ink);
  color: var(--paper);
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid var(--select);
  outline-offset: 2px;
}
label {
  display: block;
  font-size: 10px;
  color: var(--dim);
}

/* ------------------------------------------------------------ header: the card-back banner, title and links */
.header {
  background: url(../play/assets/banner.png) center / cover;
  image-rendering: pixelated;
  border-bottom: 5px solid var(--ink);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  padding: 15px 0;
}
.links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.links a {
  background: var(--paper);
}
.links a.here {
  background: var(--ink);
  color: var(--paper);
}
.title {
  /* white box on the banner so the title reads on every colour */
  display: inline-block;
  margin: 30px 0 40px;
  padding: 10px 20px;
  background: var(--paper);
  border: 5px solid var(--ink);
  font-size: 40px;
  line-height: 1.2;
}
.hero {
  text-align: center;
}

/* ------------------------------------------------------------ page sections */
section {
  padding: 40px 0 0;
}
h2 {
  font-size: 25px;
  margin-bottom: 10px;
}
.lead {
  max-width: 860px;
  color: var(--dim);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
}

/* Factions: one framed box each; each links to its cards in the library. */
.factions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
}
.faction {
  display: block;
  padding: 10px 15px 15px;
  border: 2px solid var(--ink);
  text-decoration: none;
}
.faction:hover {
  background: var(--ink);
  color: var(--paper);
}
.faction h3 {
  font-size: 20px;
}
.faction p {
  font-size: 10px;
}

/* ------------------------------------------------------------ card grids (home previews and the library) */
.cards {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-w));
  justify-content: center;
  gap: 15px;
}
.cards img {
  width: var(--card-w);
  aspect-ratio: 5 / 7;
  cursor: pointer;
}
.cards img:hover {
  outline: 3px solid var(--select);
}
.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--dim);
}

/* A card shown big over the page; click anywhere or press Escape to close it. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
.lightbox img {
  width: min(400px, 100%);
  max-height: 90vh;
  object-fit: contain;
}

/* ------------------------------------------------------------ rules */
.rules {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 15px;
  align-items: start;
}
.rule {
  padding: 10px 15px 15px;
  border: 2px solid var(--ink);
  font-size: 10px;
}
.rule h3 {
  font-size: 15px;
  margin-bottom: 5px;
}
.rule ul,
.rule ol {
  margin: 0;
  padding-left: 20px;
}
.rule p + h3 {
  margin-top: 15px;
}
.rule p + p,
.rule p + ul,
.rule ul + p {
  margin-top: 5px;
}
.rule .key {
  color: var(--p2);
}
.rule.wide {
  grid-column: 1 / -1;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.rule.wide > div {
  flex: 1 1 280px;
}
.rule .board {
  width: 176px; /* half the 352px image: still whole pixels */
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 5px;
}
th,
td {
  padding: 3px 5px;
  border: 2px solid var(--ink);
  text-align: left;
  font-weight: normal;
}
th {
  background: var(--ink);
  color: var(--paper);
}

/* ------------------------------------------------------------ card library: the game's card browser (play/css/browser.css) */
#library {
  --gallery-card: var(--card-w);
  margin-top: 20px;
}
#library .browser-filters {
  position: sticky; /* the filters stay on screen while scrolling the cards */
  top: 0;
  z-index: 20;
  border: 2px solid var(--ink);
}

/* ------------------------------------------------------------ footer */
.footer {
  /* the copyright line is in the device's normal font, not the pixel font (which has no ©) */
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  text-transform: none;
  -webkit-font-smoothing: auto;
  margin: 40px 0 20px;
  padding-top: 10px;
  border-top: 2px solid var(--ink);
  font-size: 12px;
  color: var(--dim);
}

/* ------------------------------------------------------------ phones */
@media (max-width: 640px) {
  .nav {
    justify-content: center;
  }
  .title {
    font-size: 25px;
  }
  .rules {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  :root {
    --card-w: 120px;
  }
}
