/* General */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  background-color: #3C2F2A;
  font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  color: #E7996F;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

.container {
  text-align: center;
  padding: 1em;
  max-width: 480px;
  width: 100%;
}


/* Resuable style */
.error-text {
  color: #FF6B6B;
  font-size: 1.2em;
  margin-top: 1em;
  display: block;
}

.img-rounded {
  width: 100%;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.image-container {
  margin: 1em 0;
}

.label-bold {
  margin-top: 0.5em;
  font-weight: bold;
  text-align: center;
  font-size: 1.1em;
  color: #CCCCBB;
}

.route-btns {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1em;
  margin-top: 1.5em;
}

.home-btn {
  background-color: #9d9d9d;
  color: black;
  font-weight: bold;
  text-decoration: none;
  font-size: 1em;
  padding: 0.9em 2em;
  border: none;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
  width:100%;
}

.home-btn:hover {
  background-color: #7a7a7a;
  transform: scale(1.02);
}

.solve-chp-btn {
  display: none;
  background-color: #858E51;
  color: #F6F3E9;
  font-weight: bold;
  text-decoration: none;
  font-size: 1em;
  padding: 0.9em 2em;
  border: none;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
  width: 100%;
}

.solve-chp-btn:hover {
  background-color: #636a3d;
  transform: scale(1.02);
}


/* Home page */
#chapterError {
  color: #FF6B6B;
  font-size: 1.2em;
  font-weight:bolder;
  margin-bottom: 0.5em;
  display: block;
  word-spacing:3px;
}

input#chapterInput {
  width: 100%;
  padding: 1em;
  font-size: 1em;
  border: none;
  border-radius: 12px;
  background-color: #D9DBC9;
  color: #3C2F2A;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.2em;
}

input#chapterInput::placeholder {
  color: #7A7A7A;
}

button {
  background-color: #D35C23;
  color: #F6F3E9;
  font-weight: bold;
  font-size: 1em;
  padding: 0.9em 2em;
  border: none;
  border-radius: 12px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.3s ease;
  width: 100%;
}

button:hover {
  background-color: #8e3a13;
  transform: scale(1.02);
}


/* Chapter full audio page */
h2#audioTitle {
  font-size: 1.5em;
  margin-top: 1em;
  color: #E7996F;
}

#audioPrompt {
  margin: 1em auto;
  color: #E7996F;
  font-size: 1.2em;
  line-height: 1.5;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1em;
  margin: 1.5em 0;
}

.card {
  background: linear-gradient(to bottom right, #d3c0ad, #d9dbc9);
  border-radius: 10px;
  box-shadow: 0 0 5px #b47a56;
  border: 3px solid transparent;
}

.card.highlight {
  border-color: #E7996F;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}


/* Audio Controls */
.audio-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2em;
  margin: 1.5em 0;
}

.control-btns {
  background: #3C2F2A;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  border: none;
  color: #CCCCBB;
  font-size: 1.3em;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.5em;
  cursor: pointer;
}

.control-btns:hover {
  background: #3C2F2A;
  color: whitesmoke;
  
}

.play-pause i {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    line-height: 1;
    vertical-align: middle;
}

.play-pause {
  background-color: #858E51;
  border: 2px solid #CCCCBB;
}

.play-pause:hover {
  background-color: #CCCCBB;
  color: #858E51;
  border: 2px solid #858E51;
}

#audio-controls #play,
#audio-controls #pause {
  background-color: #858E51;
  color: #fff;
  font-size: 1.5em;
}

.continue-container {
  display: flex;
  justify-content: end;
  align-items: center;
  margin-top: 2em;
  gap: 15px;
  margin-bottom: 10px;
}

.continue-btn {
  margin: 0;
  color: #CCCCBB;
  font-size: 19px;
}

.continue-button {
  background-color: #CCCCBB;
  color: #858E51;
  border: 4px solid #858E51;
  border-radius: 50%;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 0;
}

.continue-button:hover {
  background-color: #858E51;
  color: #CCCCBB;
  border: 4px solid #CCCCBB;
}

