* {
  box-sizing: border-box;
  font-family: "Segoe UI", sans-serif;
}

body {
  margin: 0;
  min-height: 100vh;
  background-image: url(../images/Gemini_Generated_Image_ddenxbddenxbdden.png);
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #111;
}

.navbar {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  padding: 0 40px;
  background: #fff;
  border: 2px solid #000;
  border-radius: 14px;
  z-index: 9999;
}

.drop-btn {
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  color: #222;
  transition: 0.2s;
}

.drop-btn:hover {
  background: #f0f0f0;
}

.menu-item {
  position: relative;
  font-size: 30px;
  cursor: pointer;
}

.menu-item span {
  padding: 6px 10px;
}

.dropdown-box {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  padding: 12px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  min-width: 160px;
  flex-direction: column;
  gap: 8px;
}

.menu-item:hover .dropdown-box {
  display: flex;
}

.logo {
  position: absolute;
  left: 20px;         
  top: 50%;
  transform: translateY(-50%);
}

.logo img {
  height: 45px;      
  width: auto;        
  display: block;
}

.test-box {
  border-radius: 16px;
  padding: 40px;
  width: 90%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  margin-top: 20px;
}

.my-footer {
  width: 100%;
  height: 100px;
  background: #393636;
  color: white;
  text-align: center;
  border-top: 3px solid #555;
  margin-top: auto; 
}


.task-title {
  margin-bottom: 10px;
  font-size: 18px;
}



 #leftOptions, #topOptions {
  text-align: center;
  width: 100%;
  max-width: 700px;
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 20px;
}

#tableArea {
  width: 50%;
  max-width: 300px; 
  min-width: 250px;
  margin-bottom: 20px;
  display: block;    
  margin-left: 120px;
  text-align: center;
}



.match-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

.match-table th,
.match-table td {
  border: 2px solid #333;
  padding: 4px 6px;
  text-align: center;
  vertical-align: middle;
  min-width: 40px;
  height: 35px;
  cursor: pointer;
  transition: all 0.2s ease;
  background-color: #fff;
}

.match-table th {
  background-color: #f0f0f0;
  font-weight: bold;
  font-size: 12px;
}

.match-table td.selected {
  background: #e3f2fd;
}
.match-table td.correct { 
  background-color: rgba(27, 94, 32, 0.3);
  color: #1b5e20; 
  font-weight: 600; 
  box-shadow: 0 0 8px rgba(27, 94, 32, 0.5); 
  transform: scale(1.05);
}

.match-table td.wrong { 
  background-color: rgba(127, 29, 29, 0.3);
  color: #7f1d1d; 
  box-shadow: 0 0 8px rgba(127, 29, 29, 0.5);
  transform: scale(1.03);
}

.match-table td.disabled {
  pointer-events: none; 
  opacity: 0.85; 
}


#testArea, #resultArea {
  background: #fff;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 16px;
  width: 90%;
  max-width: 700px;
  min-height: 400px;
  margin-bottom: 20px;
}

#resultArea h3 {
  margin-bottom: 20px;
}


#startBtn {
  background: #222;
  color: #fff;
  margin-top: 500px;
  border: none;
  padding: 14px 32px;
  font-size: 22px;
  border-radius: 10px;
  cursor: pointer;
  margin-top: 20px;
}
#nextBtn {
  display: block;
  background: #222;
  margin: 20px auto 0 auto;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
    color: #fff;

}
#restartBtn{
  display: block;
  background: #222;
  margin: 20px auto 0 auto;
  padding: 10px 20px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
    color: #fff;

}
#startBtn:hover, #nextBtn:hover, #restartBtn:hover {
  background: #444;
}

.wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  padding-top: 150px;
  padding-bottom: 120px;
}


#h1Main{
  font-size: 25px;
}



/* --- Планшети --- */
@media (max-width: 1024px) {

  .navbar {
    width: 90%;
    gap: 20px;
    padding: 0 20px;
  }

  .menu-item {
    font-size: 24px;
  }

  .logo img {
    height: 40px;
  }

  .test-box {
    width: 95%;
    padding: 30px;
  }

  #tableArea {
    width: 60%;
    margin-left: auto;
    margin-right: auto;
  }

  #testArea, #resultArea {
    max-width: 95%;
    padding: 25px;
  }

  #leftOptions, #topOptions {
    font-size: 15px;
  }

  .match-table th, .match-table td {
    font-size: 11px;
    padding: 3px 5px;
  }
}

/* --- Телефони --- */
@media (max-width: 768px) {

  .navbar {
    width: 95%;
    height: 50px;
    gap: 10px;
    padding: 0 10px;
  }

  .menu-item {
    font-size: 18px;
  }

  .logo img {
    height: 32px;
  }

  .wrapper {
    padding-top: 90px;
  }

  .test-box {
    width: 96%;
    padding: 20px;
  }

  #tableArea {
    width: 80%;
    margin-left: auto;
    margin-right: auto;
  }

  #testArea, #resultArea {
    width: 96%;
    padding: 18px;
    font-size: 16px;
  }

  #leftOptions, #topOptions {
    font-size: 14px;
  }

  .match-table th, .match-table td {
    font-size: 10px;
    padding: 2px 4px;
  }

  #startBtn,
  #nextBtn,
  #restartBtn {
    font-size: 16px;
    padding: 10px 18px;
  }
}

/* --- Дуже маленькі телефони --- */
@media (max-width: 480px) {

  .menu-item {
    font-size: 16px;
  }

  .logo img {
    height: 28px;
  }

  .test-box {
    width: 100%;
    padding: 15px;
  }

  #tableArea {
    width: 90%;
    margin-left: auto;
    margin-right: auto;
  }

  #testArea, #resultArea {
    width: 98%;
    padding: 15px;
    font-size: 14px;
  }

  #leftOptions, #topOptions {
    font-size: 13px;
  }

  .match-table th, .match-table td {
    font-size: 9px;
    padding: 2px 3px;
  }

  #startBtn,
  #nextBtn,
  #restartBtn {
    font-size: 14px;
    padding: 8px 14px;
  }
}


/* --- Дуже вузькі телефони (360px) --- */
@media (max-width: 360px) {

  .navbar {
    top: 15px;
    width: 95%;
    height: 45px;
    gap: 8px;
    padding: 0 8px;
  }

  .menu-item {
    font-size: 14px;
  }

  .logo img {
    height: 24px;
  }

  .dropdown-box {
    min-width: 110px;
    padding: 6px;
  }

  .drop-btn {
    padding: 5px 8px;
    font-size: 14px;
  }

  .wrapper {
    padding-top: 80px;
  }

  .test-box {
    width: 100%;
    padding: 12px;
  }

  #tableArea {
    width: 100%;
    overflow-x: auto; /* щоб таблиця могла скролитись якщо треба */
  }

  #testArea, #resultArea {
    width: 100%;
    padding: 12px;
    font-size: 13px;
  }

  #leftOptions,
  #topOptions {
    font-size: 12px;
    line-height: 1.4;
  }

  .match-table {
    width: 100%;
  }

  .match-table th,
  .match-table td {
    font-size: 8px;
    padding: 2px;
  }

  #startBtn,
  #nextBtn,
  #restartBtn {
    font-size: 13px;
    padding: 7px 10px;
    width: 100%;
  }

}