@import url("https://fonts.googleapis.com/css?family=Oxanium|PT+Mono&display=swap");

* {
  box-sizing: border-box;
}

:root {
  --primary-color: rgb(16, 44, 73);
  --select-color: rgb(29, 79, 130);
  --success: rgb(24, 197, 8);
  --danger: rgb(190, 61, 61);
}

body {
  margin: 0;
  font-family: PT Mono, sans-serif;
  overflow: hidden;
  display: flex;
  justify-content: center;
  height: 100vh;
  background: #f8f8f8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='%23161619' fill-opacity='0.12'%3E%3Cpath fill-rule='evenodd' d='M11 0l5 20H6l5-20zm42 31a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM0 72h40v4H0v-4zm0-8h31v4H0v-4zm20-16h20v4H20v-4zM0 56h40v4H0v-4zm63-25a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM53 41a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-30 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm-28-8a5 5 0 0 0-10 0h10zm10 0a5 5 0 0 1-10 0h10zM56 5a5 5 0 0 0-10 0h10zm10 0a5 5 0 0 1-10 0h10zm-3 46a3 3 0 1 0 0-6 3 3 0 0 0 0 6zm10 0a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM21 0l5 20H16l5-20zm43 64v-4h-4v4h-4v4h4v4h4v-4h4v-4h-4zM36 13h4v4h-4v-4zm4 4h4v4h-4v-4zm-4 4h4v4h-4v-4zm8-8h4v4h-4v-4z'/%3E%3C/g%3E%3C/svg%3E");
  background-color: rgb(249, 247, 247); /* Dark base color with transparency
  /* background-size: 20px 20px; */
}


.game-container {
  border: 1px solid black;
  box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
  width: 530px;
  height: 750px;
  position: relative;
  background: rgba(255, 255, 255, 0.5);
  user-select: none;
  margin-top: 100px;
}

.header {
  background: var(--primary-color);
  color: white;
  font-family: Oxanium, sans-serif;
  font-size: 24px;
  text-shadow: 1px 2px 2px black;
  letter-spacing: 2px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.card {
  margin: 5px auto 10px;
  height: 600px;
}

/* Splash Page -------------------- */
input[type="radio"] {
  opacity: 0;
  width: 100%;
  height: 75px;
  position: relative;
  top: -40px;
  cursor: pointer;
  z-index: 2;
}

.selection-container {
  position: relative;
  top: 65px;
}

.radio-container {
  width: 90%;
  height: 75px;
  margin: 25px;
  cursor: pointer;
  border: 2px solid black;
  border-radius: 5px;
}

label {
  position: relative;
  top: 20px;
  left: 20px;
  font-size: 30px;
}

.selected-label {
  background: var(--select-color);
  color: white;
}

.best-score {
  position: relative;
  top: -100px;
  left: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  font-size: 18px;
  max-width: fit-content;
}

.best-score span {
  margin: 0;
}

.best-score span:last-child {
  font-size: 24px;
}

.selection-footer {
  top: 134px;
}

/* Game Page -------------------------- */
.height-240 {
  height: 240px;
  width: 100%;
}

.height-500 {
  height: 500px;
  width: 100%;
}

.item-container {
  height: 552px;
  overflow-y: scroll;
  position: relative;
  -ms-overflow-style: none;
}

.item-container::-webkit-scrollbar {
  display: none;
}

.item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  height: 80px;
  margin: 0 50px;
  user-select: none;
}

.finished > h1 {
  opacity: 0.5;
}

.selected-item {
  background: var(--select-color);
  position: fixed;
  top: 443px;
  z-index: -1;
  width: 529px;
  height: 80px;
}