/* Progress Bar */
.progress-bar-container{
  width:100%;
  height:8px;
  background-color:#e0e0e0;
  border-radius:4px;
  overflow:hidden;
  margin:10px 0;
}

.progress-bar {
  height:100%;
  width:0%;
  background-color:#4caf50;
  transition: width 0.2s linear;
}

.glow{
  box-shadow: 0 0 10px 2px #4caf50, 0 0 20px 4px #4caf50;
  animation: glow-pulse 1s ease-in-out infinite;
}

@keyframes glow-pulse{
  0% {
    box-shadow: 0 0 5px 2px #4caf50;
  }
  50% {
    box-shadow: 0 0 20px 4px #4caf50;
  }
  100%{
    box-shadow:0 0 5px 2px #4caf50;
  }
}

.final:hover, .continue:hover{
  box-shadow:0 0 25px 6px #4caf50;
}

/* Solve chapter page */
#chapterTitle {
  font-size: 1.5em;
  margin-top: 1em;
  color: #E7996F;
}

#chapterImageContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  
}


#chapterImageContainer img {
  width: 100%;
  border-radius: 12px;
  border-radius: 12px;
  display: block;
  border: 10px solid #779f98;
}

.container p {
  color: #CCCCBB;
  font-size: 1.3em;
  margin: 1em auto;
  line-height: 1.4;
}

input[type="text"] {
  width: 100%;
  padding: 1em;
  font-size: 1em;
  border: none;
  border-radius: 12px;
  background-color: #D9DBC9;
  color: #3C2F2A;
  margin-bottom: 1em;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.15);
}

input[type="text"]::placeholder {
  color: #888;
}

#feedback {
  color: #FF6B6B;
  font-size: 1.2em;
}

#storyFeedback {
  color: #FF6B6B;
  font-size: 1.3em;
}


/* Solve story */
#solve-story {
  background-color: #848E51;
}

.label-bold {
  color: #333 !important;
}


/* Credits */
.credit, .instructions{
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border-radius: 8px;
}

.credit h1, .team{
  padding-bottom: 15px;
}


/* Instructions */
.instructions{
  text-align:left;
}

.team{
  color:#CCCCBB;
}

.color-yellow{
  color:#E7CB6F;
}

.color-blue{
  color:#5DCDD3;
}

.story-note{
  color:#C94A36;
}

.instructions-continue {
  margin-bottom: 20px;
}

.instructions-scrollable {
  max-height: 450px;
  overflow-y: auto;
  padding-right: 10px;
  margin-top: 20px;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 15px;
  background: #CCCCBB;
  color: #000;
}

.instructions-scrollable p {
  color: #000;
}

.download-btn {
  display: inline-block;
  padding: 10px 16px;
  background-color: #236a89;
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  margin-bottom: 15px;
  box-shadow: 0px 0px 5px #57b4db;
}

.download-btn:hover {
  background-color: #1a556e;
}

.note {
  color: #C94A36;
  font-weight: bold;
}


/* Responsive */
@media (max-width: 1024px) {
  .container {
    padding: 2.5em;
    max-width: 1024px;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .img-rounded {
    max-width: 340px;
  }

  .control-btns {
    width: 70px;
    height: 70px;
    font-size: 1.4em;
  }

  .control-btns small {
    font-size: 0.7em;
  }
}

/* Medium Devices (tablets) */
@media (max-width: 768px) {
  .container {
    padding: 2em;
    max-width: 90%;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .img-rounded {
    max-width: 300px;
  }

  .control-btns {
    width: 70px;
    height: 70px;
  }
}


/* Small Devices (phones) */
@media (max-width: 480px) {
  .container {
    padding: 1em;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .img-rounded {
    max-width: 100%;
  }

  .audio-controls {
    gap: 1em;
    flex-wrap: wrap;
  }

  /*.control-btns {*/
  /*  width: 50px;*/
  /*  height: 50px;*/
  /*  font-size: 1em;*/
  /*}*/

  .control-btns small {
    font-size: 0.5em;
  }
}