/* =====================================================================
   ЦВЕТА И ШРИФТЫ. Поменяй их здесь — и перекрасится весь сайт
   ===================================================================== */

:root {
  --bg: #fff3d6;         /* фон страницы */
  --card: #ffffff;       /* фон карточек */
  --ink: #17140f;        /* текст и обводки */
  --accent: #ff4f8b;     /* розовый */
  --accent-2: #3d6bff;   /* синий */
  --accent-3: #b6f24a;   /* салатовый */
  --accent-4: #ffc933;   /* жёлтый */
  --radius: 22px;        /* скругление углов */
  --font-title: "Unbounded", "Arial Black", sans-serif;
  --font-text: "Onest", "Segoe UI", Arial, sans-serif;
}


/* =====================================================================
   ОСНОВА
   ===================================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(0, 0, 0, 0.13) 1.3px, transparent 1.8px);
  background-size: 22px 22px;          /* узор в точку */
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 18px;
  line-height: 1.5;
}

h1, h2 {
  font-family: var(--font-title);
  line-height: 1.1;
  margin: 0 0 16px;
}

h2 {
  display: inline-block;
  font-size: 28px;
  background: linear-gradient(transparent 58%, var(--accent-4) 58%);   /* «маркер» под заголовком */
}

main, .hero {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.card {
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--ink);    /* жёсткая тень, как у наклейки */
  padding: 28px 32px;
  animation: rise 0.6s ease-out both;
}

.button {
  font-family: var(--font-title);
  font-size: 16px;
  color: white;
  background: var(--accent-2);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--ink);
  padding: 14px 24px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.button:hover {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0 var(--ink);
}

.button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}


/* =====================================================================
   БЕГУЩАЯ СТРОКА
   ===================================================================== */

.ticker {
  background: var(--ink);
  color: var(--accent-4);
  font-family: var(--font-title);
  font-size: 15px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  padding: 10px 0;
}

.ticker-text {
  display: inline-block;
  animation: run 30s linear infinite;
}

.ticker-text span {
  padding-right: 40px;
}


/* =====================================================================
   ШАПКА
   ===================================================================== */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 56px;
}

.hero h1 {
  font-size: clamp(38px, 6vw, 68px);
  font-weight: 800;
  margin-top: 20px;
}

.highlight {
  display: inline-block;
  background: var(--accent);
  color: white;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 4px 16px 10px;
  margin-top: 10px;
  rotate: -2deg;
}

.tagline {
  font-size: 21px;
  max-width: 600px;
  margin: 24px 0 0;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 600;
}

.badge.off {
  background: var(--accent);
  color: white;
}

.avatar {
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  font-size: 130px;
  background: var(--accent-3);
  border: 4px solid var(--ink);
  border-radius: 50%;
  box-shadow: 10px 10px 0 var(--ink);
  animation: wobble 3s ease-in-out infinite;
  cursor: pointer;
}

.avatar:hover {
  animation: spin 0.8s ease-in-out;
}


/* =====================================================================
   КАРТОЧКИ: сетка из двух колонок
   ===================================================================== */

main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  padding-bottom: 60px;
}

.game, .wall {
  grid-column: 1 / -1;                 /* эти карточки — во всю ширину */
}

.about {
  rotate: -0.6deg;
}

.like-box {
  rotate: 1.2deg;
  animation-delay: 0.1s;
}

.game {
  animation-delay: 0.2s;
}

.wall {
  animation-delay: 0.3s;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 20px 0 0;
}

.tags li {
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-weight: 600;
  background: var(--accent-4);
}

.tags li:nth-child(2n) {
  background: var(--accent-3);
}

.tags li:nth-child(3n) {
  background: #ffd0e1;
}


/* =====================================================================
   ЛАЙКИ
   ===================================================================== */

.like-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--accent-4);
}

.like-button {
  width: 130px;
  height: 130px;
  font-size: 64px;
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
  filter: grayscale(1);                /* пока лайка нет — сердце серое */
  transition: transform 0.1s, box-shadow 0.1s;
}

