/* =====================================================================
   ЦВЕТА, ТЕКСТУРЫ И ШРИФТ. Поменяй их здесь — и перекрасится весь мир.
   Текстуры — «пиксельный шум» на блоках, как камень и земля в игре.
   ===================================================================== */

:root {
  /* Цвета блоков */
  --stone: #7f7f7f;        /* камень */
  --dirt: #866043;         /* земля */
  --grass: #5d9b35;        /* трава сверху */
  --plank: #b8925a;        /* доски */
  --gold: #fcdb3b;         /* золото */
  --tnt: #b52a2a;          /* TNT (красный) */
  --diamond: #4ad9d9;      /* алмаз */
  --panel: #c6c6c6;        /* серая панель инвентаря */
  --ink: #000000;          /* чёрная обводка блоков */
  --shadow-text: #3f3f3f;  /* тень у надписей */

  /* Пиксельный шум поверх блоков */
  --noise-stone:
    radial-gradient(circle at 15% 25%, rgba(0,0,0,.22) 0 3px, transparent 3.5px),
    radial-gradient(circle at 60% 15%, rgba(255,255,255,.16) 0 2px, transparent 2.5px),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,.25) 0 4px, transparent 4.5px),
    radial-gradient(circle at 35% 75%, rgba(255,255,255,.12) 0 2px, transparent 2.5px);
  --noise-dirt:
    radial-gradient(circle at 20% 30%, rgba(0,0,0,.3) 0 3px, transparent 3.5px),
    radial-gradient(circle at 70% 20%, rgba(255,255,255,.12) 0 2px, transparent 2.5px),
    radial-gradient(circle at 45% 65%, rgba(0,0,0,.25) 0 4px, transparent 4.5px),
    radial-gradient(circle at 85% 85%, rgba(255,255,255,.1) 0 2px, transparent 2.5px);
  --noise-plank:
    repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 2px, transparent 2px 16px),
    radial-gradient(circle at 30% 40%, rgba(0,0,0,.1) 0 3px, transparent 3.5px);

  --font-title: "Pixelify Sans", "Courier New", monospace;
  --font-text: "Pixelify Sans", "Courier New", monospace;
}


/* =====================================================================
   ОСНОВА: земля под ногами
   ===================================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: var(--dirt);
  background-image: var(--noise-dirt);
  background-size: 64px 64px;
  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;
  color: #313131;
}

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

/* Карточка = панель инвентаря */
.card {
  background-color: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 4px 4px 0 #ffffff, inset -4px -4px 0 #555555;
  padding: 28px 32px;
  animation: rise 0.6s ease-out both;
}

/* Кнопка = доски */
.button {
  font-family: var(--font-title);
  font-size: 16px;
  color: #ffffff;
  background-color: var(--plank);
  background-image: var(--noise-plank);
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 4px 4px 0 #d9b57c, inset -4px -4px 0 #7a5a30;
  text-shadow: 2px 2px 0 #3f2a10;
  padding: 14px 24px;
  cursor: pointer;
}

.button:hover {
  filter: brightness(1.12);
}

.button:active {
  box-shadow: inset 4px 4px 0 #7a5a30, inset -4px -4px 0 #d9b57c;
  transform: translateY(3px);
}


/* =====================================================================
   БЕГУЩАЯ СТРОКА: строка чата
   ===================================================================== */

.ticker {
  background: rgba(0, 0, 0, 0.82);
  border-bottom: 4px solid var(--ink);
  color: var(--gold);
  font-family: var(--font-title);
  font-size: 15px;
  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: 700;
  margin-top: 20px;
  color: #ffffff;
  text-shadow: 4px 4px 0 var(--shadow-text);
}

/* Название — блок алмаза */
.highlight {
  display: inline-block;
  background-color: var(--diamond);
  background-image: var(--noise-stone);
  color: #ffffff;
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 4px 4px 0 #a5f3f3, inset -4px -4px 0 #2a9c9c;
  text-shadow: 3px 3px 0 #1d6b6b;
  padding: 4px 16px 10px;
  margin-top: 10px;
}

