/* IFrostGames — общий стиль сайта.
   Тема «морозная ночь»: тёмно-синий фон, ледяные акценты, жёлтые кнопки «Играть».
   У каждой игры свой цвет: он задаётся переменной --c на карточке или странице. */

:root {
  color-scheme: dark;
  --bg: #0a0f24;
  --bg-2: #0f1733;
  --card: #141d40;
  --card-2: #1a2550;
  --line: #26336a;
  --ink: #eef3ff;
  --muted: #a3b0dc;
  --ice: #7ce4ff;
  --ice-2: #4c7dff;
  --cta: #ffd23f;
  --cta-ink: #221a00;

  --c-sprunki: #c27bff;
  --c-brainrot: #43e39a;
  --c-slap: #ff7a45;
  --c-rhythm: #ffd23f;

  --f-display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --f-body: "Rubik", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r: 20px;
  --r-sm: 12px;
  --wrap: 1160px;
  --gutter: 16px;
  --c: var(--ice);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(124, 228, 255, 0.12), transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 10%, rgba(76, 125, 255, 0.14), transparent 70%),
    radial-gradient(circle at 20px 20px, rgba(255, 255, 255, 0.07) 1.2px, transparent 1.6px),
    radial-gradient(circle at 70px 55px, rgba(255, 255, 255, 0.05) 1px, transparent 1.4px);
  background-size: 100% 900px, 100% 900px, 90px 90px, 90px 90px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--ice); }
a:hover { color: #b5f6ff; }
:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

main { flex: 1; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--cta); color: var(--cta-ink);
  padding: 8px 14px; border-radius: 999px; z-index: 100; font-weight: 600;
}
.skip:focus { left: 16px; }

/* ---------- шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 15, 36, 0.82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(38, 51, 106, 0.7);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 40px; height: 40px; }
.brand-name { display: grid; line-height: 1; }
.brand-name b {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
}
.brand-name small {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 9.5px;
  letter-spacing: 0.42em;
  color: var(--ice);
  margin-top: 4px;
}
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  padding: 8px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a:hover { color: var(--ink); background: var(--card); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--card-2); }

/* ---------- кнопки ---------- */
.btn {
  --b: var(--cta);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 16px;
  line-height: 1.1;
  text-decoration: none;
  color: var(--cta-ink);
  background: var(--b);
  border: 0;
  border-radius: 999px;
  padding: 15px 26px;
  cursor: pointer;
  box-shadow: 0 6px 0 color-mix(in srgb, var(--b) 55%, #000), 0 10px 28px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
  text-align: center;
}
.btn:hover { color: var(--cta-ink); filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--b) 55%, #000), 0 4px 12px rgba(0, 0, 0, 0.3); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--sm { font-size: 14px; padding: 11px 18px; box-shadow: 0 4px 0 color-mix(in srgb, var(--b) 55%, #000); }
.btn--sm:active { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--b) 55%, #000); }
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: none;
  font-family: var(--f-body);
  font-weight: 600;
}
.btn--ghost:hover { color: var(--ink); border-color: var(--muted); background: var(--card); }
.btn--ghost:active { transform: translateY(1px); box-shadow: none; }
.btn--ice { --b: var(--ice); color: #04202b; }
.btn--ice:hover { color: #04202b; }

/* ---------- общие блоки ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ice);
}
.eyebrow::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #43e39a;
  box-shadow: 0 0 0 4px rgba(67, 227, 154, 0.2);
}

h1, h2, h3 { font-family: var(--f-display); line-height: 1.12; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(30px, 6vw, 56px); }
h2 { font-weight: 800; font-size: clamp(24px, 3.6vw, 34px); }
h3 { font-weight: 600; font-size: 18px; }

.section { padding: 56px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head p { margin: 8px 0 0; color: var(--muted); max-width: 60ch; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tags li {
  font-size: 12.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: color-mix(in srgb, var(--c) 70%, #fff);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
}

/* ---------- главная: первый экран ---------- */
.hero { padding: 48px 0 24px; }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 40px;
  align-items: center;
}
.hero-text { display: grid; gap: 18px; justify-items: start; }
.hero h1 .ice {
  background: linear-gradient(90deg, #b5f6ff, #5fd6ff 45%, #6f8bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero .lead { font-size: 18px; color: var(--muted); margin: 0; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.hero-perks { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; padding: 0; margin: 4px 0 0; color: var(--muted); font-size: 14.5px; }
.hero-perks li { display: inline-flex; align-items: center; gap: 8px; }
.hero-perks svg { width: 18px; height: 18px; color: var(--ice); }

.collage { position: relative; aspect-ratio: 5 / 4; }
.collage img {
  position: absolute;
  width: 68%;
  height: auto;
  border-radius: var(--r);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.collage img:nth-child(1) { left: 0; top: 4%; transform: rotate(-6deg); }
.collage img:nth-child(2) { right: 0; top: 22%; transform: rotate(5deg); z-index: 1; }
.collage img:nth-child(3) { left: 12%; bottom: 0; transform: rotate(-2deg); z-index: 2; }
.collage .mark {
  position: absolute; z-index: 3;
  right: 6%; bottom: 4%;
  width: 22%;
  aspect-ratio: 1;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  filter: drop-shadow(0 10px 24px rgba(76, 125, 255, 0.55));
}

/* ---------- карточки игр ---------- */
.games {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.game-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--c) 70%, var(--line));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px color-mix(in srgb, var(--c) 40%, transparent);
}
.game-card__cover { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--card-2); }
.game-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card__body { display: flex; flex-direction: column; gap: 12px; padding: 18px 18px 20px; flex: 1; }
.game-card h3 { font-size: 17px; }
.game-card h3 a { color: var(--ink); text-decoration: none; }
.game-card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.game-card p { margin: 0; color: var(--muted); font-size: 14.5px; flex: 1; }
.game-card__actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 2; }
.game-card .platform { font-size: 12.5px; color: var(--muted); position: relative; z-index: 2; }

