@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700&display=swap');

:root {
 --red-color: #B90000;
 --green-color: #209F00;
 --blue-color: #083F8E;
 --yellow-color: #F6E355;
 --text-color: #2d3436;
 --bg-gradient: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
 --glass-bg: rgba(255, 255, 255, 0.85);
 --glass-border: rgba(255, 255, 255, 0.3);
 --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
}

* {
 box-sizing: border-box;
 margin: 0;
 padding: 0;
}

.quiz-body {
 width: 100%;
}

.container {
 width: 90%;
 margin: 0 auto;
 border-radius: 20px;
 padding: 2rem;
 text-align: center;
 position: relative;
 overflow: hidden;
}

@media screen and (max-width: 767px) {
 .container {
  width: 100%;
  padding: 0rem;
 }
}

.screen {
 display: none;
 animation: fadeIn 0.5s ease;
}

.screen.active {
 display: block;
}

@keyframes fadeIn {
 from {
  opacity: 0;
  transform: translateY(10px);
 }

 to {
  opacity: 1;
  transform: translateY(0);
 }
}

/* Start Screen */
.intro-box {
 margin-bottom: 2rem;
 font-size: 1.1rem;
 line-height: 1.8;
}

.btn {
 padding: 1rem 2.5rem;
 border: none;
 border-radius: 50px;
 font-size: 1.2rem;
 font-weight: bold;
 cursor: pointer;
 transition: transform 0.2s, box-shadow 0.2s;
 font-family: inherit;
}

.btn.primary {
 background: var(--red-color);
 color: white;
}

.btn.secondary {
 background: var(--green-color);
 color: white;
}

.btn:hover {
 transform: translateY(-3px);
 filter: brightness(1.1);
}

.btn:active {
 transform: translateY(1px);
}

.bounce {
 animation: bounce 2s infinite;
}

@keyframes bounce {

 0%,
 20%,
 50%,
 80%,
 100% {
  transform: translateY(0);
 }

 40% {
  transform: translateY(-10px);
 }

 60% {
  transform: translateY(-5px);
 }
}

/* Quiz Screen */

.mission-head {
 font-size: 48px;
 margin-bottom: 10px;
 font-family: "Exo",
  sans-serif;
}

@media screen and (max-width: 767px) {
 .mission-head {
  font-size: 24px;
 }
}

.mission-head--01 {
 color: var(--green-color);
}

.mission-head--02 {
 color: var(--blue-color);
}

.mission-head--03 {
 color: var(--red-color);
}

.mission-head span.num {
 padding-left: 0.2em;
 font-size: 1.2em;
}

.progress-bar-container {
 width: 100%;
 height: 10px;
 background: #eee;
 border-radius: 5px;
 margin-bottom: 1rem;
 overflow: hidden;
}

.progress-bar {
 height: 100%;
 width: 0%;
 transition: width 0.3s ease;
}

.progress-bar--01 {
 background: var(--green-color);
}

.progress-bar--02 {
 background: var(--blue-color);
}

.progress-bar--03 {
 background: var(--red-color);
}

.quiz-header {
 margin-bottom: 1.5rem;
 font-size: 1.2rem;
}

.question-card {
 background: white;
 padding: 1.5rem;
 border-radius: 15px;
 box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
 margin-bottom: 2rem;
 min-height: 120px;
 display: flex;
 align-items: center;
 justify-content: center;
 border-width: 5px;
 border-style: solid;
}

@media screen and (max-width: 767px) {
 .question-card {
  border-width: 3px;
  padding: 0.5rem;
  text-align: left;
 }
}

.question-card--01 {
 border-color: var(--green-color);
}

.question-card--02 {
 border-color: var(--blue-color);
}

.question-card--03 {
 border-color: var(--red-color);
}

.question-card h2 {
 font-size: 1.3rem;
 color: var(--text-color);
}

@media screen and (max-width: 767px) {
 .question-card h2 {
  font-size: 16px;
 }
}

.choices-grid {
 display: grid;
 gap: 1rem;
}

@media screen and (max-width: 767px) {
 .choices-grid {
  gap: 0.5rem;
 }
}

.choices-grid--01 .choice-btn {
 background: var(--green-color);
}

