* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #331E66;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

body {
    animation: fadeIn 0.2s ease;
    font-family: "Nunito", sans-serif;
    background: url('../images/fon.webp') repeat;
}

h1,
h4 {
    color: yellow;
    text-align: center;
    font-weight: 900;
    line-height: 1.1;
    margin: 15px 0 10px;
    transform: scaleX(0.95);
}

h4 {
    font-size: 28px;
}

h2 {
    font-size: 22px;
    font-weight: 800;
    color: yellow;
    text-align: center;
    margin: 5px 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 3px 10px rgba(0,0,0,0.4);
    transform: scaleX(0.9);
    line-height: 1.2;
}

h3 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    transform: scaleX(0.9);
    line-height: 1.2;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    height: 100%;
    user-select: none;
}

.header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 900px;
    height: 60px;
    background: rgba(0, 0, 0, 0.6);
    z-index: 3;
}

.menu {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 40px;
	
}

.menu ul {
    display: flex;
    gap: 6px 20px;
    list-style: none;
    flex-wrap: wrap;
}

.menu a {
    white-space: nowrap;
    font-size: 14px;
}

.logo {
    height: 40px;
}

.hero {
    width: 100%;
    max-width: 900px;
    height: 650px;
    margin: 0 auto;
    background: url('../images/Cap.webp') no-repeat left top;
    position: relative;
    overflow: hidden;
    z-index: 1;
    user-select: none;
}

.score {
    position: absolute;
    height: 15%;
    top: 15%;
    left: 0%;
    transform: translate(+25%, 0%);
    z-index: 2;
    pointer-events: none;
    opacity: 0.8;
}

#score {
    position: absolute;
    top: 21%;
    left: 53px;
    text-align: left;
    font-size: 27px;
    font-weight: bold;
    color: yellow;
    z-index: 3;
    padding: 10px 15px;
    border-radius: 10px;
    pointer-events: none;
}

.leaf-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.joker-stage {
    position: absolute;
    width: 900px;
    height: 650px;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
    transform-origin: top center;
    z-index: 2;
    pointer-events: none;
}

.joker-layer {
    position: absolute;
    inset: 0;
    width: auto;
    height: 80%;
    object-fit: contain;
    margin-left: 455px;
    margin-top: 100px;
    z-index: 2;
    pointer-events: none;
}

.ball {
    position: absolute;
    inset: 0;
    width: 12%;
    height: 12%;
    object-fit: contain;
    margin-left: 600px;
    margin-top: 210px;
    z-index: 1;
    pointer-events: none;
}

.eye {
    position: absolute;
    width: 60px;
    height: 60px;
    overflow: hidden;
    border-radius: 50%;
    z-index: 1;
}

#eye1 {
    top: 217px;
    left: 595px;
}

#eye2 {
    top: 225px;
    left: 650px;
}

.iris {
    position: absolute;
    width: 50%;
    height: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.sun {
    width: 80px;
    position: absolute;
    top: 80px;
    left: 800px;
    animation: sunDance 3s ease-in-out infinite;
    transform-origin: center bottom;
    pointer-events: none;
    filter:
        drop-shadow(0 0 10px rgba(220,240,255,0.9))
        drop-shadow(0 0 25px rgba(140,180,255,0.5))
        drop-shadow(0 0 50px rgba(90,120,255,0.3));
}

.wave {
    position: absolute;
    top: 485px;
    left: 730px;
    pointer-events: none;
}

@keyframes sunDance {
    0% { transform: rotate(-8deg) translateY(0) scaleY(1) scaleX(0.95); }
    25% { transform: rotate(0deg) translateY(-5px) scaleY(1.05); }
    50% { transform: rotate(10deg) translateY(0) scaleY(1.0); }
    75% { transform: rotate(0deg) translateY(-5px) scaleY(1.10); }
    100% { transform: rotate(-8deg) translateY(0) scaleY(1) scaleX(0.95); }
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
}

nav a {
    position: relative;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
    padding-bottom: 5px;
    transition: all 0.3s ease;
}

nav a.active {
    color: yellow;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0%;
    height: 2px;
    background: yellow;
    transition: width 0.3s ease;
}

nav a.active::after,
nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: yellow;
}

nav ul:hover a,
nav ul:hover a.active {
    color: rgba(255, 255, 255, 0.3);
}

