/* ===== БИТИК И ДРУЗЬЯ — MAIN STYLES ===== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --red:    #E5392E;
  --orange: #FB8C00;
  --yellow: #FDD835;
  --green:  #43A047;
  --blue:   #1E88E5;
  --purple: #8E24AA;
  --heart:  #FF3B5C;
  --dark:   #1A1430;
  --bg:     #FFF9F0;
  --card:   #FFFFFF;
  --text:   #2C1654;
  --muted:  #7B5EA7;
  --radius: 24px;
  --shadow: 0 8px 32px rgba(28,20,48,0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

/* ===== PIXEL DECORATION ===== */
.pixel-border {
  border: 3px solid transparent;
  background-clip: padding-box;
  position: relative;
}

/* ===== HEADER / NAV ===== */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,249,240,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(142,36,170,0.1);
  padding: 0 5%;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.4rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--red), var(--orange), var(--yellow), var(--green), var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
  margin-left: 2rem;
  transition: color 0.2s;
}
nav a:hover { color: var(--purple); }

/* ===== HERO ===== */
.hero {
  min-height: 100vh;
  padding: 100px 5% 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 60px;
  background: radial-gradient(ellipse 80% 60% at 50% 20%, rgba(142,36,170,0.08) 0%, transparent 70%),
              radial-gradient(ellipse 60% 40% at 80% 80%, rgba(30,136,229,0.07) 0%, transparent 70%);
  flex-wrap: wrap;
}

.hero-text { max-width: 500px; }

.hero-tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
}

.hero h1 span {
  background: linear-gradient(90deg, var(--heart), var(--orange), var(--yellow));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 36px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(28,20,48,0.18); }

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: white;
  box-shadow: 0 6px 20px rgba(142,36,170,0.35);
}

.btn-outline {
  background: transparent;
  color: var(--purple);
  border: 2.5px solid var(--purple);
}

.hero-image {
  position: relative;
  width: 340px;
  flex-shrink: 0;
}

.hero-image img {
  width: 100%;
  filter: drop-shadow(0 20px 40px rgba(142,36,170,0.25));
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-16px); }
}

.spark {
  position: absolute;
  border-radius: 50%;
  animation: spark-float 3s ease-in-out infinite;
}
.spark:nth-child(2) { width:14px;height:14px; background:var(--yellow); top:10%; right:5%;  animation-delay:0s; }
.spark:nth-child(3) { width:10px;height:10px; background:var(--heart);  bottom:20%;left:0%; animation-delay:1s; }
.spark:nth-child(4) { width:8px; height:8px;  background:var(--green);  top:40%;  left:5%;  animation-delay:2s; }
.spark:nth-child(5) { width:12px;height:12px; background:var(--blue);   bottom:5%;right:10%;animation-delay:0.5s; }

@keyframes spark-float {
  0%,100% { transform:scale(1) translateY(0); opacity:0.8; }
  50%      { transform:scale(1.3) translateY(-8px); opacity:1; }
}

/* ===== SECTIONS ===== */
section {
  padding: 80px 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.section-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  margin-bottom: 14px;
}

.section-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 48px;
}

/* ===== CHARACTERS ===== */
#characters { max-width: 1200px; }

.chars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}

