@font-face {
  font-family: "sudojifont";
  src:
    url("../fonts/pulang-webfont.woff2") format("woff2"),
    url("../fonts/pulang-webfont.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display:swap;
}




@font-face {
  font-family: 'OpenSans-Regular';
  src: url("../fonts/OpenSans-Regular.woff2") format("woff2"), url("../fonts/OpenSans-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display:swap;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  height: 101%;
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  font-family: "OpenSans-Regular", sans-serif;
  flex-direction: column;
  margin: 4px;
  font-size: 1.125rem; /* 18px */
  /* background: rgb(2,0,36);
  background: radial-gradient(circle, rgba(2,0,36,1) 0%, rgba(9,9,121,1) 0%, rgba(0,212,255,1) 100%);  */
  background: linear-gradient(to right, #acb6e5, #74ebd5) !important;
}


header {
  margin: 10px 0px;
  display: flex;
    max-width: 768px;
    flex-direction: row;
    justify-content: space-between;
    /* align-content: center; */
    align-items: center;
}

h1 {
  font-family: "sudojifont";
  margin: 10px;
  line-height: 0px;
  font-size: clamp(1.5rem, 1.125rem + 1.25vw, 2.125rem);
}

h1 a {
  color: #fff;
  text-decoration: none;
  text-shadow: 1px 1px 2px black;
}

h1 a span {
font-size: 20px;
}


.social {
  display: flex;
  padding-right: 10px;
  align-items: center;
  justify-content: flex-end;
  font-size: 14px; 
  text-transform: uppercase; 
font-weight: bold;
}

.social a {
margin-left: 10px;
line-height: 0px;
}

.social svg {
  height: auto;
  width:30px;border-radius:5px;height:auto;fill:#c771b8;background:#fff;
}

.disabled {
  pointer-events: none; /* Prevents click events */
  opacity: 0.2; /* Visually indicates disabled state */
}

.game-info {
  display: flex;
  padding: 10px 0px;
  justify-content: space-between;
  text-align: center;
}


.game-info,
#sudoji-container,
#cellValue-selector,
.game-controls {
  width: 100%;
  max-width: 768px;
}

.howto {
  padding: 0px 20px;
  max-width: 740px;
  text-wrap: pretty;
}



.game-info span {
  text-transform: uppercase;
  font-weight: bold;
  font-size: 14px;
}

#timer {
  padding-left: 10px;
}

#time {
  font-variant: tabular-nums; 
}

#score {
}

#score-wrapper {
}

#errors {
  padding-right: 10px;
}

.game-controls {
  display: flex;
  justify-content: space-around;
  padding: 10px 0px 20px 0px;
}

#sudoji-container {
  position: relative;
  aspect-ratio: 1/1;
}

#start-button-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 20px;
  font-size: 20px;
  cursor: pointer;
  z-index: 10; /* Ensure it's above the grid */
}

#sudoji-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 0px;
  border: 0.5px solid #000;
  border-radius: 10px;
  background: #fff;
}

#cellValue-selector {
  display: flex;
  width: 100%;
  /* background: #bcd1d52e; */
  justify-content: space-around;
  padding: 10px 0px 10px 0px;
  align-items: center;
}

#cellValue-selector > div {
  background: none;
}

#cellValue-selector div button {
  font-size: clamp(18px, 7vw, 50px);
  padding: 0px;
  background: none;
  text-shadow: 5px 5px 4px #0000002b;
  border: none;
}

#emoji-selector {
  display: block;
}

.cell {
  display: flex;
  justify-content: center;
  align-items: center;

  aspect-ratio: 1/1;

  background: #fff;
  border-right: 1px solid #b6aeae4d;
  border-bottom: 1px solid #b6aeae4d;
  /* border-color: rgba(54, 57, 59);  */
  font-size: 45px;
  font-size: clamp(18px, 7.2vw, 45px);
  line-height: 0px;
  cursor: pointer;
  overflow: hidden;
}

