:root {
  --bg-color: #ccc;
  --text-color: #222;
  --bg-input: #5566ea;
  --wrong-color: #f08080;
  --correct-color: #0f9c00;
}

body.dark {
  --bg-color: #222;
  --text-color: #ccc;
  --bg-input: #4e4eb8;
}

body {
  font-family: Arial, sans-serif;
  padding: 20px;
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 1rem;
  max-width: 800px;
  margin: 0 auto;
  height: 100vh;
}

h1 {
  text-align: center;
  height: 4vh;
}

#keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
  user-select: none;
  width: 100%;
  height: auto;
  position: fixed;
  bottom: 5px;
  left: 0;
  background: var(--bg-color);
  padding: 8px 0;
  border: 1px solid;
  box-sizing: border-box;
}

.showKeyboard.active button {
  background-color: var(--bg-input);
  color: #ccc;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  /* center rows */
  gap: 4px;
}

.key {
  flex: 0 0 auto;
  padding: 10px 0;
  font-size: 18px;
  width: 8.5%;
  max-width: 60px;
  padding: 14px 0;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  border: 1px solid #aaa;
  border-radius: 6px;
  background: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  transition: background 0.2s;
}

.key.active{
  background-color: var(--bg-input);
}
.key.disabled{
  opacity: 0.2;
}

#puzzle-wrapper {
  position: relative;
  height: 64vh;
  overflow-y: auto;
}

#puzzle-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 80px;
  align-items: flex-end;
  justify-content: center;
}

.finished #puzzle-wrapper #puzzle-container {
  opacity: 0.1;
}

.finished #puzzle-wrapper #status {
  background-color: #222222cc;
}

.puzzle-word {
  margin: 0 10px;
  display: flex;
  flex-wrap: wrap;
}

.puzzle-char.static {
  margin: 0;
  font-weight: bold;
}

.puzzle-char {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 5px;
}

.puzzle-char .letter-box {
  text-align: center;
  font-size: 1.5rem;
  width: 30px;
  height: 30px;
  text-transform: uppercase;
  font-weight: 600;
  border: none;
  border-bottom: 1px solid;
  background: none;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 30px;
  /* matches height */
  vertical-align: middle;
  box-sizing: border-box;
}
.letter-box:empty::before {
  content: "";
  display: inline-block;
  width: 100%;
  height: 100%;
}
.puzzle-char.active {
  outline: 0.15rem solid var(--bg-input);
  border-radius: 5%;
  background-color: var(--bg-input);
}

.number {
  font-size: 1rem;
  color: var(--text-color);
  margin-top: 4px;
  transition: all 1s ease-in-out;
}

#lives-container {
  text-align: center;
  margin-bottom: 15px;
  font-size: 24px;
  height: 4vh;
}

.life {
  margin: 0 5px;
  color: var(--text-color);
}

.hide {
  opacity: 0;
}

#status {
  position: absolute;
  top: 0;
  width: 100%;
  text-align: center;
  padding-top: 30px;
  z-index: -1;
}

.finished #status {
  z-index: 1;
}

#status h1 {
  height: auto;
}
#status strong {
  font-size: 1.2rem;
}

#status .next-btn-wrapper {
  padding-top: 30px;
}

#next-btn,
#restart-btn {
  padding: 8px 20px;
  border-radius: 5px;
  border: 1px solid;
  color: white;
  background: #222;
  font-weight: bold;
  font-size: 20px;
  cursor: pointer;
}

/* 🔹 Responsive for mobile */
/* @media (max-width: 768px) { */







/* } */

#menu {
  position: fixed;
    top: 15px;
    right: 15px;
}
#menu #menu-icon {
  background-image: url("../images/settings.svg");
  background-repeat: no-repeat;
  background-position: center;
  width: 24px;
  height: 24px;
  border: none;
}

body.dark #menu #menu-icon {
  background-image: url("../images/settings-dark.svg");
}
.controls.hide {
  z-index: -1;
}
.controls {
  position: absolute;
  width: 50vw;
  max-width: 300px;
  right: 50px;
  top: 30px;
  background: var(--bg-color);
  border: 2px solid;
  padding: 5px;
  border-radius: 6px;
  z-index: 1;
}

#closeMenu {
  float: right;
  padding: 5px;
  font-weight: bold;
}
.controls .options div button {
  width: 100%;
  font-size: 1rem;
  padding: 6px 12px;
}
.controls .options div {
  margin: 25px 5px;
}
.buttons button {
  background-color: var(--bg-color);
  color: var(--text-color);
  border: 2px solid var(--text-color);
  border-radius: 6px;
}