/* Midnight Market Studios: shared styles for the hub pages. Games under /play/ bring their own. */
:root {
  --night: #061328;
  --night-2: #0a1a35;
  --panel: #0e2043;
  --line: #1c3260;
  --moon: #fef0cc;
  --muted: #a7b0c8;
  --gold: #f7ac3d;
  --coral: #fb7555;
  --beta: #4fd6b8;
  --early: #f7ac3d;
  --soon: #8e98b3;
  --radius: 16px;
  --display: 'Josefin Sans', Futura, 'Century Gothic', sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 500px at 82% -8%, rgba(254, 240, 204, 0.07), transparent 60%),
    radial-gradient(700px 400px at 0% 40%, rgba(251, 117, 85, 0.05), transparent 60%),
    var(--night);
  color: var(--moon);
  font: 16px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.05; margin: 0; text-transform: uppercase; letter-spacing: 0.02em; }
h2 { font-size: clamp(28px, 4vw, 40px); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--night); padding: 8px 12px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 16px; }

/* wordmark: Midnight Market over a spaced-out STUDIOS, as in the logo */
.wordmark { display: inline-flex; flex-direction: column; line-height: 1; }
.wordmark b { font: 700 18px var(--display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--moon); padding-top: 3px; }
.wordmark i { font: 600 9.5px var(--display); font-style: normal; text-transform: uppercase; letter-spacing: 0.55em; color: var(--gold); margin-top: 4px; }
.wordmark.big b { font-size: clamp(44px, 7.5vw, 92px); line-height: 0.95; letter-spacing: 0.02em; }
.wordmark.big i { font-size: clamp(14px, 2vw, 22px); letter-spacing: 0.6em; margin-top: 14px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: rgba(6, 19, 40, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--moon); }
.brand .mark { width: 36px; height: auto; }
.top nav { display: flex; gap: clamp(12px, 3vw, 28px); }
.top nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.top nav a:hover { color: var(--moon); }

main { padding: 0 clamp(16px, 4vw, 48px); max-width: 1280px; margin: 0 auto; }
section { margin: clamp(56px, 8vw, 96px) 0; }

/* buttons */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--moon);
  font: 600 15px var(--body); text-decoration: none;
  transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.btn:hover { border-color: var(--gold); transform: translateY(-1px); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--night); }
.btn.primary:hover { background: #ffc263; }
.btn.big { min-height: 54px; padding: 0 30px; font-size: 17px; }
.btn.disabled { color: var(--muted); border-style: dashed; cursor: default; }
.btn.disabled:hover { transform: none; border-color: var(--line); }

.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 14px; font: 700 13px var(--display); text-transform: uppercase; letter-spacing: 0.22em; color: var(--coral); }
.lede { font-size: clamp(17px, 2vw, 19px); color: #d9d6cf; max-width: 48ch; margin: 18px 0 28px; }

/* studio hero: the illustrated emblem with the wordmark */
.studio-hero { display: grid; grid-template-columns: minmax(220px, 0.8fr) 1.2fr; gap: clamp(24px, 5vw, 72px); align-items: center; margin-top: clamp(32px, 6vw, 72px); }
.emblem { width: 100%; max-width: 440px; justify-self: center; filter: drop-shadow(0 30px 60px rgba(247, 172, 61, 0.18)); }
.tagline { margin: 22px 0 0; font: 700 15px var(--display); letter-spacing: 0.3em; text-transform: uppercase; color: var(--coral); }

/* featured game */
.featured { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: clamp(20px, 3vw, 32px); background: var(--night-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); }
.featured h2 { font-size: clamp(36px, 5vw, 60px); }
.feat-art, .game-art {
  display: block; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  box-shadow: 0 30px 80px -34px var(--a, var(--gold));
}
.feat-art img, .game-art img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* games grid */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: 600 13px var(--body); cursor: pointer; }
.chip:hover { color: var(--moon); border-color: #2c4682; }
.chip.on { background: var(--moon); color: var(--night); border-color: var(--moon); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  transition: transform 0.16s, border-color 0.16s, box-shadow 0.16s;
}
.card:hover { transform: translateY(-4px); border-color: var(--glow); box-shadow: 0 18px 50px -24px var(--glow); }
.card-link { display: block; height: 100%; text-decoration: none; }
.cover { position: relative; }
.cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cover .badge { position: absolute; top: 12px; left: 12px; }
.card-body { padding: 16px 18px 20px; }
.card h3 { font-size: 22px; margin-top: 8px; }
.card p { margin: 8px 0 14px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font: 600 11px var(--body); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--line); padding: 3px 8px; border-radius: 6px; }
.empty { color: var(--muted); }