.cell:nth-child(1) {
  border-top-left-radius: 10px;
}

.cell:nth-child(9) {
  border-top-right-radius: 10px;
}

.cell:nth-child(73) {
  border-bottom-left-radius: 10px;
}

.cell:nth-child(81) {
  border-bottom-right-radius: 10px;
}

/* Outer borders of the sudoji grid */
/* #sudoji-grid {
  border-top: 1px solid black;
  border-left: 1cap solid black;
  border-bottom: 1px solid black;
} */

/* Thick border for right edge of each 3x3 grid */
.cell:nth-child(3n) {
  border-right-color: #000;
}

.cell:nth-child(9n) {
  border-right-color: transparent;
}

/* Thick border for bottom edge of each 3x3 grid */
.cell:nth-child(n + 19):nth-child(-n + 27),
.cell:nth-child(n + 46):nth-child(-n + 54) {
  border-bottom-color: #000;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal h2 {
  margin: 0px;
  font-family: "sudojifont";
}

.modal-content {
  background-color: rgb(233 229 229);
  box-shadow: rgba(0, 0, 0, 0.25) 6px 2px 6px 3px;
  margin: 15% auto;
  padding: 15px;
  border: 4px solid #ea3dcb;

  border-radius: 10px;
  width: 80%;
  position: relative;
  padding-bottom: 40px;
}

p {
  line-height: 1.45em;
}



#close-cheat-button,
#close-error-button  {
  padding: 5px 30px;
  border-radius: 20px;
  border: 4px solid #ea3dcb;
  background: #ea3dcb;
  color: #fff;
  font-size: 20px;
    position: absolute;
    bottom: -20px;
    right: 20px;
    font-weight: bold;
    cursor: pointer;

}

#close-cheat-button:hover,
#close-cheat-button:focus,
#close-error-button:hover,
#close-error-button:focus  {
background: #fff;
color: #ea3dcb;
  text-decoration: none;
  cursor: pointer;
}




#close-score-button{
  color: #aaa;
  font-size: 40px;
  position: absolute;
  top: -3px;
  right: 10px;
  font-weight: bold;
  cursor: pointer;
  /* opacity: 0;
  animation-name: show-close;
  animation-delay: 1s;
  animation-duration: 0.4s;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards; */
}

#close-score-button:hover,
#close-score-button:focus{
  color: black;
  text-decoration: none;
  cursor: pointer;
}

/* 
#background-grid {
  position: absolute;
  top: 0px;


  width: 100%;
    height: 100%;
    left: 0px;
    z-index: -1;
  display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 1fr);
gap:1px;
} */

/* .bg-grid:nth-of-type(2n + 1) {
  background-color: red;
} */

#sudoji-container #sudoji-grid .cell.column-completed:not(.column-completed-done),
#sudoji-container #sudoji-grid .cell.row-completed:not(.row-completed-done),
#sudoji-container #sudoji-grid .cell.grid-completed:not(.grid-completed-done) {
  animation-name: correct-bg;
  animation-duration: 0.6s;
  animation-timing-function: ease;
  animation-iteration-count: 1;
  background-color: #a9e7d5 !important;
}

body #sudoji-grid .cell.correct {
  animation: correct-bg 0.6s 1;
  animation-timing-function: ease;
}

/* .correct span {
  animation: correct 0.3s 1;
  animation-delay: 0.3s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
} */

.incorrect {
  /* background-color: #ffcdd2;  */
  animation: incorrect-bg 1s 1;
  animation-timing-function: ease;
}

.incorrect span {
  animation: incorrect 1s 1;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

#sudoji-grid .cell.highlight-row,
#sudoji-grid .cell.highlight-col,
#sudoji-grid .cell.highlight-grid {
  background: #e7f1fa;
}

#sudoji-grid .cell.selected-cell {
  background: rgba(165, 216, 255, 0.6);
}


.cell.game-completed span {
  transform: scale(1.5); /* 50% increase for game completion */
}

