/* GLOBAL */
* {
  box-sizing: border-box;
  --background-color: #E8DEF8;
  --background-color-2: #D7DFFF;
  --sudoku-background: #D8C8F5;
}

body {
  margin: 0;
  font-family: "Arial", sans-serif;
  background-color: var(--background-color-2);
  color: #000;
}

h1#header_text {
  font-size: 48px;
  margin: 30px 40px 10px;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/*MAIN LAYOUT*/
main {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 60px;
  width: 100%;
  margin-top: 10px;
}

/*difficulty and checkboxes*/
#tools {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: flex-start;
}

/* Difficulty */
#difficulty {
  display: flex;
  background-color: rgba(0,0,0,0.1);
  border-radius: 20px;
  padding: 6px;
  gap: 6px;
}

#difficulty > li {
  background-color: var(--background-color);
  border-radius: 16px;
  padding: 6px 18px;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
}

#difficulty li.difficulty-selected {
  background-color: #553e69;
  color: #fff;
}
.difficulty-selected{
    background-color: #553e69;
  color: #fff;
}

/* Checkbox list */
#checkboxlist {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

#checkboxlist li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

/* checkbox box */
#checkboxlist input[type="checkbox"] {
  margin-top: 4px;
  width: 16px;
  height: 16px;
}

#checkboxlist label {
  display: flex;
  flex-direction: column;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.checkbox-label {
  margin-top: 2px;
  font-size: 13px;
  font-weight: normal;
  color: #555;
}

/* buttons and numpad*/
#numpad {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

/* tool buttons*/
#game_buttons {
  width: 100%;
  display: flex;
  justify-content: center;
}

#button_list {
  display: flex;
  flex-direction: row;
  gap: 12px;
}

#button_list > li {
  width: 74px;
  height: 70px;
  background-color: var(--background-color);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0px 3px 8px rgba(0,0,0,0.25);
  cursor: pointer;
}

/* numpad */
#numpad-grid {
  background-color: var(--sudoku-background);
  border-radius: 20px;
  border: 3px solid #b4a4dd;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 70px);
  gap: 16px;
}

.numpad-cell {
  background-color: var(--background-color);
  border: 2px solid black;
  border-radius: 12px;
  font-size: 22px;
  height: 50px;
  display:flex;
  justify-content:center;
  align-items:center;
  cursor:pointer;
}

/*board header and board */
#sudoku_section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* timer and difficulty text  */
#sudoku_grid_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  width: 500px;
  margin-bottom: 4px;
}

.hidetimer {
  visibility: hidden;
}
.timer {
  display: flex;
  align-items: center;
}

#timer svg {
  margin-right: 6px;
}


/* BOARD PANEL */
#sudoku_grid {
  background-color: var(--sudoku-background);
  border: 3px solid #b4a4dd;
  border-radius: 32px;
  padding: 30px 34px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
}

/* outer 9x9 area */
#sudoku_grid #grid {
  width: 500px;
  height: 500px;
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-template-rows: repeat(3,1fr);
  border: 4px solid black;
  background-color: var(--background-color);
}

/* 3x3 sections */
#sudoku_grid #section {
  display: grid;
  grid-template-columns: repeat(3,1fr);
  grid-template-rows: repeat(3,1fr);
  border: 3px solid black;
}

/* cell */
#sudoku_grid .board-cell {
  border: 1px solid #444;
  background-color: #f3eaff;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size: 20px;
  cursor:pointer;
}

#sudoku_grid .board-cell:hover{
  background-color: var(--background-color-2);
}

/* FOOTER */
#footer {
  text-align: center;
  padding: 30px 0;
  font-size: 14px;
  opacity: 0.6;
}
/* Remove background and padding from right-side difficulty */
#sudoku_grid_header #difficulty {
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

#diffdisplay {
  margin-left: 4px;
  font-weight: normal;
}

/* Prevent wrapping text blocks */
#sudoku_grid_header p {
  margin: 0;
  padding: 0;
  display: inline;
}

.highlight{
  background-color: var(--sudoku-background) !important;
}


#startbtn{
  background-color: var(--sudoku-background);
  border-radius: 4px;
  width: 4em;
  height: 2em;
  font-weight: bold;
}
.error{
background-color: lightcoral !important;
  border: 1px solid darkred !important;
}
