:root {
  --background: #fcfcff;
  --lavander: #d19cdd;
  --accent: #ffc72c;
  --accent-dimmed: #ffe49b;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* --- Global footer gradient --- */

main.flex-grow-1 {
  position: relative;
  /* This establishes a stacking context for the pseudo-element */
  z-index: 1;
}

main.flex-grow-1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 15vh;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(209, 156, 221, 0), var(--lavander));
  pointer-events: none;
  bottom: -5px;
}

/* --- General --- */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--background);
  color: var(--lavander);
  text-align: center;
  box-sizing: border-box;
  font-family: "Nyght Serif", sans-serif;
}

@font-face {
  font-family: "Nyght Serif";
  src: url("/static/fonts/NyghtSerif-Regular.woff2") format("woff2"),
    url("/static/fonts/NyghtSerif-Medium.woff2") format("woff2"),
    url("/static/fonts/NyghtSerif-LightItalic.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

.button-container {
  margin-top: 6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 2rem;
}

.button {
  width: 278px;
  box-sizing: border-box;
  border: none;
  color: black;
  border-radius: 50px;
  padding: 12px 0;
  text-align: center;
  background-color: var(--accent);
  font-size: 48px;
  font-weight: 700;
  line-height: 100%;
  text-decoration: none;
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via,
    --tw-gradient-to;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.button:hover {
  background-color: var(--accent-dimmed);
  cursor: pointer;
}
.button:active {
  background-color: var(--lavander);
}
.button.button-sm {
    width: auto; /* Let padding define the width */
    padding: 12px 40px;
    font-size: 1.75rem; /* A smaller font size */
}

.header-nav a {
  color: var(--background);
  font-size: 30px;
  font-weight: 700;
  line-height: 100%;
  transition-property: color, background-color, border-color,
    text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via,
    --tw-gradient-to;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 300ms;
}
.header-nav a.active {
  color: var(--accent);
  text-decoration: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-weight: 700;
}
.header-nav a:hover {
  color: var(--accent);
}

/* --- Page heading --- */
.page-heading {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  font-style: italic;
  color: var(--lavander);
  margin-top: 10px;
  margin-bottom: 20px;
  line-height: 1.3;
}

.page-heading::after {
  content: "– – – – – – – – – –";
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1;
  vertical-align: middle;
}

@media (min-width: 768px) {
  .page-heading {
    margin-top: 15px;
    margin-bottom: 25px;
  }
}

.gif-overlay-container {
  position: relative;
  display: block;
  max-width: 100%;
  height: auto;
  margin: 3rem auto;
}

.gif-overlay-container img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0; /* Reset margin */
}

/* Common styles for both h1 titles */
.gif-overlay-container h1 {
  position: absolute;
  width: 100%;
  font-size: 48px;
  font-weight: 700;
  margin: 0;
  padding: 0 4rem; /* Adds some space from the sides */
  box-sizing: border-box;
}

/* Specific position for the top title */
.gif-overlay-container #hero-title-top {
  top: 20%;
  text-align: left;
}

/* Specific position for the bottom title */
.gif-overlay-container #hero-title-bottom {
  bottom: 20%;
  text-align: right;
}

.description-text {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  line-height: 1.6; /* Increased line-height for better readability */
  text-align: center;
  margin-bottom: 3rem;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .description-text {
    max-width: 83.3333%;
  }
}

/* --- Voting --- */

.images-container {
  display: flex;
  flex-direction: column; /* Stack images vertically by default (mobile) */
  align-items: center;
  gap: 15px; /* Space between images */
  padding: 0 10px;
  padding-bottom: 40px;
  flex-grow: 1; /* Added to push footer down if content is short */
}

/* On medium screens and up (desktop), display images side-by-side */
@media (min-width: 768px) {
  .images-container {
    flex-direction: row; /* Make images display in a row on desktop */
    justify-content: center; /* Center them horizontally */
    gap: 30px;
  }
}

.images-container img {
  width: 80vw; /* ~80% of viewport width */
  max-width: 300px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
}
.images-container img:hover {
  transform: scale(1.05);
}

.vote-form {
  display: inline-block;
}
.vote-form button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

.pixel-bar {
  width: 80%;
  max-width: 400px;
  margin: 10px auto 25px auto;
  display: flex;
  flex-wrap: nowrap;
  border: 2px solid var(--lavander);
  background-color: var(--background);
  overflow: hidden;
  min-height: 12px;
}
.pixel-bar .pixel {
  height: 12px;
  box-sizing: border-box;
  border-right: 1px solid var(--background);
}
/* Remove border on the last pixel to prevent double border effect */
.pixel-bar .pixel:last-child {
  border-right: none;
}

.winner-container {
  display: flex;
  justify-content: center;
  flex-grow: 1;
}

.winner-container img {
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  max-width: 90vw;
  width: 320px;
  height: auto;
}

/* --- Talking Dog --- */

.dog-dialogue-section {
  background: linear-gradient(to bottom, var(--background), var(--lavander));
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  padding: 5% 2%;
  flex-wrap: wrap;
}

.dog-dialogue-section--reversed {
  flex-direction: row-reverse;
}

.dog-dialogue-section .dialogue-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 500px;
}

.dog-dialogue-section .dog-with-paper {
  position: relative;
  display: block;
  max-width: 350px;
  height: auto;
}

.dog-dialogue-section .thought-bubble {
  background: var(--background);
  position: relative;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  color: black;
  font-size: 48px;
  font-weight: 700;
  line-height: 100%;
  border: 6px black solid;
  border-radius: 76px;
  padding: 4rem;
}

