:root {
  /* Colours */
  /* Swatches */
  --pink: #e460f0;
  --blue: #8cb1be;
  --green: #8cbeb2;
  --orange: #f39c5c;
  --red: #f06060;
  --dark-grey: var(--shadow);
  --yellow: #f2e97e;
  --brown: #5c4b51;
  --black: #303030;
  --white: #fff;
  /* Hues */
  --antiquewhite: #faebd7;
  --soft-yellow: #f6f4d8;
  --light-yellow: #fdfcef;
  --light-brown: #5c4b5115;
  --light-green: #ddfff0;
  --dark-green: #6cae9f;
  --dark-pink: #d96fa2;
  --light-blue: #93bff0;
  --soft-blue: #6a9ad1;
  --light-orange: #f6c26f;
  --dark-orange: #d88a0e;
  --dark-blue: #274d78;
  --darker-blue: #102236;
  /*Other colours */
  --form-control-color: var(--blue);
  --form-selection-color: var(--red);
  --list-item-color: var(--dark-pink);
  --placeholder-color: var(--dark-green);
  --shadow: #333;
  --button-hover:
    var(--dark-blue) /* Fonts */ --font-heading: aglet-slab, sans-serif;
  --font-card: hwt-artz, sans-serif;
  --font-body: aglet-slab, sans-serif;
  --font-body-bold: aglet-slab, sans-serif;
  --font-fancy: "chill script", sans-serif;

  /* Other */
  --header-height: 25vh;
}

/* Default to mobile screens */

html,
body {
  font-family: var(--font-body);
  padding: 0;
  margin: 0;
}
body {
  padding: 1em;
  background-color: var(--light-yellow);
  /* Remove default margins */
  font-weight: 400;
  font-size: 14pt;
  overflow-y: auto;
  color: var(--brown);
}
header {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--orange);
  padding: 2vh 0 0 3em;
  margin: -1em -1em auto;
  overflow: clip;
  /* overflow:-moz-hidden-unscrollable; */
}
main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 1em;
  /* height: 65vh; */
  /* overflow: scroll; */
}
/* footer {
  height: 5vh;
  background-color: #5c4b51;
} */
form {
  display: flex;
}
form input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.5em;
  border: var(--green) medium solid;
  border-radius: 1ch;
  text-align: center;
}
form input::placeholder {
  color: var(--placeholder-color);
}
h1,
h2 {
  font-family: var(--font-heading);
  text-align: center;
  font-size: 1.5rem;
}
h2 {
  font-family: var(--font-fancy);
}
button {
  padding: 0.5em 1em;
  font-size: 1rem;
  text-transform: uppercase;
  font-family: var(--font-body);
}

button#startBattle {
  margin: 2em auto -1.5em; /* Put it visibly closer to the item list than the form */
  align-self: stretch;
}
.card {
  background: white;
  padding: 1em;
  margin: 1em;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  flex: 1;
  text-align: center;
  transition:
    transform 0.2s,
    background-color 0.3s;
  position: relative;
}
.card:hover {
  transform: scale(1.05);
  background-color: #e6f2ff;
}
.item-list {
  align-self: stretch;
}
.selected {
  background-color: var(--orange) !important;
  color: white;
}
.highlight {
  border: 3px solid var(--orange);
  background-color: var(--yellow);
}
.remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--dark-pink);
  color: var(--white);
  border: none;
  border-radius: 20%;
  width: 20px;
  height: 20px;
  cursor: pointer;
}
.winner-check {
  display: block;
  font-size: 24px;
  color: var(--green);
  margin-top: 0.5em;
}
.item-list,
.battle-area,
.results {
  margin-top: 20px;
}
.btn {
  padding: 10px 20px;
  margin: 5px;
  background-color: var(--green);
  color: white;
  border: none;
  border-radius: 0.5em;
  cursor: pointer;
}
.btn.add {
  padding: 0.5rem 1rem;
  margin: 0.25rem;
  font-size: 1.5rem;
}
.btn:hover {
  background-color: var(--blue);
}
.hidden {
  display: none;
}
.controls {
  margin-top: 1em;
}
#battleArea button {
  font-weight: bold;
  font-size: 1em;
}
#reset-controls button {
  text-transform: none;
  font-weight: 400;
}
.controls button {
  padding: 0.5em 1em;
  font-size: 1rem;
  text-transform: none;
}
.flex-column {
  /* For use by javascript when container is initially hidden */
  display: flex;
  flex-direction: column;
  align-items: center;
}
.battle-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
}
.btn,
.card {
  font-weight: bold;
  text-transform: capitalize;
}
#startBattle.btn {
  margin: 2cap auto 0;
  font-size: large;
}
textarea {
  width: 100%;
  height: 100px;
  margin-top: 10px;
}
#choozatron-logo {
  /* object-fit: cover; */
  max-height: var(--header-height);
  overflow: hidden;
}
#about {
  position: absolute;
  top: 1em;
  right: 1em;
  font-size: 1em;
  background-color: var(--orange);
  border-radius: 1em;
  font-weight: 800;
  border: 0.125em solid var(--brown);
  width: 2cap;
  height: 2cap;
  text-align: center;
  color: var(--brown);
  text-decoration: none;
  padding: 0;
  margin: 0;
}
#about a {
  font-weight: 800;
  color: var(--brown);
  text-decoration: none;
  vertical-align: middle;
}
#about:hover {
  background-color: var(--pink);
}
#progressContainer {
  align-self: stretch;
}
#progressBar {
  height: 20px;
  background-color: var(--light-brown);
  border-radius: 10px;
  overflow: hidden;
}
#progressFill {
  height: 100%;
  width: 0%;
  background-color: var(--orange);
  transition: width 0.3s ease;
}
#startBattle {
  background-color: var(--orange);
}
#battleArea {
  align-items: center;
  border: 0.25em solid var(--brown);
  background-color: var(--soft-yellow);
  border-radius: 1em;
  padding: 1em;
}
#results {
  border: 0.25em solid var(--orange);
  border-radius: 1em;
  padding: 1em;
}
#results div {
  text-align: center;
}
#nextButton {
  align-self: center;
}

