.la-html5-game {
  box-sizing: border-box;
  width: min(640px, 96vw);
  margin: 0 auto 18px;
  border: 1px solid #8ab6d6;
  background: #f7fbff;
  color: #17324d;
  font-family: Arial, Helvetica, sans-serif;
  text-align: left;
}

.la-html5-game * {
  box-sizing: border-box;
}

.la-game-shell {
  min-height: 500px;
  padding: 14px;
  background: linear-gradient(#ffffff, #eef8ff);
}

.la-game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid #c9dceb;
  padding-bottom: 10px;
}

.la-game-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  color: #0b6ea8;
}

.la-game-stats {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  font-weight: bold;
  color: #31506a;
}

.la-pill {
  border: 1px solid #bad1e1;
  border-radius: 4px;
  background: #ffffff;
  padding: 5px 8px;
}

.la-button {
  border: 1px solid #1976a6;
  border-radius: 4px;
  background: #1b87bd;
  color: #ffffff;
  cursor: pointer;
  font-weight: bold;
  padding: 7px 12px;
}

.la-button:hover,
.la-button:focus {
  background: #126d9c;
}

.la-match-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.la-card {
  position: relative;
  min-height: 110px;
  border: 2px solid #4a9ed1;
  border-radius: 6px;
  background: #ffffff;
  color: #18425e;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.2;
  overflow: hidden;
  padding: 8px;
  text-align: center;
}

.la-card:focus {
  outline: 3px solid #f6b432;
  outline-offset: 2px;
}

.la-card.is-hidden {
  background: #2d94c6;
  color: #ffffff;
}

.la-card.is-hidden:before {
  content: "?";
  display: grid;
  place-items: center;
  position: absolute;
  inset: 0;
  font-size: 46px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.la-card.is-hidden > * {
  visibility: hidden;
}

.la-card.is-matched {
  border-color: #58a942;
  background: #edf9e9;
  cursor: default;
}

.la-card img {
  display: block;
  max-width: 78px;
  max-height: 66px;
  margin: 4px auto 7px;
}

.la-card-word {
  display: grid;
  place-items: center;
  min-height: 88px;
}

.la-status {
  min-height: 22px;
  margin-top: 12px;
  color: #31506a;
  font-weight: bold;
  text-align: center;
}

.la-reading-layout {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(260px, 1fr);
  gap: 14px;
}

.la-passage,
.la-quiz {
  border: 1px solid #c5d9e8;
  border-radius: 4px;
  background: #ffffff;
  padding: 12px;
}

.la-passage {
  max-height: 460px;
  overflow: auto;
  line-height: 1.48;
}

.la-stanza {
  margin: 0 0 8px;
}

.la-question {
  border-bottom: 1px solid #e0ecf4;
  padding: 10px 0;
}

.la-question:first-child {
  padding-top: 0;
}

.la-question-title {
  margin: 0 0 8px;
  color: #17324d;
  font-weight: bold;
}

.la-choice {
  display: block;
  margin: 6px 0;
  padding: 5px 6px;
}

.la-choice input {
  margin-right: 6px;
}

.la-choice.is-correct {
  background: #e7f7df;
}

.la-choice.is-wrong {
  background: #ffe7e1;
}

.la-reading-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

@media (max-width: 680px) {
  .la-game-shell {
    min-height: 0;
  }

  .la-game-top,
  .la-reading-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .la-game-stats {
    justify-content: flex-start;
  }

  .la-match-board {
    grid-template-columns: repeat(3, 1fr);
  }

  .la-card {
    min-height: 96px;
    font-size: 16px;
  }

  .la-reading-layout {
    grid-template-columns: 1fr;
  }
}
