/* Magus Play public website. One file, no framework. Phone first. */
:root {
  color-scheme: dark;
  --bg-1: #0d0a3a;
  --bg-2: #24105c;
  --bg-3: #3d1470;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #c9c3e6;
  --gold: #f2c14e;
  --gold-2: #e9a426;
  --gold-ink: #241044;
  --danger: #ff8a8a;
  --radius: 18px;
  --gutter: 16px;
  --max: 1080px;
  --narrow: 760px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-1);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(242, 193, 78, 0.12), transparent 60%),
    radial-gradient(900px 600px at -10% 10%, rgba(139, 92, 246, 0.28), transparent 60%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 45%, var(--bg-3) 100%);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  overflow-wrap: anywhere;
}

main {
  flex: 1;
  outline: none;
}

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

a {
  color: var(--gold);
  text-underline-offset: 3px;
}

a:hover {
  color: #ffd877;
}

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(1.9rem, 6vw, 3.2rem);
}

h2 {
  font-size: clamp(1.35rem, 4vw, 1.8rem);
}

h3 {
  font-size: 1.2rem;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.wrap.narrow {
  max-width: var(--narrow);
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
}

.skip-link:focus {
  top: 12px;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--card-border);
  background: rgba(13, 10, 58, 0.55);
  backdrop-filter: blur(8px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  font-size: 1.1rem;
}

.brand:hover {
  color: var(--text);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--gold), var(--gold-2));
  color: var(--gold-ink);
  font-size: 22px;
  line-height: 1;
}

.brand-logo {
  border-radius: 10px;
  object-fit: contain;
}

.main-nav {
  display: flex;
  gap: 18px;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.main-nav a:hover {
  color: var(--text);
}

/* ---------- hero ---------- */

.hero {
  padding: 56px 0 32px;
  text-align: center;
}

.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 18px;
  color: var(--gold);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}

.hero-brand .brand-mark {
  width: 56px;
  height: 56px;
  font-size: 34px;
  border-radius: 16px;
}

.hero h1 {
  max-width: 18ch;
  margin-left: auto;
  margin-right: auto;
}

.lead {
  font-size: clamp(1.05rem, 2.6vw, 1.25rem);
  color: var(--muted);
  max-width: 46ch;
  margin: 0 auto 1.2em;
}

.btn {
  display: inline-block;
  padding: 13px 24px;
  border-radius: 999px;
  border: 0;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn-gold {
  background: linear-gradient(180deg, #ffd56b, var(--gold) 45%, var(--gold-2));
  color: var(--gold-ink);
  box-shadow: 0 6px 20px rgba(242, 193, 78, 0.25);
}

.btn-gold:hover {
  color: var(--gold-ink);
  filter: brightness(1.06);
}

/* ---------- sections and cards ---------- */

.section {
  padding: 28px 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 0 0 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.game-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.game-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text);
  text-decoration: none;
}

.game-card-head:hover h3 {
  color: var(--gold);
}

.game-card h3 {
  margin: 0;
}

.tagline {
  margin: 0;
  color: var(--muted);
}

.more {
  margin-top: auto;
  font-weight: 700;
  text-decoration: none;
}

.game-icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.game-icon-blank {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(145deg, #6d28d9, #2a137a);
  border: 2px solid rgba(242, 193, 78, 0.6);
  color: var(--gold);
  font-size: 32px;
  font-weight: 800;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 7px 16px;
  border-radius: 12px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-decoration: none;
  line-height: 1.1;
}

.store-badge:hover {
  color: #fff;
  border-color: var(--gold);
}

.store-badge span {
  display: flex;
  flex-direction: column;
}

.store-badge small {
  font-size: 0.7rem;
  opacity: 0.85;
}

.store-badge b {
  font-size: 1.05rem;
}

.store-badge-web {
  background: rgba(242, 193, 78, 0.12);
  border-color: rgba(242, 193, 78, 0.5);
}

.soon {
  display: inline-block;
  margin: 0;
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(242, 193, 78, 0.12);
  border: 1px solid rgba(242, 193, 78, 0.4);
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- game page ---------- */

.game-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.game-hero .game-icon {
  width: 112px;
  height: 112px;
  border-radius: 26px;
  font-size: 48px;
}

.game-hero > div {
  flex: 1 1 260px;
  min-width: 0;
}

.game-hero .lead {
  margin: 0 0 16px;
}

.shots {
  list-style: none;
  margin: 0 0 20px;
  padding: 4px 0 12px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
}

/* One screenshot per view, shown whole at the page's width (the next one peeks in to show there are more). */
.shots li {
  flex: 0 0 100%;
  display: flex;
  justify-content: center;
  scroll-snap-align: start;
}

.shots:has(li + li) li {
  flex-basis: 92%;
}

.shots img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  /* Portrait screenshots stay within the screen's height. */
  max-height: min(80vh, 720px);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  object-fit: contain;
}

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.features svg {
  flex: none;
  margin-top: 3px;
  color: var(--gold);
}

.back {
  font-weight: 700;
  text-decoration: none;
}

/* ---------- prose (Markdown) ---------- */

.prose {
  padding: 24px 20px;
}

.prose h1 {
  font-size: clamp(1.7rem, 5vw, 2.4rem);
}

.prose h2 {
  margin-top: 1.6em;
  font-size: 1.3rem;
  color: var(--gold);
}

.prose h3,
.prose h4,
.prose h5,
.prose h6 {
  margin-top: 1.3em;
  font-size: 1.1rem;
}

.prose > :first-child {
  margin-top: 0;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  padding-left: 1.4em;
}

.prose li {
  margin: 0.3em 0;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--card-border);
  margin: 1.6em 0;
}

.prose strong {
  color: #fff;
}

.updated {
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---------- form ---------- */

.form h2 {
  color: var(--gold);
}

.field {
  margin: 0 0 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(10, 6, 40, 0.6);
  color: var(--text);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--gold);
}

input[aria-invalid='true'] {
  border-color: var(--danger);
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.form-errors {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 138, 138, 0.5);
  color: #ffd2d2;
}

.form-errors ul {
  margin: 0;
  padding-left: 1.2em;
}

.notice {
  border-color: rgba(242, 193, 78, 0.6);
}

.notice h2 {
  color: var(--gold);
}

/* ---------- footer ---------- */

.site-footer {
  margin-top: 32px;
  padding: 28px 0 16px;
  border-top: 1px solid var(--card-border);
  background: rgba(8, 5, 34, 0.55);
  font-size: 0.95rem;
}

.footer-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.footer-grid p {
  margin: 0 0 8px;
}

.footer-links,
.social,
.langs {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links li {
  margin: 0 0 8px;
}

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

.social,
.langs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.social a,
.langs a {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: var(--text);
  text-decoration: none;
}

.social a:hover,
.langs a:hover {
  border-color: var(--gold);
}

.langs a[aria-current] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--gold-ink);
  font-weight: 700;
}

.copy {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (min-width: 720px) {
  .hero {
    padding: 88px 0 48px;
  }

  .card {
    padding: 28px;
  }

  .prose {
    padding: 36px 40px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}
