/* -------------------- ТВОЙ ОРИГИНАЛ -------------------- */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(270deg, #a1c4fd, #c2e9fb, #667eea, #764ba2);
  background-size: 800% 800%;
  animation: gradientShift 20s ease infinite;
  margin: 0;
  padding: 20px;
  color: #333;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

h1,
h2 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 20px;
}

.container {
  max-width: 800px;
  margin: auto;
  padding: 20px;
  background: linear-gradient(to bottom right, #ffffffee, #f0f8ffdd);
  backdrop-filter: blur(4px);
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  animation: fadeInUp 1s ease forwards;
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.buttons,
#voteButtons {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px auto;
}

input[type="text"] {
  display: block;
  width: 100%;
  max-width: 400px;
  margin: 0 auto 20px auto;
  padding: 14px 18px;
  font-size: 1rem;
  border: 2px solid #3498db;
  border-radius: 14px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.4s ease, box-shadow 0.4s ease;
  color: #333;
  background-color: #fff;
  font-weight: 500;
  font-family: inherit;
}

input[type="text"]::placeholder {
  color: #aaa;
  font-weight: 400;
}

input[type="text"]:focus {
  border-color: #764ba2;
  box-shadow: 0 0 15px rgba(118, 75, 162, 0.6);
}

button {
  padding: 10px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  cursor: pointer;
  transition: background-position 0.4s ease, box-shadow 0.3s ease,
    transform 0.2s ease;
  margin: 5px;
  font-weight: 700;
  font-family: inherit;
  background-size: 200% 200%;
  background-position: left center;
  box-shadow: 0 4px 15px rgba(118, 75, 162, 0.5),
    inset 0 -2px 5px rgba(255, 255, 255, 0.3);
}

button:hover {
  background-position: right center;
  box-shadow: 0 6px 20px rgba(118, 75, 162, 0.8),
    inset 0 -3px 7px rgba(255, 255, 255, 0.5);
  transform: translateY(-3px) scale(1.05);
}

button:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 3px 8px rgba(118, 75, 162, 0.6),
    inset 0 -1px 3px rgba(255, 255, 255, 0.4);
}

.bar-row {
  margin-bottom: 15px;
  width: 100%;
}

.bar {
  width: 100%;
  height: 30px;
  background: #ddd;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  margin-top: 5px;
}

.bar-fill {
  height: 100%;
  width: 0;
  opacity: 0;
  border-radius: 12px 0 0 12px;
  color: white;
  font-weight: bold;
  line-height: 30px;
  text-align: start;
  padding-left: 10px;
  box-sizing: border-box;
  transition: width 1.2s ease, opacity 0.6s ease;
  position: absolute;
  top: 0;
  left: 0;
  white-space: nowrap;
  user-select: none;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: start;
  justify-content: start;
  overflow: hidden;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
}

.fact {
  background: linear-gradient(90deg, #2ecc71, #27ae60);
  box-shadow: 0 0 12px #27ae60;
}

.fake {
  background: linear-gradient(90deg, #e74c3c, #c0392b);
  box-shadow: 0 0 12px #c0392b;
}

.bar-fill.visible {
  opacity: 1;
  animation: barFadeIn 1s ease forwards;
  transform-origin: left;
}

@keyframes barFadeIn {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  font-size: 1rem;
}

th,
td {
  padding: 12px;
  border-bottom: 1px solid #ddd;
}

th {
  background: #f1f1f1;
  color: #555;
  text-align: left;
}

.timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.8rem;
  font-weight: bold;
  background: linear-gradient(145deg, #ffffff, #d0e7ff);
  border: 2px solid #764ba2;
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 0 15px rgba(118, 75, 162, 0.6),
    inset 0 0 15px rgba(255, 255, 255, 0.7);
  color: #764ba2;
  width: 150px;
  margin: 25px auto;
  transition: background 0.3s, color 0.3s;
  user-select: none;
  animation: pulseGlow 3s ease-in-out infinite;
}

.timer-value {
  font-size: 3rem;
  color: #9b59b6;
  margin: 5px 0;
  transition: color 0.3s;
}

.timer-label,
.timer-unit {
  font-size: 1rem;
  color: #555;
}

@keyframes pulseGlow {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(118, 75, 162, 0.6),
      inset 0 0 20px rgba(182, 111, 213, 0.8);
  }
  50% {
    box-shadow: 0 0 22px rgba(118, 75, 162, 1),
      inset 0 0 30px rgba(182, 111, 213, 1);
  }
}

/* ---------------- Секция input с живыми кнопками ---------------- */
.input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 500px;
  margin: 0 auto 20px;
}

.input-section input {
  padding: 12px;
  border: 2px solid #aaa;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
}

.input-section button {
  background-color: #27ae60;
  color: white;
  font-weight: 600;
  border: none;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.input-section button:hover {
  background-color: #219150;
}

.questions button[data-truth="fact"]::after {
  content: " ✅";
  color: #2ecc71;
}

.questions button[data-truth="fake"]::after {
  content: " ❌";
  color: #e74c3c;
}

/* ---------------- Анимация на кнопках вопросов ---------------- */
.questions button {
  position: relative;
  overflow: hidden;
  z-index: 0;
  border-radius: 14px;
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

.questions button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, #764ba2, #667eea);
  transition: transform 0.5s ease;
  transform: translateX(-100%);
  z-index: -1;
  border-radius: 14px;
}

.questions button:hover::before {
  transform: translateX(0);
}

/* -------------------- АДАПТАЦИЯ -------------------- */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .container {
    padding: 15px 20px;
    border-radius: 10px;
  }

  h1,
  h2 {
    font-size: 1.4rem;
  }

  input[type="text"] {
    font-size: 0.95rem;
    padding: 12px 14px;
  }

  #voteButtons {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  button {
    width: 100%;
    margin: 10px 0;
    font-size: 1rem;
  }

  .timer {
    width: 80%;
    max-width: none;
  }

  table {
    font-size: 0.9rem;
  }
}

/* -------------------- Плавные переходы для основных элементов -------------------- */
button,
input[type="text"],
.timer,
.bar-fill {
  transition: all 0.3s ease;
}

/* -------------------- Скрытые элементы -------------------- */
.hidden {
  display: none;
}
