:root {
  --purple: rgb(213 139 186);
  --red: rgb(239 134 0);
  --green: rgb(143 213 154);
  --blue: rgb(13 182 239);
  --grey: rgb(255 255 255);
  --gold: rgb(248 182 2);
  --white: rgb(255 255 255);
  --black: rgb(24 23 23);
  --blue-accent: rgba(57 101 157 / 0.1);
  --purple-accent: rgba(96 81 139 / 0.1);
  --red-accent: rgba(203 60 18 / 0.1);
  --green-accent: rgba(128 165 46 / 0.1);
  --grey-accent: rgba(158 158 158 / 0.1);
  --gold-accent: rgba(248 182 40 / 0.1);
  --dark-grey: rgba(29, 29, 29, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
  text-rendering: optimizeLegibility;
  text-decoration: none;
}

.loading {
  position: fixed;
  z-index: 999;
  height: 100%;
  width: 100%;
  background: black;
  color: white;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 2em;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loading p {
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: url(Images/background-optimised.jpg) no-repeat center;
  background-size: cover;
}

#es-footer {
  width: 100%;
  align-self: stretch;
}

.site-disclaimer {
  font-family: 'Inter', Arial, sans-serif;
  font-size: 11px;
  font-weight: 300;
  line-height: 1.4;
  color: rgba(250, 241, 171, 0.5);
  text-align: center;
  padding: 24px 16px 0;
  max-width: 400px;
  margin: 0 auto;
}

button:hover {
  cursor: pointer;
}

.content-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: auto;
  max-width: 375px;
  padding: 16px;
}

.logo-button-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.logo {
  background: url(Images/lost-cities-logo.png) no-repeat center;
  background-repeat: no-repeat;
  /* Prevents the image from repeating */
  background-position: center;
  /* Centers the image in the container */
  background-size: contain;
  width: 128px;
  height: 80px;
  flex-shrink: 0;
}

.button-container {
  background-color: white;
  /* Light background for contrast */
  padding: 0px;
  /* Or any other value that suits your design */
  display: inline-block;
  border-radius: 8px;
  /* Or flex, block, etc., as per your layout */
  /* Add any other styling as needed */
}

.button-style {
  display: flex;
  padding: 8px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: linear-gradient(
    107deg,
    #fece42 0%,
    #feda43 21.5%,
    #fbd37d 40.5%,
    #f1a005 79.5%,
    #efc318 100%
  );
  border-radius: 8px;
  border: 1px solid transparent;
  -webkit-mask-image: linear-gradient(
    45deg,
    #fff 25%,
    rgba(255, 255, 255, 0.2) 50%,
    #fff 75%
  );
  mask-image: linear-gradient(
    45deg,
    #fff 25%,
    rgba(255, 255, 255, 0.2) 50%,
    #fff 75%
  );
  -webkit-mask-size: 800%;
  mask-size: 800%;
  -webkit-mask-position: 0;
  mask-position: 0;
  color: #0b0908;
  text-align: center;
  font-family: Acme;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
}

.button-style:hover {
  transition: mask-position 1s ease, -webkit-mask-position 1s ease;
  /* Reduced duration for faster animation */
  -webkit-mask-position: 120%;
  mask-position: 120%;
  opacity: 1;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.container {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-self: stretch;
}

div[class^="expedition-"] {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex: 1 0 0;
}

.exp-icon {
  display: flex;
  height: 80px;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  border-radius: 4px;
  background-repeat: no-repeat;
  /* Prevents the image from repeating */
  background-position: center;
  /* Centers the image in the container */
  background-size: contain;
}

.card-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  align-self: stretch;
  perspective: 1000px;
}

.card-stack > *:not(:first-child) {
  margin-top: -24px;
}