nav ul a:hover,
nav ul a.active:hover {
    color: yellow;
}

.content {
    padding: 5px;
}

.game-title {
    font-size: 1.3em;
}

.layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    width: 100%;
    max-width: 1000px;
    margin-top: 0;
}

.wrapper {
    perspective: 900px;
    will-change: transform;
}

.card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity .6s ease, transform .6s ease;
}

.card.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.card img {
    width: 100%;
    display: block;
    transform: translateZ(20px);
    pointer-events: none;
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    transform: translateZ(30px);
}

.card-content {
    position: absolute;
    bottom: 0;
    padding: 20px;
    color: white;
    transform: translateZ(60px);
}

.card-content h3 {
    margin: 0 0 8px;
}

.card-content p {
    font-size: 14px;
    opacity: 0.8;
}

.glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    mix-blend-mode: overlay;
}

.card::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 22px;
    background: linear-gradient(45deg, #ff00cc, #3333ff, #ffcc00);
    filter: blur(10px);
    opacity: 0;
    transition: .3s;
}

.card:hover::before {
    opacity: .8;
}

.spark {
    position: absolute;
    width: 10px;
    height: 10px;
    background: gold;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    animation: sparkAnim 0.8s ease-out forwards;
}

@keyframes sparkAnim {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1) translate(var(--x), var(--y)); opacity: 0; }
}

.small_cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 30px;
    padding-top: 10px;
    max-width: 900px;
    margin: 0 auto;
}

.small_card-wrapper {
    width: 100%;
    cursor: pointer;
}

.small_card {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: url("../images/Button.webp") no-repeat center/cover;
    border-radius: 20px;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    position: relative;
    overflow: hidden;
}

.small_card::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.4),
        transparent
    );
    transition: 0.6s;
}

.small_card-icon {
    position: absolute;
    inset: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.35s ease;
}

.small_card-wrapper:hover .small_card {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.small_card-wrapper:hover .small_card::before {
    left: 100%;
}

.small_card-wrapper:hover .small_card-icon {
    transform: scale(1.1) rotate(5deg);
}

.fall-item {
    position: absolute;
    top: -80px;
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: auto;
    cursor: pointer;
    animation: fall linear forwards, sway ease-in-out infinite;
    will-change: transform, filter;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(var(--fall-distance)) rotate(360deg); opacity: 0; }
}

@keyframes sway {
    0%, 100% { margin-left: 0px; }
    50% { margin-left: 30px; }
}

.fly-layer {
    position: absolute;
    top: 100px;
    left: 0;
    width: 120px;
    will-change: transform;
    z-index: 1;
    cursor: pointer;
    pointer-events: auto;
}

.gallery {
    position: relative;
    max-width: 1100px;
    margin: 10px auto;
}

.gallery-wrapper {
    overflow: hidden;
    cursor: grab;
}

.gallery-track {
    display: flex;
    transition: transform 0.4s ease;
    cursor: grab;
	  will-change: transform;
	    align-items: stretch; /* важно */
}

.gallery-track img {
  flex: 0 0 auto;
    /* width: calc(100% / 5); */
	  width: 100%;
  height: auto;
    padding: 6px;
    border-radius: 12px;
    object-fit: cover;
    user-select: none;
    pointer-events: none;
}

.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 22px;
    border-radius: 8px;
    z-index: 10;
}
nav {
  margin-left: auto;
}
.prev { left: 5px; }
.next { right: 5px; }

.nav:hover {
    background: rgba(0,0,0,0.8);
}

.nav:disabled {
    opacity: 0.3;
    cursor: default;
}

@media (max-width: 900px) {
    .gallery-track img {
        width: calc(100% / 3);
    }
}

@media (max-width: 500px) {
    .gallery-track img {
        width: 100%;
    }
}

.plaque-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    width: 100%;
}

.Purple_plaque {
    display: block;
    width: 800px;
}

.plaque-text,
.plaque-text_2 {
    position: absolute;
    left: 50%;
    text-align: center;
    color: black;
}

.plaque-text {
    top: 35%;
    transform: translate(-20%, -20%);
}

.plaque-text_2 {
    top: 25%;
    transform: translate(-44%, -20%);
}

