/* style.css */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: center;
  margin: 0;
  padding: 20px;
  background: #f0f8ff;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.menu-info {
  font-size: 0.9rem;
  color: #444;
  margin-bottom: 20px;
}

.menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.category-btn {
  background-color: #02768f;
  border: none;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: bold;
  color: white;
  cursor: pointer;
  transition: 0.3s;
  min-width: 70px;
}

.category-btn.active {
  background-color: #c21111;
  color: white;
}

.category-btn.nav-arrow {
  background-color: #0b38a4;
  color: white;
  font-size: 1.3rem;
  font-weight: bold;
  border-radius: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  transition: background-color 0.3s;
  border: none;
}

.category-btn.nav-arrow:hover {
  background-color: #002a99;
}

#word {
  font-size: 3rem;
  font-weight: bold;
  color: #333;
  margin: 30px 0 10px;
  min-height: 60px;
  cursor: pointer;
}

#meaning {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 30px;
  min-height: 1.5em;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}

button {
  cursor: pointer;
}

#randomBtn {
  background-color: #087445;
  color: white;
  font-size: 1.1rem;
  padding: 10px 30px;
  border: none;
  border-radius: 8px;
}

#intervalInput {
  padding: 10px;
  width: 100px;
  text-align: center;
  font-size: 1rem;
  border: 2px solid #0040ff;
  border-radius: 6px;
}

#applyBtn, #toggleLangBtn, #togglePickBtn, #toggleShowBtn, #toggleAutoShowBtn {
  width: 120px;            
  height: 40px;           
  padding: 0 10px;
  background-color: black;
  color: white;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

#applyBtn span,
#toggleLangBtn span,
#togglePickBtn span,
#toggleShowBtn span,
#toggleAutoShowBtn span {
  display: block;
  font-size: 1rem;
  max-width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
  font-size: clamp(0.6rem, 2vw, 1rem); 
}

#applyBtn {
  background-color: #c21111;
}

/* Link button */
a.menu-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  box-sizing: border-box;
  text-decoration: none;
  transition: all 0.25s ease;
}

a.menu-link.kotoba {
  border: 1.5px solid #02768f;
  color: #0078d7;
}

a.menu-link.kotoba:hover {
  background-color: #02768f;
  color: white;
}

a.menu-link.donate {
  border: 1.5px solid #ED1842;
  color: #ED1842;
}

a.menu-link.donate:hover {
  background-color: #ED1842;
  color: white;
}

/* Table */
table {
  margin: 20px auto;
  border-collapse: collapse;
  width: 90%;
  max-width: 700px;
}

table, th, td {
  border: 1px solid #999;
}

th, td {
  padding: 10px;
  text-align: center;
}

#searchInput {
  margin: 10px auto;
  padding: 10px;
  width: 90%;
  max-width: 400px;
  font-size: 1rem;
  border: 2px solid #0040ff;
  border-radius: 6px;
  display: none;
}

footer {
  margin-top: 40px;
  font-size: 0.9rem;
  color: #000000;
}

@media (max-width: 600px) {
  h1 {
    font-size: 2rem;
  }

  #word {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
    align-items: center;
  }

  table, th, td {
    font-size: 0.9rem;
  }

  #searchInput {
    width: 95%;
  }
}

/* Quiz */
#quizContainer {
  background: #f9fafe;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 64, 255, 0.1);
  padding: 25px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 1rem;
  color: #222;
  animation: fadeIn 0.3s ease-in;
}

#quizContainer h3 {
  text-align: center;
  color: #0b38a4;
  margin-bottom: 20px;
  font-size: 1.6rem;
}

#quizContainer ol {
  padding-left: 20px;
}

#quizContainer li {
  margin-bottom: 15px;
  line-height: 1.6;
  background: #f0f4ff;
  padding: 10px;
  border-radius: 8px;
}

.quiz-option {
  background: #ffffff;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 6px 0;
  transition: 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.quiz-option:hover {
  background: #e6f0ff;
  border-color: #0b38a4;
}

.quiz-option input[type="radio"] {
  margin-right: 10px;
}

#quizContainer button {
  background-color: #0b38a4;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 1rem;
  margin: 12px 6px 0 0;
  cursor: pointer;
  transition: 0.3s;
}

#quizContainer button:hover {
  background-color: #002a99;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Hide/mini buttons */
.hide-btn {
  background-color: #e8f0fe;
  border: 1px solid #90caf9;
  color: #0b38a4;
  padding: 6px 12px;
  margin: 4px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.hide-btn:hover {
  background-color: #d2e3fc;
}

.mini-show-btn {
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 4px;
  background: #e8f0fe;
  border: 1px solid #90caf9;
  cursor: pointer;
}

.mini-show-btn:hover {
  background: #d2e3fc;
}

/* Drawing pad */
#resizeHandle {
  height: 18px;
  background: transparent;
  cursor: ns-resize;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

#resizeHandle::before {
  content: "";
  width: 60px;
  height: 4px;
  background-color: #999;
  border-radius: 2px;
}
