:root{
  --bg: #f4efe6;
  --paper: #f8f4ec;
  --ink: #1f1b18;
  --muted: #6f655b;
  --line: #d8d0c4;
  --line-strong: #b8aa96;
  --accent: #7a2e2a;
  --accent-2: #8b6b2e;
  --card: #fbf8f2;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

#app {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
}

.top-bar {
  padding: 1rem 1.25rem;
  text-align: center;
  background: linear-gradient(to bottom, #fbf8f2, #f4efe6);
  border-bottom: 1px solid var(--line-strong);
}

.top-bar .title {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.top-bar .subtitle {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.game-area {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  min-height: 0;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.75rem;
  font-size: 0.95rem;
}

.clues-label {
  font-weight: 600;
  color: var(--ink);
}

.fart-banner {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(122, 46, 42, 0.25);
  background: #fffaf2;
  color: var(--accent);
  font-size: 0.85rem;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  padding: 0;
}

.person {
  min-height: 140px;
  border-radius: 0;
  border: 1px solid var(--line-strong);
  background: linear-gradient(to bottom, #fbf8f2, #f1eadf);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0.6rem 0;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease, background 0.08s ease;
  box-shadow: var(--shadow);
}

.person:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
  background: linear-gradient(to bottom, #fffdf8, #f3ecdf);
}

.person-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.person-emoji {
  font-size: 1.9rem;
  transition: transform 0.12s ease;
}

.person-label {
  font-size: 0.8rem;
  color: var(--ink);
  opacity: 0.9;
}

.person.selected {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 2px rgba(139, 107, 46, 0.18);
}

.person.correct {
  border-color: #567a4f;
  box-shadow: 0 0 0 2px rgba(86, 122, 79, 0.18);
}

.person.wrong {
  border-color: #9b4a43;
  box-shadow: 0 0 0 2px rgba(155, 74, 67, 0.18);
}

.person.bounce .person-emoji {
  animation: bounce 0.25s ease-out;
}

@keyframes bounce {
  0% { transform: translateY(0); }
  30% { transform: translateY(-6px); }
  60% { transform: translateY(3px); }
  100% { transform: translateY(0); }
}

.clue-toast {
  margin: 0.9rem 0 0;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-strong);
  background: var(--card);
  font-size: 0.98rem;
  text-align: center;
  min-height: 3.1rem;
  line-height: 1.4;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.controls {
  padding: 0.9rem 0 0;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.controls .btn {
  border-radius: 0;
  border: 1px solid #000;
  background: #201c19;
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  cursor: pointer;
  min-width: 150px;
  transition: background 0.12s, transform 0.06s;
  box-shadow: 0 6px 14px rgba(0,0,0,.14);
}

.controls .btn.primary {
  background: var(--accent);
  border-color: #5f221f;
  color: #fff;
  font-weight: 600;
}

.controls .btn:hover:not(:disabled) {
  background: #3a2e22;
}

.controls .btn.primary:hover:not(:disabled) {
  background: #8b3934;
}

.controls .btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.controls .btn:not(:disabled):active {
  transform: translateY(1px);
}

.result-panel {
  margin: 0.9rem 0 0;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
  text-align: center;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}

@media (max-width: 900px) {
  .person {
    min-height: 120px;
  }
}

@media (max-width: 700px) {
  .person {
    min-height: 95px;
  }

  .person-emoji {
    font-size: 1.35rem;
  }

  .person-label {
    font-size: 0.68rem;
  }
}


@media (max-width: 560px) {
  .game-area {
    padding: 0.8rem;
  }

  .hud-row {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .top-bar .title {
    font-size: 1.45rem;
  }

  .top-bar .subtitle {
    font-size: 0.9rem;
  }

  .person-emoji {
    font-size: 1.6rem;
  }

  .person-label {
    font-size: 0.72rem;
  }

  .controls .btn {
    width: 100%;
    min-width: 0;
  }

  .clue-toast,
  .result-panel {
    font-size: 0.9rem;
  }
}
