/* Фон страницы */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, sans-serif;
  background-color: #1e1e1e;
  color: #f1f1f1;
  display: flex;
  flex-direction: column;
}

/* Главный layout */
.main-wrapper {
  display: flex;
  flex: 1;
}

.side-menu {
  position: fixed;
  top: 56px;
  left: 0; /* Для десктопа он всегда виден */
  width: 240px;
  background-color: #252525;
  border-right: 1px solid #444;
  padding: 25px 20px;
  box-sizing: border-box;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100% - 56px);
  z-index: 999;
  transition: left 0.3s ease;
}

.menu-footer {
  font-size: 8px;
  padding: 15px 10px;
  color: #777;
  text-align: center;
}
.menu-footer a {
  color: #888;
  text-decoration: none;
}

.menu-footer a:hover {
  text-decoration: underline;
}

.menu-link.active {
  font-weight: bold;
  color: #00cc88;
}

.side-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.side-menu li {
  margin-bottom: 16px;
}


/* Контент */
.main-content {
  flex-grow: 1;
  padding: 40px;
  background-color: #2a2a2a;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* Шапка */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 56px; /* или твоя высота */
  z-index: 1000;
  background: #111;
  display: flex;
  align-items: center;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.main-wrapper {
  padding-top: 56px; /* должен точно соответствовать высоте шапки */
}

.header-content {
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #fff;
  font-weight: bold;
  font-size: 1.1em;
}

.logo img {
  margin-right: 8px;
}

.site-name {
  font-family: 'Segoe UI', sans-serif;
}


/* Блок CPS контейнера */
.cps-container {
  width: 100%;
  max-width: 600px;
  background-color: #333;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}

/* Заголовки */
.cps-container h1,
.cps-container h2,
.cps-container h3 {
  color: #ffffff;
  margin-bottom: 15px;
}

/* Кнопка старт */
#cps-start {
  padding: 12px 24px;
  font-size: 16px;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}
#cps-start:hover {
  background-color: #555;
}
#cps-start:active {
  transform: scale(0.98);
}

/* Зона кликов */
#cps-click-zone {
  width: 500px;
  height: 200px;
  background-color: #3a3a3a;
  border-radius: 8px;
  margin: 20px 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: background 0.2s;
}
#cps-click-zone:active {
  background-color: #444;
}

#cps-click-zone.disabled {
  opacity: 0.3;
  transition: opacity 0.3s;
}

/* Статистика */
.cps-stats {
  display: flex;
  gap: 30px;
  font-size: 16px;
  margin-bottom: 20px;
}
/* Таймер */
#cps-timer {
  font-size: 20px;
  color: #aaa;
  margin-top: 10px;
}

/* Результат */
#cps-result h2 {
  color: #00cc88;
  margin-bottom: 10px;
}
#cps-result.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25%  { transform: translateX(-5px); }
  50%  { transform: translateX(5px); }
  75%  { transform: translateX(-3px); }
}

/* SEO-блок */
/* Описание */
.cps-description {
  max-width: 800px;
  color: #bbb;
  text-align: left;
  margin: 40px auto 0;
  margin-top: 30px;
  font-size: 15px;
  line-height: 1.6;
}

/* Скрытый блок */
.hidden {
  display: none;
}

/* Обновление стиля меню */
.side-menu a {
  color: #aaa;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.side-menu a:hover {
  background-color: #333;
  color: #fff;
}

.side-menu .active a {
  background-color: #333;
  font-weight: bold;
  color: #00cc88;
}

.side-menu i {
  font-size: 16px;
}

.site-footer {
  background-color: #1a1a1a;
  padding: 10px 20px;
  text-align: center;
  font-size: 13px;
  color: #888;
  border-top: 1px solid #333;
}
.site-footer .footer-line a {
  color: #bbb;
  margin: 0 4px;
  text-decoration: none;
}
.site-footer .footer-line a:hover {
  text-decoration: underline;
}
.site-footer .footer-line a.active {
  font-weight: bold;
  color: #fff;
}


/* Обёртка всей игры */
.cps-wrapper {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: none;
}

/* Верх (заголовок + старт) */
.cps-top {
  text-align: center;
  margin-bottom: 20px;
}

.cps-settings {
  margin-top: 10px;
}
.cps-settings select,
.cps-settings button {
  margin-left: 8px;
  padding: 8px 12px;
  background-color: #444;
  color: #fff;
  border: none;
  border-radius: 6px;
}
.cps-settings button:hover {
  background-color: #555;
}

/* Анимации кликов */
#clicks-fx {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.cps-fx {
  position: absolute;
  font-size: 20px;
  color: #00cc88;
  animation: flyUp 0.6s ease-out forwards;
}
@keyframes flyUp {
  0%   { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-30px); }
}

#cps-time-buttons button {
  background: #333;
  color: white;
  border: none;
  padding: 6px 12px;
  margin: 0 4px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

#cps-time-buttons button:hover {
  background: #444;
}