/* aisle label: a lit dot plus the aisle name */
.aisle { display: inline-flex; align-items: center; gap: 7px; font: 700 11px var(--display); text-transform: uppercase; letter-spacing: 0.2em; color: var(--glow); }
.aisle::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 8px var(--glow); }

.badge { display: inline-block; font: 700 11px var(--display); text-transform: uppercase; letter-spacing: 0.14em; padding: 6px 9px 4px; border-radius: 6px; background: rgba(6, 19, 40, 0.82); border: 1px solid currentColor; }
.badge.beta, .badge.released { color: var(--beta); }
.badge.early-access { color: var(--early); }
.badge.coming-soon { color: var(--soon); }

/* about + community */
.about { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: clamp(28px, 4vw, 48px); background: var(--night-2); border: 1px solid var(--line); border-radius: calc(var(--radius) + 6px); }
.about p { color: #d9d6cf; max-width: 54ch; }
.about h2 { margin-bottom: 8px; }
.aisles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.aisles li { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--glow); }
.aisles b { font: 700 16px var(--display); text-transform: uppercase; letter-spacing: 0.1em; color: var(--glow); }
.aisles span { font-size: 14px; color: var(--muted); line-height: 1.4; }
.community { text-align: center; }
.community p { color: var(--muted); }
.community .actions { justify-content: center; }

/* game page */
.game-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(28px, 5vw, 56px); }
.game-hero h1 { font-size: clamp(40px, 6vw, 72px); }
.game-copy .kicker > span:last-child { color: var(--muted); letter-spacing: 0.1em; }
.meta { margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.game-detail { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 56px); }
.game-detail h2 { font-size: 24px; margin-bottom: 14px; }
.game-detail p { color: #d9d6cf; }
.features { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.features li { padding-left: 26px; position: relative; }
.features li::before { content: '✦'; position: absolute; left: 2px; top: 0; color: var(--gold); }
.note { padding: 12px 14px; border-left: 3px solid var(--gold); background: var(--night-2); border-radius: 0 8px 8px 0; font-size: 14px; }
.controls { width: 100%; border-collapse: collapse; font-size: 14px; }
.controls th, .controls td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.controls th { font-weight: 600; color: var(--muted); padding-right: 16px; width: 45%; }
.controls td { font-weight: 600; }
.more h2 { font-size: 28px; margin-bottom: 20px; }

.lost { text-align: center; padding: 100px 16px; display: grid; justify-items: center; gap: 8px; }
.lost img { width: 120px; margin-bottom: 16px; }
.lost h1 { font-size: clamp(40px, 8vw, 72px); }
.lost p { color: var(--muted); margin-bottom: 20px; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 80px; padding: 40px clamp(16px, 4vw, 48px); display: grid; gap: 12px; justify-items: start; color: var(--muted); font-size: 14px; }
.foot p { margin: 0; }
.brand.small .mark { width: 28px; }
.brand.small .wordmark b { font-size: 15px; }
.brand.small .wordmark i { font-size: 8px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot-links a { color: var(--moon); text-decoration: none; }
.foot-links a:hover { color: var(--gold); }
.fine { font-size: 12px; }

@media (max-width: 860px) {
  .studio-hero, .featured, .game-hero, .game-detail, .about { grid-template-columns: 1fr; }
  .studio-hero { text-align: center; }
  .studio-hero .emblem { max-width: 260px; }
  .studio-hero .lede { margin-left: auto; margin-right: auto; }
  .studio-hero .actions { justify-content: center; }
  .game-art { order: -1; }
  .top nav a:not(:first-child) { display: none; }
}
@media (max-width: 480px) {
  .wordmark b { font-size: 15px; }
  .aisles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