.item-footer,
.selection-footer {
  width: 100%;
  height: 90px;
  background: rgba(0, 0, 0, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.item-footer {
  top: 1px;
}

button {
  cursor: pointer;
  height: 50px;
  border-radius: 5px;
  font-size: 25px;
  font-family: Oxanium, sans-serif;
  color: white;
  border: none;
  outline: none;
}

button:hover {
  filter: brightness(110%);
}

button:active {
  transform: scale(0.99);
}

.wrong,
.right {
  width: 40%;
}

.wrong {
  background: var(--danger);
  margin-right: 25px;
}

.right {
  background: var(--success);
}

.start,
.play-again {
  width: 90%;
  background: var(--primary-color);
}

/* Countdown Page ---------------------- */
.countdown {
  margin-top: 45%;
  font-size: 100px;
  text-align: center;
  user-select: none;
  cursor: pointer;
}

/* Score Page ------------------------- */
.score-container {
  height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.score-footer {
  width: 100%;
  height: 90px;
  display: flex;
  justify-content: center;
  position: relative;
  top: -30px;
}

.title {
  font-size: 45px;
  color:rgb(16, 44, 73);
}

.final-time {
  font-size: 130px;
  margin: 0;
  color: var(--success);
}

.base-time {
  margin-top: 100px;
  margin-bottom: 0;
  color:rgb(16, 44, 73);
}

.penalty-time {
  color: var(--danger);
}


/* Modal Background */
.modal {
  display: none; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgba(0, 0, 0, 0.8); /* Black background with transparency */
}

/* Modal Content */
.modal-content {
  background-color: #fefefe; /* White background */
  margin: 15% auto; /* 15% from the top and centered */
  padding: 20px; /* Padding */
  border: 1px solid #888; /* Border */
  width: 80%; /* Width of the modal */
  max-width: 500px; /* Max width */
  border-radius: 8px; /* Rounded corners */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Shadow effect */
}

/* Modal Header */
.modal-content h2 {
  color: #4CAF50; /* Green color for the heading */
  font-family: 'Arial', sans-serif; /* Font styling */
      text-align: center; /* Center the text */
    margin: 0; /* Remove any default margin */
}

/* Close Button */
.close-button {
  color: #aaa; /* Gray color */
  float: right; /* Float to the right */
  font-size: 28px; /* Font size */
  font-weight: bold; /* Bold font */
  cursor: pointer; /* Pointer cursor on hover */
}

.close-button:hover,
.close-button:focus {
  color: #000; /* Darker color on hover */
  text-decoration: none; /* No underline */
}

/* Modal Text */
.modal-content p {
  font-family: 'Arial', sans-serif; /* Font styling */
  font-size: 18px; /* Font size */
  color: #333; /* Dark gray color for the text */
  text-align: center; /* Centered text */
}

/* Media Query: Laptop */
@media screen and (max-width: 1800px) {
  .game-container {
    margin-top: 35px;
  }

  .selected-item {
    top: 380px;
  }
}


/* Media Query: Large Smartphone (Vertical) */
@media screen and (max-width: 500px) {
  .game-container {
    width: 100%;
    margin-top: 0;
    border: none;
  }

  .selected-item {
    top: 345px;
  }

  .header {
    font-size: 1.20rem;
  }

  .countdown {
    margin-top: 60%;
  }

  .selection-container {
    top: 100px;
  }

  .radio-container {
    width: 93%;
    margin: 15px;
  }

  label {
    font-size: 1.7rem;
  }

  .best-score {
    font-size: 1rem;
    left: 245px;
  }

  .selection-footer {
    top: 183px;
  }
}

/* Media Query: iPhone 12 and iPhone 13 */
@media screen and (max-width: 375px) {
  .best-score {
    left: 15px; /* Adjust positioning to be more responsive */
    font-size: 0.8rem; /* Scale down font size */
  }

  .header {
    font-size: 1.5rem; /* Scale down header font size */
  }

  label {
    font-size: 0.8rem; /* Scale down label font size */
  }

  .title {
    font-size: 1.5rem; /* Scale down title font size */
  }

  button {
    font-size: 0.8rem; /* Scale down button font size */
  }

  .final-time {
    font-size: 3rem; /* Scale down final time font size */
  }

  .item {
    height: 60px; /* Reduce item height for better fit */
    margin: 0 10px; /* Adjust margin for smaller screens */
  }
}

/* Media Query: iPhone 13 */
@media screen and (max-width: 376px) {
  /* Additional styles specific to iPhone 13 can go here if needed */
}

/* Media Query: Mobile */
@media screen and (max-width: 600px) {
  .header {
    font-size: 1.4rem;
  }

  label {
    font-size: 0.9rem;
  }

  .best-score span:last-child {
    font-size: 0.9rem;
  }

  button {
    font-size: 0.9rem;
  }

  .title {
    font-size: 1.5rem;
  }

  .final-time {
    font-size: 4rem;
  }
}