.plaque-text h2,
.plaque-text_2 h2 {
    font-size: clamp(18px, 2.2vw, 22px);
    font-weight: 800;
    color: yellow;
    text-align: center;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

.plaque-text h3,
.plaque-text_2 h3 {
    font-size: clamp(15px, 1.8vw, 18px);
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 5px;
}

.download-btn {
    position: absolute;
    display: inline-block;
    transition:
        transform 0.2s ease,
        filter 0.2s ease,
        box-shadow 0.2s ease;
    border-radius: 20px;
    overflow: hidden;
    transform: scale(1);
}

.btn1 {
    top: 83%;
    left: 55%;
    --tx: -50%;
    --ty: -50%;
    transform: translate(-50%, -50%) scale(1);
}

.btn2 {
    top: 85%;
    left: 0%;
    --tx: 17%;
    --ty: -50%;
    transform: translate(17%, -50%) scale(1);
    z-index: 2;
}

.btn3 {
    top: 70%;
    left: 0%;
    --tx: 95%;
    --ty: -50%;
    transform: translate(95%, -50%) scale(1);
    z-index: 2;
}

.download-btn:hover {
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(1.04);
    filter: brightness(1.08);
    box-shadow: 0 15px 35px rgba(0,0,0,0.45);
}

.download-btn:active {
    transform: translate(var(--tx, 0), var(--ty, 0)) scale(0.94);
}

.download-btn img {
    display: block;
    width: 320px;
    user-select: none;
    pointer-events: none;
}

.download-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-35%, -50%);
    color: black;
    font-size: 21px;
    pointer-events: none;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.hero-text {
    position: absolute;
    top: 50%;
    left: 40px;
    text-align: center;
    color: black;
}

.hero h2 {
    font-size: 48px;
    color: yellow;
    text-align: center;
    font-weight: 900;
    text-shadow:
        0 3px 10px rgba(0,0,0,0.9),
        0 0 20px rgba(0,0,0,0.6);
    opacity: 0.8;
    line-height: 1.1;
    transform: scaleX(0.8);
}

.hero h3 {
    font-size: 20px;
    color: white;
    text-align: center;
    font-weight: 700;
    opacity: 0.8;
    text-shadow:
        0 3px 10px rgba(0,0,0,0.9),
        0 0 20px rgba(0,0,0,0.6);
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  opacity: 0.6;
  padding: 3px;
  border-radius: 9px;
  background:
    linear-gradient(
      180deg,
      rgba(50, 25, 100, .95),
      rgba(18, 10, 45, .95)
    );

  border: 1px solid rgba(141, 92, 255, .22);

  box-shadow:
    0 0 10px rgba(120,70,255,.12);
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 24px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 11px !important;
  font-weight: 700;
  letter-spacing: .5px;
  color: rgba(255,255,255,.55);
  transition: .2s ease;
}

.lang-btn:hover {
  color: #fff;
  background: rgba(141,92,255,.12);
}

.lang-btn.active {
  color: #fff;
  background: linear-gradient(135deg, #7f4fff, #ac72ff);
  box-shadow: 0 0 10px rgba(140,90,255,.35);
}

.lang-switch:hover .lang-btn {
  opacity: .35;
}

.lang-switch .lang-btn:hover {
  opacity: 1;
}


/* BURGER */

.burger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  gap: 5px;
  z-index: 100;
    position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.burger-btn span {
  width: 24px;
  height: 2px;
  background: #fff;
  transition: .3s;
}

.burger-btn.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.burger-btn.open span:nth-child(2) {
  opacity: 0;
}

.burger-btn.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.slide {
  flex: 0 0 50%; /* мобильная версия */
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* display: block; */
}



@media (min-width: 768px) {
  .slide { flex: 0 0 33.333%; }
  .btn3{
    top:70%;
    left:50%;
    transform: translate(-45%, -50%) scale(1.1);
}
}

@media (min-width: 900px) {
  .slide { flex: 0 0 20%; }
}
/* ==========================================================
   MOBILE VERSION
   ========================================================== */

@media (max-width:768px){

html,
body{
    overflow-x:hidden;
}
.burger-btn {
  display: flex;
}

nav {
  position: fixed;
  top: 60px;
  left: 0;
  width: 100%;
  background: rgba(0,0,0,.92);
  z-index: 999;

  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-10px);

  transition: 
    max-height 0.35s ease,
    opacity 0.25s ease,
    transform 0.25s ease;
}

nav.open {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
}


nav ul {
  flex-direction: column;
  gap: 0;
  width: 100%;
}

nav li {
  width: 100%;
}

nav a {
   display: block;
   border-bottom: none;
   text-align: center;
   font-size: 13px;
   padding: 6px 8px;
  }


/* ---------- HEADER ---------- */

.header{
    height:60px;
}

.menu{
    padding:0 12px;
}

.logo{
    height:34px;
}

nav ul{
    gap:12px;
}
.lang-switch {
  margin-top: 0;
    margin-left:5px;
}

/* ---------- HERO ---------- */

.hero{
    width:100%;
    height:560px;
    background-position:center top;
    background-size:cover;
    overflow:hidden;
}

/* ---------- SCORE ---------- */

.score{
    width:110px;
	height: auto;
    top:160px;
    left:45px;
    transform:none;
}

#score{
    top:190px;
    left:59px;
    font-size:20px;
    padding:0;
}