.dog-dialogue-section .thought-bubble::before,
.dog-dialogue-section .thought-bubble::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 6px black solid;
  background: var(--background);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Default tail (points right) */
.dog-dialogue-section .thought-bubble::before {
  width: 3rem;
  height: 3rem;
  bottom: 30%;
  right: -2rem;
}

.dog-dialogue-section .thought-bubble::after {
  width: 2rem;
  height: 2rem;
  bottom: 20%;
  right: -3.5rem;
}

/* Reversed tail (points left) */
.dog-dialogue-section--reversed .thought-bubble::before {
  right: auto;
  left: -2rem;
}

.dog-dialogue-section--reversed .thought-bubble::after {
  right: auto;
  left: -3.5rem;
}

#dog-dialogue-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 1rem;
  box-sizing: border-box;
}

/* MODIFICATION: Constrain width and adjust padding for better desktop look */
#dog-dialogue-modal .dog-dialogue-section {
  background: none;
  padding: 2rem;
  max-width: 900px; /* Prevents it from looking too wide on large screens */
}

#dog-dialogue-modal .dog-with-paper {
  max-width: 300px; /* A good size for the dog in the modal */
}

#dog-dialogue-modal .thought-bubble {
  font-size: 2rem; /* Balanced font size for desktop modal */
  padding: 3rem;
}

#dog-dialogue-modal .button-container {
  margin-top: 1.5rem;
  flex-direction: row; /* Buttons appear side-by-side in the modal */
  flex-wrap: wrap;
  gap: 1rem;
}

/* Mobile styles remain the same as user confirmed they are OK */
@media (max-width: 918px) {
  #dog-dialogue-modal .dog-dialogue-section {
    padding: 1rem;
  }
  #dog-dialogue-modal .dog-with-paper {
    max-width: 150px;
  }
  #dog-dialogue-modal .thought-bubble {
    font-size: 1.5rem;
  }
}

/* --- Team --- */

.team-card {
  box-sizing: border-box;
  border: none;
  background-color: transparent;
  transition: transform 0.2s ease-in-out;
  margin-bottom: 20px;
  margin-left: auto;
  margin-right: auto;
  max-width: 343px;
  border-radius: 8px;
}

.team-card:hover {
  transform: scale(1.05);
}

.team-card .team-card-img {
  width: 100%;
}

.team-card .card-title {
  font-weight: 700;
  color: #000;
  text-align: left;
}

.team-card .team-card-role {
  font-size: 1rem;
  color: #000;
  text-align: left;
  line-height: 1.3;
}

/* Some other styles — such as footer or dog containers — might be an overhead but see if I give a shit */
.gradient-section-container {
  background: linear-gradient(
    to bottom,
    var(--background) 0%,
    var(--background) 65%,
    var(--lavander) 100%
  );
  width: 100%;
  /* The padding has been removed from here */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

footer {
  position: relative;
  z-index: 2;
  width: 100%;
  background: var(--lavander);
  color: #fcfcff;
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  font-style: italic;
  text-align: center;
  padding: 5px 5px 12px;
  box-sizing: border-box;
}

/* --- Responsive homepage overwrites --- */

@media (max-width: 918px) {
  /* Top "Spinning Dog" section */
  .gif-overlay-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
  }
  .gif-overlay-container #hero-title-top,
  .gif-overlay-container #hero-title-bottom {
    position: static;
    transform: none;
    margin: 0;
    text-align: center;
    font-size: 2rem;
    line-height: 1.2;
  }
  .gif-overlay-container img {
    order: 1;
    margin: 0 0 1rem 0;
    max-width: 60%;
  }
  .gif-overlay-container #hero-title-top {
    order: 2;
  }
  .gif-overlay-container #hero-title-bottom {
    order: 3;
  }

  /* Bottom "Are you ready?" section */
  .dog-dialogue-section {
    flex-direction: column;
    gap: 0;
    padding: 2rem 1rem 4rem 1rem;
  }

  .dog-dialogue-section .dog-with-paper {
    order: 1; /* This puts the dog first on mobile */
    margin-bottom: -40px;
    z-index: 2;
    max-width: 180px;
  }

  .dog-dialogue-section .dialogue-container {
    order: 2; /* This puts the bubble and buttons container second */
    width: 95%;
    z-index: 1;
  }

  .dog-dialogue-section .thought-bubble {
    font-size: 1.5rem;
    padding: 3.5rem 1.5rem 1.5rem 1.5rem;
    border-width: 4px;
    border-radius: 40px;
    text-align: center;
  }

  .dog-dialogue-section .thought-bubble::before,
  .dog-dialogue-section .thought-bubble::after {
    bottom: auto;
    right: auto;
    left: auto;
    transform: none;
    border-width: 4px;
  }
  
  .dog-dialogue-section .thought-bubble::before {
    top: -1.2rem;
    left: calc(50% - 2.5rem);
    width: 2rem;
    height: 2rem;
  }
  
  .dog-dialogue-section .thought-bubble::after {
    top: -2.2rem;
    left: calc(50% - 4.5rem);
    width: 1.2rem;
    height: 1.2rem;
  }

  /* Buttons */
  .button-container {
    margin-top: 2rem;
    gap: 1rem;
  }
  .button {
    width: 240px;
    font-size: 2rem;
    padding: 10px 0;
  }

  .header-nav {
    display: inline-block;
    font-size: 1.4rem; /* even larger on small screens */
    padding: 4px 6px;
    justify-content: center !important;
    gap: 16px;
  }
}