html,
body,
section,
header,
div {
  font-family: "Noto Sans", sans-serif;
}


body {
  overflow: hidden;
}

#menu_btn,
#website_btn{
  padding:10px;
}

.one-pager {
  margin-top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  max-height: calc(100dvh - var(--header-height));
  background-color: transparent;
}

#menu{
  justify-content: space-between;
  width: 90%;
  padding: 0% 5% 5% 5%;
}

#gameboard {
  width: 90%;  /* Explicit content width */
  padding-top: 1%;
  padding-bottom: 5%;
  justify-content: center;
  display: grid;
  grid-template-rows: 1fr 1fr 1fr;
}

.welcome_msg{
  text-align: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 3rem);
  padding:0px 50px;
  left: 0;
  right: 0;
  padding: 12px 0px 12px 0px;
}

.overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.5);
  z-index: 4;
  cursor: pointer;
}

.overlay2 {
  display: grid;
  border: 1px solid var(--gray);
  border-radius: 1rem;
  z-index: 5;
  /* TODO: Probably fix this so it's not always a pointer */
  cursor: pointer;
  background-color: var(--gray);
  width: 100%;
  height: 80%;
  max-width: 800px;
  grid-template-rows: 0.1fr repeat(5, 1fr);
  padding: 1%;
  box-sizing: border-box;
}


.overlaytop {
  height: 0%;
  width: 100%;
  position: fixed;
  z-index: 5;
  top: 0;
  left: 0;
  background-color: rgba(0,0,0, 0.9);
  overflow-y: hidden;
  transition: 0.5s;
  display: flex;
  align-self: center;
  justify-content: center;
  align-items: center;
  text-align: center;
}


.overlaytop-content {
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.overlaytop a {
  padding: 8px;
  text-decoration: none;
  font-size: 36px;
  color: #818181;
  display: block;
  transition: 0.3s;
}

.overlaytop a:hover, .overlay a:focus {
  color: #f1f1f1;
}

.overlaytop #closebtn {
  position: absolute;
  top: 20px;
  right: 45px;
  font-size: 60px;
}

/*Create the scoreboard*/
#scoreboard {
  justify-content: space-around;
  align-content: center;
  align-items: center;
  height:100%;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(5px, 1vw, 15px);
}

#row1{
  display: grid;
  grid-template-columns: 2fr 1fr 2fr;
  /* gap: 10px; */
  justify-items: center;
  align-items: center;
}

/* row2 */
#cardsContainer {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  /* gap: 10px; */
  justify-items: center;
  align-items: center;
}

#row3{
  padding: 10px 0px;
}

.box{
  height:100%;
  width:100%;
  align-items: center;
  justify-content: center;
}

.user{
  justify-content: space-evenly;
  flex-direction: column;
  border: 1px solid var(--gray);
  display: flex;
  text-align: center;
  align-items: center;
  justify-content:center;
  font-size: clamp(1rem, 3vw, 2rem);
  border-radius: 0.5rem;
  background-color: var(--red);
  min-height: 80px;
}

.userName{
  font-size: clamp(1rem, 2.5vw, 2rem);
  padding: clamp(5px, 1.5vw, 10px);
  justify-content:center;
  align-items: center;
  border-bottom: 1px solid var(--gray);
  height:70%;
  display: flex;
  overflow:clip;
}

.points{
  justify-content:center;
  align-items: center;
  font-size: clamp(1rem, 2.5vw, 2rem);
  height:30%;
  display: flex;
}

.button {
  height: 100%;
  width: 100%;
  border: 1px solid var(--gray);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0.5rem;
  background-color: var(--purple);
  transition: all 0.1s ease;
}

.button:hover:not(:disabled) {
  box-shadow: 0 12px 16px 0 rgba(0, 0, 0, 0.24), 0 17px 50px 0 rgba(0, 0, 0, 0.19);
  cursor: pointer;
}

.button:disabled {
  color: inherit !important;
}

.button.krypto{
  background-color: var(--red);
}

/*Create the timer cell*/
#timer {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

#deal_cards {
  font-size: clamp(1.5rem, 4vw, 3rem);
  min-height: 60px;
}

#actions {
  width: 100%;
  gap: clamp(5px, 2vw, 40px);
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  padding-top: 5px;
}

.action_container{
  flex: 1;
}

.action{
  font-size: clamp(1.5rem, 4vw, 3rem);
  min-height: 50px;
}

/*types of cards*/

.solutionCardsContainer{
  justify-content: center;
  align-items: center;
  display:grid;
  grid-template-columns: 1fr 0.5fr repeat(4, 1fr);
  height:98%;
}

