@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,600;0,9..40,700;1,9..40,400&display=swap");

:root {
  --bg: #0b1220;
  --surface: #121a2b;
  --border: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-dim: #0ea5e9;
  --card-radius: 14px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1e3a5f 0%, transparent 55%), var(--bg);
  color: var(--text);
  line-height: 1.55;
}

main {
  flex: 1 0 auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.wrap {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.brand {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
}
.brand span {
  color: var(--accent);
}

nav.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.95rem;
}
nav.site-nav a {
  color: var(--muted);
}
nav.site-nav a:hover {
  color: var(--text);
}

.hero {
  padding: 2.5rem 0 1.5rem;
}
.hero h1,
.hero-brand {
  margin: 0 0 0.5rem;
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}
.hero-brand span {
  color: var(--accent);
}
.hero p.lead {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

/* Homepage uses a single .wrap.home-main so hero, toolbar, and grid share one padded column. */

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  margin: 1.75rem 0 1rem;
  width: 100%;
}

.toolbar-group {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: none;
  justify-content: flex-start;
}

.toolbar-category {
  max-width: none;
}

.toolbar-group label {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.toolbar-search {
  flex: 0 0 auto;
  min-width: 0;
}

.toolbar-search input[type="search"] {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 28rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.toolbar-category select {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  max-width: 16rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.1rem;
  padding-bottom: 3rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover {
  border-color: #334155;
  transform: translateY(-2px);
}
.card a.main {
  color: inherit;
  text-decoration: none;
}
.card a.main:hover {
  text-decoration: none;
}

.card-cover {
  aspect-ratio: 16 / 10;
  background: #0f172a;
}
.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 0.75rem 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.card-body h2 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.25;
}
.meta {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.card-actions {
  margin-top: auto;
  padding-top: 0.5rem;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #0b1220;
}
.btn-primary:hover {
  filter: brightness(1.05);
}

.btn.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.btn.btn-ghost:hover {
  background: rgba(148, 163, 184, 0.08);
  text-decoration: none;
}

.play-shell {
  padding: 1rem 0 2rem;
}
.play-shell__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.65rem;
}
.play-shell__title {
  margin: 0;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  flex: 1 1 12rem;
}
.play-shell__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.play-shell__hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 62ch;
}
.play-frame-wrap {
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #0f172a;
  min-height: min(82vh, 900px);
}
.play-frame {
  display: block;
  width: 100%;
  height: min(82vh, 900px);
  border: 0;
  vertical-align: top;
}

.similar-games {
  margin-top: 2rem;
  padding-bottom: 0.5rem;
}

.similar-games__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.similar-games__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 0.85rem;
}

.similar-game {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.similar-game:hover {
  border-color: #334155;
  transform: translateY(-2px);
  text-decoration: none;
}

.similar-game__cover {
  aspect-ratio: 16 / 10;
  background: #0f172a;
}

.similar-game__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.similar-game__title {
  padding: 0.5rem 0.55rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 2rem 0;
}
@media (min-width: 720px) {
  .detail-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    align-items: start;
  }
}

.detail-cover {
  border-radius: var(--card-radius);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 10;
  background: #0f172a;
}
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-head {
  display: block;
}
.detail-head h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.detail-head .src {
  margin: 0 0 0.35rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.detail-host {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.play-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  margin-top: 1rem;
}
.play-panel p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 0 3rem;
}
.prose h1 {
  margin-top: 0;
}
.prose h2 {
  margin-top: 1.75rem;
  font-size: 1.15rem;
}
.prose ul {
  padding-left: 1.25rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.25rem 0 1.75rem;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--muted);
  background: rgba(11, 18, 32, 0.55);
}

.footer-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2.5rem;
}

@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  }
}

.footer-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
}

.footer-about .footer-heading {
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: -0.02em;
}

.footer-about p {
  margin: 0;
  max-width: 42ch;
  line-height: 1.6;
}

.footer-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.footer-nav a {
  color: var(--muted);
}
.footer-nav a:hover {
  color: var(--accent);
}

.footer-meta {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
}
.footer-meta p {
  margin: 0;
  max-width: 75ch;
}

.badge {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: #1e293b;
  font-size: 0.72rem;
  color: var(--muted);
}
