* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@font-face {
  font-family: "Peli Emoji";
  src: url("/fonts/NotoColorEmoji.woff2") format("woff2");
  font-display: swap;
}

html {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  font-family: "Comic Sans MS", "Trebuchet MS", Verdana, sans-serif;
  /* A greener sky than the Finnish pages, so it is obvious at a glance that
     this is the English corner. */
  background: linear-gradient(180deg, #cfe9d4 0%, #a8dab5 100%);
  color: #22402c;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}

:root.no-emoji-font body {
  font-family: "Comic Sans MS", "Trebuchet MS", Verdana, "Peli Emoji", sans-serif;
}

header {
  padding: 0.5rem 1rem 1rem;
  text-align: center;
  flex-shrink: 0;
}

header h1 {
  margin: 0;
  font-size: 2.2rem;
}

#tagline {
  margin: 0.3rem 0 0;
  font-size: 1rem;
  color: #3c5c46;
}

main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  max-width: 900px;
  padding: 0 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.hidden {
  display: none !important;
}

#hub-link {
  align-self: flex-start;
  color: #22402c;
  font-weight: bold;
  text-decoration: none;
  background: #ffffff;
  border-radius: 14px;
  padding: 0.6rem 1.1rem;
  box-shadow: 0 4px 0 #5c9b70;
}

h2 {
  margin: 0 0 0.7rem;
  text-align: center;
  font-size: 1.3rem;
}

/* ---------------- Vocabulary level ---------------- */

#level-hint {
  margin: -0.4rem 0 0.7rem;
  text-align: center;
  font-size: 0.85rem;
  color: #3c5c46;
}

#level-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.level-button {
  background: #ffffff;
  border: 3px solid transparent;
  border-radius: 18px;
  padding: 1rem;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 5px 0 #5c9b70;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  text-align: center;
  min-height: 48px;
  transition: transform 0.1s ease;
}

.level-button:hover {
  transform: translateY(-3px);
}

.level-button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #5c9b70;
}

.level-button.active {
  background: #fff8d6;
  border-color: #e0b400;
}

.level-title {
  font-size: 1.15rem;
  font-weight: bold;
}

.level-note {
  font-size: 0.85rem;
  color: #56705e;
}

/* ---------------- Games ---------------- */

#game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.2rem;
}

.game-card {
  background: #ffffff;
  border-radius: 20px;
  padding: 1.6rem 1rem;
  text-align: center;
  text-decoration: none;
  color: #22402c;
  box-shadow: 0 6px 0 #5c9b70;
  transition: transform 0.1s ease;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.game-card:hover {
  transform: translateY(-4px);
}

.game-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #5c9b70;
}

.game-card .icon {
  font-size: 3rem;
  line-height: 1;
}

.game-card .title {
  font-size: 1.3rem;
  font-weight: bold;
}

.game-card .description {
  font-size: 0.95rem;
  color: #56705e;
}

.keyboard-required {
  font-size: 0.85rem;
  font-weight: bold;
  color: #b3151b;
}

#voice-note {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: #3c5c46;
}

button,
a {
  touch-action: manipulation;
}

@media (hover: none) {
  button:hover,
  a:hover,
  .game-card:hover,
  .level-button:hover {
    transform: none;
  }
}

@media (max-width: 620px) {
  header h1 { font-size: 1.5rem; }
  #tagline { font-size: 0.85rem; }
  #level-bar { grid-template-columns: 1fr; }
  .game-card { padding: 1.1rem 0.7rem; }
  .game-card .icon { font-size: 2.4rem; }
  .game-card .title { font-size: 1.1rem; }
  .game-card .description { font-size: 0.85rem; }
}