#cps-time-buttons button.active {
  background: #0f0;
  color: #000;
  font-weight: bold;
}
#cps-time-buttons {
  display: flex;
  gap: 8px;
  margin-top: 5px;
  justify-content: center;
}

#cps-time-buttons .time-btn {
  background: #333;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

#cps-time-buttons .time-btn:hover {
  background: #444;
}

#cps-time-buttons .time-btn.active {
  background: #00cc44;
  color: #000;
}


.cps-click-instruction {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  color: #ccc;
  pointer-events: none;
  opacity: 0.8;
  text-align: center;
}
/* Зона */
.spacebar-zone {
  width: 500px;
  height: 200px;
  background: #222;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto;
  color: #aaa;
  font-size: 1.3rem;
  user-select: none;
  outline: none;
  transition: transform 0.15s ease, background 0.15s;
  position: relative;
}

.spacebar-zone.active {
  background: #333;
  transform: scale(1.02);
  box-shadow: 0 0 12px #0ff4;
}

/* Выбор времени */
.time-select {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px auto 0;
}

.time-select button {
  padding: 6px 12px;
  background: #444;
  border: none;
  color: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
}

.time-select button.active,
.time-select button:hover {
  background: #0cf;
}

/* Счётчик и результат */
.spacebar-counter {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 1.2rem;
  margin-top: 15px;
}

.spacebar-result {
  text-align: center;
  margin-top: 20px;
  color: #ccc;
}

#achievements div {
  margin-top: 6px;
  font-weight: bold;
  color: gold;
}

/* Кнопка рестарта */
.restart-btn {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  background: #0cf;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  color: black;
  font-weight: bold;
}

.restart-btn.hidden {
  display: none;
}

/* SEO-блок */
.seo-description {
  margin-top: 50px;
  padding: 20px;
  color: #aaa;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}

.seo-description h2,
.seo-description h3 {
  color: #fff;
  margin-top: 1.5em;
}

.seo-description ul {
  padding-left: 20px;
  margin: 0.5em 0 1.5em;
}

#aim-zone {
  position: relative;
  width: 100%;
  height: 400px;
  background: #222;
  border-radius: 10px;
  margin: 20px 0;
  overflow: hidden;
  cursor: crosshair;
}

.aim-target {
  position: absolute;
  background: #f44;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

.aim-target:hover {
  transform: scale(1.2);
}

.aim-target.crit {
  background: gold;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}


@keyframes pop {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(-20px); opacity: 0; }
}

/* Основной контейнер */
.drag-zone {
  position: relative;
  width: 100%;
  max-width: 600px;
  height: 400px;
  margin: 40px auto;
  background: #1e1e1e;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

/* UI-элементы внутри зоны */
.drag-ui {
  position: relative;
  width: 300px;
  height: 300px;
}

/* Цель */
.drag-target {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100px;
  height: 100px;
  background: rgba(0, 255, 0, 0.2);
  border: 2px dashed #0f0;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

/* Перетаскиваемый элемент */
.drag-handle {
  position: absolute;
  top: 10%;
  left: 10%;
  width: 50px;
  height: 50px;
  background: #0af;
  border-radius: 50%;
  cursor: grab;
  z-index: 2;
  transition: transform 0.2s ease;
}
.drag-handle:active {
  cursor: grabbing;
  transform: scale(1.1);
}
.drag-handle.dragging {
  box-shadow: 0 0 10px #0af;
}

/* Информация (счёт и таймер) */
.drag-info {
  position: absolute;
  bottom: -60px;
  width: 100%;
  text-align: center;
  font-size: 18px;
  color: #fff;
  display: flex;
  justify-content: space-around;
}
.drag-score {
  font-weight: bold;
  color: #0f0;
}
.drag-timer {
  font-weight: bold;
  color: #f00;
}

/* Сообщение/инструкция */
.drag-message {
  margin-top: 20px;
  font-size: 16px;
  color: #ccc;
  text-align: center;
}

/* SEO-блок */
.game-description {
  max-width: 800px;
  margin: 40px auto 20px;
  color: #ccc;
  font-size: 15px;
  line-height: 1.6;
}
.game-description h2 {
  font-size: 22px;
  margin-bottom: 10px;
  color: #fff;
}
.game-description ul {
  margin-top: 10px;
  padding-left: 20px;
  list-style: disc;
}

/* Кнопка повтора */
.retry-btn {
  margin-top: 15px;
  padding: 10px 20px;
  background: #0af;
  border: none;
  color: #fff;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease;
}
.retry-btn:hover {
  background: #09c;
}


#drag-zone {
  position: relative;
  width: 100%;
  height: 400px;
  background: #222;
  border-radius: 12px;
  margin: 20px 0;
  overflow: hidden;
}

.aim-fx {
  position: absolute;
  font-size: 18px;
  font-weight: bold;
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 10;
}

.fx-hit {
  color: #3f6;
  text-shadow: 0 0 5px #6f6, 0 0 10px #3f3;
  animation: fxUp 0.4s forwards;
}

.fx-miss {
  color: #f44;
  text-shadow: 0 0 5px #f88;
  animation: fxShake 0.3s forwards;
}

@keyframes fxUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-25px) scale(1.6); opacity: 0; }
}

