/* public/main.css */

/* Variables */
:root {
  --bg-color: #1e1e1e;
  --body-color: #f8f8f2;
  --accent: #50fa7b;
  --accent-hover: #4edf73;
  --container-bg: #282a36;
  --cell-bg: #131626;
  --cell-border: #44475a80; 
  --cell-active-bg: var(--accent);
  --cell-input-color: var(--body-color);
  --cell-given-color: var(--accent);
  --border-radius: 0.5rem;
  --gap: 1rem;
  --font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* Basic reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font: inherit;
}

/* HTML styles */
html {
  font-size: 10px;
}

/* Body styles */
body {
  background-color: var(--bg-color);
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  place-items: center;
  place-content: center;
  gap: var(--gap);
  font-family: var(--font-family);
  color: var(--body-color);
}

/* Typography Styles */
h1, h2, h3, h4, h5, h6 {
  font-weight: bold;
  margin: 1rem 0;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }
p {
  font-size: 1rem;
  line-height: 1.5; 
  margin: 0.5rem 0;
}
strong, b {
  font-weight: bold;
}
em, i {
  font-style: italic;
}

/* Game Container */
#game {
  background-color: var(--container-bg);
  border: 1px solid var(--container-border);
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.5);
}

/* Buttons */
button {
  background-color: var(--accent);
  color: var(--container-bg);
  border: none;
  border-radius: var(--border-radius);
  padding: 1rem 2rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}
button:hover {
  background-color: var(--accent-hover);
}

/* Sudoku grid */
#grid, .box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--cell-border);
}
.cell {
  position: relative;
  background-color: var(--cell-bg);
  color: var(--body-color);
  box-shadow: 0 0 0 1px var(--cell-border);
  display: flex;
  place-content: center;
  place-items: center;
  width: 4rem;
  height: 4rem;
  font-size: 2rem;
}
.cell label {
  display: none;
}
.cell input {
  position: relative;
  background-color: transparent;
  color: var(--cell-input-color);
  border: 0;
  padding: 1rem;
  width: 100%;
  height: 100%;
  text-align: center;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  appearance: none;
}
.cell input::-webkit-inner-spin-button,
.cell input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cell input[readOnly] {
  color: var(--cell-given-color);
}
.cell input:focus {
  outline: none;
  caret-color: transparent;
}
.cell:has(input:focus)::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0; 
  width: 100%;
  height: 100%;
  background-color: var(--cell-active-bg);
  opacity: 0.3;
}