/* Generated from Designs/design-assets (selected A2 direction) with mockup-only rules removed. */

@font-face {
  font-family: Manrope;
  src: url("../fonts/manrope-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-00FF;
}

@font-face {
  font-family: Manrope;
  src: url("../fonts/manrope-cyrillic-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Manrope;
  src: url("../fonts/manrope-latin-800-normal.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
  unicode-range: U+0000-00FF;
}

@font-face {
  font-family: Manrope;
  src: url("../fonts/manrope-cyrillic-800-normal.woff2") format("woff2");
  font-weight: 600 900;
  font-display: swap;
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

* {
  box-sizing: border-box;
}

button,
input,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
input {
  font: inherit;
}

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  color: inherit;
}

button:disabled {
  cursor: default;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #e78c40;
  outline-offset: 4px;
}

button {
  border: 0;
}

svg {
  display: block;
}

img {
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

a,
button,
input {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-flex;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.space {
  justify-content: space-between;
}

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

.eyebrow {
  font-size: var(--fs-xs);
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 1.7px;
  text-transform: uppercase;
}

.art {
  overflow: hidden;
  position: relative;
}

.art > svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-weight: 800;
  font-size: var(--fs-base);
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent, #151713);
  transition: transform 0.18s;
}

.primary:hover {
  transform: translateY(-2px);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--fs-sm);
  font-weight: 800;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: none;
  color: inherit;
  font-size: var(--fs-md);
}

.search input::placeholder {
  color: var(--muted);
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  font-size: var(--fs-xl);
  line-height: 1.3;
  letter-spacing: -0.5px;
}

.chip {
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 10px 16px;
  font-size: var(--fs-md);
  white-space: nowrap;
  background: transparent;
  font-weight: 800;
}

.chips {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.game-card {
  min-width: 0;
  position: relative;
}

.game-open {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0;
  background: transparent;
}

.game-open .art {
  aspect-ratio: 4/3;
  border-radius: var(--card-radius, 14px);
  transition: transform 0.22s;
}

.game-open:hover .art {
  transform: translateY(-4px);
}

.game-title {
  display: block;
  font-size: var(--fs-base);
  line-height: 1.3;
  font-weight: 800;
  margin-top: 12px;
}

.game-meta {
  display: block;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--muted);
  margin-top: 5px;
}

.game-card .favorite {
  position: absolute;
  /* Above the hover preview video so it stays clickable while a clip plays. */
  z-index: 2;
  right: 9px;
  top: 9px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffffde;
  color: #243d35;
  opacity: 0;
  transition: opacity 0.2s;
}

.game-card:hover .favorite,
.favorite:focus-visible,
.favorite[aria-pressed="true"] {
  opacity: 1;
}

.favorite[aria-pressed="true"] {
  background: #ffe69a;
  color: #a65624;
}

.favorite .icon {
  width: 15px;
  height: 15px;
}

.badge {
  position: absolute;
  /* Above the hover preview video, which covers the whole art area. */
  z-index: 1;
  top: 11px;
  left: 11px;
  font-size: var(--fs-xs);
  line-height: 1.2;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 6px;
  background: #fff;
  color: #28372f;
  letter-spacing: 0.5px;
}

.empty-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
  grid-column: 1/-1;
  font-size: var(--fs-base);
  line-height: 1.6;
  max-width: 64ch;
  margin-inline: auto;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--muted);
  padding: 30px 0 90px;
  margin-top: 35px;
  border-top: 1px solid var(--line);
}

.page-footer nav {
  display: flex;
  gap: 22px;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  max-width: calc(100% - 24px);
  padding: 14px 20px;
  background: #213b32;
  color: #fff;
  box-shadow: 0 5px 30px #0003;
  border-radius: 12px;
  font-size: var(--fs-base);
  text-align: center;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 12px;
  background: #fff;
  color: #111;
}

.skip:focus {
  top: 10px;
}

@media (hover: none) {
  .game-card .favorite {
      opacity: 1;
    }
}

@media (max-width: 600px) {
  .page-footer {
      flex-direction: column;
      gap: 18px;
    }

  .game-title {
      font-size: var(--fs-md);
    }

  .chip {
      min-height: 44px;
    }

  .text-link,
  .page-footer nav a {
      display: inline-flex;
      align-items: center;
      min-height: 44px;
    }

  .game-card .favorite {
      width: 40px;
      height: 40px;
    }

  .game-card .favorite .icon {
      width: 18px;
      height: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
      scroll-behavior: auto !important;
      transition: none !important;
      animation: none !important;
    }
}

/* ---------------------------------------------------------------------------
   PlayTree additions: theme tokens and rules for server-rendered content that
   the design mockup produced with JavaScript (covers are real images now).
   --------------------------------------------------------------------------- */

:root {
  --accent: #6c8fff;
  --on-accent: #101a33; /* dark text on the periwinkle accent: 5.8:1, white was 3:1 */
  --muted: #92a3bf;
  --line: #2a364c;
  --card-radius: 12px;

  /* Type scale. Every font-size in the public stylesheets comes from these tokens;
     --fs-xs is the floor, so no text renders below 12px. */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 15px;
  --fs-base: 16px;
  --fs-lg: 18px;
  --fs-xl: 22px;
  --fs-2xl: 28px;
  --fs-3xl: clamp(32px, 8vw, 44px);
  color-scheme: dark;
}

body {
  margin: 0;
  font-family: Manrope, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #141b2b;
  color: #f0f4ff;
  font-size: var(--fs-base);
  line-height: 1.5;
}

/* Covers are real images; the mockup inlined SVG art. Small avatars keep their own dimensions. */
.art > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

img.art {
  display: block;
  object-fit: cover;
}

/* Hover preview: it sits on top of the cover and only fades in once card-preview.js starts playback. */
.art .preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.game-card.is-previewing .art .preview {
  opacity: 1;
}

.tile-play {
  position: absolute;
  right: 12px;
  bottom: 14px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #2b3c55;
  color: #7391bd;
  pointer-events: none;
}

.tile-play svg {
  width: 12px;
  height: 12px;
}

.game-card:hover .tile-play {
  background: var(--accent);
  color: var(--on-accent);
}

.not-found {
  max-width: 560px;
  padding-top: 60px;
}

.not-found .eyebrow {
  color: #7f95b6;
  margin-bottom: 14px;
}

.not-found h1 {
  font-size: var(--fs-2xl);
  letter-spacing: -0.8px;
  margin-bottom: 14px;
}

.not-found p {
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.6;
  max-width: 64ch;
  margin-bottom: 26px;
}

.not-found .primary {
  background: var(--accent);
  color: var(--on-accent);
}

/* ---------------------------------------------------------------------------
   Site navigation: the same brand and menu on every public page. Pages wrap the
   _SiteNavigation partial in <aside class="site-nav">, which is the left column
   on wide screens and a horizontal strip under the page header on phones.
   --------------------------------------------------------------------------- */

.site-nav {
  background: #101725;
  border-right: 1px solid #263147;
  padding: 29px 15px;
  display: flex;
  flex-direction: column;
  gap: 31px;
}

.brand {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: -1.6px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 10px;
  transform: rotate(-8deg);
  background: #7594ff;
  color: #fff;
  box-shadow: 0 5px 17px #4369ed30;
}

.brand-mark .icon {
  width: 23px;
  height: 23px;
}

.site-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.site-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 11px 12px;
  border-radius: 9px;
  font-size: var(--fs-md);
  color: #97a4bf;
}