#cardsContainer > .cardContainer {
  aspect-ratio: 3/5;
  width: min(90%, 150px);
  max-width: 90%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.targetContainer > .card {
  aspect-ratio: 3/5;
  width: min(90%, 150px);
  height: auto;
  max-width: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.solutionCardsContainer > .solutionCard{
  width: 90%;
  height: 95%;
  max-width: 90%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.targetContainer {
  height:100%;
  width:100%;
  justify-content: center;
  align-items: center;
}

#target{
  border-top: 1px solid var(--gray);
  width:100%;
  justify-content: center;
}

.krypto_container{
  display: none;
  width:100%;
  font-size: clamp(1.5rem, 4vw, 3rem);
  justify-content: space-between;
  gap: clamp(5px, 2vw, 20px);
}

.krypto_key{
  height: 100%;
  width: 100%;
  border: 1px solid var(--gray);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.5rem, 4vw, 3rem);
  border-radius: 0.5rem;
  background-color: var(--red);
  min-height: 60px;
}

#difficulty_menu{
  justify-content: center;
  align-items: center;
}

#difficulty_container{
  display: flex;
  flex-direction: column;
  height:60%;
  width: 80%;
  border-radius: 0.5rem;
  justify-content:center;
  padding: 50px;
  background-color: var(--gray);
}


.difficulty{
  padding:10px 0px;
  justify-content: center;
  align-items:center;
}

.mode_container{
  padding:10px 0px;
  justify-content: center;
  align-items:center;
  height: 100%;
}

.mode_type{
  padding: 10px;
  font-weight: bold;
  text-align: center;
}

.mode_description{
  padding: 10px;
  text-align: center;
}


.card {
  border: 1px solid var(--gray);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(1rem, 3vw, 2rem);
  border-radius: 0.5rem;
  background-color: var(--yellow);
}


#solution {
  margin-top: var(--header-height);
  max-height: 100dvh;
  padding:5px;
  justify-content: center;
  align-items: center;
}

.solutionCard{
  border: 1px solid var(--gray);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.5rem, 4vw, 3rem);
  border-radius: 0.5rem;
  background-color: var(--yellow);
}

.solutionTitle{
  color: #f1f1f1;
  justify-content: center;
  text-align: center;
  width: 100%;
  font-size: clamp(1.5rem, 4vw, 3rem);
}

#operations{
  justify-content: space-between;
  gap: clamp(5px, 2vw, 40px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-bottom: 5px;
}

.operation{
  font-size: clamp(2rem, 6vw, 5rem);
  flex: 1;
  min-height: 60px;
}

.solutionOperation{
  border: 1px solid var(--gray);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: clamp(1.5rem, 4vw, 3rem);
  border-radius: 0.5rem;
}

.instructions {
  justify-content: center;
  align-items: center;
  background-color: transparent;
  width: auto;
  height: 100%;
  overflow: visible;
}

#instructions {
  height: 50%;
  width: auto;
  border-radius: 50%;
  overflow: visible;
}

#instructions svg {
  display: flex;
  height: 100%;
  width: auto;
}

.disabled{
  cursor: not-allowed;
}


.selected{
  background-color: var(--green);
}

.invalid{
  background-color: red;
}

.correct{
  background-color: var(--green);
}

/* timer from css-tricks.com*/


/* Sets the containers height and width */
.base-timer {
  position: relative;
  height: 200px;
  width: 200px;
  max-width: 100%;
  max-height: 100%;
}

/* Removes SVG styling that would hide the time label */
.base-timer__circle {
  fill: none;
  stroke: none;
}

/* The SVG path that displays the timer's progress */
.base-timer__path-elapsed {
  stroke-width: 7px;
  stroke: grey;
}

.base-timer__label {
  position: absolute;

  /* Size should match the parent container */
  width: 200px;
  height: 200px;

  /* Keep the label aligned to the top */
  top: 0;

  /* Create a flexible box that centers content vertically and horizontally */
  display: flex;
  align-items: center;
  justify-content: center;

  /* Responsive font size */
  font-size: clamp(24px, 4vw, 48px);
}

.base-timer__path-remaining {
  /* Just as thick as the original ring */
  stroke-width: 7px;

  /* Rounds the line endings to create a seamless circle */
  stroke-linecap: round;

  /* Makes sure the animation starts at the top of the circle */
  transform: rotate(90deg);
  transform-origin: center;

  /* One second aligns with the speed of the countdown timer */
  transition: 1s linear all;

  /* Allows the ring to change color when the color value updates */
  stroke: currentColor;
}

.base-timer__svg {
  /* Flips the svg and makes the animation to move left-to-right */
  transform: scaleX(-1);
}

.base-timer__path-remaining.green {
  color: var(--green);
}

.base-timer__path-remaining.orange {
  color: orange;
}

