:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --ink: #1f2933;
  --muted: #697386;
  --line: #ddd8cf;
  --green: #148a63;
  --green-dark: #0f6b4d;
  --red: #c44949;
  --amber: #f2bd57;
  --blue: #2c6d9e;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-rows: 1fr auto;
  align-content: center;
  gap: 16px;
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 16px 32px;
}

.ghost-button {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.trainer {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
}

.ghost-button {
  width: 44px;
  height: 56px;
  border-radius: 8px;
  font-size: 32px;
}

.card {
  display: grid;
  min-height: 260px;
  grid-template-rows: auto 1fr auto;
  border: 1px solid #cfc7bb;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
  cursor: pointer;
  padding: 20px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.card:active {
  transform: scale(0.985);
}

.card.is-flipped {
  border-color: var(--green);
}

.language {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.word {
  align-self: center;
  overflow-wrap: anywhere;
  font-size: 42px;
  font-weight: 850;
  line-height: 1.12;
}

.hint {
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary,
.secondary {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.primary {
  background: var(--green);
}

.primary:active {
  background: var(--green-dark);
}

.secondary {
  background: var(--red);
}

@media (max-width: 380px) {
  .app-shell {
    padding-inline: 12px;
  }

  .trainer {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 8px;
  }

  .ghost-button {
    width: 36px;
  }

  .word {
    font-size: 34px;
  }
}