#sudoji-grid .cell.highlight-value {
  background: rgba(165, 216, 255, 0.9);
  /* transform: scale(1.4);
  border-radius: 5px;
  border: 1px solid #ddd; */
}

/* #sudoji-grid .cell.highlight-value span {
  text-shadow: 2px 2px 10px;

 }
  */

#sudoji-grid .cell.highlight-value span {
  animation: correct-bg 0.6s 1;
  animation-timing-function: ease-out;
}

@keyframes show-close {
  0% {
    opacity: 0;
  }
  70% {
    opacity: 1;
  }
}

@keyframes correct-bg {
  0% {
    background-color: inherit;
  }
  100% {
    background-color: #a9e7d5;
  }

}

/* @keyframes correct {
  0% {
    transform: scale(1);
  }
  25% {
    transform: scale(1.2);
  }
  50% {
    transform: scale(1.4);
  }
  75% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
} */

@keyframes incorrect-bg {
  0% {
    background-color: inherit;
  }
  50% {
    background-color: red;
  }
  100% {
    background-color: inherit;
  }
}

@keyframes incorrect {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(0.8);
  }
  50% {
    transform: rotate(180deg) scale(0.5);
  }
  75% {
    transform: rotate(270deg) scale(0.3);
  }
  100% {
    transform: rotate(360deg) scale(0);
  }
}

@keyframes pulse {
  0% {
    background-color: inherit;
  }
  40% {
    background-color: #a9e7d5;
  }
  100% {
    background-color: inherit;
  }
}

/* -------------------------------- 

Icons 

-------------------------------- */

.cd-icon {
  --size: 1em;
  font-size: var(--size);
  height: 1em;
  width: 1em;
  display: inline-block;
  color: inherit;
  fill: currentColor;
  line-height: 1;
  flex-shrink: 0;
  max-width: initial;
}

.cell:nth-child(n + 0):nth-child(-n + 3),
.cell:nth-child(n + 7):nth-child(-n + 9),
.cell:nth-child(n + 10):nth-child(-n + 12),
.cell:nth-child(n + 16):nth-child(-n + 18),
.cell:nth-child(n + 19):nth-child(-n + 21),
.cell:nth-child(n + 25):nth-child(-n + 27),
.cell:nth-child(n + 31):nth-child(-n + 33),
.cell:nth-child(n + 40):nth-child(-n + 42),
.cell:nth-child(n + 49):nth-child(-n + 51),
.cell:nth-child(n + 55):nth-child(-n + 57),
.cell:nth-child(n + 61):nth-child(-n + 63),
.cell:nth-child(n + 64):nth-child(-n + 66),
.cell:nth-child(n + 70):nth-child(-n + 72),
.cell:nth-child(n + 73):nth-child(-n + 75),
.cell:nth-child(n + 79):nth-child(-n + 81) {
  /* background: #f8eeeeba; */
}

/* --------------------------------

Component 

-------------------------------- */

.split-btn-v2 {
  position: relative;
  z-index: 1;
  width: 200px;
  background: rgb(255 255 255);
  border-radius: 8px;
}

.split-btn-v2--expanded .split-btn-v2__btn {
  opacity: 0;
  pointer-events: none;
  width: 200px;
}

.split-btn-v2--expanded .split-btn-v2__list-wrapper {
  opacity: 1;
  pointer-events: auto;
  width: 200px;

  background: rgb(208 193 225 / 47%);
  border-radius: 8px;
}

.split-btn-v2--expanded .split-btn-v2__list {
  transform: scale(0.86);
  width: 200px;
}

.split-btn-v2--expanded .split-btn-v2__morph-bg {
  /* box-shadow: 0 0 0 1px hsla(230, 13%, 9%, 0.05), 0 0.9px 1.25px hsla(230, 13%, 9%, 0.025), 0 3px 5px hsla(230, 13%, 9%, 0.05), 0 12px 20px hsla(230, 13%, 9%, 0.09); */
  box-shadow:
    rgba(240, 46, 170, 0.4) 5px 5px,
    rgba(240, 46, 170, 0.3) 10px 10px,
    rgba(240, 46, 170, 0.2) 15px 15px,
    rgba(240, 46, 170, 0.1) 20px 20px,
    rgba(240, 46, 170, 0.05) 25px 25px;
}