.base-timer__path-remaining.red {
  color: red;
}


/* POPUP for when krypto is called */

/* Popup container - can be anything you want */
.popup {
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* The actual popup */
.popup .popuptext {
  visibility: hidden;
  width: 160px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 0;
  position: absolute;
  z-index: 3;
  bottom: 110%;
  left: 50%;
  margin-left: -80px;
}

/* Popup arrow */
.popup .popuptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

/* Toggle this class - hide and show the popup */
.popup .show {
  visibility: visible;
  -webkit-animation: fadeIn 1s;
  animation: fadeIn 1s;
}

/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
  from {opacity: 0;}
  to {opacity: 1;}
}


@keyframes fadeIn {
  from {opacity: 0;}
  to {opacity:1 ;}
}

@media screen and (max-height: 450px) {
  .overlaytop {overflow-y: auto;}
  .overlaytop a {font-size: 20px}
  .overlaytop .closebtn {
  font-size: 40px;
  top: 15px;
  right: 35px;
  }
}

/* Timer Responsiveness */
@media (max-width: 1200px), (max-height: 1200px) {
  .base-timer {
    height: 160px;
    width: 160px;
  }

  .base-timer__label {
    width: 160px;
    height: 160px;
    font-size: clamp(20px, 3.5vw, 40px);
  }

  .base-timer__path-elapsed,
  .base-timer__path-remaining {
    stroke-width: 6px;
  }
}

@media (max-width: 767px), (max-height: 767px) {
  .base-timer {
    height: 120px;
    width: 120px;
  }

  .base-timer__label {
    width: 120px;
    height: 120px;
    font-size: clamp(16px, 4vw, 32px);
  }

  .base-timer__path-elapsed,
  .base-timer__path-remaining {
    stroke-width: 5px;
  }

  /* Adjust timer container for mobile */
  #timer {
    width: 100%;
    max-width: 120px;
  }

  #difficulty_container{
    width: 90%;
    height: 90%;
  }

  /* User cards mobile adjustments */
  #scoreboard {
    gap: 5px;
  }

  .user {
    font-size: clamp(0.8rem, 2.5vw, 1.2rem);
  }

  .userName {
    font-size: clamp(0.8rem, 2vw, 1.2rem);
    padding: clamp(3px, 1vw, 8px);
  }

  .points {
    font-size: clamp(0.8rem, 2vw, 1.2rem);
  }

  /* Action and operation buttons mobile adjustments */
  #deal_cards {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
  }

  .action {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
  }

  .operation {
    font-size: clamp(1.5rem, 5vw, 3rem);
  }

  .krypto_key {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
  }

  #actions {
    gap: 5px;
    padding-top: 5px;
  }

  #operations {
    gap: 5px;
    padding-bottom: 5px;
  }
}

@media (max-width: 480px), (max-height: 480px) {
  .base-timer {
    height: 100px;
    width: 100px;
  }

  .base-timer__label {
    width: 100px;
    height: 100px;
    font-size: clamp(14px, 4.5vw, 28px);
  }

  .base-timer__path-elapsed,
  .base-timer__path-remaining {
    stroke-width: 4px;
  }

  #timer {
    max-width: 100px;
  }

  /* User cards small mobile adjustments */
  #scoreboard {
    gap: 3px;
  }

  .user {
    min-height: 50px;
    font-size: clamp(0.7rem, 3vw, 1rem);
    border-radius: 0.3rem;
  }

  .userName {
    font-size: clamp(0.7rem, 2.5vw, 1rem);
    padding: clamp(2px, 0.8vw, 5px);
  }

  .points {
    font-size: clamp(0.7rem, 2.5vw, 1rem);
  }

  /* Action and operation buttons small mobile adjustments */
  #deal_cards {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  .action {
    font-size: clamp(1rem, 4vw, 1.5rem);
  }

  .operation {
    font-size: clamp(1.2rem, 5.5vw, 2.5rem);
  }

  .krypto_key {
    font-size: clamp(1rem, 4vw, 1.5rem);
    padding: 5px;
  }

  #actions {
    gap: 3px;
    padding-top: 3px;
  }

  #operations {
    gap: 3px;
    padding-bottom: 3px;
  }

  .krypto_container {
    gap: 5px;
  }
}

/* Improve touch interactions on mobile */
@media (hover: none) and (pointer: coarse) {
  .button {
    /* Increase touch target size */
    min-height: 44px;
    min-width: 44px;
  }

  .button:hover {
    /* Remove hover effects on touch devices */
    box-shadow: none;
  }

  .button:active {
    /* Add active state for touch feedback */
    transform: scale(0.95);
    transition: transform 0.1s ease;
  }
}
