/*
 * Copyright (c) 2025-2026 Evolution Creek Software. All rights reserved.
 *
 * Unauthorized copying, linking, or other unintended use of this file
 * (in part or in whole) is strictly prohibited.
 */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#grid {
  width: min(520px, 90vw);
  display: grid;
  position: relative;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  margin-top: 2.5rem;
}

.cell {
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 1/1;
  overflow: hidden;
  border: 1px solid saddlebrown;
  font-family: "Fredoka", sans-serif;
  font-weight: normal;
  font-size: 1.9rem;
  display: flex;
  justify-content: center;
  background-color: white;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.thick-bottom {
  border-bottom: 3px solid saddlebrown;
}

.thick-top {
  border-top: 3px solid saddlebrown;
}

.thick-right {
  border-right: 3px solid saddlebrown;
}

.thick-left {
  border-left: 3px solid saddlebrown;
}

.top-left {
  border-top-left-radius: 10px;
}

.top-right {
  border-top-right-radius: 10px;
}

.bottom-left {
  border-bottom-left-radius: 10px;
}

.bottom-right {
  border-bottom-right-radius: 10px;
}

.cell:focus {
  background-color: burlywood !important;
}

#grid.no-game .cell:focus {
  background-color: white !important;
  outline: none;
}

#grid.no-game .cell:hover {
  background-color: white !important;
  outline: none;
}

.hidden {
  display: none;
}

#numpad {
  width: min(520px, 90vw);
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  margin-top: 1rem;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.numPadCell {
  width: 100%;
  box-sizing: border-box;
  aspect-ratio: 1/1;
  border: 2px solid saddlebrown;
  border-radius: 8px;
  font-family: "Fredoka", sans-serif;
  font-weight: normal;
  font-size: 1.9rem;
  display: flex;
  justify-content: center;
  background-color: bisque;
  color: black;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine){
  .numPadCell:hover {
    background-color: peru;
  }

  #easyButton:hover {
    background-color: darkseagreen;
  }

  #mediumButton:hover {
    background-color: goldenrod;
  }

  #hardButton:hover {
    background-color: rgb(165, 42, 42);
  }

  .main:hover {
    background-color: peru;
  }
}

.numPadCell:active {
  background-color: burlywood;
  transform: scale(0.95);
}

@keyframes zoomAnimation {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.zoom{
  animation: zoomAnimation 0.4s ease;
}

.cell:hover {
  background-color: burlywood;
  transform: scale(1.05);
}

.score {
  min-width: 80px;
}


#lifetimeStats {
  font-family: 'Caveat', cursive;
  font-size: clamp(20px, 3vw, 28px);
  margin-top: 0.5rem;
  min-width: 280px;
}

.statsRow {
  display: grid;
  grid-template-columns: 6rem 4.5rem 5rem;
  text-align: center;
  gap: 0.25rem;
}

.statsRow.header {
  border-bottom: 1px solid #aaa;
  margin-bottom: 0.2rem;
  font-size: clamp(16px, 2.5vw, 22px);
  color: #555;
}

#pointsStats {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.4rem;
  padding-top: 0.3rem;
  border-top: 1px solid #aaa;
  font-size: clamp(16px, 2.5vw, 22px);
}

#scoreBoardDiv {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
  font-family: 'Caveat', cursive;
  font-size: clamp(20px, 3vw, 30px);
  justify-content: center;
  text-align: center;
  margin-bottom: -0.5rem;
  padding: 0 1rem;
}

#buttons{
  display: flex;
  gap: 2.5rem;
}

#main-buttons{
  max-width: 90vw;
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

#difficulty-buttons{
  max-width: 90vw;
  display: flex;
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.button {
  margin-top: clamp(15px, 3vw, 25px);
  width: 190px;
  display: flex;
  color: black;
  font-family: 'Caveat', cursive;
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  font-size: 30px;
  padding: 0.5em 1em;
  border: 2px solid black;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: background-color 0.2s ease, transform 0.2s ease;
  touch-action: manipulation;
}

.button:active{
  transform: scale(0.95);
}

.main{
  background-color: moccasin;
}

#easyButton{
  background-color: lightgreen;
}

#mediumButton{
  background-color: rgb(251, 236, 93);
}

#hardButton{
  background-color: indianred;
}

@media (max-width: 600px) {
  #grid {
    width: 97vw;
  }

  .cell {
    font-size: 25px;
    line-height: 1;
  }

  .cell.thick-bottom {
    border-bottom-width: 2px;
  }

  .cell.thick-top {
    border-top-width: 2px;
  }

  .cell.thick-right {
    border-right-width: 2px;
  }

  .cell.thick-left {
    border-left-width: 2px;
  }

  #numpad {
    width: 97vw;
  }

  .numPadCell {
    font-size: 25px;
    line-height: 1;
  }


  #scoreBoardDiv{
    font-size: 25px;
    width: 90vw;
  }

  #lifetimeStats {
    font-size: clamp(20px, 5vw, 28px);
    min-width: unset;
    width: 90vw;
  }

  .statsRow {
    grid-template-columns: 5.5rem 4rem 4.5rem;
  }

  #main-buttons{
    max-width: 95vw;
    gap: 1rem;
  }

  #difficulty-buttons{
    max-width: 95vw;
    gap: 1rem;
  }

  .button{
    width: 150px;
    font-size: 25px;
    padding: 0.5em 0.5em;
    border-radius: 10px;
  }

  .button:hover{
    width: 150px;
  }

  #easyButton:hover{
    background-color: lightgreen;
  }


  #mediumButton:hover{
    background-color: rgb(251, 236, 93);
  }


  #hardButton:hover{
    background-color: indianred;
  }

  .main:hover {
    background-color: lightcyan;
  }

}