.site-menu a:hover {
  background: #202d46;
  color: #e9f0ff;
}

.site-menu a.active {
  background: #25334f;
  color: #9eb6ff;
}

.site-menu-label {
  font-size: var(--fs-xs);
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #8494b0;
  margin: 10px 12px 6px;
}

/* The column is 196px wide here, so the menu rows give the labels more room. */
@media (max-width: 1100px) {
  .site-nav {
    padding: 26px 12px;
    gap: 26px;
  }

  .brand-mark {
    width: 29px;
    height: 29px;
  }

  .site-menu a {
    gap: 9px;
    padding: 11px 9px;
  }

  .site-menu a .icon {
    width: 18px;
    height: 18px;
  }

  .site-menu-label {
    margin: 8px 9px 5px;
  }
}

@media (max-width: 760px) {
  /* Phones keep the whole menu: a horizontal scroller, never a hidden sidebar. */
  .site-nav {
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid #263147;
  }

  .site-nav .brand {
    display: none; /* the page header carries the brand at this width */
  }

  .site-menu {
    flex-direction: row;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .site-menu::-webkit-scrollbar {
    display: none;
  }

  .site-menu a {
    flex: 0 0 auto;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 30px;
    background: #1b2740;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  .site-menu a.active {
    background: #2d3f63;
  }

  .site-menu-label {
    display: none;
  }
}
/* Shared leaderboard page and host dialog. Scores are text, never game-provided markup. */
.leaderboard-page {
    width: min(900px, calc(100% - 32px));
    margin: 32px auto;
}

.leaderboard-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin: 24px 0;
}

.leaderboard-filters label {
    display: grid;
    gap: 8px;
}

.leaderboard-page input,
.leaderboard-page select,
.leaderboard-page button,
.leaderboard-dialog button {
    min-height: 44px;
    padding: 8px 16px;
    font: inherit;
    border-radius: 12px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #687083;
}

.leaderboard-table .is-me {
    font-weight: 800;
}

.leaderboard-dialog {
    width: min(540px, calc(100% - 32px));
    max-height: 80dvh;
    overflow: auto;
    padding: 24px;
    border: 1px solid #687083;
    border-radius: 20px;
    background: #18202d;
    color: #f4f5f8;
    font-size: var(--fs-base, 16px);
}

.leaderboard-dialog::backdrop {
    background: #0009;
}

.leaderboard-dialog ol {
    padding: 0;
    list-style: none;
}

.leaderboard-dialog li {
    padding: 8px 0;
}
