:root {
  --bg-page: #f7e1b5;
  --text-main: #3b2314;
  --bg-container: #68839a;
  --bg-progress: #4a5f70;
  --bg-button: #f2a93b;
  --text-button: #3b2314;
  --color-logo: #d1a02e;
  --color-stats: #f2a93b;
  --shadow-container: rgba(0, 0, 0, 0.4);

  --letter-default: #9ab0c1;
  --letter-correct: #ffffff;
  --letter-incorrect: #d12e2e;
  --caret-color: #f2a93b;
  --active-bg: rgba(242, 169, 59, 0.2);
}

[data-theme="dark"] {
  --bg-page: #241c15;
  --text-main: #f3dfd1;
  --bg-container: #3d5060;
  --bg-progress: #283642;
  --bg-button: #f2a93b;
  --text-button: #241c15;
  --color-logo: #e0ac39;
  --color-stats: #f2a93b;
  --shadow-container: rgba(0, 0, 0, 0.6);

  --letter-default: #7991a4;
  --letter-correct: #f7e1b5;
  --letter-incorrect: #e65252;
  --caret-color: #f2a93b;
  --active-bg: rgba(242, 169, 59, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}


body {
  background-color: var(--bg-page);
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

header {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  margin-bottom: 20px;
  margin-top: -30px;
}

button {
  margin-top: 15px;
  padding: 10px 10px;
  background-color: var(--bg-button);
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-button);
}

.progress img {
  width: 75px;
  height: 75px;
}

.container {
  width: 90%;
  max-width: 800px;
  background-color: var(--bg-container);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 8px 24px var(--shadow-container);
  margin: 30px;
}

.logo {
  color: var(--color-logo);
  font-size: 50px;
}

.stats {
  display: flex;
  gap: 20px;
  font-size: 1.2rem;
  color: var(--color-stats);
  margin-top: 30px;
}

.progress {
  position: relative;
  height: 40px;
  background-color: var(--bg-progress);
  border-radius: 20px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin-top: 40px;
}

.letter {
  color: var(--letter-default);
}

.letter.correct {
  color: var(--letter-correct);
}

.letter.incorrect {
  color: var(--letter-incorrect);
}

.letter.active {
  border-left: 2px solid var(--caret-color);
  background-color: var(--active-bg);
}

.hidden {
  display: none;
}

.stats-wrapper {
  width: 90%;
  max-width: 800px;
  margin: 30px auto; 
}

.stats-panel {
  width: 100%;
  margin: 0 auto;
  position: relative;
  text-align: center;
  font-size: large;
  font-weight: 600;
}

.top-bar {
  text-align: center;
  margin-bottom: 20px;
}

.options {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.options-container {
  display: flex;
  align-items: center;
}

.options-container span {
  margin-top: 15px;
}

.active-btn {
  border: #241c15 3px solid;
}

#cat-sprite {
  font-size: 1.8rem;
  position: absolute;
  left: 10px;
  transition: left 0.1s linear;
  z-index: 2;
}

#fish-sprite {
  font-size: 1.8rem;
  position: absolute;
  right: 10px;
}

#words-box {
  font-size: 1.6rem;
  line-height: 2.2rem;
  letter-spacing: 2px;
  word-wrap: break-word;
  user-select: none;
  min-height: 120px;
}

#results {
  margin-top: 20px;
  text-align: center;
  font-size: large;
  font-weight: 600;
}

#toggle-button {
  position: absolute;
  top: 15px;
  left: 15px;
  margin: 0;
  padding: 8px 12px;
  font-size: 0.9rem;
  z-index: 10;
}

#share-button {
  position: absolute;
  top: 15px;
  right: 15px;
  margin: 0;
  padding: 8px 12px;
  font-size: 0.9rem;
  z-index: 10;
}

@media (max-width: 1100px) {

  .stats-wrapper {
    width: 90%;
    max-width: 800px;
    margin: 30px auto;
    order: -1;
  }

  .stats-panel {
    width: 100%;
    margin: 0 auto;
    position: relative;
    transform: none;
  }
}
