/* css/style.css */
/* -----------------------------------------
   Reset + Base
------------------------------------------*/
@import url(https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700,800,900&display=swap);

/* The new CSS reset - v1.8.5 */
*:where(:not(html, iframe, canvas, img, svg, video, audio):not(svg *, symbol *)) { all: unset; display: revert; }
*, *::before, *::after { box-sizing: border-box; }
a, button { cursor: revert; }
ol, ul, menu { list-style: none; padding: 0; margin: 0; }
img { max-inline-size: 100%; max-block-size: 100%; display: block; }
table { border-collapse: collapse; }
input, textarea { -webkit-user-select: auto; }
textarea { white-space: revert; }
::-moz-placeholder { color: unset; }
::placeholder { color: unset; }
::marker { content: initial; }
:where([hidden]) { display: none; }
:where([contenteditable]:not([contenteditable=false])) { -moz-user-modify: read-write; -webkit-user-modify: read-write; overflow-wrap: break-word; -webkit-line-break: after-white-space; -webkit-user-select: auto; }
:where([draggable=true]) { -webkit-user-drag: element; }
:where(dialog:modal) { all: revert; }

/* -----------------------------------------
   Design Tokens
------------------------------------------*/
:root {
  --brand: #ffb400;
  --brand-2: #f4b73e;
  --surface: #ffffff;
  --text: #0b0b0d;
  --muted: #6b7280;
  --border: rgba(0,0,0,0.12);
  --radius: 12px;
  --shadow-1: 0 10px 30px rgba(0,0,0,0.10);
  --shadow-2: 0 10px 25px rgba(255, 180, 0, 0.25);
  --grad: radial-gradient(1200px 600px at 10% -10%, rgba(255,180,0,.25), transparent 60%), radial-gradient(800px 400px at 90% 10%, rgba(255,255,255,.12), transparent 60%), linear-gradient(180deg, #fff, #fafafa);
}

[data-theme="dark"] {
  --surface: #0d0e14;
  --text: #eef0f3;
  --muted: #a0a7b4;
  --border: rgba(255,255,255,0.12);
  --grad: radial-gradient(1200px 600px at 10% -10%, rgba(255,180,0,.08), transparent 60%), radial-gradient(800px 400px at 90% 10%, rgba(255,255,255,.06), transparent 60%), linear-gradient(180deg, #0d0e14, #0b0c12);
}

/* -----------------------------------------
   Base Typography & Layout
------------------------------------------*/
html, body { font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; font-weight: 400; color: var(--text); background: var(--grad); min-height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }
p { line-height: 1.6; color: var(--text); }
h1 { font-size: clamp(28px, 3.2vw + 8px, 40px); font-weight: 700; text-align: left; margin: 10px 0 16px; }
h2 { font-size: clamp(22px, 2.2vw + 6px, 30px); font-weight: 700; margin: 24px auto 12px; text-align: center; border-bottom: 2px solid var(--brand); max-width: fit-content; padding-bottom: 6px; }
h3 { font-size: clamp(18px, 1.6vw + 4px, 22px); font-weight: 600; margin: 14px 0; }
ol { list-style: decimal; padding-left: 22px; }
ul { padding-left: 22px; }
li { line-height: 1.6; }
ol li::marker, ul li::marker { color: var(--brand-2); }

/* Accessibility */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; background: var(--brand); color: #000; padding: 10px 14px; border-radius: 8px; z-index: 1000; }
.skip-link:focus { left: 12px; box-shadow: var(--shadow-2); }

/* Containers */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* -----------------------------------------
   Header / Nav with burger
------------------------------------------*/
.header { position: sticky; top: 0; left: 0; width: 100%; z-index: 60; backdrop-filter: saturate(120%) blur(10px); background: color-mix(in oklab, var(--surface) 92%, transparent); border-bottom: 1px solid var(--border); box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.header .container { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 14px 20px; }

.logo a { display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .5px; }

.nav { position: relative; }
.nav__list { display: flex; gap: 18px; list-style: none; padding: 0; margin: 0; }
.nav__item { list-style: none; }
.nav__link { color: var(--text); opacity: .85; transition: opacity .2s ease; position: relative; padding-bottom: 4px; text-decoration: none; }
.nav__link:hover { opacity: 1; color: var(--brand); }
.nav__link::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0%; background: var(--brand); transition: width .25s ease; }
.nav__link:hover::after, .nav__link:focus-visible::after { width: 100%; }

.auth { display: flex; gap: 10px; justify-self: end; }

/* Burger */
.burger { width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 10px; display: none; align-items: center; justify-content: center; background: transparent; }
.burger span { width: 20px; height: 2px; background: var(--text); display: block; border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.burger span + span { margin-top: 5px; }

.menu-open .burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Off-canvas nav for mobile */
@media (max-width: 992px) {
  .nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(80vw, 360px);
    background: var(--surface);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    transition: transform .25s ease;
    padding: 80px 24px 24px;
    box-shadow: -20px 0 50px rgba(0,0,0,.06);
  }
  .nav__list { flex-direction: column; gap: 16px; }
  body.menu-open .nav { transform: translateX(0); }
  .burger { display: inline-flex; }
  /* затемнение фона */
  body.menu-open::before {
    content: "";
    position: fixed; inset: 0;
    background: rgba(0,0,0,.35);
    backdrop-filter: blur(2px);
    z-index: 50;
  }
}

/* Buttons */
.btn { border-radius: var(--radius); display: inline-flex; justify-content: center; align-items: center; padding: 12px 18px; border: 1.5px solid transparent; transition: all .25s ease; font-weight: 600; }
.btn-1 { background: var(--brand); color: #000; box-shadow: var(--shadow-2); animation: glow 1.8s ease-in-out infinite; }
.btn-1:hover { transform: translateY(-1px); background: #000; color: var(--brand); }
.btn-2 { border: 1.5px solid var(--brand); color: var(--text); background: transparent; }
.btn-2:hover { background: var(--brand); color: #000; }
.btn-cta { background: #fff; color: #000; border: 1.5px solid #000; }
[data-theme="dark"] .btn-cta { background: #0f1116; color: var(--text); border-color: var(--brand); }
.btn-cta:hover { background: #000; color: var(--brand); }

/* Icon button */
.btn-icon { width: 44px; height: 44px; border: 1px solid var(--border); background: transparent; border-radius: var(--radius); }
.btn-icon:hover { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 25%, transparent); }

/* Moon icon */
.icon-moon {
  width: 18px; height: 18px; display: inline-block; border-radius: 50%;
  background: conic-gradient(from 180deg, #0000 0 50%, var(--text) 0);
  box-shadow: inset -5px 0 0 0 var(--text);
}

/* Sections / Banner */
.section { padding: 90px 0 60px; }
.banner {
  background: linear-gradient(135deg, var(--brand) 0%, #ffd36d 100%);
  position: relative; overflow: hidden; isolation: isolate;
}
.banner::after {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 600px; height: 600px;
  background: radial-gradient(closest-side, rgba(255,255,255,.35), transparent 65%);
  filter: blur(24px); transform: translate3d(0,0,0); pointer-events: none;
}
.banner__grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; }
.banner__text { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.banner__text h1 { margin: 0; }
.banner__img { text-align: center; }
.banner__img img { filter: drop-shadow(0 18px 28px rgba(0,0,0,.18)); animation: floaty 6s ease-in-out infinite; }
.banner__btn a { white-space: nowrap; font-size: 18px; }

/* Dynamic flames (lightweight, GPU-friendly) */
.flames { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.f {
  position: absolute; bottom: -10%;
  width: 18vw; max-width: 220px; aspect-ratio: 1 / 1;
  background: radial-gradient(50% 60% at 50% 70%, rgba(255,120,0,.35), rgba(255,120,0,0) 70%),
              radial-gradient(40% 50% at 40% 40%, rgba(255,200,0,.25), rgba(255,200,0,0) 70%);
  filter: blur(10px) saturate(110%);
  mix-blend-mode: screen; opacity: .22; transform: translateY(0) scale(1);
  will-change: transform, opacity;
}
.f1 { left: 10%; animation: flameFloat 8s ease-in-out infinite; }
.f2 { left: 40%; animation: flameFloat 9s ease-in-out -2s infinite; }
.f3 { right: 25%; animation: flameFloat 7.5s ease-in-out -1s infinite; }
.f4 { right: 5%; animation: flameFloat 10s ease-in-out -3s infinite; }
@keyframes flameFloat {
  0%   { transform: translateY(10%) scale(1); opacity: .18; }
  50%  { transform: translateY(-6%) scale(1.05); opacity: .28; }
  100% { transform: translateY(10%) scale(1); opacity: .18; }
}

/* Hero badges (no bullets) */
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; padding: 0; margin: 4px 0 0; list-style: none; }
.hero-badges li {
  list-style: none; font-size: 13px; line-height: 1; color: #111;
  background: rgba(255,255,255,.8); border: 1px solid rgba(0,0,0,.1); border-radius: 999px;
  padding: 8px 10px; box-shadow: 0 5px 14px rgba(0,0,0,.06);
}
[data-theme="dark"] .hero-badges li { background: rgba(17,19,25,.8); color: var(--text); border-color: rgba(255,255,255,.08); }

/* Dates */
.meta-dates { font-size: 14px; color: #1f2937; display: flex; gap: 8px; align-items: center; opacity: .9; }
.meta-dates .sep { opacity: .6; }
[data-theme="dark"] .meta-dates { color: var(--muted); }

/* Games */
.games-wrap { border-bottom: 1px solid var(--border); }
.games-wrap h2 { margin-bottom: 32px; }
.games-grid { display: grid; grid-template-columns: repeat(4, minmax(220px,1fr)); gap: 22px; }
.game-item {
  position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden;
  background: color-mix(in oklab, var(--surface) 90%, #ddd);
  box-shadow: var(--shadow-1); transform: translateZ(0);
  transition: transform .25s ease, box-shadow .25s ease;
}
.game-item:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 20px 40px rgba(0,0,0,.15); }
.game-item img { width: 100%; height: 100%; object-fit: cover; filter: saturate(1.05); transform: scale(1.02); transition: transform .4s ease; }
.game-item:hover img { transform: scale(1.06); }
.game-item_inner {
  position: absolute; inset: 0; display: grid; grid-template-rows: 1fr auto; align-items: end; justify-items: center;
  padding: 16px; background: linear-gradient(to top, rgba(0,0,0,.55), rgba(0,0,0,0) 35%); backdrop-filter: blur(1px);
}
.game-item:hover .game-item_inner { background: linear-gradient(to top, rgba(0,0,0,.65), rgba(0,0,0,0) 35%); }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .game-item_inner { background: linear-gradient(to top, rgba(0,0,0,.5), rgba(0,0,0,0) 35%); }
}
.game-item_play {
  background: var(--brand); color: #000; padding: 12px 18px; font-size: 14px; border: 2px solid #000;
  text-transform: uppercase; text-decoration: none; border-radius: 8px; font-weight: 800;
  transition: all .25s ease; box-shadow: var(--shadow-2);
}
.game-item_play:hover { background: #000; color: var(--brand); transform: translateY(-2px); }
.game-item_name { color: #fff; font-size: 18px; font-weight: 600; text-shadow: 0 2px 10px rgba(0,0,0,.5); }

/* Content & Tables */
.content { padding: 60px 0; }
.content p { margin: 12px 0; }
.content img { margin: 0 auto; max-width: 500px; }
.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--border); background: color-mix(in oklab, var(--surface) 96%, #fff); }
table { width: 100%; min-width: 520px; }
table tr td, table tr th { border: 1px solid var(--border); padding: clamp(10px, 1.2vw, 14px); }
table tr th { background-color: var(--brand-2); color: #fff; font-size: 18px; text-align: center; }
table tr td:hover { background-color: color-mix(in oklab, var(--surface) 92%, #e3e3e3); }
.table-wrap table td:first-child { width: 36%; font-weight: 600; }
@supports (position: sticky) {
  .table-wrap td:first-child {
    position: sticky; left: 0; background: color-mix(in oklab, var(--surface) 98%, #fff); z-index: 1;
  }
}

/* Footer */
.footer { padding: 24px 0; border-top: 1px solid var(--border); background: color-mix(in oklab, var(--surface) 96%, transparent); box-shadow: inset 0 1px 0 var(--border); }
.footer__grid { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.footer__left, .footer__right { font-size: 14px; color: var(--muted); }
.footer__right time { font-variant-numeric: tabular-nums; }

/* Utilities & Effects */
.reveal { opacity: 0; transform: translateY(18px); transition: all .6s cubic-bezier(.2,.65,.2,1); }
.reveal.in-view { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: .12s; }
.delay-2 { transition-delay: .24s; }
.delay-3 { transition-delay: .36s; }

/* Animations */
@keyframes glow {
  from { box-shadow: 0 0 6px rgba(255,180,0,.35), 0 0 0 0 rgba(255,180,0,0); }
  to   { box-shadow: 0 0 18px rgba(255,180,0,.6), 0 0 32px 6px rgba(255,180,0,.16); }
}
@keyframes floaty {
  0% { transform: translate3d(-10px, 0, 0) rotate(0.0001deg); }
  50% { transform: translate3d(10px, 0, 0) rotate(0.0001deg); }
  100% { transform: translate3d(-10px, 0, 0) rotate(0.0001deg); }
}

/* Accessibility & Focus */
:focus-visible { outline: 3px solid color-mix(in oklab, var(--brand) 85%, #000 15%); outline-offset: 2px; border-radius: 6px; }
a:focus-visible, .btn:focus-visible, button:focus-visible {
  outline: none; box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 35%, transparent); border-radius: 8px;
}

/* Scroll behavior and anchor offset */
html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 90px; }

/* Custom scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--brand) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--brand), #ffd36d);
  border-radius: 10px; border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(#ffd36d, var(--brand)); }

/* Text selection */
::selection { background: color-mix(in oklab, var(--brand) 40%, #ffffff 60%); color: #000; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .banner__img img { animation: none !important; }
}

/* Fallbacks for color-mix */
@supports not (color: color-mix(in oklab, red 50%, blue)) {
  .header { background: var(--surface); }
  .table-wrap { background: var(--surface); }
  .footer { background: var(--surface); }
  .game-item { background: #f2f2f2; }
}

/* Print */
@media print {
  *, *::before, *::after { background: #fff !important; color: #000 !important; box-shadow: none !important; text-shadow: none !important; }
  .header, .nav, .auth, .banner, .banner__img, .btn, .block_90, .block_100 { display: none !important; }
  .section { padding: 0 !important; }
  .games-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  a::after { content: " (" attr(href) ")"; font-size: 12px; }
}

/* Responsive */
@media (max-width: 1024px) {
  .banner__grid { grid-template-columns: 1fr; }
  .games-grid { grid-template-columns: repeat(2, minmax(220px,1fr)); }
}
@media (max-width: 992px) {
  /* Burger/nav handled earlier; ensure spacing */
  .header .container { grid-template-columns: 1fr auto auto; }
}
@media (max-width: 768px) {
  .section { padding: 80px 0 50px; }
  .container { max-width: 100%; padding: 0 16px; }
  .games-grid { grid-template-columns: 1fr; }
  .game-item { aspect-ratio: 1 / 1; }
  .hero-badges { gap: 8px; }
}
@media (max-width: 380px) {
  .auth { gap: 6px; }
  .btn { padding: 9px 12px; }
  .meta-dates { flex-wrap: wrap; gap: 4px; }
}

/* Legacy blocks kept */
.block_90 { padding: 0 16px; display: block; max-width: 100%; margin-bottom: 20px; }
@media (min-width: 991px) { .block_90 { display: none; max-width: 100%; } }
@media (max-width: 991px) { .block-main-image { display: none; } }
@media (max-width: 991px) { .block-main { min-height: inherit; padding: 20px 0; } }
@media (max-width: 991px) { .hero-block { margin-bottom: 12px; } }
.block_100 { max-width: 100%; margin: 0 auto; display: block; }
@media (max-width: 991px) { .block_100, .btn-2 { display: none; } }
.link-head-a { display: block !important; margin: 0 auto; text-align: center; }

/* End of stylesheet */

/* Burger: ровная анимация крестика */
.burger { position: relative; width: 44px; height: 44px; border: none; border-radius: 10px; display: none; align-items: center; justify-content: center; background: transparent; }
.burger span {
  position: absolute; left: 50%; top: 50%;
  width: 22px; height: 2px; background: var(--text);
  border-radius: 2px; transform-origin: center;
  transition: transform .25s ease, opacity .2s ease, background-color .2s ease;
}
.burger span:nth-child(1) { transform: translate(-50%, calc(-50% - 3px)); }
.burger span:nth-child(2) { transform: translate(-50%, -50%); }
.burger span:nth-child(3) { transform: translate(-50%, calc(-50% + 7px)); }

.menu-open .burger span:nth-child(1) { transform: translate(-50%, -50%) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translate(-50%, -50%) rotate(-45deg); }

@media (max-width: 992px) {
  .nav {
    position: fixed; inset: 0 0 0 auto; width: min(82vw, 360px);
    background: var(--surface); border-left: 1px solid var(--border);
    transform: translateX(100%); transition: transform .25s ease;
    padding: 80px 24px 24px; box-shadow: -20px 0 50px rgba(0,0,0,.12);
    z-index: 100; /* выше оверлея */
            height: 100vw;
  }
  .nav__list { flex-direction: column; gap: 18px; }
  .burger { display: inline-flex; }
}

/* Полноэкранный оверлей под меню */
.menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  backdrop-filter: blur(2px); z-index: 50; /* ниже панели меню, выше хедера */
}

/* Уберите старый псевдооверлей, если был */
body.menu-open::before { content: none !important; }

/* Состояния открытого меню */
body.menu-open .nav { transform: translateX(0); }
body:not(.menu-open) .menu-overlay { display: none; }


.nav__list, .nav__item { list-style: none; margin: 0; padding: 0; }
.nav__link { text-decoration: none; }

.nav__list, .nav__item { list-style: none; margin: 0; padding: 0; }
.nav__link { text-decoration: none; }



/* Кнопка темы как переключатель */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: transparent;
}
.theme-toggle:hover { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand) 25%, transparent); }

/* Иконки темы (CSS-only) */
.theme-toggle__icon { width: 18px; height: 18px; display: inline-block; transition: transform .2s ease, opacity .2s ease; }
.theme-toggle .sun {
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffda6b 50%, #0000 51%),
    conic-gradient(from 0deg, #ffda6b 0 25%, #0000 0 100%);
  box-shadow: 0 0 0 2px #ffda6b inset;
}
.theme-toggle .moon {
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #cfd8ff 55%, #0000 56%),
    radial-gradient(circle at 60% 60%, #aab7ff 35%, #0000 36%);
  box-shadow: inset -6px 0 0 0 #cfd8ff;
}

/* Визуальное состояние: какая тема активна */
[data-theme="light"] .theme-toggle .sun { opacity: 1; transform: scale(1); }
[data-theme="light"] .theme-toggle .moon { opacity: .5; transform: scale(.9); filter: grayscale(.3); }
[data-theme="dark"] .theme-toggle .moon { opacity: 1; transform: scale(1); }
[data-theme="dark"] .theme-toggle .sun { opacity: .5; transform: scale(.9); filter: grayscale(.3); }