.split-btn-v2__btn {
  position: relative;
  z-index: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  text-decoration: none;
  border-radius: 0.375em;
  padding: 0.5rem 1rem;
  font-weight: bold;
  line-height: 1.2;
  color: hsl(230, 13%, 9%);
  cursor: pointer;
  transition: 0.3s;
  text-transform: uppercase;
  width: 100%;
}

.split-btn-v2__btn:hover .split-btn-v2__btn-icon {
  transform: translateY(1px);
}

.split-btn-v2__btn:hover ~ .split-btn-v2__morph-bg {
  background: hsl(0, 0%, 100%);
  box-shadow:
    0 0 0 1px hsla(230, 13%, 9%, 0.05),
    0 0 0 1px hsla(230, 13%, 9%, 0.02),
    0 1px 3px -1px hsla(230, 13%, 9%, 0.2);
}

.split-btn-v2__btn:focus-visible {
  outline: none;
}

.split-btn-v2__btn:focus-visible ~ .split-btn-v2__morph-bg {
  box-shadow:
    0 0 0 1px hsla(230, 13%, 9%, 0.05),
    0 0.3px 0.4px hsla(230, 13%, 9%, 0.02),
    0 0.9px 1.5px hsla(230, 13%, 9%, 0.045),
    0 3.5px 6px hsla(230, 13%, 9%, 0.09),
    0 0 0 2px hsl(0, 0%, 100%),
    0 0 0 4px hsl(230, 7%, 23%);
}

.split-btn-v2__btn:active {
  transform: translateY(2px);
}

.split-btn-v2__btn-icon {
  transition: 0.2s;
  height: 12px;
  width: 12px;
}