.tagline {
  font-size: 21px;
  max-width: 600px;
  margin: 24px 0 0;
  color: #ffffff;
  text-shadow: 2px 2px 0 var(--shadow-text);
}

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

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

.badge.off {
  background: var(--tnt);
  color: #ffffff;
}

/* Аватар = земляной блок с травой сверху */
.avatar {
  width: 240px;
  height: 240px;
  display: grid;
  place-items: center;
  font-size: 130px;
  background-color: var(--dirt);
  background-image: var(--noise-dirt);
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 0 24px 0 var(--grass), inset -8px -8px 0 #5a3a1a;
  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: 3px solid var(--ink);
  border-radius: 0;
  padding: 4px 14px;
  font-weight: 600;
  background: var(--gold);
}

.tags li:nth-child(2n) {
  background: var(--grass);
  color: #ffffff;
}

.tags li:nth-child(3n) {
  background: var(--stone);
  color: #ffffff;
}


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

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

.like-button {
  width: 130px;
  height: 130px;
  font-size: 64px;
  background-color: var(--panel);
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset -6px -6px 0 #9a9a9a, inset 6px 6px 0 #ffffff;
  cursor: pointer;
  filter: grayscale(1);                /* пока яблока нет — оно серое */
  transition: transform 0.1s, box-shadow 0.1s;
}

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

.like-button:active {
  transform: translate(4px, 4px);
  box-shadow: inset 6px 6px 0 #6a6a6a;
}

.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: #ffffff;
  background-color: var(--stone);
  background-image: var(--noise-stone);
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset -4px -4px 0 #5e5e5e, inset 4px 4px 0 #b5b5b5;
  text-shadow: 2px 2px 0 #3a3a3a;
  padding: 36px 22px 22px;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.3s;
}

.fact:hover {
  transform: translate(-2px, -2px);
  filter: brightness(1.1);
}

/* Номер факта: берётся из 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: #ffffff;
  background-color: var(--diamond);
  border: 3px solid var(--ink);
  border-radius: 0;
  text-shadow: none;
}

/* Правда = изумрудный блок */
.fact.truth {
  background-color: var(--grass);
}

/* Ложь = блок TNT */
.fact.lie {
  background-color: var(--tnt);
}

/* Штамп «ПРАВДА» или «ЛОЖЬ!» после ответа */
.fact.truth::after,
.fact.lie::after {
  position: absolute;
  right: 16px;
  bottom: -16px;
  font-family: var(--font-title);
  font-size: 18px;
  color: var(--ink);
  background-color: var(--panel);
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 2px 12px;
  text-shadow: none;
  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: #ffffff;
  background-color: #5e5e5e;
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 3px 3px 0 #3a3a3a;
  padding: 12px 16px;
}

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

.wall-form input:focus,
.wall-form textarea:focus {
  outline: 3px solid var(--gold);
  outline-offset: 0;
}

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

/* Табличка = доски с надписью */
.message {
  background-color: var(--plank);
  background-image: var(--noise-plank);
  color: #ffffff;
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: inset 4px 4px 0 #d9b57c, inset -4px -4px 0 #7a5a30;
  text-shadow: 2px 2px 0 #3f2a10;
  padding: 14px 18px;
  animation: rise 0.4s ease-out both;
  overflow-wrap: anywhere;
}

.message:nth-child(3n + 2) {
  background-color: var(--grass);
  background-image: none;
  box-shadow: inset 4px 4px 0 #7fbf3f, inset -4px -4px 0 #3a6b1f;
  text-shadow: 2px 2px 0 #24461a;
}

.message:nth-child(3n) {
  background-color: var(--stone);
  background-image: var(--noise-stone);
  box-shadow: inset 4px 4px 0 #a0a0a0, inset -4px -4px 0 #505050;
  text-shadow: 2px 2px 0 #3a3a3a;
}

.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(--gold);
}

.empty {
  color: #ffffff;
  text-shadow: 2px 2px 0 var(--shadow-text);
}

footer {
  text-align: center;
  font-size: 15px;
  color: #ffffff;
  background-color: #1b1b1b;
  padding: 24px;
  border-top: 4px solid 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;
  }
}
