body {
  font-family: Arial, sans-serif;
  background-color: #f9f9f9;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  box-sizing: border-box;
}

header {
  display: flex;
  flex-direction: row;
  background-color:#0F62FE;
  color: white;
  text-align: center;
  padding: 1rem;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ddd;
}

.header h1 {
  font-size: 24px;
  margin: 0;
}

#help-button {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background-color: #007bff; /* Kék háttér */
  color: white;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
}

#help-button:hover {
  background-color: #0056b3; /* Sötétebb kék hover */
}

main {
  margin: 1rem;
}

/* Két oszlopos megjelenés */
#sentence {
  font-size: 1.5rem;
  margin-bottom: 1rem;

  display: grid;
  grid-template-columns: repeat(2, max-content); /* oszlopok mérete tartalomhoz igazodik */
  gap: 10px 20px;

  justify-content: center;
}

#sentence p{
  font-size: 1.1rem;
}


#word-panel {
  text-align: center;
  line-height: 3; /* Megnövelt sorköz */
}

#word-counter {
  text-align: center;
  margin-top: 10px;
  margin-bottom: 20px;
  font-size: 1em;
  color: #555;
}

#button-panel {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

#word-panel span {
  font-size: 1.5rem;
  margin: 0 5px;
  cursor: pointer;
  padding: 3px 5px;
  display: inline-block;
  height: 50px;
}

/* OPTIONS PANEL FORMÁZÁS */
#options-panel {
  display: block !important;
  visibility: hidden; /* Láthatatlan induláskor, de a helye megvan */
  opacity: 0;
  transition: visibility 0.2s, opacity 0.2s ease-in-out;
  position: absolute !important;
  background: white !important;
  border: 1px solid black !important;
  padding: 10px !important;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1) !important;
  min-width: 200px !important;
  max-height: 440px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important; /* Vízszintes görgetés TILOS */
  z-index: 9999 !important;
}


/* 
#options-panel.hidden {
  display: none !important;
}
 */


#options-panel button {
  display: block;
  width: 100%;
  margin-bottom: 5px;
}


/* Alapgomb-stílus */
button {
  padding: 10px 20px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 5px;
  text-transform: none;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  border: 1px solid #000000; /* Sötétebb sárga körvonal */
}


.hidden {
  display: none !important;
}

#original_sentence{
  text-align: center;
  font-size: 14px;
}

.word.active {
  background-color:yellow;
}

.word[data-label] {
  position: relative;
  display: inline-block;
  margin-right: 5px;

}

.word[data-label]::before {
  content: attr(data-label);
  display: flex;
  justify-content: center;  /* Vízszintesen középre igazítás */
  align-items: center;  /* Függőlegesen középre igazítás */
  position: relative;
  text-align: center;
  height: 30px;
  min-width: 100px;
  width: 100%;
  padding: 2px;
  font-size: 14px;
  white-space: nowrap;
  font-family: cursive;
  top: 20px;
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  margin: 5px;
  color: white;
}



.word.correct::after {
  content: "✔";
  color: lime;
  font-size: 14px;
  margin-left: 5px; /* Kis távolság a címke után */
  vertical-align: middle;
}

.word.incorrect::after {
  content: "✘";
  color: red;
  font-size: 14px;
  margin-left: 5px; /* Kis távolság a címke után */
  vertical-align: middle;
}

.word .underline {
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
}


/* Címke formázás */
.word-label {
  display: inline-block;
  padding: 5px 10px;
  margin-left: 10px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  min-width: 80px;
  height: 20px;
  font-size: 16px;
  color: white;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  border: 1px solid #000000; /* Sötétebb körvonal */
  cursor: not-allowed;
}

.inactive {
  color: gray; /* Szürke színnel jelöljük a nem elemezhető szavakat */
  pointer-events: none; /* Nem lehet rájuk kattintani */
  cursor: default; /* Nincs kattintási ikon */
  opacity: 0.5; /* Halványabb megjelenítés */
}

.word {
  color: black; /* Elemzésre alkalmas szavak színe */
  cursor: pointer; /* Kattintási ikon */
  font-size: 1.8em;
}

.word-container {
  height: 40px;
  padding: 5px 10px;
  font-size: 16px;
  
  display: flex;           /* Flexbox használata */
  align-items: center;      /* Függőleges középre igazítás */
}

.back-button, #check-button, #new-sentence-button {
  background-color: #3498db; /* Kék háttér */
  color: white;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
  border: 1px solid #000000; /* Sötétebb körvonal */
}

.back-button:hover, #check-button:hover, #new-sentence-button {
  background-color: #2980b9; /* Sötétebb kék hover */
}

#feedback {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 2rem auto;
  padding: 1rem;
  text-align: center;
  background-color: #f8f8f8;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

/* Kisebb kijelzőn (pl. mobilon) váltson egy oszloposra */
@media (max-width: 768px) {
  #sentence {
    grid-template-columns: 1fr; /* Egy oszlop, kitölti a szélességet */
    justify-items: center;      /* Szavakat középre igazít */
  }
}

/* --- MOBIL OPTIMALIZÁLÁS --- */
@media (max-width: 768px) {
  .word-label {
    font-size: 14px;   /* Kisebb betűméret mobilon */
    padding: 3px 6px;  /* Kompaktabb padding */
    max-width: 90%;    /* Ne lógjon ki a képernyőről */
  }
}

@media (max-width: 480px) {
  .word-label {
    font-size: 13px;   /* Még kisebb betűméret nagyon kis kijelzőn */
    line-height: 1.2;
  }
}