.split-btn-v2__list-wrapper {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.split-btn-v2__list {
  transform: scale(0.5);
  transition: 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.split-btn-v2__list-item {
  display: flex;
  gap: 0.25rem;
  width: 100%;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  font-size: 1rem;
  color: hsl(230, 13%, 9%);
  padding: 0.5rem 0.75rem;
  border-radius: 0.1875em;
  cursor: pointer;

  font-size: 24px;
  margin-bottom: 5px;
  transition: background 0.3s;
}

.split-btn-v2__list-item .cd-icon {
  height: 16px;
  width: 16px;
}

.split-btn-v2__list-item:hover {
  background-color: hsla(230, 13%, 9%, 0.075);
}

.split-btn-v2__list-item:hover .split-btn-v2__anim-path {
  animation: split-btn-svg-path-anim 2s;
}

.split-btn-v2__list-item:focus-visible {
  outline: none;
  background-color: hsla(250, 84%, 54%, 0.15);
  color: hsl(250, 84%, 54%);
}

.split-btn-v2__anim-path {
  transform-origin: 8px 2px;
  transform: translateY(-1px);
}

@keyframes split-btn-svg-path-anim {
  /* bounce animation */
  0%,
  20%,
  40%,
  100% {
    transform: translateY(-1px);
  }
  10%,
  30% {
    transform: translateY(1px);
  }
}

/* morphing background */
.split-btn-v2__morph-bg {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  border-radius: 0.375em;
  pointer-events: none;
  transform-origin: left top;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  background-color: hsl(0, 0%, 100%);
  box-shadow:
    0 0 0 1px hsla(230, 13%, 9%, 0.05),
    0 0.3px 0.4px hsla(230, 13%, 9%, 0.02),
    0 0.9px 1.5px hsla(230, 13%, 9%, 0.045),
    0 3.5px 6px hsla(230, 13%, 9%, 0.09);
  transition:
    box-shadow 0.3s,
    transform 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
    background 0.3s,
    height 0.3s cubic-bezier(0.645, 0.045, 0.355, 1),
    width 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  will-change: transform, height, width;
}

/* -------------------------------- 

Utilities 

-------------------------------- */

.cd-inline-flex {
  display: inline-flex;
}

.animate {
  animation-duration: 0.75s;
  animation-delay: 0.5s;
  animation-name: animate-slide;
  animation-timing-function: cubic-bezier(0.26, 0.53, 0.74, 1.48);
  animation-fill-mode: backwards;
}

/* Fade In */
.animate.fade {
  animation-name: animate-fade;
  animation-timing-function: ease-in;
  animation-duration: 0.2s;
}
@keyframes animate-fade {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

/* Slide In */
.animate.slide {
  animation-name: animate-slide;
  animation-timing-function: ease-in;
  animation-duration: 0.2s;
}
@keyframes animate-slide {
  0% {
    opacity: 0;
    transform: translate(0, 10px);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0);
  }
}

/* Animation Delays */
.delay-1 {
  animation-delay: 0s;
}
.delay-2 {
  animation-delay: 0.1s;
}
.delay-3 {
  animation-delay: 0.15s;
}
.delay-4 {
  animation-delay: 0.2s;
}
.delay-5 {
  animation-delay: 0.25s;
}
.delay-6 {
  animation-delay: 0.3s;
}
.delay-7 {
  animation-delay: 0.35s;
}
.delay-8 {
  animation-delay: 0.4s;
}
.delay-9 {
  animation-delay: 0.45s;
}
.delay-10 {
  animation-delay: 1.5s;
}
.delay-11 {
  animation-delay: 1.55s;
}
.delay-12 {
  animation-delay: 1.7s;
}
.delay-13 {
  animation-delay: 1.8s;
}
.delay-14 {
  animation-delay: 1.9s;
}
.delay-15 {
  animation-delay: 2s;
}

table#scoresTable {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

table#scoresTable td {
  font-size: 16px;
  border-bottom: 1px solid #c751c8;
  padding: 5px 10px;
}

table#scoresTable tr:nth-child(1) td {
  font-weight: bold;
  background: #c751c8;
  color: #fff;
  text-transform: uppercase;
  font-size: 12px;
}

table#scoresTable td:nth-child(2) {
  text-transform: capitalize;
  text-align: center;
}

table#scoresTable td:nth-child(3),
table#scoresTable td:nth-child(4),
table#scoresTable td:nth-child(5) {
  text-align: center;
}

table#scoresTable td:nth-child(6) {
  text-align: right;
}

@media screen and (prefers-reduced-motion: reduce) {
  .animate,
  .correct span,
  .incorrect span {
    animation: none !important;
  }
}

button {
  padding: 5px 20px;
  border-radius: 20px;
  border: 3px solid #000;
  font-size: 14px;
  text-transform: uppercase;
  background: #fff;
  letter-spacing: 0.15px;
  
}




#cheatModalCostElement {
  font-weight: bolder;
}

#cheat-button {
  box-shadow: 5px 5px 4px #0000002b;
  font-weight: bold;
}


/* button:focus, button:active {
  box-shadow: none;
} */

#reset-button svg {
  width: 20px;
}

@media screen and (max-width: 480px) {


.social svg {
  width: 25px;
}
  
  #sudoji-grid,
  .cell:nth-child(1),
  .cell:nth-child(9),
  .cell:nth-child(73),
  .cell:nth-child(81) {
    border-radius: 0px;
  }

  table#scoresTable td:nth-child(3),
  table#scoresTable td:nth-child(4),
  table#scoresTable td:nth-child(5),a.reddit,a.linkedin {
    display: none;
  }
}

/* 320px — 480px: Mobile devices
481px — 768px: iPads, Tablets
769px — 1024px: Small screens, laptops
1025px — 1200px: Desktops, large screens
1201px and more —  Extra large screens, TV */