/* широкая карточка мини-игры */
.feature {
  --c: var(--c-rhythm);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(120deg, #0f2229, #163039);
  border: 1px solid #2a4b55;
  border-radius: var(--r);
  overflow: hidden;
}
.feature__cover img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 16 / 9; }
.feature__body { display: grid; gap: 14px; align-content: center; justify-items: start; padding: 28px; }
.feature__body p { margin: 0; color: #b9d3cf; }
.feature__actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* разработчик */
.dev {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  background: linear-gradient(135deg, rgba(124, 228, 255, 0.08), rgba(76, 125, 255, 0.06));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
}
.dev img { width: 120px; height: 120px; filter: drop-shadow(0 12px 30px rgba(76, 125, 255, 0.45)); }
.dev p { margin: 8px 0 0; color: var(--muted); max-width: 64ch; }

/* ---------- страница игры ---------- */
.crumbs { padding-top: 22px; font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.crumbs a:hover { color: var(--ink); }

.game-hero { padding: 18px 0 8px; }
.game-hero .wrap {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 36px;
  align-items: center;
}
.game-cover {
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--c) 45%, var(--line));
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45), 0 0 80px color-mix(in srgb, var(--c) 18%, transparent);
  aspect-ratio: 16 / 9;
  background: var(--card-2);
}
.game-cover img { width: 100%; height: 100%; object-fit: cover; }
.game-info { display: grid; gap: 16px; justify-items: start; }
.game-info h1 { font-size: clamp(26px, 4.2vw, 40px); }
.game-info .lead { margin: 0; font-size: 17.5px; color: var(--muted); }
.play-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 4px; }
.play-row .btn { font-size: 18px; padding: 17px 30px; }
.play-note { font-size: 13.5px; color: var(--muted); margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.play-note span { display: inline-flex; align-items: center; gap: 6px; }
.play-note span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

.test-link {
  display: grid;
  gap: 2px;
  font-size: 14px;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--muted);
}
.test-link a { font-weight: 600; }