.choices-grid--02 .choice-btn {
 background: var(--blue-color);
}

.choices-grid--03 .choice-btn {
 background: var(--red-color);
}

.choice-btn {
 border: 2px solid #eee;
 padding: 1rem;
 border-radius: 12px;
 font-size: 1.1rem;
 cursor: pointer;
 transition: all 0.2s;
 font-family: inherit;
 color: #fff;
 text-align: left;
 padding-left: 2em;
}

@media screen and (max-width: 767px) {
 .choice-btn {
  font-size: 14px;
  padding-left: 1em;
 }
}

.choice-btn:hover {
 background: var(--text-color);
}

/* Result Screen */
#result-screen h2 {
 font-size: 36px;
 font-weight: bold;
 color: var(--text-color);
 background: linear-gradient(transparent 70%, var(--yellow-color) 30%);
 display: inline-block;
 padding: 0 30px;
 margin-bottom: 20px;
}

@media screen and (max-width: 767px) {
 #result-screen h2 {
  font-size: 30px;
  margin-bottom: 20px;
 }
}

.score-card {
 background: white;
 padding: 2rem;
 border-radius: 20px;
 margin-bottom: 2rem;
 box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
 border-width: 5px;
 border-style: solid;
}

@media screen and (max-width: 767px) {
 .score-card {
  border-width: 3px;
  width: 90%;
  margin: 0 auto 2rem;
  padding: 1rem;
 }
}

.score-card--01 {
 border-color: var(--green-color);
}

.score-card--02 {
 border-color: var(--blue-color);
}

.score-card--03 {
 border-color: var(--red-color);
}

.score-circle {
 font-size: 3rem;
 font-weight: bold;
 color: var(--red-color);
 margin-bottom: 1rem;
}

@media screen and (max-width: 767px) {
 .score-circle {
  margin-bottom: 0rem;
 }
}

.score-slash,
.score-total {
 font-size: 1.5rem;
 color: #aaa;
}

.result-message {
 font-size: 1.4rem;
 font-weight: bold;
 color: var(--text-color);
 white-space: pre-wrap;
}

@media screen and (max-width: 767px) {
 .result-message {
  font-size: 16px;
  text-align: left;
 }
}

.actions {
 display: flex;
 flex-direction: column;
 gap: 1rem;
}

@media (min-width: 480px) {
 .actions {
  flex-direction: row;
  justify-content: center;
 }
}

@media screen and (max-width: 767px) {

 .actions {
  width: 90%;
  margin: 0 auto;
 }
}

/* Modal */
.modal {
 display: none;
 position: fixed;
 z-index: 1000;
 left: 0;
 top: 0;
 width: 100%;
 height: 100%;
 background-color: rgba(0, 0, 0, 0.5);
 backdrop-filter: blur(4px);
}

.modal.visible {
 /* Note: JS toggles display via style or class, let's use flex for centering */
 display: flex;
 justify-content: center;
 align-items: center;
}

.modal-content {
 background-color: #fff;
 width: 90%;
 max-width: 960px;
 border-radius: 20px;
 box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
 display: flex;
 flex-direction: column;
 max-height: 90vh;
 animation: slideUp 0.3s ease;
}

@keyframes slideUp {
 from {
  opacity: 0;
  transform: translateY(20px);
 }

 to {
  opacity: 1;
  transform: translateY(0);
 }
}

.modal-header {
 padding: 1rem;
 border-bottom: 1px solid #eee;
 display: flex;
 justify-content: space-between;
 align-items: center;
}

.close-btn {
 font-size: 2rem;
 cursor: pointer;
 color: #aaa;
 line-height: 1;
}

.close-btn:hover {
 color: var(--text-color);
}

.modal-body {
 padding: 1.5rem;
 overflow-y: auto;
}

.table-responsive {
 overflow-x: auto;
}

#gradebook-table {
 width: 100%;
 border-collapse: collapse;
 min-width: 500px;
 /* Ensure table doesn't squish too much */
}

#gradebook-table th,
#gradebook-table td {
 padding: 5px 1rem;
 text-align: left;
 border-bottom: 1px solid #eee;
}