@keyframes fxShake {
  0% { transform: translate(-50%, -50%) translateX(0); opacity: 1; }
  25% { transform: translate(-50%, -50%) translateX(-4px); }
  50% { transform: translate(-50%, -50%) translateX(4px); }
  75% { transform: translate(-50%, -50%) translateX(-3px); }
  100% { transform: translate(-50%, -50%) translateX(0); opacity: 0; }
}

@keyframes fx-fade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(1.3);
  }
}

.logo img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
}
.logo {
  color: #f1f1f1;
  text-decoration: none;
}
.logo:hover {
  opacity: 0.8;
}

#aim-zone {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a, #111);
  transition: background 0.5s ease;
}

#aim-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: repeating-radial-gradient(circle at center, #222 0px, #1a1a1a 2px, #1a1a1a 6px);
  animation: waveAnim 4s infinite linear;
  opacity: 0.3;
  pointer-events: none;
}

@keyframes waveAnim {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

/* До старта */
#aim-zone.idle {
  animation: pulseIdle 4s infinite;
}

@keyframes pulseIdle {
  0%, 100% { background-color: #222; }
  50% { background-color: #2a2a2a; }
}

/* Во время игры */
#aim-zone.active {
  background: linear-gradient(135deg, #1e1e1e, #111);
  box-shadow: 0 0 20px #0cf5;
  animation: none;
}

/* Кольцо волны */
.aim-click-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #66f;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: clickRing 0.6s ease-out forwards;
  z-index: 1;
}

@keyframes clickRing {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(5);
  }
}


.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 6px 12px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.tab-btn.active {
  background: #0cf;
  color: #000;
  font-weight: bold;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
}
.stats-table th, .stats-table td {
  padding: 8px;
  border-bottom: 1px solid #444;
  text-align: center;
}
.stats-table th {
  background: #333;
}

#cps-click-zone.active {
  background: linear-gradient(135deg, #1e1e1e, #000000);
  box-shadow: 0 0 15px #0cf5;
  transition: 0.3s ease;
}

.aim-click-ring {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #66f;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: clickRing 0.6s ease-out forwards;
  z-index: 1;
}

@keyframes clickRing {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(4);
  }
}

.cookie-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 300px;
  height: 200px;
  background: #111;
  color: #eee;
  padding: 20px;
  box-sizing: border-box;
  font-size: 14px;
  border-radius: 10px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  border: 1px solid #333;
}

.cookie-banner.hidden {
  display: none;
}

.cookie-banner .cookie-text {
  line-height: 1.5;
  font-size: 14px;
}

.cookie-banner button {
  background: #0cf;
  color: black;
  border: none;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  align-self: flex-end;
  transition: background 0.2s;
}

.cookie-banner button:hover {
  background: #09c;
}



/* Burger menu button */
.menu-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  margin-right: 16px;
  cursor: pointer;
  display: none;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .side-menu {
    position: fixed;
    top: 56px;
    left: -240px;
    width: 240px;
    height: calc(100% - 56px);
    background-color: #252525;
    transition: left 0.3s ease;
    z-index: 9999;
    overflow-y: auto;
  }

  .side-menu.active {
    left: 0;
  }

  .main-wrapper {
    padding-left: 0;
  }

  .main-content {
    padding: 30px 20px;
  }
}

.cps-time-buttons button {
  background: #444;
  color: #fff;
  border: none;
  padding: 6px 12px;
  margin: 0 4px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.2s;
}

.cps-time-buttons button:hover {
  background: #555;
}

.cps-time-buttons button.active {
  background: #00cc44;
  color: #000;
}

#aim-instruction {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ccc;
  font-size: 1.2rem;
  opacity: 0.8;
  text-align: center;
  pointer-events: none;
}

.cps-results-table {
  max-width: 500px;
  margin: 20px auto;
  text-align: center;
}

.aim-main-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  align-items: flex-start;
}

#aim-area {
  flex: 0 0 480px;
  max-width: 100%;
}

#aim-history {
  flex: 0 0 220px;
  max-width: 100%;
}

.cps-results-table h3 {
  text-align: center;
  margin-bottom: 6px;
}

.cps-results-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

.cps-results-table th,
.cps-results-table td {
  padding: 4px 6px;
  text-align: center;
}

.cps-results-table th {
  background: #222;
  font-weight: 600;
}

.cps-results-table tr:nth-child(even) {
  background-color: rgba(255,255,255,0.03);
}

.aim-waiting {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: #ccc;
  text-align: center;
  pointer-events: none;
}
.page-container a,
.seo-description a,
.game-description a {
  color: #bbb;
  text-decoration: none;
  border-bottom: 1px dashed #555;
  transition: 0.2s;
}
.page-container a:hover,
.seo-description a:hover,
.game-description a:hover {
  color: #fff;
  text-decoration: underline;
  border-bottom-color: #888;
}
.page-container a.active,
.seo-description a.active,
.game-description a.active {
  font-weight: bold;
  color: #fff;
}
