/* Wings & Horns — shared styles */

:root {
  --bg: #08070f;
  --bg-2: #0b0a18;
  --panel: #0f0e1d;
  --panel-2: #14122a;
  --line: #232145;
  --line-soft: #1a1834;
  --ink: #f4eee0;
  --dim: #9a93b8;
  --dimmer: #6d6790;
  --gold: #f5c451;
  --gold-soft: #ffe9a3;
  --ember: #e8553c;
  --soul: #9be7ff;
  --grace: #7cf0c0;
  --font-display: 'Press Start 2P', ui-monospace, SFMono-Regular, monospace;
  --font-body: 'Space Grotesk', system-ui, -apple-system, Segoe UI, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 600px at 15% -10%, rgba(60, 48, 140, 0.40), transparent 70%),
    radial-gradient(800px 500px at 100% 10%, rgba(120, 40, 40, 0.18), transparent 65%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; }

/* ---------- scanlines ---------- */
.scanlines {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.028) 0px,
    rgba(255, 255, 255, 0.028) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
}

/* ---------- top bar ---------- */
.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 44px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(8, 7, 15, 0.72);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark { width: 34px; height: 34px; flex: none; }

.brand-name {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.ghost-btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  text-decoration: none;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
  white-space: nowrap;
}

.ghost-btn:hover,
.ghost-btn:focus-visible {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.06);
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: #14100a;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border: 1px solid #b98f2c;
  border-radius: 999px;
  padding: 15px 26px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 30px -12px rgba(245, 196, 81, 0.65);
  transition: transform .18s ease, box-shadow .18s ease;
}

.btn-alt {
  color: var(--ink);
  background: rgba(15, 14, 29, 0.7);
  border-color: var(--line);
  box-shadow: none;
}

.btn-alt:hover,
.btn-alt:focus-visible {
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.08);
  box-shadow: none;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px -12px rgba(245, 196, 81, 0.8);
  outline: none;
}

/* ---------- hero ---------- */
.hero {
  max-width: 940px;
  margin: 0 auto;
  padding: clamp(56px, 10vw, 120px) clamp(20px, 5vw, 40px) clamp(40px, 6vw, 72px);
  text-align: center;
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 26px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 6.6vw, 58px);
  line-height: 1.35;
  letter-spacing: 0.01em;
  margin: 0 0 26px;
  text-shadow: 0 0 40px rgba(155, 231, 255, 0.16), 0 3px 0 rgba(0, 0, 0, 0.55);
}

.hero h1 .amp {
  color: var(--gold);
  text-shadow: 0 0 26px rgba(245, 196, 81, 0.55);
}

.lede {
  max-width: 620px;
  margin: 0 auto 34px;
  font-size: clamp(16px, 2.1vw, 19px);
  color: var(--dim);
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.hint {
  font-size: 13px;
  color: var(--dimmer);
}

/* ---------- games ---------- */
.games {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 40px) clamp(48px, 7vw, 90px);
  scroll-margin-top: 80px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(13px, 2.2vw, 17px);
  line-height: 1.5;
  margin: 0;
  letter-spacing: 0.02em;
}

.section-head p {
  margin: 0;
  color: var(--dimmer);
  font-size: 14px;
}

/* ---------- filters ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.filter {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.filter span {
  margin-left: 4px;
  font-size: 11px;
  color: var(--dimmer);
}

.filter:hover,
.filter:focus-visible {
  color: var(--ink);
  border-color: var(--gold);
  outline: none;
}

.filter[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--gold);
  background: rgba(245, 196, 81, 0.10);
}

.filter[aria-pressed="true"] span { color: var(--gold); }

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.card[hidden] { display: none; }

.card-wide {
  grid-column: span 2;
  flex-direction: row;
}

.card-wide .card-art {
  width: 42%;
  flex: none;
  aspect-ratio: auto;
  border-bottom: 0;
  border-right: 1px solid var(--line-soft);
}

.card-wide .card-art svg { max-width: 180px; }

.card-wide .card-body { justify-content: center; }

.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(245, 196, 81, 0.55);
  box-shadow: 0 22px 50px -24px rgba(245, 196, 81, 0.5);
  outline: none;
}

.card-art {
  aspect-ratio: 6 / 5;
  display: grid;
  place-items: center;
  padding: 22px;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(90, 80, 180, 0.20), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 22px);
  border-bottom: 1px solid var(--line-soft);
}

.card-art svg { width: 100%; max-width: 190px; height: auto; }

.card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 20px 22px;
  flex: 1;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-num {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.tag {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dimmer);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}

.card h3 {
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.5;
  margin: 4px 0 0;
  color: var(--ink);
}

.card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--dim);
  flex: 1;
}

.card-cta {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.card:hover .card-cta span { transform: translateX(3px); }
.card-cta span { transition: transform .18s ease; }

/* ---------- strip ---------- */
.strip {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px) clamp(60px, 9vw, 110px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.strip > div {
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(15, 14, 29, 0.55);
}

.strip h3 {
  font-family: var(--font-display);
  font-size: 10px;
  line-height: 1.6;
  margin: 0 0 10px;
  color: var(--gold);
}

.strip p {
  margin: 0;
  font-size: 14.5px;
  color: var(--dim);
  line-height: 1.65;
}

/* ---------- play view ---------- */
#playView {
  max-width: 1100px;
  margin: 0 auto;
  padding: 22px clamp(14px, 4vw, 40px) 60px;
}

