:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #111317;
  color: #f8f9fa;
  --surface: #1b1e24;
  --surface-strong: #242832;
  --border: rgba(255, 255, 255, 0.14);
  --muted: #b7bdc8;
  --accent: #6ce5a5;
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  margin: 0;
}

body {
  background: #111317;
}

a {
  color: #97efbf;
}

.game-detail-shell {
  min-height: 100dvh;
}

.game-site-header,
.game-detail-footer {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 24px;
  padding: 10px max(24px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid var(--border);
  background: #0d0f13;
}

.game-site-brand {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 750;
  text-decoration: none;
}

.game-site-brand-mark,
.player-brand {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  flex: 0 0 auto;
  overflow: hidden;
  object-fit: cover;
}

.player-brand img {
  display: block;
  width: 100%;
  height: 100%;
}

.game-site-header nav {
  display: flex;
  margin-left: auto;
  gap: 8px;
}

.game-site-header nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 12px;
  color: #dfe3ea;
  text-decoration: none;
}

.game-detail-page {
  width: min(1320px, calc(100% - 48px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.game-breadcrumbs {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 0.875rem;
}

.game-detail-hero {
  max-width: 900px;
  padding: 38px 0 28px;
}

.game-kicker {
  color: #ff8f99;
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
}

.game-detail-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.08;
}

.game-detail-hero > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.player-dialog {
  display: grid;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #050607;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  grid-template-rows: 64px minmax(560px, 72dvh);
}

.player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #171a1f;
}

.player-header h2 {
  min-width: 0;
  flex: 1;
  margin: 0;
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-close {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 2rem;
  text-decoration: none;
}

.player-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.player-frame {
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

.game-detail-layout {
  display: grid;
  align-items: start;
  gap: 40px;
  margin-top: 56px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
}

.game-guide {
  display: grid;
  gap: 34px;
}

.game-guide h2,
.game-facts h2,
.related-games h2 {
  margin: 0 0 14px;
  font-size: 1.55rem;
}

.game-guide p,
.game-guide li,
.game-facts p,
.related-games p {
  color: #d7dbe3;
  line-height: 1.75;
}

.game-guide p {
  margin: 0 0 14px;
}

.game-guide li + li {
  margin-top: 10px;
}

.game-facts {
  position: sticky;
  top: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.game-facts dl {
  margin: 0;
}

.game-facts dl div {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.game-facts dt {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.game-facts dd {
  margin: 0;
}

.game-facts h3 {
  margin: 24px 0 8px;
}

.game-source-note {
  font-size: 0.8rem;
}

.related-games {
  margin-top: 56px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}

.related-games > div {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-games > div a {
  display: grid;
  min-height: 96px;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: #fff;
  text-decoration: none;
}

.related-games small {
  color: var(--muted);
}

.game-detail-footer {
  justify-content: center;
  border-top: 1px solid var(--border);
  border-bottom: 0;
  color: var(--muted);
}

.game-detail-footer a {
  min-height: 44px;
  align-content: center;
}

a:focus-visible {
  outline: 3px solid #ff8f99;
  outline-offset: 3px;
}

@view-transition {
  navigation: auto;
}

@media (max-width: 800px) {
  .game-site-header nav {
    display: none;
  }

  .game-detail-page {
    width: min(100% - 28px, 720px);
    padding-top: 16px;
  }

  .game-detail-hero {
    padding: 26px 0 22px;
  }

  .player-dialog {
    grid-template-rows: 58px minmax(420px, 68dvh);
  }

  .player-header {
    padding: 7px 8px;
  }

  .game-detail-layout {
    gap: 36px;
    margin-top: 40px;
    grid-template-columns: 1fr;
  }

  .game-facts {
    position: static;
  }

  .related-games > div {
    grid-template-columns: 1fr;
  }

  .game-detail-footer {
    flex-wrap: wrap;
    gap: 8px 18px;
  }
}

@media (max-width: 480px) {
  .game-detail-page {
    width: 100%;
  }

  .game-breadcrumbs,
  .game-detail-hero,
  .game-guide,
  .game-facts,
  .related-games {
    margin-right: 14px;
    margin-left: 14px;
  }

  .player-dialog {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    grid-template-rows: 56px minmax(360px, 62dvh);
  }
}
