/* Font Tanımlamaları */
:root {
  --heading-font: 'Bangers', cursive;
  --body-font: 'Roboto', sans-serif;
}

/* Genel Sayfa ve Ahşap Arka Plan */
body {
  font-family: var(--body-font);
  background-color: #3a2e25; /* Fallback color */
  background-image: url(''); /* Ahşap doku */
  color: #3d3d3d;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  margin: 0;
  box-sizing: border-box;
}

/* Oyun Paneli (Parşömen Kağıdı) */
.game-wrapper {
  width: 100%;
  max-width: 800px;
  background: #fdf5e6; /* Parşömen rengi */
  padding: 25px;
  border-radius: 15px;
  border: 3px solid #5d4037; /* Koyu ahşap çerçeve */
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  text-align: center;
}

/* Başlık */
h1 {
  font-family: var(--heading-font);
  font-size: 4em;
  color: #d9534f;
  margin: 0 0 20px 0;
  text-shadow: 3px 3px 0px #fff, 5px 5px 0px rgba(0,0,0,0.2);
  letter-spacing: 3px;
}

/* Oyun Alanı (İki Sütunlu Yapı) */
.game-area {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.left-panel, .right-panel {
  flex: 1;
  min-width: 280px;
}

/* Adam Asmaca Çizimi */
#hangman {
  background: rgba(0,0,0,0.05);
  border-radius: 10px;
  border: 2px dashed #b9a997;
  max-width: 100%;
  height: auto;
}

/* İpucu, Yanlış Harfler, Skor */
#hint, #wrongLetters, #scoreDisplay {
  font-size: 1.2em;
  margin: 15px 0;
  font-weight: bold;
}
#wrongLetters span {
  color: #d9534f;
  font-size: 1.5em;
  letter-spacing: 5px;
  text-transform: uppercase;
}
#scoreDisplay span {
  color: #5cb85c;
  font-size: 1.3em;
}

/* Harf Kutuları */
#word {
  margin: 20px auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  min-height: 60px;
}
.letter-box {
  border-bottom: 4px solid #8c7a6b;
  width: 45px;
  height: 55px;
  margin: 5px;
  font-size: 2.5em;
  font-family: var(--heading-font);
  color: #3a2e25;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s ease;
  transform-style: preserve-3d;
}
.letter-box.space { border: none; }
.letter-box.revealed { /* Harf ortaya çıkınca animasyon */
  transform: rotateY(360deg);
  border-color: #5cb85c;
}

/* Klavye */
#keyboard {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
#keyboard button {
  font-family: var(--body-font);
  font-weight: bold;
  font-size: 1.3em;
  width: 45px;
  height: 45px;
  background-color: #e0d6c7;
  border: 1px solid #c8bba9;
  border-bottom-width: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.1s ease-in-out;
}
#keyboard button:hover:not(:disabled) {
  background-color: #f0e9dd;
}
#keyboard button:active:not(:disabled) {
  transform: translateY(3px);
  border-bottom-width: 1px;
}
#keyboard button:disabled { /* Kullanılmış tuşlar */
  opacity: 0.5;
  cursor: not-allowed;
}
/* JavaScript ile eklenecek sınıflar */
.key-correct { background-color: #5cb85c !important; color: white; }
.key-wrong { background-color: #d9534f !important; color: white; }


/* Oyun Sonu Modalı */
.modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.modal-content {
  background: #fdf5e6;
  padding: 30px 40px;
  border-radius: 20px;
  text-align: center;
  border: 3px solid #5d4037;
  box-shadow: 0 5px 25px rgba(0,0,0,0.5);
  max-width: 90%;
}
.modal-content h2 {
  font-family: var(--heading-font);
  font-size: 3em;
  margin: 0 0 10px 0;
}
#modal-title.win { color: #5cb85c; }
#modal-title.lose { color: #d9534f; }
.modal-content p { font-size: 1.2em; }
.modal-content input {
  width: 80%;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 2px solid #c8bba9;
  font-size: 1em;
}
.modal-btn {
  font-size: 1.2em;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 10px;
  color: white;
  font-weight: bold;
}
.modal-btn.submit { background-color: #f0ad4e; }
.modal-btn.again { background-color: #5bc0de; }

/* Mobil uyumluluk */
@media (max-width: 768px) {
  h1 { font-size: 2.5em; }
  .game-area { flex-direction: column; align-items: center; }
  .left-panel { order: 2; }
  .right-panel { order: 1; }
}