:root {
  color-scheme: light;
  --page: #f8f8f2;
  --white: #fff;
  --ink: #201b2b;
  --muted: #6a6571;
  --line: #e9e7e3;
  --purple: #5135da;
  --lime: #def74e;
  --sidebar: 218px;
  --header: 76px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
  accent-color: var(--purple);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
html { min-width: 300px; scroll-padding-top: calc(var(--header) + 18px); }
body { margin: 0; }
button, input { font: inherit; }
button { color: inherit; }
button:not(:disabled) { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #7352f1; outline-offset: 4px; }
[hidden] { display: none !important; }
html:not(.interactive) [data-interactive] { display: none; }
.player:not([data-loaded]) [data-game-control] { display: none; }
.icon { display: block; width: 21px; height: 21px; flex: none; }
.skip-link { position: fixed; left: 10px; top: -100px; z-index: 5; padding: 10px 16px; border-radius: 10px; background: var(--lime); }
.skip-link:focus { top: 10px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(100px, 460px) auto;
  align-items: center;
  gap: 0 24px;
  height: var(--header);
  padding: 0 30px 0 25px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.brand { display: inline-flex; align-items: center; width: fit-content; gap: 11px; font-weight: 900; font-size: 1.88rem; letter-spacing: -.08em; line-height: 1; }
.brand-period { color: var(--purple); }
.brand-mark { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-content: center; grid-template-columns: repeat(2, 8px); gap: 3px; border-radius: 11px; background: var(--lime); }
.brand-mark i { width: 8px; height: 8px; border-radius: 1px; background: var(--ink); }
.brand-mark i:last-child { transform: rotate(15deg) scale(.85); }
.search { display: flex; height: 45px; align-items: center; gap: 11px; padding: 0 12px 0 14px; border: 1px solid #eceae7; border-radius: 12px; background: #f6f5f3; color: var(--muted); }
.search:focus-within { border-color: #b0a1fa; background: #fcfbff; }
.search input { width: 100%; min-width: 0; border: 0; padding: 0; outline: 0; background: transparent; color: var(--ink); }
.search input:focus-visible { outline: 0; }
.search input::placeholder { color: #68636d; }
.search-shortcut { min-width: 24px; text-align: center; color: #655d70; background: var(--white); border: 1px solid #eae7e2; border-radius: 5px; font-size: .86rem; line-height: 23px; }
.button { display: inline-flex; min-height: 44px; gap: 9px; align-items: center; justify-content: center; padding: 0 15px; border: 1px solid transparent; border-radius: 11px; font-size: .93rem; font-weight: 750; }
.shuffle { justify-self: end; border-color: #e8e4f4; background: #f4f0ff; color: #4b31c0; }
.shuffle:hover { background: #e9e1ff; }

.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: calc(100vh - var(--header)); }
.sidebar { border-right: 1px solid var(--line); background: #fff; }
.navigation { position: sticky; top: calc(var(--header) + 16px); display: grid; gap: 5px; padding: 9px 13px 15px; margin-top: 16px; }
.navigation a { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 12px; border-radius: 10px; font-size: .93rem; font-weight: 690; color: #585261; }
.navigation a:hover { background: #f6f3ff; color: #4c31c4; }
.navigation a[aria-current="page"] { color: #4428bc; background: #eee8ff; }
.content { width: 100%; max-width: 1580px; min-width: 0; padding: 34px clamp(24px, 3.1vw, 54px) 55px; margin-inline: auto; outline: 0; }

.hero { position: relative; display: grid; align-items: center; isolation: isolate; min-height: clamp(350px, 32vw, 475px); overflow: hidden; border-radius: 24px; background: #3425c9 url('assets/blocks-hero.jpg') 66% center / cover no-repeat; color: white; }
.hero::before { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(90deg, #2420a7ed, #2c1ca6a6 34%, transparent 66%); }
.hero-inner { max-width: 580px; padding: 35px clamp(22px, 4.25vw, 68px); }
.hero-tag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #ffffff54; border-radius: 7px; background: #2f22998a; font-size: .78rem; font-weight: 780; letter-spacing: .07em; text-transform: uppercase; }
.hero-tag .icon { width: 15px; height: 15px; color: #f1ff93; }
.hero h2 { margin: 13px 0 10px; font-size: clamp(3rem, 6.05vw, 6.35rem); font-weight: 900; line-height: .94; letter-spacing: -.07em; }
.hero p { max-width: 28ch; margin: 17px 0 23px; color: #f2efff; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.45; }
.primary { background: var(--lime); color: #221e26; border-color: transparent; }
.primary:hover { background: #eafa80; }
.hero .primary { min-height: 50px; padding-inline: 18px 23px; font-size: 1rem; }

.catalog { margin-top: 34px; }
.catalog.is-first { margin-top: 3px; }
.catalog-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 13px 20px; margin-bottom: 17px; }
.catalog-toolbar h2, .catalog-toolbar h1 { margin: 0; font-size: clamp(1.6rem, 3.2vw, 2.35rem); font-weight: 870; line-height: 1.12; letter-spacing: -.055em; }
.catalog-intro { max-width: 65ch; margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.filters { display: flex; flex-wrap: wrap; gap: 7px; }
.filter { display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 7px 13px; border: 1px solid #e4e1dd; border-radius: 40px; background: white; color: #514b5a; font-size: .88rem; font-weight: 690; }
.filter:hover { border-color: #ae9bf8; color: #4c31c4; }
.filter[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: white; }
.game-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.game-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid #eae7e2; border-radius: 15px; background: white; transition: transform .18s ease, box-shadow .18s ease; }
.game-card:hover, .game-card:focus-within { transform: translateY(-3px); box-shadow: 0 10px 24px #26213a14; }
.game-link { display: block; }
.game-link:focus-visible { outline-offset: -4px; }
.cover { position: relative; display: block; aspect-ratio: 1.49; overflow: hidden; background: var(--cover-bg); }
.cover-art { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.game-card:hover .cover-art { transform: scale(1.05); }
.game-card-body { position: relative; display: grid; min-height: 70px; align-content: center; padding: 10px 39px 11px 12px; }
.game-card-title { margin: 0 0 4px; font-size: clamp(.93rem, 1.23vw, 1.12rem); font-weight: 830; letter-spacing: -.03em; }
.game-category { display: flex; align-items: center; gap: 6px; color: #655e6e; font-size: .83rem; font-weight: 560; }
.game-category::before { width: 7px; height: 7px; border-radius: 2px; background: var(--genre-color); content: ""; }
.card-play { position: absolute; top: 50%; right: 9px; transform: translateY(-50%); display: grid; width: 29px; height: 29px; place-items: center; border-radius: 50%; background: #f0edf6; color: #5339c3; }
.card-play .icon { width: 15px; height: 15px; }
.favorite-button { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 1px solid #e8e4eb; border-radius: 11px; background: #fff; color: #463956; }
.favorite-button:hover { background: #f3eaff; }
.favorite-button[aria-pressed="true"] { color: #b63771; }
.favorite-button[aria-pressed="true"] svg { fill: #ef729c; }
.game-card .favorite-button { position: absolute; top: 8px; right: 8px; width: 33px; height: 33px; border: 0; border-radius: 10px; background: #fffffff0; box-shadow: 0 3px 10px #211e322d; }
.game-card .favorite-button .icon { width: 17px; height: 17px; }
.empty { display: grid; justify-items: start; gap: 11px; padding: 28px; border: 1px dashed #ddd8e4; border-radius: 15px; background: #fff; }
.empty p { margin: 0; color: var(--muted); }
.site-footer { margin-top: 35px; padding-top: 14px; border-top: 1px solid var(--line); color: #716a77; font-size: .85rem; }

.game-page { max-width: 1090px; margin-inline: auto; }
.breadcrumbs { margin-bottom: 12px; color: var(--muted); font-size: .9rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 5px 8px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { margin-right: 8px; content: "/" / ""; }
.breadcrumbs a { color: #4a34b7; font-weight: 650; }
.breadcrumbs a:hover { text-decoration: underline; }
.related-games { margin-top: 28px; }
.related-games > h2 { font-size: 1.4rem; }
.game-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 16px; }
.game-heading h1 { margin: 0; font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 880; letter-spacing: -.065em; line-height: 1; }
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 16px; align-items: start; }
.player { min-width: 0; overflow: hidden; border: 1px solid #e7e2ee; border-radius: 17px; background: white; }
.player-toolbar { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 9px; padding: 7px 10px 7px 13px; }
.counters { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.counter { display: grid; gap: 2px; align-content: center; line-height: 1.12; }
.counter span { color: #6a6175; font-size: .75rem; font-weight: 650; }
.counter strong { font-variant-numeric: tabular-nums; font-size: 1.06rem; }
.tools { display: flex; gap: 5px; }
.tool-button { display: grid; width: 39px; min-height: 40px; place-items: center; padding: 0; border: 1px solid #eee9f4; border-radius: 9px; background: #f8f5ff; color: #463399; }
.tool-button:hover:not(:disabled) { background: #eae0ff; }
.tool-button:disabled { opacity: .42; }
.tool-button .icon { width: 18px; height: 18px; }
.stage { position: relative; display: grid; justify-items: center; overflow: hidden; background: #15132a; }
.stage canvas { display: block; width: 100%; background: #15132a; touch-action: none; }
.stage canvas:focus-visible { outline: 3px solid #b3a3ff; outline-offset: -4px; }
.game-overlay { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 15px; color: white; background: #121124bc; text-align: center; }
.game-overlay h2 { max-width: 23ch; margin: 0; font-size: clamp(1.4rem, 3.6vw, 2.65rem); font-weight: 850; line-height: 1.05; letter-spacing: -.045em; }
.game-overlay p { max-width: 28ch; margin: 0; color: #e6def8; font-size: .9rem; }
.game-overlay .button { margin-top: 3px; }
.touch-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 9px; background: #faf8ff; }
.touch-controls button { display: inline-flex; gap: 5px; align-items: center; justify-content: center; min-width: 46px; min-height: 44px; padding: 0 8px; border: 1px solid #e1d9f2; border-radius: 9px; background: white; color: #463399; font-size: .83rem; font-weight: 730; touch-action: none; }
.touch-controls button:active { background: #e6dafa; }
.game-details { padding: 17px 16px 19px; border: 1px solid #e8e3ed; border-radius: 16px; background: white; }
.game-details h2 { margin: 0 0 8px; font-size: 1.12rem; letter-spacing: -.02em; }
.game-details p { margin: 0 0 17px; color: #584f64; line-height: 1.5; }
.game-details dl { display: grid; gap: 9px; margin: 0; }
.game-details dl div { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px; }
.game-details dt, .game-details kbd { font-size: .84rem; font-weight: 700; }
.game-details kbd { display: inline-block; min-width: 23px; padding: 3px 6px; border: 1px solid #e9e1f4; border-radius: 5px; background: #f6f0ff; color: #5035ab; text-align: center; }
.game-details dd { margin: 0; color: #645b6e; font-size: .88rem; }
.player:fullscreen { display: flex; flex-direction: column; justify-content: center; width: 100%; height: 100%; border: 0; border-radius: 0; background: #141223; }
.player:fullscreen .stage { display: flex; min-height: 0; flex: 1; align-items: center; justify-content: center; }
.player:fullscreen .stage canvas { width: auto; max-width: 100%; height: auto; max-height: 100%; object-fit: contain; }
.player:fullscreen .player-toolbar, .player:fullscreen .touch-controls { background: white; }

@media (max-width: 1180px) {
  :root { --sidebar: 185px; }
  .topbar { gap: 0 15px; padding-inline: 20px; }
  .game-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .player-layout { grid-template-columns: minmax(0, 1fr) 205px; }
}
@media (max-width: 940px) {
  :root { --sidebar: 160px; }
  .navigation { padding-inline: 8px; }
  .navigation a { padding-inline: 8px; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .player-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 740px) {
  :root { --header: 65px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 12px; padding-inline: 14px; }
  .brand { font-size: 1.55rem; gap: 6px; }
  .brand-mark { width: 31px; height: 31px; flex-basis: 31px; border-radius: 9px; }
  .search { height: 40px; gap: 5px; padding-inline: 8px; }
  .search-shortcut, .shuffle > span:last-child { display: none; }
  .shuffle { width: 42px; min-height: 42px; padding: 0; }
  .shell { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .navigation { position: static; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0; padding: 6px 8px; }
  .navigation a { display: grid; place-content: center; justify-items: center; gap: 4px; min-height: 47px; padding: 4px 1px; white-space: nowrap; font-size: clamp(.65rem, 2.8vw, .84rem); }
  .navigation .icon { width: 17px; height: 17px; }
  .content { padding: 17px 14px 35px; }
  .hero { min-height: 345px; align-items: end; border-radius: 17px; background-size: auto 73%; background-position: 81% 0; }
  .hero::before { background: linear-gradient(0deg, #2d20ac 12%, #2d20acdd 36%, #2d20ac22 70%, transparent 90%); }
  .hero-inner { padding: 17px 19px 20px; }
  .hero h2 { margin: 9px 0; font-size: clamp(2.45rem, 8vw, 4.2rem); }
  .hero h2 br { display: none; }
  .hero-tag { font-size: .68rem; }
  .hero p { margin: 8px 0 13px; }
  .hero .primary { min-height: 44px; }
  .catalog { margin-top: 25px; }
  .game-grid { gap: 9px; }
  .game-card { border-radius: 11px; }
  .game-card-body { min-height: 61px; padding-left: 8px; padding-right: 30px; }
  .game-card .favorite-button { top: 5px; right: 5px; width: 34px; height: 34px; }
  .card-play { right: 6px; width: 24px; height: 24px; }
}
@media (max-width: 520px) {
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-heading { margin-bottom: 10px; }
  .player-toolbar { padding-inline: 7px; }
  .counters { gap: 5px 10px; }
  .tools { gap: 3px; }
  .tool-button { min-width: 33px; width: 33px; min-height: 35px; }
  .tool-button .icon { width: 16px; height: 16px; }
  .touch-controls { display: grid; grid-template-columns: repeat(var(--control-count), minmax(0, 1fr)); gap: 4px; padding: 7px; }
  .touch-controls button { display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 0; min-height: 45px; padding: 3px 1px; font-size: .69rem; }
  .touch-controls .icon { width: 17px; height: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
