* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --main-bg-color: #fffffff0;
  --secondary-bg-color: rgb(220, 220, 220);
  --bg-highlight-color: rgb(220, 220, 220);
  --on-surface: black;
  --border-color: #ccc;
  --default-radius: 8px;
}

body {
  height: 100vh;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1rem;
  background-color: var(--main-bg-color);
}

h1 {
  color: var(--on-surface);
}

/* Dark mode */
body.dark-mode {
  --main-bg-color: #1a1a1a;
  --secondary-bg-color: #2e2e2e;
  --on-surface: #e0e0e0;
  --border-color: #555;
  --bg-highlight-color: #676767;
}

body.dark-mode input {
  background-color: var(--secondary-bg-color);
  color: var(--on-surface);
}

body.dark-mode .autocomplete-item {
  background-color: var(--secondary-bg-color);
  color: var(--on-surface);
}

body.dark-mode .autocomplete-item:hover {
  background: var(--bg-highlight-color);
}

.main-div {
  height: 100%;
  aspect-ratio: 10 / 16;
  margin: 0 auto 0 auto;
  background-color: var(--main-bg-color);

  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
}

@media (max-width: 600px) {
  .main-div {
    width: 100vw;
    height: 100dvh;
  }
}

.hidden {
  display: none;
}

.title-image {
  max-height: 100%;
  min-width: 0;
}

.game-header {
  height: 9vh;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.controls {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: 1fr;
  align-items: center;
  margin-bottom: 2dvh;
}

/* autocomplete */

.form-group {
  position: relative;
}

input {
  min-height: 2.75rem;
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--default-radius);
  border: 1px solid var(--border-color);
  font-size: 1rem;
  transition: 0.2s ease;
}

.autocomplete-list {
  position: absolute;
  bottom: 100%;
  left: 0;
  width: 100%;
  border-radius: var(--default-radius);
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  overflow: hidden;
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  background-color: var(--main-bg-color);
}

.autocomplete-item:hover {
  background: var(--bg-highlight-color);
}

.icon-btn-game {
  margin: 4px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--on-surface);
  background-color: var(--main-bg-color);
  color: var(--on-surface);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
}

.icon-btn-header {
  margin-right: 4px;
  margin-left: 4px;
  padding: 4px;
  height: 2.5rem;
  width: 2.5rem;
  border: none;
  background-color: transparent;

  cursor: pointer;
  color: grey;

  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-header {
  fill: currentColor;
  display: block;
  width: 100%;
  height: 100%; 
}

/*.icon-btn-game.give-up {
  color: red;
}*/

.icon-game {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
  display: block;
}

.icon-in-text {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  display: inline-block;
}

.icon-in-box {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
  vertical-align: middle;
}

/* game board */
.game-board {
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.with-background {
  background-image: url("background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.guesses-list {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.game-row-boxes {
  width: 100%;
  padding: 0.3rem;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: 1fr;
  gap: 0.25rem;
}

.game-row-box {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* makes height = width */
  height: 0;
  color:white;
  border: 1px solid var(--border-color);
  align-content: center;
  text-align: center;
  font-size: 0.75rem;
}

.game-row-box-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-row-box.header-boxes {
  color: var(--on-surface);
  font-size: 0.9rem;
}

.attempt-text {
  color: var(--on-surface);
  font-size: 1rem;
  font-weight: bold;
  padding-left: 0.3rem;
}

.victory-text {
  color: var(--on-surface);
  font-size: 1.4rem;
  font-weight: bold;
  width: 100%;
  text-align: center;
}

.text-bg {
  background-color: var(--main-bg-color);
}

.green-box {
  background-color: rgb(30, 126, 30);
}

.red-box {
  background-color: rgb(209, 32, 32);
}

.yellow-box {
  background-color: rgb(255, 170, 0);
}

.blue-box {
  background-color: rgb(121, 176, 178);
}

.arrow-icon-wrapper {
  position: absolute;
  font-size: 0.9rem;
  line-height: 1;
}

.arrow-icon {
  width: 1rem;
  height: 1rem;
  fill: currentColor;
  vertical-align: middle;
  line-height: 1;
}

.arrow-top {
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
}

.arrow-bottom {
  bottom: 4px;
  transform: translateX(-50%) rotate(180deg);
  left: 50%;
}

.arrow-ne {
  top: 4px;
  right: 4px;
  transform: rotate(45deg);
}

.arrow-e {
  right: 4px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
}

.arrow-w {
  left: 4px;
  top: 50%;
  transform: translateY(-50%) rotate(270deg);
}

.arrow-se {
  bottom: 4px;
  right: 4px;
  transform: rotate(135deg);
}

.arrow-sw {
  bottom: 4px;
  left: 4px;
  transform: rotate(225deg);
}

.arrow-nw {
  top: 4px;
  left: 4px;
  transform: rotate(315deg);
}