.play-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.play-titles { flex: 1; text-align: center; min-width: 0; }

.play-titles h2 {
  font-family: var(--font-display);
  font-size: clamp(12px, 2vw, 16px);
  margin: 0;
  line-height: 1.5;
}

.play-titles p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--dimmer);
}

.play-spacer { width: 96px; flex: none; }

.play-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 0;
}

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid var(--line);
  background: rgba(15, 14, 29, 0.85);
  border-radius: 999px;
  padding: 6px 12px;
}

.chip span {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dimmer);
}

.chip b {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--ink);
  font-weight: 400;
}

.stage {
  width: 100%;
  max-width: var(--stage-max, 560px);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #0a0917;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6),
    0 30px 80px -40px rgba(120, 110, 255, 0.55);
  overflow: hidden;
  line-height: 0;
}

.stage canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.status {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  color: var(--dim);
  text-align: center;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.actions:empty { display: none; }

.controls {
  margin: 22px auto 0;
  max-width: 640px;
  text-align: center;
  font-size: 12.5px;
  color: var(--dimmer);
  line-height: 1.7;
}

/* ---------- dpad (touch only) ---------- */
.pad-host { display: none; }

@media (any-pointer: coarse), (max-width: 780px) {
  .pad-host:not(:empty) { display: block; }
}

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  grid-template-rows: repeat(2, 58px);
  gap: 8px;
  justify-content: center;
  margin-top: 6px;
}

.dpad button {
  font-size: 18px;
  color: var(--ink);
  background: rgba(20, 18, 42, 0.95);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.dpad button:active {
  background: rgba(245, 196, 81, 0.15);
  border-color: var(--gold);
}

.dpad button[data-d="up"] { grid-column: 2; grid-row: 1; }
.dpad button[data-d="left"] { grid-column: 1; grid-row: 2; }
.dpad button[data-d="down"] { grid-column: 2; grid-row: 2; }
.dpad button[data-d="right"] { grid-column: 3; grid-row: 2; }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line-soft);
  padding: 30px clamp(16px, 4vw, 44px) 46px;
  max-width: 1180px;
  margin: 0 auto;
}

.fine {
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--dimmer);
  margin: 0 0 10px;
  max-width: 78ch;
}

.muted { opacity: 0.72; }

/* ---------- responsive ---------- */
@media (min-width: 1080px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr 1fr; }
  .strip { grid-template-columns: 1fr; }
  .card-art { aspect-ratio: 16 / 9; }
}

@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; flex-direction: column; }
  .card-wide .card-art {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .section-head { flex-direction: column; gap: 6px; }
  .topbar { padding: 11px 16px; }
  .play-head { flex-wrap: nowrap; gap: 10px; margin-bottom: 10px; align-items: flex-start; }
  .play-titles { text-align: right; order: 0; flex: 1; }
  .play-titles h2 { font-size: 11px; }
  .play-titles p { display: none; }
  .play-head .ghost-btn { padding: 6px 11px; font-size: 12px; }
  .play-spacer { display: none; }
  #playView { padding: 12px 12px 40px; }
  .brand-name { font-size: 10px; }
  .hero h1 { line-height: 1.5; }
  .hero-buttons { gap: 10px; }
  .hero-buttons .btn { padding: 13px 18px; font-size: 9px; }
  .card-art { aspect-ratio: 3 / 2; }
  .hud { gap: 6px; }
  .chip { padding: 5px 10px; }
  .chip span, .chip b { font-size: 9px; }
  .status { font-size: 12px; }
  .dpad { grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 52px); gap: 6px; }
}

@media (max-width: 420px) {
  .eyebrow { font-size: 8px; letter-spacing: 0.1em; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}