.share {
  appearance: none;
  background: none;
  border: 0;
  color: var(--muted);
  font: 500 14px var(--f-body);
  padding: 8px 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.share:hover { color: var(--ink); }
.share svg { width: 18px; height: 18px; }

.about {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
}
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 26px;
}
.panel > h2 { font-size: 22px; margin-bottom: 14px; }
.prose p { margin: 0 0 14px; color: #ccd5f3; }
.prose p:last-child { margin-bottom: 0; }

.features { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.features li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.features .ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-size: 20px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}
.features b { color: var(--ink); font-weight: 600; }
.features span { color: #ccd5f3; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; color: #ccd5f3; }
.steps li::before {
  counter-increment: step;
  content: counter(step);
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 15px;
  color: var(--cta-ink);
  background: var(--c);
}
.steps b { color: var(--ink); }

.more .games { grid-template-columns: repeat(3, 1fr); }

/* ---------- страница «Создай ритм!»: скачивание ---------- */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.pack {
  display: grid;
  gap: 8px;
  align-content: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}
.pack h3 { font-size: 16px; }
.pack p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.pack .btn { justify-self: start; }
.pack--all { background: linear-gradient(135deg, rgba(255, 210, 63, 0.14), rgba(255, 210, 63, 0.04)); border-color: rgba(255, 210, 63, 0.45); }

.cat { margin-top: 30px; }
.cat h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c);
  margin-bottom: 12px;
}
.cat h3 small { font: 400 13.5px var(--f-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.tracks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.track {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.track.playing { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); }
.track-play {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 25%, var(--card-2));
  color: var(--ink);
}
.track-play:hover { background: color-mix(in srgb, var(--c) 45%, var(--card-2)); }
.track.playing .track-play { background: var(--c); color: #111; }
.track-play svg { width: 18px; height: 18px; }
.track-meta { display: grid; min-width: 0; }
.track-name { font-weight: 600; font-size: 15px; line-height: 1.3; }
.track-desc { font-size: 13px; color: var(--muted); line-height: 1.35; }
.track-file { font-size: 12px; color: color-mix(in srgb, var(--muted) 70%, transparent); font-variant-numeric: tabular-nums; }
.track-dl {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}
.track-dl:hover { color: var(--ink); border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.track-dl svg { width: 16px; height: 16px; }

.callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: var(--r);
  background: rgba(124, 228, 255, 0.07);
  border: 1px solid rgba(124, 228, 255, 0.3);
  color: #ccd5f3;
}
.callout svg { width: 28px; height: 28px; color: var(--ice); }
.callout p { margin: 0; }

/* ---------- подвал ---------- */
.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: rgba(10, 15, 36, 0.6); }
.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 26px;
  padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  color: var(--muted);
  font-size: 14px;
}
.site-footer nav { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer nav a { color: var(--muted); text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- планшеты ---------- */
@media (max-width: 980px) {
  .games, .more .games { grid-template-columns: repeat(2, 1fr); }
  .hero .wrap, .game-hero .wrap { grid-template-columns: 1fr; gap: 28px; }
  .collage { max-width: 560px; width: 100%; justify-self: center; }
  .about { grid-template-columns: 1fr; }
  .feature { grid-template-columns: 1fr; }
  .packs { grid-template-columns: 1fr; }
  .tracks { grid-template-columns: 1fr; }
}

/* ---------- телефоны ---------- */
@media (max-width: 640px) {
  body { font-size: 15.5px; }
  .site-header .wrap { min-height: 60px; gap: 8px; }
  .brand img { width: 34px; height: 34px; }
  .brand-name b { font-size: 16px; }
  .brand-name small { font-size: 8px; letter-spacing: 0.36em; }
  .nav a { font-size: 14px; padding: 7px 10px; }
  .nav .nav-dev { display: none; }
  .hero { padding-top: 28px; }
  .hero .lead { font-size: 16.5px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .section { padding-top: 40px; }
  .games, .more .games { grid-template-columns: 1fr; gap: 16px; }
  .game-card__actions .btn { flex: 1 1 auto; }
  .feature__body { padding: 20px; }
  .dev { grid-template-columns: 1fr; padding: 22px; gap: 16px; }
  .dev img { width: 84px; height: 84px; }
  .panel { padding: 20px; }
  .play-row .btn { flex: 1 1 100%; }
  .track { grid-template-columns: 42px 1fr; }
  .track-play { width: 42px; height: 42px; }
  .track-dl { grid-column: 1 / -1; justify-content: center; }
}
@media (max-width: 380px) {
  .brand-name small { display: none; }
  .nav a { padding: 7px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .game-card, .btn { transition: none; }
  .game-card:hover { transform: none; }
}
