* {
  padding: 0;
  margin: 0;
}

h1 {
  margin-top: 58px;
  text-align: center;
  position: fixed;
  top: -6px;
  left: 0;
  right: 0;
}

h1 a {
  text-decoration: none;
  color: #333;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #333;
  z-index: 1000;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
}

nav ul li {
  margin: 0 15px;
}

nav ul li a {
  color: white;
  text-decoration: none;
  padding: 10px 15px;
  display: block;
}

.container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.container.word {
  position: fixed;
  top: 120px;
  left: 20px;
  right: 20px;
  height: 80vh;
  overflow-y: scroll;
}

.container.word h2 {
  line-height: 1;
  border-bottom: 1px solid #777;
  padding-bottom: 3px;
  font-size: 1rem;
  text-align: center;
  margin-top: 20px;
}

.word-details {
  position: fixed;
  top: 105px;
  left: 20px;
  right: 20px;
  height: 22vh;
  background-color: #f4f4f4;
  padding: 20px;
  z-index: 1000;
  border-bottom: 2px solid #ccc;
  overflow: hidden;
  border-radius: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-content: center;
  justify-content: center;
  align-items: center;
}

.word-details h2 {
  margin: 0;
  line-height: 1.4;
}

.word-details p {
  margin: 5px 0;
}

#pronunciation,
#japanese-meaning {
  font-size: 0.8rem;
  margin: 0;
}

.word-info {
  position: fixed;
  height: 50vh;
  top: 43vh;
  left: 0;
  right: 0;
  background: #efefef;
}

.tabs {
  display: flex;
  background-color: #333;
  color: white;
  padding: 10px;
  position: relative;
  z-index: 10;
  overflow-x: scroll;
  width: 100%;
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  cursor: pointer;
  background-color: #444;
  border: none;
  color: white;
}

.tab:hover {
  background-color: #555;
}

.word-list-container {
  flex: 1;
  overflow-y: auto;
  height: 40vh;
}

.word-list {
  display: none;
  padding: 20px;
}

.word-list ul {
  list-style: none;
  padding: 0;
}

.word-list li {
  padding: 10px;
  background-color: #f9f9f9;
  margin: 5px 0;
  cursor: pointer;
}

.word-list li:hover {
  background-color: #ddd;
}

.tab.active {
  background-color: #888;
}

.alphabet-grid,
.numbers-grid {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  justify-content: center;
  justify-items: stretch;
}
.alphabet-grid {
  grid-template-columns: repeat(4, 1fr);
}
.numbers-grid {
  grid-template-columns: repeat(2, 1fr);
}
.letter,
.number {
  padding: 5px;
  font-size: 20px;
  text-align: center;
  cursor: pointer;
  border: solid 1px #999;
  border-radius: 3px;
  color: #333;
}

.letter small,
.number small {
  font-size: 0.8rem;
}

footer {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  text-align: center;
  line-height: 5vh;
}

@media screen and (max-width: 768px) {
  h1 {
    margin-top: 10px;
    font-size: 1.4rem;
    top: 0px;
  }

  nav {
    top: auto;
    bottom: 0;
  }

  nav ul {
    justify-content: space-around;
  }

  .container.word {
    top: 50px;
    height: 80vh;
  }

  .word-details {
    top: 55px;
  }
  .word-info {
    height: 55vh;
    top: 40vh;
  }
}
