/* ===== Colours we reuse everywhere ===== */
:root {
  --yes: #22a06b;
  --no: #e0555c;
  --blue: #4f7fe8;
  --red: #e0555c;
  --wood: #8b5a2b;
  --wood-dark: #6b4420;
  --ink: #1f2430;
  --paper: #ffffff;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, #eef2ff, #fdf2f8);
  min-height: 100vh;
}


/* ==========================================================
   THE TWO DEBATERS AT THE TOP
   ========================================================== */

.stage {
  background: linear-gradient(#2b3350, #4a5578);
  display: flex;
  justify-content: center;
  gap: 130px;
  align-items: flex-end;
  padding: 100px 20px 0;
  position: relative;
  overflow: hidden;
}

/* The wooden floor they stand on */
.stage::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: var(--wood-dark);
  border-top: 4px solid #4a2d13;
}

/* One debater = bubble + person + lectern */
.spot {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}

/* The one who is talking leans forward */
.spot.talking {
  transform: scale(1.06);
}

/* ===== The people ===== */
.person {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: -18px; /* tucks them in behind the lectern */
}

.head {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f3c9a0;
  border: 3px solid #d9a877;
  position: relative;
}

.eye {
  position: absolute;
  top: 17px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #33291f;
}

.eye.left  { left: 10px; }
.eye.right { right: 10px; }

.mouth {
  position: absolute;
  bottom: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 6px;
  border-radius: 0 0 15px 15px;
  background: #a8434a;
}

/* When someone talks, their mouth flaps open and shut */
.spot.talking .mouth {
  animation: talk 0.35s infinite;
}

@keyframes talk {
  0%, 100% { height: 4px; }
  50%      { height: 12px; }
}

.body {
  width: 72px;
  height: 62px;
  border-radius: 34px 34px 10px 10px;
  margin-top: 4px;
}

#spot-left  .body { background: var(--blue); }
#spot-right .body { background: var(--red); }

/* ===== The lecterns ===== */
.lectern-top {
  width: 104px;
  height: 28px;
  background: var(--wood);
  border: 3px solid #5a3818;
  border-radius: 6px 6px 0 0;
  transform: perspective(140px) rotateX(24deg);
}

.lectern-post {
  width: 28px;
  height: 52px;
  background: var(--wood-dark);
  margin: 0 auto;
  border-left: 3px solid #5a3818;
  border-right: 3px solid #5a3818;
}

.lectern-base {
  width: 80px;
  height: 10px;
  background: var(--wood);
  border: 3px solid #5a3818;
  border-radius: 4px;
  margin: 0 auto;
}

/* ===== Speech bubbles ===== */
.bubble {
  position: absolute;
  bottom: 100%;
  width: 210px;
  background: white;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 0.92rem;
  line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}

.bubble.show {
  opacity: 1;
  transform: translateY(-8px);
}

/* The little pointy tail at the bottom of the bubble */
.bubble::after {
  content: "";
  position: absolute;
  top: 100%;
  border: 12px solid transparent;
  border-top-color: white;
}

#bubble-left  { left: 10px; }
#bubble-left::after  { left: 30px; }

#bubble-right { right: 10px; }
#bubble-right::after { right: 30px; }


/* ==========================================================
   THE DEBATES UNDERNEATH
   ========================================================== */

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px 20px;
}

/* ===== Topic cards ===== */
.topic-card {
  background: var(--paper);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}

.topic-card:hover {
  transform: translateY(-3px);
  border-color: #8b9cff;
}

.topic-card h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.topic-card .count {
  color: #6b7280;
  font-size: 0.9rem;
}

/* ===== Debate room ===== */
.hidden {
  display: none;
}

#back-button {
  background: none;
  border: none;
  color: #4f46e5;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin-bottom: 10px;
}

#back-button:hover {
  text-decoration: underline;
}

/* The bar that shows which side is winning */
.score-bar {
  display: flex;
  height: 34px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin: 16px 0 24px;
  background: #d9dee9;
}

.score-side {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
  transition: width 0.4s ease;
  white-space: nowrap;
  overflow: hidden;
}

.score-side.yes { background: var(--yes); }
.score-side.no  { background: var(--no); }

/* The two columns of arguments */
.sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.side {
  background: var(--paper);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow);
  border-top: 5px solid;
}

.yes-side { border-top-color: var(--yes); }
.no-side  { border-top-color: var(--no); }

.side h3 {
  margin: 0 0 12px;
}

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

.side li {
  background: #f6f7fb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.side li .text {
  flex: 1;
}

/* The little 👍 vote button on each argument */
.vote-button {
  background: white;
  border: 1px solid #d0d5e0;
  border-radius: 999px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: 0.85rem;
  white-space: nowrap;
}

.vote-button:hover {
  background: #eef2ff;
  border-color: #8b9cff;
}

.empty-note {
  color: #9aa1b1;
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 12px;
}

/* ===== The "add an argument" box ===== */
.add-form {
  display: flex;
  gap: 8px;
}

.add-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid #d0d5e0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
}

.add-form input:focus {
  outline: 2px solid #8b9cff;
  border-color: transparent;
}

.add-form button {
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  font-weight: bold;
}

.add-form button:hover {
  background: #3f38c4;
}

footer {
  text-align: center;
  padding: 30px;
  color: #6b7280;
  font-size: 0.9rem;
}


/* ===== On phones, shrink and stack things ===== */
@media (max-width: 640px) {
  .stage {
    gap: 20px;
    padding-top: 90px;
  }
  .bubble {
    width: 140px;
    font-size: 0.8rem;
  }
  .sides {
    grid-template-columns: 1fr;
  }
}