.char-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 24px 28px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  overflow: hidden;
}
.char-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  border-radius: var(--radius) var(--radius) 0 0;
}
.char-card.bitik::before    { background: linear-gradient(90deg,var(--red),var(--orange),var(--yellow),var(--green),var(--blue),var(--purple)); }
.char-card.pixelina::before { background: linear-gradient(90deg,#f48fb1,#ce93d8,#80cbc4); }
.char-card.glitch::before   { background: linear-gradient(90deg,#9e9e9e,#607d8b); }
.char-card.megabyte::before { background: linear-gradient(90deg,var(--blue),#0d47a1); }

.char-card:hover { transform: translateY(-8px); box-shadow: 0 20px 48px rgba(28,20,48,0.16); }

.char-img {
  height: 180px;
  object-fit: contain;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 16px rgba(28,20,48,0.15));
}

.char-name {
  font-size: 1.3rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.char-role {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 12px;
}
.bitik    .char-role { background: linear-gradient(135deg,var(--purple),var(--blue)); }
.pixelina .char-role { background: linear-gradient(135deg,#e91e63,#9c27b0); }
.glitch   .char-role { background: linear-gradient(135deg,#607d8b,#455a64); }
.megabyte .char-role { background: linear-gradient(135deg,var(--blue),#0d47a1); }

.char-desc { font-size: 0.95rem; color: var(--muted); line-height: 1.6; }

/* ===== STORY ===== */
#story {
  max-width: 1200px;
  background: linear-gradient(135deg, #1A1430 0%, #2d1b6e 100%);
  border-radius: 32px;
  color: white;
  padding: 72px 8%;
}
#story .section-label { color: rgba(255,255,255,0.5); }
#story .section-title { color: white; }
#story .section-sub   { color: rgba(255,255,255,0.7); }

.story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.story-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 28px;
}

.story-num {
  font-size: 2.5rem;
  font-weight: 900;
  opacity: 0.15;
  line-height: 1;
  margin-bottom: 8px;
}

.story-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--yellow);
}
.story-card p { font-size: 0.95rem; color: rgba(255,255,255,0.7); line-height: 1.65; }

/* ===== DOWNLOADS ===== */
#downloads { max-width: 1200px; }

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.dl-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s;
}
.dl-card:hover { transform: translateY(-5px); }

.dl-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
}
.dl-icon.book  { background: linear-gradient(135deg,var(--orange),var(--yellow)); }
.dl-icon.video { background: linear-gradient(135deg,var(--purple),var(--blue)); }
.dl-icon.soon  { background: #f5f5f5; }

.dl-card h3 { font-size: 1.1rem; font-weight: 800; }
.dl-card p  { font-size: 0.9rem; color: var(--muted); line-height: 1.6; flex: 1; }

.dl-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.dl-badge.free   { background:#e8f5e9; color:#2e7d32; }
.dl-badge.soon   { background:#f5f5f5; color:#757575; }
.dl-badge.sub    { background:linear-gradient(135deg,var(--purple),var(--blue)); color:white; }
.dl-badge.dl-btn {
  background: linear-gradient(135deg, var(--green, #43b89c), var(--blue));
  color: white;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.dl-badge.dl-btn:hover { opacity: 0.85; }

/* ===== GAMES ===== */
#games { max-width: 1200px; }

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.game-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}
.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 22px 50px rgba(28,20,48,0.2);
}

.game-card-art {
  position: relative;
  height: 190px;
  background: linear-gradient(135deg, #2d1b6e 0%, #150f2e 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.game-art-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

/* Арт-кадр из самой игры показываем в полную силу — он и есть иллюстрация,
   а не подложка под спрайт (в отличие от .game-art-bg с opacity 0.4). */
.game-art-full {
  opacity: 1;
  transition: transform 0.4s;
}
.game-card:hover .game-art-full { transform: scale(1.05); }

.game-art-char {
  position: relative;
  z-index: 1;
  height: 150px;
  object-fit: contain;
  filter: drop-shadow(0 12px 26px rgba(0,0,0,0.45));
  transition: transform 0.3s;
}
.game-card:hover .game-art-char { transform: scale(1.08) translateY(-4px); }

.game-card-art-soon {
  font-size: 4rem;
  filter: grayscale(0.6);
  opacity: 0.55;
}

.game-card-body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.game-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--purple), var(--blue));
  color: #fff;
}
.game-badge.soon { background: #eceff1; color: #78909c; }

.game-card-body h3 { font-size: 1.2rem; font-weight: 900; }
.game-card-body p { font-size: 0.94rem; color: var(--muted); line-height: 1.6; flex: 1; }

.game-play-btn {
  align-self: flex-start;
  margin-top: 6px;
  padding: 12px 30px;
  font-size: 0.98rem;
}

.game-card-soon { opacity: 0.75; }
.game-card-soon:hover { transform: none; box-shadow: var(--shadow); }

/* ===== CAROUSEL ===== */
.carousel-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 0 12px;
}

.carousel-track-outer {
  width: min(340px, 80vw);
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(28,20,48,0.22);
}

.carousel-track {
  position: relative;
  width: 100%;
}

.carousel-slide {
  display: none;
  position: relative;
}
.carousel-slide.active { display: block; }

.carousel-slide img {
  width: 100%;
  aspect-ratio: 4/5;
  object-fit: cover;
  display: block;
  border-radius: 20px;
}

.slide-num {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(26,20,48,0.65);
  color: rgba(255,255,255,0.9);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.carousel-btn {
  background: white;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--purple);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(28,20,48,0.14);
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
  margin: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(142,36,170,0.25);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  flex-wrap: wrap;
  padding: 0 5%;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(142,36,170,0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 0;
}
.carousel-dot.dot-active {
  background: var(--purple);
  transform: scale(1.4);
}

/* ===== FOOTER ===== */
footer {
  background: var(--dark);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 40px 5%;
  font-size: 0.9rem;
  line-height: 1.8;
}
footer .logo { font-size: 1.2rem; margin-bottom: 12px; display: block; }
footer a { color: rgba(255,255,255,0.5); text-decoration: none; }
footer a:hover { color: white; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding-top: 90px; text-align: center; flex-direction: column; }
  .btn-row { justify-content: center; }
  .story-grid { grid-template-columns: 1fr; }
  nav { display: none; }
  #story { padding: 48px 6%; }
}