#gradebook-table th {
 background-color: #f8f9fa;
 color: #666;
 font-weight: bold;
 vertical-align: middle;
 padding: 0px 1rem;
 white-space: nowrap;
}

#gradebook-table td:last-child {
 text-align: center;
 font-weight: bold;
 font-size: 1.2em;
}

@media screen and (max-width: 767px) {
 .modal-header {
  padding: 7px;
 }

 #gradebook-table {
  font-size: 14px;
  margin-bottom: 10px;
 }

 #gradebook-table th,
 #gradebook-table td {
  padding: 5px 10px;
 }

 #gradebook-table th {
  padding: 0px 10px;
 }

 #gradebook-table td {
  font-size: 13px;
 }
}

.status-correct {
 color: var(--green-color);
 font-weight: bold;
}

.status-wrong {
 color: var(--primary-color);
 ;
 font-weight: bold;
}

/* Utility for hidden screens */
.hidden {
 display: none !important;
}

/* Feedback Section */
.feedback-container {
 margin-top: 2rem;
 padding-top: 2rem;
 border-top: 2px dashed #eee;
 animation: fadeIn 0.5s ease;
}

@media screen and (max-width: 767px) {
 .feedback-container {
  margin-top: 0;
  padding-top: 0;
  border-top: 2px dashed #eee;
  animation: fadeIn 0.5s ease;
 }
}

.feedback-icon {
 font-size: 5rem;
 font-weight: bold;
 margin-bottom: 1rem;
 animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media screen and (max-width: 767px) {
 .feedback-icon {
  font-size: 80px;
  line-height: 1.2;
  font-weight: bold;
  margin-bottom: 0;
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
 }

}

.feedback-icon.correct {
 color: var(--green-color);
}

.feedback-icon.wrong {
 color: var(--primary-color);
 ;
}

.feedback-icon.correct::after {
 content: "〇";
}

.feedback-icon.wrong::after {
 content: "×";
}

@keyframes popIn {
 0% {
  transform: scale(0);
  opacity: 0;
 }

 80% {
  transform: scale(1.1);
  opacity: 1;
 }

 100% {
  transform: scale(1);
 }
}

.feedback-text {
 font-size: 1.5rem;
 font-weight: bold;
 margin-bottom: 1rem;
 color: var(--text-color);
}

.explanation-box {
 background: #f8f9fa;
 border-radius: 15px;
 padding: 1.5rem;
 margin-bottom: 1.5rem;
 text-align: left;
}

.explanation-box h3 {
 margin-bottom: 0.5rem;
 font-size: 1.1rem;
}

.explanation-box--01 {
 border-left: 5px solid var(--green-color);
}

.explanation-box--02 {
 border-left: 5px solid var(--blue-color);
}

.explanation-box--03 {
 border-left: 5px solid var(--red-color);
}

.explanation-box--01 .explanation-box h3 {
 border-left: 5px solid var(--green-color);
}

.explanation-box--02 .explanation-box h3 {
 border-left: 5px solid var(--blue-color);
}

.explanation-box--03 .explanation-box h3 {
 border-left: 5px solid var(--red-color);
}

.explanation-box p {
 line-height: 1.6;
 font-size: 1rem;
}

@media screen and (max-width: 767px) {
 .explanation-box p {
  line-height: 1.6;
  font-size: 14px;
 }
}

.hint-area {
 margin: 30px 0;
}

.hint-area #hint-btn {
 background: var(--yellow-color);
 width: 80%;
 height: 60px;
 border-radius: 10px;
 cursor: pointer;
 transition: .3s;
 font-weight: bold;
 font-size: 1.2em;
}

.hint-area #hint-btn:hover {
 transition: .3s;
 background: var(--text-color);
 color: #fff;
}

.hint-area .hint-text {
 background: #fff;
 border-radius: 10px;
 padding: 30px 20px;
 margin: 10px auto 0;
 text-align: left;
 background: #fff8c5;
 width: 80%;
}

@media screen and (max-width: 767px) {
 .hint-area #hint-btn {
  width: 90%;
  font-size: 16px;
 }

 .hint-area .hint-text {
  width: 90%;
  font-size: 14px;
 }
}