body {
    margin: 0;
    padding: 0;
    background-color: #0f172a;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

h1 {
    font-size: 22px;
}

#header_section {
    margin-top: 0;
    height: 10vh;
    text-align: center;
    background-color: #1e293b;
    display: flex;
    justify-content: space-around;
    align-items: center;
    color: white;
}

#header_section button {
    border: none;
    background-color: #0f172a;
    font-size: x-large;
    color: white;
    padding: 7px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: 
        background-color 0.25s ease,
        transform 0.15s ease,
        box-shadow 0.25s ease;
}

#header_section button:hover {
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

#header_section button:active {
    transform: scale(0.95);
    box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
    background-color: #172033;
}


#player1_section {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2563eb;
    color: white;
    border-bottom-left-radius: 25px;
    border-bottom-right-radius: 25px;
    font-size: large;
}

#player2_section {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #dc2626;
    color: white;
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    z-index: 1000;
    font-size: large;
}

#game_section {
  position: absolute;
  top: calc(50% + 5vh);
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

#word_input_section {
  width: 80%;
  background-color: #1e293b;
  padding: 30px 40px;
  border-radius: 15px;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#word_input_section h2 {
  color: white;
  margin: 0;
  font-size: 1.5rem;
  text-align: center;
}

#word_warning {
    color: white;
    margin: 0px;
    display: none;
}

#word_input_section input {
  width: 200px;
  padding: 8px 10px;
  border: 2px solid #2563eb;
  border-radius: 8px;
  background-color: #0f172a;
  color: white;
  font-size: 1rem;
  text-align: center;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

#word_input_section input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 8px rgba(96, 165, 250, 0.6);
}

#word_input_section button {
  border: none;
  background-color: #2563eb;
  color: white;
  font-size: 1rem;
  padding: 8px 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: 
    background-color 0.25s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

#word_input_section button:hover {
  background-color: #1d4ed8;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

#word_input_section button:active {
  transform: scale(0.95);
  background-color: #172033;
  box-shadow: 0 0 5px rgba(59, 130, 246, 0.4);
}


#input_word {
  text-transform: uppercase;
}

#input_word::placeholder {
  text-transform: initial;
}


#guessing_section {
  position: absolute;
  top: calc(50% + 5vh);
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  width: 70vw;
  height: 60vh;
  display: none;
  flex-direction: column;
  width: 70%;
  align-items: center;
  gap: 20px;
  text-align: center;
  animation: fadeIn 0.4s ease;
  overflow-y: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  overflow-x: hidden;
}


#guessing_section h2 {
  font-size: 1.8rem;
  margin-bottom: 0px;
  letter-spacing: 0.5px;
}

.guess_input_fields, #guess_char {
  text-transform: uppercase;
  color: #ffffff;
  font-size: 1.0rem;
  font-weight: bold;
  text-align: center;
  letter-spacing: 1px;

  background-color: #1e293b;
  border: none;
  border-bottom: 3px solid #ffffff;
  border-radius: 3px;

  height: 30px;
  width: 20px;
  margin: 7px 5px;

  transition: all 0.25s ease;
}

#guess_char {
  width: 90px;
}

#warning_letter {
  margin: 0px;
}

.guess_input_fields:fokus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 10px rgba(96, 165, 250, 0.6);
  transform: scale(1.03);
}

#guessing_section button {
  border: none;
  background-color: #2563eb;
  color: white;
  font-size: 1.05rem;
  padding: 10px 25px;
  margin: 0px;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

#guessing_section button:hover {
  background-color: #1d4ed8;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px);
}

#guessing_section button:active {
  transform: scale(0.96);
  background-color: #172033;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.4);
}


#result_win_section {
  position: absolute;
  top: calc(50% + 5vh);
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #1e293b;
  color: white;
  padding: 45px 50px;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.08);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 50%;
  max-width: 250px;
  text-align: center;
  animation: fadeIn 0.4s ease;
}

#result_win_section button {
  margin-top: 15px;
}

#result_win_section h2 {
  font-size: 2rem;
  margin: 0;
}

#result_win_text {
  font-size: 1.2rem;
  color: #93c5fd;
}

#play_again_btn {
  border: none;
  color: white;
  background-color:#16a34a;
  font-size: 1.05rem;
  padding: 10px 25px;
  border-radius: 12px;
  cursor: pointer;
  transition:
    background-color 0.25s ease,
    transform 0.15s ease,
    box-shadow 0.25s ease;
}

#play_again_btn:hover {
  background-color: #16a34a;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.6);
  transform: translateY(-2px);
}

#play_again_btn:active {
  transform: scale(0.96);
  background-color: #14532d;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

/* === Sanfte Fade-in Animation === */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}






@media (min-width: 768px) {
    h1 {
        font-size: xx-large;
    }

    #player1_section {
        position: fixed;
        height: 90vh;
        width: 100px;
        border-radius: 0 25px 25px 0;
        writing-mode: sideways-lr;
        font-size: x-large;
    }

    #player2_section {
        top: calc(0 + 10vh);
        right: 0;
        left: auto;
        bottom: auto;
        width: 100px;
        height: 90vh;
        border-radius: 25px 0 0 25px;
        writing-mode: sideways-rl;
        font-size: x-large;
    }
}

#hangmanCanvas {
  align-self: center;
  background: radial-gradient(circle at top, #1e293b, #0f172a);
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(59,130,246,0.3);
}

@media (max-width: 768px) {
  #hangmanCanvas {
    margin-top: -60px;
    transform: scale(0.65);
  }
}

.revealed {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  font-weight: 800;
  animation: goldShine 3s linear infinite, fadeInReveal 0.8s ease forwards;
  background: linear-gradient(90deg, #b8860b, #ffd700, #fff8dc, #ffd700, #b8860b);
  background-size: 400%;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

@keyframes goldShine {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes fadeInReveal {
  0% {
    opacity: 0;
    transform: scale(0.8);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}