.card {
  display: flex;
  height: 80px;
  padding: 4px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  align-self: stretch;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: var(--dark-grey, #363434);
  box-shadow: 0px -16px 16px -4px rgba(0, 0, 0, 0.5),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
  position: relative;
  transition: transform 0.3s ease, border 0.3s ease;
  transform-style: preserve-3d;
}

.card:hover {
  border: 1px solid black;
  cursor: pointer;
  transform: translateY(-8px);
  z-index: 0;
}

.card:hover ~ .card {
  z-index: 1;
}

.card.active {
  border-radius: 4px;
  transform: rotateY(180deg);
  background-color: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.card.active:hover {
  transform: translateY(-8px) rotateY(180deg);
  /* Only lift, keep the flip */
}

.card.active .text {
  transform: rotateY(180deg);
  backface-visibility: hidden;
  /* This ensures the text doesn't show through the back of the card */
}

.card:hover ~ .card {
  z-index: 1;
}

.text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.text-left {
  color: var(--white);
  text-align: center;
  font-family: Inter;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.text-right {
  color: var(--white);
  text-align: right;
  font-family: Inter;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
  line-height: normal;
}

.card-image {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex: 1 0 0;
  align-self: stretch;
  border-radius: 4px;
  transition: transform 0.3s ease, border 0.3s ease;
  /* This is already correctly set up */
}

/* Expedition Purple */
.expedition-purple .exp-icon {
  background-image: url(Images/purple-expedition.png);
}

.expedition-purple .card:hover {
  border-radius: 4px;
  border: 0.5px solid var(--purple);
  background: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-purple .card:hover .card-image {
  background: url(Images/purple-card.png), cover no-repeat;
  filter: none;
  border: 0.5px solid var(--purple);
  opacity: 0.5;
}

.expedition-purple .card.active {
  border-radius: 4px;
  border: 2px solid var(--purple, #d58bba);
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-purple .card-image {
  opacity: 0.25;
  background: url(Images/purple-card.png), lightgray 50% / cover no-repeat;
  filter: grayscale(100%);
}

.expedition-purple .card.active .card-image {
  opacity: 1;
  background: url(Images/purple-card.png), cover no-repeat;
  filter: none;
  border: 1px solid var(--purple, #d58bba);
}

.expedition-purple .card.active .text p {
  color: var(--purple);
}

/* Expedition green */
.expedition-green .exp-icon {
  background-image: url(Images/green-expedition.png);
}

.expedition-green .card:hover {
  border-radius: 4px;
  border: 0.5px solid var(--green);
  background: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-green .card:hover .card-image {
  background: url(Images/green-card.png), cover no-repeat;
  filter: none;
  border: 0.5px solid var(--green);
  opacity: 0.5;
}

.expedition-green .card.active {
  border-radius: 4px;
  border: 2px solid var(--green, #d58bba);
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-green .card-image {
  opacity: 0.25;
  background: url(Images/green-card.png), lightgray 50% / cover no-repeat;
  filter: grayscale(100%);
}

.expedition-green .card.active .card-image {
  opacity: 1;
  background: url(Images/green-card.png), cover no-repeat;
  filter: none;
  border: 1px solid var(--green, #d58bba);
}

.expedition-green .card.active .text p {
  color: var(--green);
}

/* Expedition red */
.expedition-red .exp-icon {
  background-image: url(Images/red-expedition.png);
}

.expedition-red .card:hover {
  border-radius: 4px;
  border: 0.5px solid var(--red);
  background: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-red .card:hover .card-image {
  background: url(Images/red-card.png), cover no-repeat;
  filter: none;
  border: 0.5px solid var(--red);
  opacity: 0.5;
}

.expedition-red .card.active {
  border-radius: 4px;
  border: 2px solid var(--red, #d58bba);
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-red .card-image {
  opacity: 0.25;
  background: url(Images/red-card.png), lightgray 50% / cover no-repeat;
  filter: grayscale(100%);
}

.expedition-red .card.active .card-image {
  opacity: 1;
  background: url(Images/red-card.png), cover no-repeat;
  filter: none;
  border: 1px solid var(--red, #d58bba);
}

.expedition-red .card.active .text p {
  color: var(--red);
}

/* Expedition blue */
.expedition-blue .exp-icon {
  background-image: url(Images/blue-expedition.png);
}

.expedition-blue .card:hover {
  border-radius: 4px;
  border: 0.5px solid var(--blue);
  background: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-blue .card:hover .card-image {
  background: url(Images/blue-card.png), cover no-repeat;
  filter: none;
  border: 0.5px solid var(--blue);
  opacity: 0.5;
}

.expedition-blue .card.active {
  border-radius: 4px;
  border: 2px solid var(--blue, #d58bba);
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-blue .card-image {
  opacity: 0.25;
  background: url(Images/blue-card.png), lightgray 50% / cover no-repeat;
  filter: grayscale(100%);
}

.expedition-blue .card.active .card-image {
  opacity: 1;
  background: url(Images/blue-card.png), cover no-repeat;
  filter: none;
  border: 1px solid var(--blue, #d58bba);
}

.expedition-blue .card.active .text p {
  color: var(--blue);
}

/* Expedition grey */
.expedition-grey .exp-icon {
  background-image: url(Images/grey-expedition.png);
}

.expedition-grey .card:hover {
  border-radius: 4px;
  border: 0.5px solid var(--white);
  background: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-grey .card:hover .card-image {
  background: url(Images/grey-card.png), cover no-repeat;
  filter: none;
  border: 0.5px solid var(--white);
  opacity: 0.5;
}

.expedition-grey .card.active {
  border-radius: 4px;
  border: 2px solid var(--grey, #d58bba);
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-grey .card-image {
  opacity: 0.25;
  background: url(Images/grey-card.png), lightgray 50% / cover no-repeat;
  filter: grayscale(100%);
}

.expedition-grey .card.active .card-image {
  opacity: 1;
  background: url(Images/grey-card.png), cover no-repeat;
  filter: none;
  border: 1px solid var(--grey, #d58bba);
}

.expedition-grey .card.active .text p {
  color: var(--grey);
}

/* Expedition gold */
.expedition-gold .exp-icon {
  background-image: url(Images/gold-expedition.png);
}

.expedition-gold .card:hover {
  border-radius: 4px;
  border: 0.5px solid var(--gold);
  background: #000;
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-gold .card:hover .card-image {
  background: url(Images/gold-card.png), cover no-repeat;
  filter: none;
  border: 0.5px solid var(--gold);
  opacity: 0.5;
}

.expedition-gold .card.active {
  border-radius: 4px;
  border: 2px solid var(--gold, #d58bba);
  box-shadow: 0px -8px 16px -4px rgba(0, 0, 0, 0.38),
    0px -16px 24px 0px rgba(0, 0, 0, 0.24), 0px -8px 8px -4px rgba(0, 0, 0, 0.7);
}

.expedition-gold .card-image {
  opacity: 0.25;
  background: url(Images/gold-card.png), lightgray 50% / cover no-repeat;
  filter: grayscale(100%);
}

.expedition-gold .card.active .card-image {
  opacity: 1;
  background: url(Images/gold-card.png), cover no-repeat;
  filter: none;
  border: 1px solid var(--gold, #d58bba);
}

.expedition-gold .card.active .text p {
  color: var(--gold);
}

#calculate-button {
  width: 100%;
  height: 48px;
}

#resetCards,
.close-button {
  display: flex;
  padding: 8px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  width: 100%;
  height: 48px;
  border-radius: 8px;
  border: 1px solid var(--gold);
  background: rgba(0, 0, 0, 0.25);
  color: var(--gold);
  text-align: center;
  font-family: Acme;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
}

.modal {
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6);
  /* semi-transparent black background */
  display: none;
  justify-content: center;
  /* centers the modal horizontally */
  align-items: center;
  /* centers the modal vertically */
  border-radius: 12px;
}

.modal-content {
  display: flex;
  flex-direction: column;
  background-color: black;
  margin: 15% auto;
  padding: 20px;
  width: 80%;
  border-radius: 8px;
  color: white;
  max-width: 375px;
  background-image: url("/Images/background-optimised.jpg");
  background-size: cover;
  background-position: center;
  /* This centers the image in the container */
  border: 1px solid #f6da4b;
  gap: 24px;
}

#score-display {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.overall-total-score {
  display: flex;
  flex-direction: column;
  align-items: center;
}

strong {
  color: #faf1ab;
  text-align: center;
  font-family: Acme;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.final-score {
  color: #f6da4b;
  text-align: center;
  -webkit-text-stroke-width: 0.25;
  -webkit-text-stroke-color: var(--White, #fff);
  font-family: Acme;
  font-size: 40px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

/* Scores Styles */
.scores-heading {
  display: flex;
  flex-direction: column;
}

.scores-columns {
  display: flex;
  flex-direction: row;
  /* Change to row to align score columns horizontally */
  justify-content: space-around;
  /* This will space out the columns evenly */
  align-items: flex-start;
  /* Aligns columns at the top */
  width: 100%;
}

.color-score-column {
  flex: 1;
  max-width: 48px;
  /* Each column will take equal width */
}

.exp-icon {
  display: flex;
  height: 80px;
  padding: 8px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
  align-self: stretch;
  border-radius: 4px;
  background-repeat: no-repeat;
  /* Prevents the image from repeating */
  background-position: center;
  /* Centers the image in the container */
  background-size: contain;
}

.color-score-total {
  color: #f6da4b;
  text-align: center;
  -webkit-text-stroke-width: 0.25;
  -webkit-text-stroke-color: var(--White, #fff);
  font-family: Acme;
  font-size: 20px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  /* Styles for color total score */
}

.color-score-bonus-title {
  color: #faf1ab;
  text-align: center;
  font-family: Acme;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
  /* Styles for color bonus score */
}

.color-score-bonus-total {
  color: #f6da4b;
  text-align: center;
  -webkit-text-stroke-width: 0.25;
  -webkit-text-stroke-color: var(--White, #fff);
  font-family: Acme;
  font-size: 18px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.coffee {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: white;
  text-align: center;
  font-family: Inter;
  font-size: 12px;
  font-style: normal;
  font-weight: 300;
  line-height: normal;
}

.coffee h3 {
  color: #f6da4b;
  text-align: center;
  font-family: Acme;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: normal;
}

.coffee a {
  color: #faf1ab;
  text-decoration: underline;
}

.coffee p {
  color: #faf1ab;
}

/*Media Queries*/

@media (prefers-reduced-motion: reduce) {
  .card {
    transition: none;
    /* Disables transitions */
  }

  .card:hover,
  .card.active,
  .card.active:hover {
    transform: none;
    /* Disables transformations on hover/active states */
  }

  .loading p {
    animation: none;
  }
}
