:root {
  --bg: #08142d;
  --bg-deep: #030816;
  --red: #d62828;
  --gold: #f7d774;
  --gold-soft: #f1c75a;
  --cream: #fff5d6;
  --white: #f8fbff;
  --blue: #73c7ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --panel: rgba(9, 24, 48, 0.72);
  --line: rgba(255, 245, 214, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% 30%, var(--bg), var(--bg-deep));
  font-family: 'Segoe UI', 'Roboto', sans-serif;
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Орбиты */
.orbit, .orbit-two, .orbit-three {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--line);
  pointer-events: none;
  z-index: 0;
}

.orbit {
  width: 80vmin;
  height: 80vmin;
  top: 10%;
  left: -20vmin;
  animation: spin 40s linear infinite;
}

.orbit-two {
  width: 60vmin;
  height: 60vmin;
  bottom: 5%;
  right: -15vmin;
  animation: spin-reverse 35s linear infinite;
}

.orbit-three {
  width: 110vmin;
  height: 110vmin;
  top: 40%;
  left: 30%;
  animation: spin 50s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

/* Комета */
.comet {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 20px 4px white;
  top: 15%;
  left: 80%;
  animation: cometFly 12s linear infinite;
  z-index: 1;
}

@keyframes cometFly {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(-60vw, 40vh) scale(0.3);
    opacity: 0;
  }
}

/* Планета */
.planet {
  position: absolute;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle at 30% 30%, #f9d976, #f39f86);
  border-radius: 50%;
  bottom: 8%;
  right: 5%;
  box-shadow: 0 0 40px rgba(243, 159, 134, 0.5);
  z-index: 0;
  animation: float 8s ease-in-out infinite;
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

/* Контейнер wrapper */
.wrapper {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 72px;
}

/* Hero-секция */
.hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(247, 215, 116, 0.26);
  border-radius: 28px;
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 20% 20%, rgba(115, 199, 255, 0.15), transparent 30%),
    radial-gradient(circle at 80% 10%, rgba(247, 215, 116, 0.13), transparent 24%),
    radial-gradient(circle at 50% 80%, rgba(214, 40, 40, 0.18), transparent 34%),
    linear-gradient(138deg, #00d900b7 0%, #bf1be382 38%, var(--bg-deep) 100%);
  padding: 44px 28px 34px;
  isolation: isolate;
}

.ribbon-section {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  color: var(--gold-soft);
}

.ribbon-left, .ribbon-right {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  padding: 6px 14px;
  border-radius: 40px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.star {
  color: var(--gold);
  font-size: 0.9rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: center;
}

.title {
  font-size: 3.6rem;
  line-height: 1.2;
  margin: 0 0 24px 0;
  background: linear-gradient(135deg, #fff, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gold {
  color: var(--gold);
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

.subtitle {
  font-size: 1.15rem;
  line-height: 1.4;
  opacity: 0.9;
  margin-bottom: 32px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  background: rgba(255, 245, 214, 0.1);
  backdrop-filter: blur(4px);
  padding: 8px 18px;
  border-radius: 60px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(247, 215, 116, 0.3);
}

.poster-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 320px;
}

.sunburst {
  position: absolute;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(247, 215, 116, 0.2) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  z-index: 0;
}

.rocket-wrap {
  position: relative;
  animation: floatRocket 3s ease-in-out infinite;
}

.rocket-svg {
  width: 200px;
  filter: drop-shadow(0 0 12px rgba(247, 215, 116, 0.6));
  transition: transform 0.3s;
}

.rocket-svg:hover {
  transform: scale(1.05);
}

.rocket-trail {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 40px;
  background: linear-gradient(to top, #ff8800, transparent);
  border-radius: 4px;
  animation: trailFlicker 0.4s infinite alternate;
}

@keyframes floatRocket {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
  100% { transform: translateY(0px); }
}

@keyframes trailFlicker {
  0% { opacity: 0.6; height: 30px; }
  100% { opacity: 1; height: 48px; }
}

/* Секция игры */
.section {
  margin-top: 48px;
  margin-bottom: 48px;
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 32px;
  background: linear-gradient(135deg, #fff, var(--gold-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 24px;
  align-items: start;
}

.game-panel,
.game-info {
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}

.game-info p {
  margin: 0 0 14px;
  line-height: 1.7;
  font-size: 17px;
  color: rgba(255, 245, 214, 0.94);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0;
}

button {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 12px 18px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #210a0a;
  background: linear-gradient(180deg, var(--gold), var(--gold-soft));
  box-shadow: 0 10px 20px rgba(247, 215, 116, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.2s ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(247, 215, 116, 0.28);
  filter: brightness(1.03);
}

button.secondary {
  color: var(--cream);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

.stat {
  min-width: 120px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  text-align: center;
}

.stat span {
  display: block;
  font-size: 0.8rem;
  opacity: 0.7;
}

.stat strong {
  font-size: 1.8rem;
  display: block;
}

.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 20px;
  padding: 12px;
  margin-bottom: 16px;
}

.tile {
  aspect-ratio: 1 / 1;
  background-size: 300% 300%;
  background-position: center;
  border-radius: 16px;
  transition: 0.1s linear;
  cursor: pointer;
  border: 1px solid rgba(255,215,0,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.tile.empty {
  background: rgba(255,255,255,0.05) !important;
  border: 1px dashed rgba(255,215,0,0.5);
  cursor: default;
  backdrop-filter: blur(2px);
}

.tile:not(.empty):hover {
  transform: scale(0.97);
  filter: brightness(1.1);
}

.hint {
  font-size: 0.85rem;
  text-align: center;
  opacity: 0.7;
  margin-top: 8px;
}

.preview {
  height: 80px;
  background: url('shared/pictures/space-puzzle.jpeg') center/cover no-repeat;
  border-radius: 16px;
  margin-top: 20px;
  border: 1px solid rgba(255,255,255,0.2);
  opacity: 0.8;
}

/* Футер */
.footer {
  margin-top: 26px;
  text-align: center;
  opacity: 0.82;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Адаптивность */
@media (max-width: 980px) {
  .hero-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }
  .poster-art {
    min-height: 360px;
  }
}

@media (max-width: 850px) {
  .ribbon-section {
    flex-direction: column;
  }
  .ribbon-left, .ribbon-right {
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .wrapper {
    width: min(100% - 18px, 1180px);
  }
  .hero,
  .section {
    padding: 20px;
    border-radius: 22px;
  }
  .title {
    line-height: 1.02;
  }
  .rocket-wrap {
    width: 240px;
    height: 300px;
  }
  .sunburst {
    width: 260px;
    height: 260px;
  }
  .puzzle-board {
    gap: 6px;
    padding: 8px;
  }
  .tile {
    border-radius: 12px;
  }
}

@media (max-width: 430px) {
  .controls {
    flex-direction: column;
    width: 100%;
  }
  .stats {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }
}
.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  margin: 40px 0;
}
.photo-card {
  background: rgba(255,255,255,0.1);
  border-radius: 24px;
  padding: 16px;
  backdrop-filter: blur(8px);
  text-align: center;
  width: 280px;
}
.photo {
  width: 100%;
  border-radius: 20px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.photo-label {
  margin-top: 12px;
  font-size: 1rem;
  font-weight: bold;
}
@media (max-width: 640px) {
  .gallery { flex-direction: column; align-items: center; }
}