/* ---------- JOKER ---------- */

.joker-stage{
    /* width:900px; */
    /* height:650px; */

    transform:
        translateX(-45%)
		translateY(15%)
        scale(.55);

    transform-origin:top center;
}

/* ---------- TEXT ---------- */

.hero-text{
    position:absolute;

    left:40px;;
    right:auto;

    top:auto;
    bottom:110px;

    text-align:center;

    padding:0 15px;
}

.hero h2{
    font-size:34px;
    line-height:1;
}

.hero h3{
    font-size:15px;
    margin-top:10px;
}

/* ---------- DOWNLOAD ---------- */

.btn2{
    top:auto;
    bottom:15px;
    left:15px;

    /* transform:translateX(-50%); */
}

.download-btn img{
    width:220px;
}

.download-text{
    font-size:15px;
}

/* ---------- CARDS GAME ---------- */

.leaf-layer{
    position:absolute;
    inset:0;
    overflow:hidden;
    z-index:20;
}

/* увеличить карты для пальца */

.fall-item{
    min-width:70px;
    min-height:70px;

    touch-action:manipulation;
}

/* ---------- CONTENT ---------- */

.content{
    padding:15px;
}

h1{
    font-size:28px;
}

h4{
    font-size:26px;
}

h2{
    font-size:18px;
}

h3{
    font-size:14px;
}

/* ---------- FEATURES ---------- */

.small_cards{
    grid-template-columns:repeat(4, 1fr);
    gap:12px;
}

.small_card-wrapper{
    max-width:none;
    width:100%;
}

/* ---------- SCREENSHOTS ---------- */

.gallery{
    margin-top:20px;
}

.gallery-track img{
    width:100%;
}

/* ---------- ADVENTURE CARDS ---------- */

.layout-grid{
    grid-template-columns:repeat(2, 1fr);
    gap:10px;
}

/* ---------- PLAQUE ---------- */

.Purple_plaque{
    width:100%;
}

.plaque-text{
    width:90%;
    left:50%;
    top:65%;
    transform:translate(-40%, -70%);
}
.plaque-text h2,
.plaque-text_2 h2 {
	    transform:translate(-5%, 30%);
	    font-size:19px;
}

.plaque-text h3,
.plaque-text_2 h3 {
    font-size:15px;
		    transform:translate(-5%, 30%);
}
.plaque-text h2{
    font-size:19px;
}

.plaque-text h3{
    font-size:14px;
}

/* нижняя кнопка */

.btn1{
    top:140%;
    left:50%;
    transform: translate(-45%, -50%) scale(1.6);
}

.btn1 img{
    width:220px;
}
.btn3{
    top:140%;
    left:50%;
    transform: translate(-45%, -50%) scale(1.6);
}

.btn3 img{
    width:220px;
}
/* ---------- GALLERY ARROWS ---------- */

.nav{
    padding:8px 12px;
    font-size:20px;
}

/* ---------- FLY ---------- */

.fly-layer{
    width:90px;
}

/* ---------- SUN ---------- */

.sun{
    width:55px;
    top:80px;
    left:60px;
    right:auto;
}

/* ---------- WAVE ---------- */

.wave{
    width:90px;
    top:310px;
    left:395px;
    right:0;
}


  .lang-switch {
    margin-left: auto;
    margin-right: 10px;
    margin-top: 0;
  }

}