#restartGame:hover,
#resetGame:hover,
#refineGame:hover,
#copyScores:hover,
#exportScores:hover {
  background-color: var(--dark-orange);
}
#restartGame {
  background-color: var(--dark-pink);
}
#resetGame {
  background-color: var(--red);
}
#refineGame {
  background-color: var(--orange);
}
#exportScores {
  background-color: var(--blue);
}

/* About page and footer */

/* About pages */
.page {
  border: 0;
  padding: 1.5em;
  display: flex;
  flex-direction: column;
  align-self: center;
}
.page h1 {
  font-size: 2em;
  margin-bottom: 0.5lh;
  color: var(--orange);
}
.page h2 {
  font-size: 1.5em;
  margin: 2ch 0 0;
  padding-bottom: 0.25ch;
  border-bottom: var(--orange) 2pt solid;
}
.page li {
  margin: 0.5em 0;
}
.page a.start {
  display: inline-block;
  align-self: center;
  text-decoration: none;
  padding: 0.5em 1.5em;
  margin-left: 1em;
  border-radius: 1em;
  background-color: var(--brown);
  color: var(--yellow);
}
.page a.start:hover {
  color: var(--yellow);
  background-color: var(--black);
}
.page a.start::before {
  content: "👉 ";
  position: relative;
  left: -0.5em;
}
.page a.start:hover::before {
  content: "👍 ";
  position: relative;
  left: -0.5em;
}

/* footer */
footer {
  display: flex;
  flex-direction: column;
  flex: 90% auto max-content;
  align-items: center;
  padding: 0.5lh 0 0;
  margin: 2em -1.5em -1.5em;
  background-color: var(--brown);
  color: var(--yellow);
  border-top: 0.5ch solid var(--yellow);
}
#about footer section {
  width: initial;
  min-height: initial;
  align-content: initial;
}
footer section#donate,
footer section#feedback {
  border-radius: 2em;
  padding: 0 0.5lh;
  font-weight: 500;
}
footer section#donate,
footer section#feedback {
  display: flex;
  align-items: center;
}
footer section#feedback .button {
  background-color: var(--light-orange);
}
footer section#feedback .button:hover,
footer section#feedback .button:active {
  background-color: var(--pink);
}
footer section#licence img {
  opacity: 0.5;
  align-self: flex-end;
}
footer section p {
  color: var(--light-blue);
  margin: 0;
}
footer section p strong {
  color: var(--orange);
  font-weight: 700;
  display: block;
}
footer section form {
  margin: 0 0.5em;
}
footer section form input {
  border: none;
}
footer section#licence {
  background-color: var(--black);
  color: var(--dark-orange);
  text-align: center;
  font-weight: 300;
  padding: 1lh;
  margin-top: 1lh;
  width: -webkit-fill-available;
}
footer section#licence p {
  color: var(--dark-orange);
}
footer section#licence a {
  color: var(--light-blue);
  text-decoration: none;
  font-weight: 500;
}
footer section#licence a:hover {
  color: var(--orange);
  text-decoration: underline;
}

h2.function::before {
  content: "⚙️ ";
}
h2.tip::before {
  content: "💡 ";
}

/* *****************************
Larger screens 
******************************* */

@media (min-width: 768px) {
  html,
  body {
    min-height: 100%;
    margin: 0;
    /* Remove default margins */
  }
  header {
    display: flex;
    flex-direction: row;
    justify-content: center;
    background-color: var(--orange);
    /* padding: 2em 0 0 0; */
    margin: -1em -1em auto;
    max-height: var(--header-height);
  }
  /* About pages */
  .page {
    font-size: 16pt;
  }
  .page main section {
    border: 0;
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    align-self: center;
    max-width: 50vw;
  }
}