.like-button.liked {
  background: var(--accent);
  filter: none;
}

.like-button:active {
  transform: translate(4px, 4px);
  box-shadow: 1px 1px 0 var(--ink);
}

.like-button.pop {
  animation: pop 0.4s ease-out;
}

.like-count {
  font-family: var(--font-title);
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
}

.like-label {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}


/* =====================================================================
   ДВЕ ПРАВДЫ И ОДНА ЛОЖЬ
   ===================================================================== */

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 28px;
}

.fact {
  position: relative;
  min-height: 170px;
  text-align: left;
  font-family: var(--font-text);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 36px 22px 22px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.3s;
}

.fact:hover {
  transform: translate(-3px, -3px) rotate(-1deg);
  box-shadow: 9px 9px 0 var(--ink);
}

/* Номер факта в кружке: берётся из data-fact="1" в index.html */
.fact::before {
  content: attr(data-fact);
  position: absolute;
  top: -18px;
  left: 18px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-family: var(--font-title);
  color: white;
  background: var(--accent-2);
  border: 3px solid var(--ink);
  border-radius: 50%;
}

.fact.truth {
  background: var(--accent-3);
}

.fact.lie {
  background: var(--accent);
  color: white;
}

/* Штамп «ПРАВДА» или «ЛОЖЬ!» после ответа */
.fact.truth::after,
.fact.lie::after {
  position: absolute;
  right: 16px;
  bottom: -16px;
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--ink);
  background: var(--card);
  border: 3px solid var(--ink);
  border-radius: 10px;
  padding: 2px 12px;
  rotate: -8deg;
  animation: stamp 0.35s ease-out;
}

.fact.truth::after {
  content: "ПРАВДА";
}

.fact.lie::after {
  content: "ЛОЖЬ!";
}

.fact.picked {
  outline: 4px dashed var(--ink);
  outline-offset: 6px;
}

.game-result {
  font-size: 22px;
  font-weight: 800;
  min-height: 33px;
  margin: 34px 0 0;
}


/* =====================================================================
   СТЕНА
   ===================================================================== */

.wall-form {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 14px;
  margin: 10px 0 28px;
}

.wall-form input,
.wall-form textarea {
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 12px 16px;
}

.wall-form textarea {
  height: 58px;
  resize: vertical;
}

.wall-form input:focus,
.wall-form textarea:focus {
  outline: none;
  background: white;
  box-shadow: 4px 4px 0 var(--accent-2);
}

.messages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.message {
  background: var(--accent-4);
  border: 3px solid var(--ink);
  border-radius: 18px 18px 18px 4px;  /* уголок, как у облачка в чате */
  padding: 14px 18px;
  animation: rise 0.4s ease-out both;
  overflow-wrap: anywhere;
}

.message:nth-child(3n + 2) {
  background: var(--accent-3);
}

.message:nth-child(3n) {
  background: #ffd0e1;
}

.message-head {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.message p {
  margin: 6px 0 0;
}

.message a {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-2);
}

.empty {
  color: #6b655a;
}

footer {
  text-align: center;
  font-size: 15px;
  padding: 24px;
  border-top: 3px dashed var(--ink);
}


/* =====================================================================
   АНИМАЦИИ
   ===================================================================== */

@keyframes run {
  to { transform: translateX(-50%); }
}

@keyframes rise {
  from { opacity: 0; translate: 0 40px; }
}

@keyframes wobble {
  0%, 100% { rotate: -6deg; }
  50%      { rotate: 6deg; }
}

@keyframes spin {
  to { rotate: 360deg; }
}

@keyframes pop {
  50% { scale: 1.3; }
}

@keyframes stamp {
  from { opacity: 0; scale: 2.5; }
}


/* =====================================================================
   ТЕЛЕФОН: всё в одну колонку
   ===================================================================== */

@media (max-width: 800px) {
  .hero, main, .facts, .wall-form {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 160px;
    height: 160px;
    font-size: 86px;
  }
}
